> [!NOTE] Sum of Squares (Euler, 1760)
> If $p \equiv 1 \mod{4}$ is [[Prime Numbers|prime]], then $p$ is a sum of two squares.
###### Proof
If $p\equiv 1 \mod{4}$ then $\left( \frac{-1}{p} \right)=1$, so there exists $m\in \mathbb{Z}$ such that $m^2\equiv -1 \mod{p}$.
Let $\Lambda$ be the lattice in $\mathbb{R}^n$ spanned by ${1 \choose m}$ and ${0 \choose p}$. Then $\det \Lambda = p$.
Let $S=\{ (x,y) \in \mathbb{R}^2: x^2 +y^2 < 2p \}$. Then $\text{vol}(S) = 2\pi p > 4 \det \Lambda$ so by [[Minkowski's Theorem|Minkowski's]] theorem, $S \cap \Lambda\setminus \{ 0 \}$ is non-empty. That is, there exist $(x, y) \in S \cap \Lambda\setminus \{ 0 \}$ and $a, b\in \mathbb{Z}$ such that $\begin{pmatrix}
x \\ y
\end{pmatrix} = \begin{pmatrix}
a \\ am+bp
\end{pmatrix}$Now $\begin{align}
x^2 +y^2 &= a^2 +(am+bp)^2 \equiv a^2+(am)^2 \\
&= a(m^2+1) \equiv 0 \mod{p}
\end{align}$Since $x^2+y^2 \in (0,2p)$ is divisible by $p$, it must equal $p$.