In Book's Algebraic number theory, I. Stewart page 142:
Theorem 7.2: If $p$ is prime of the form 4k+1 then $p$ is sum of two squares.
Proof: The multiplicative group $G$ of the field $\mathbb Z/(p)$ is cyclic and has order $p-1=4k$. It therefore contains an element $u$ of order $4$. Then $u^2\equiv -1 \ (mod\ p)$ since $-1$ is the only element of order $2$ in $G$.
Let $L\subset \mathbb Z^2$ be the lattice in $\mathbb R^2$ consisting of all pairs $(a,b)$ with $a,b\in\mathbb Z$ such that
$$b\equiv ua\ (mod \ p)$$.
This is a subgroup of $\mathbb Z^2$ of index $p$ ...
They could help in the following steps:
a) How prove is a Lattice?
b) Why is a subgroup of index $p$?
Thank you all.
A lattice is a finitely generated free abelian group in this context. The set of all given $(a,b)$ is the free abelian group generated by $(1,u)$ and $(0,p)$, so it is a lattice. $\mathbb{Z}\oplus \mathbb{Z}$ has a decomposition as the direct sum of the subgroup generated by $(1,u)$ and the subgroup generated by $(0,1)$. Thus for any element $x$ of $\mathbb{Z}\oplus \mathbb{Z}$ we have that $px$ is in the subgroup we are considering, so the subgroup has index at most $p$. Thus the only possibilities are index 1 or index $p$, and since there are elements not contained in the subgroup it must be of index $p$.