Why are the spin operators defined as they are? $$\begin{align*}S_z &= \frac{\hbar}{2} \left(\left|+\right>\left<+\right| - \left|-\right>\left<-\right|\right)\\
S_y &= i\frac{\hbar}{2} \left(\left|-\right>\left<+\right| - \left|+\right>\left<-\right|\right)\\
S_x &= \frac{\hbar}{2} \left(\left|+\right>\left<-\right| + \left|-\right>\left<+\right|\right)
\end{align*}
$$
I keep reading that this is the way the spin operators for $\frac{1}{2}$-spin systems are 'defined'. I suspect the reason to define this way is very obvious and that's why explanations behind the definitions are omitted, but I can't figure it out.
What are the reasons for the order of the $\pm$ kets/bras, and what determines whether you add them ($S_x$) or subtract ($S_z$, $S_y$)?
 A: The way you've written them, those are the spin operators in the $\hat{S}_z$ eigenbasis for a spin-1/2 particle. The two $\hat{S}_z$ eigenstates are spin up (written as $|+\rangle$ or $\uparrow$) and spin down ($|-\rangle$ or $\downarrow$), which can be written as $\begin{pmatrix}1\\0\end{pmatrix}$ and $\begin{pmatrix}0\\1\end{pmatrix}$ in the $\hat{S}_z$ eigenbasis. When constructing the operators, you want to end up with
$$
\hat{S}_z |+\rangle = \frac{\hbar}{2} |+\rangle, \quad \hat{S}_z |-\rangle = -\frac{\hbar}{2} |-\rangle.
$$
Since $\hat{S}_z$ is diagonalized in its eigenbasis with eigenvalues of $\pm {\hbar}/{2}$, we know its form is
$$
\hat{S}_z = \frac{\hbar}{2} \pmatrix{1&0\\0&-1}
$$
which can also be written as
$$
\hat{S}_z = \frac{\hbar}{2}\big(|+\rangle \langle +|- |-\rangle \langle -| \big)
$$
You can get the other two operators by rotating the $\hat{S}_z$ operator to the $x$ or $y$ axes, or by constructing the eigenvectors of $\hat{S}_x$ and $\hat{S}_y$ in the $\hat{S}_z$ basis, from the commutation relations $[\hat{S}_i,\hat{S}_j] = i \varepsilon_{ijk}\hat{S}_k$, or from the ladder operators $\hat{S}_\pm = \hat{S}_x \pm i\hat{S}_y$. These operators shift the eigenvalue and eigenket by one unit of $\hbar$,
$$
\hat{S}_\pm |\mp\rangle = \hbar \,|\pm\rangle, \quad \hat{S}_\pm |\pm\rangle = 0.
$$
This yields the form of the ladder operators
$$
\hat{S}_+ = \hbar \pmatrix{0&1\\0&0},\quad \hat{S}_- = \hbar \pmatrix{0&0\\1&0}.
$$
Using the expression for $\hat{S}_\pm$ in terms of $\hat{S}_x$ and $\hat{S}_y$, you end up with the forms in your post. You can also check that they follow the commutation relations (which they do).
A: These are mainly conventions. Conventionally, the kets $|+\rangle$ and $|-\rangle$ are taken to be eigenkets of the z-spin operator with, respectively, z-spin of $+\hbar/2$ and -$\hbar/2$.
S_x and S_y are chosen such that they obey the canonical commutation relations for angular momenta
$$
[S_i,S_j]=i\epsilon_{ijk}S_k
$$
E.g.,
$$
[S_x,S_y]=iS_z
$$
and so on.
