According to Wiki, the spin exchange operator is $$P_{12}=\frac{1}{2}(1+\vec\sigma_1\otimes\vec\sigma_2),$$ and i can verify that this is true by acting it to a 2-spin system.
But i don't know how this can be derived. My attempt: $$P=\langle\uparrow|\downarrow\rangle\otimes \langle\downarrow|\uparrow\rangle +\langle\downarrow|\uparrow\rangle\otimes\langle\uparrow|\downarrow\rangle+ +\langle\uparrow|\uparrow\rangle\otimes\langle\uparrow|\uparrow\rangle +\langle\downarrow|\downarrow\rangle\otimes\langle\downarrow|\downarrow\rangle.$$ Using some matrix calculation i get $$P=\left(\begin{array} &1&0&0&0\\ 0&0&1&0\\ 0&1&0&0\\ 0&0&0&1 \end{array}\right)$$ and this do equal the first equation, but how could one come that up?