The summation over neighboring spins can be rewritten as ∑ ∑ ⟨ ⟨ i , j ⟩ ⟩ = 1 2 ∑ ∑ i ∑ ∑ j ∈ ∈ n n ( i ) , where n n ( i ) means "nearest neighbor of i ", and the 1 / 2 prefactor avoids double counting, since each bond participates in two spins. Simplifying leads to the final expression