Heisenberg Hamiltonian for spin-spin system I wonder how we should conclude the following Hamiltonian (I mean the 32-18 in the picture below, written in solid state physics by Ashcroft & Mermin.) for spin-spin system?
(It is in chapter 32 of Ashcroft & Mermin.)

 A: 
Step 0: Outline.

We are going to define a candidate Hamiltonian. We know that we get the right answer if it has all the right behavior. While checking everything the Hamiltonian might possibly do seems daunting, things are simplified by two important facts:


*

*The Hilbert space is small -- only 4-dimensional. In fact, we're going to group three basis states together (the "triplet"), so we really only care about two parts of the space.

*If you define how an operator acts on a basis for a vector space, you've fully defined the operator.



Step 1: Find out how $\mathbf{S}_1\cdot\mathbf{S}_2$ acts on states of interest.

Start off by constructing the total spin operator $\mathbf{S} = \mathbf{S}_1 + \mathbf{S}_2.$ Clearly
$$ \mathbf{S}^2 = \mathbf{S}_1^2 + \mathbf{S}_2^2 + 2 \mathbf{S}_1\cdot\mathbf{S}_2. \tag{1} $$
As the authors note, $S_i^2 = 3/4$. What they mean is that for any of the four basis states of the form $\lvert S_1 \rangle \otimes \lvert S_2 \rangle$,
\begin{gather}
\lvert +1/2 \rangle \otimes \lvert +1/2 \rangle, \\
\lvert +1/2 \rangle \otimes \lvert -1/2 \rangle, \\
\lvert -1/2 \rangle \otimes \lvert +1/2 \rangle, \\
\lvert -1/2 \rangle \otimes \lvert -1/2 \rangle,
\end{gather}
$S_1$ acting on the state returns the state multiplied by $3/4$, and similarly for $S_2$. Since any state is a linear combination of these four, this must hold for the whole space, so we can replace $S_1^2$ and $S_2^2$ in (1) with this constant (times an implicit identity operator):
$$ \mathbf{S}^2 = \frac{3}{2} + 2 \mathbf{S}_1\cdot\mathbf{S}_2. \tag{2} $$

Step 2: Shift to a new basis where we look at total spin as a quantum number.

We'll now work with the states
\begin{align}
& \underbrace{\lvert 0,0 \rangle,}_\mathrm{singlet} &&
\underbrace{\lvert 1,-1 \rangle, \lvert 1,0 \rangle, \lvert 1,+1 \rangle,}_\mathrm{triplet}
\end{align}
all of the form $\lvert S,m_S \rangle$. These are related to our old states by Clebsh-Gordan coefficients, but we don't even need to worry about the explicit linear transformation. We're just making a conceptual shift.

Step 3a: Find how $\mathbf{S}_1\cdot\mathbf{S}_2$ acts on the singlet state.

Since $S = 0$, $\mathbf{S}^2 = 0$. Plug this into (2) to find
$$ \mathbf{S}_1\cdot\mathbf{S}_2 \lvert 0,0 \rangle = -\frac{3}{4} \lvert 0,0 \rangle. \tag{3} $$

Step 3b: Find how $\mathbf{S}_1\cdot\mathbf{S}_2$ acts on the triplet state.

Now $S = 1$, so $\mathbf{S}^2 = 2$. Again plug into (2) to find
$$ \mathbf{S}_1\cdot\mathbf{S}_2 \lvert 1,m_S \rangle = +\frac{1}{4} \lvert 1,m_S \rangle. \tag{4} $$

Step 4: Define a candidate Hamiltonian and see how it acts on our basis.

Define
$$ \mathcal{H}^\mathrm{spin} = \frac{1}{4} (E_\mathrm{s} + 3E_\mathrm{t}) - (E_\mathrm{s} - E_\mathrm{t}) \mathbf{S}_1\cdot\mathbf{S}_2. \tag{5} $$
(3) and (5) together tell us
$$ \mathcal{H}^\mathrm{spin} \lvert 0,0 \rangle = E_\mathrm{s} \lvert 0,0 \rangle, \tag{6} $$
while (4) and (5) together yield
$$ \mathcal{H}^\mathrm{spin} \lvert 1,m_S \rangle = E_\mathrm{t} \lvert 1,m_S \rangle. \tag{7} $$

Step 5: Conclude our Hamiltonian is correct.

Note we only ever wanted our Hamiltonian to give the contribution to the energy brought about by the two spins. From (6) we know our candidate has the singlet state as an eigenvector with the correct eigenvalue (the singlet state energy $E_\mathrm{s}$). Similarly, (7) tells us our candidate has each of the three triplet states as additional eigenvectors, all with the triplet energy $E_\mathrm{t}$ as an eigenvalue.
Since this operator has the right behavior acting on each vector in a basis, it must have the right behavior acting on all possible spin states. This of course holds in any basis, but we simply used two very convenient bases in the proof.
