We aim to give a proof of the following theorem, by using Minkowski’s First Theorem.

Theorem (Lagrange)

Every positive integer is the sum of four squares.

To establish this theorem, we shall require 3 lemmata.

Lemma 1

Let m be an odd positive integer, then there exist a,b \in \mathbb{Z} s.t.

a^{2}+b^{2}+1 \equiv 0 \pmod{m}.

Proof
We split into 3 cases.
(i) m = p, an odd prime.

Let

A = \{a^{2}, a=0,1,\ldots,(p-1)/2\},
B = \{-b^{2}-1, b=0,1,\ldots,(p-1)/2\}.

Clearly |A| = |B| = (p+1)/2 and the elements of A (resp. B) are pairwise incogruent modulo p. To see this,
assume a, a' \in A satisfy a^{2} \equiv a'^{2} \pmod{p}. Clearly a' \equiv 0 \Rightarrow a \equiv 0. Assume
a' \not\equiv 0 \pmod{p}. Then (aa'^{-1})^{2} \equiv 1 \pmod{p}. By Lagrange’s theorem,

x^{2} \equiv 1 \pmod{p}

has only 2 solutions, and these are -1 and 1. If aa'^{-1} \equiv -1 \pmod{p}, then a \equiv -a' \pmod{p}, which is a contradiction to how A was defined.

So aa'^{-1} \equiv 1 \pmod{p}, and hence a \equiv a' \pmod{p}. Similarly for B.

So by the pigeonhole priniciple, the 2 sets can’t be distinct, and it follows that there exist integers a,b such that a^{2} + b^{2} + 1 \equiv 0 \pmod{p}.

(ii) m = p^{k}, k\geq 1, p odd prime.

We proceed by induction. We have the case k=1 from before. For some k \geq 1, assume there exist integers a,b such that

a^{2} + b^{2} +1 \equiv 0 \pmod{p^{k}}.

Then there exists some integer s such that

a^{2} + b^{2} +1 = sp^{k}.

Clearly p cant divide both a and b. Assume a \not\equiv 0 \pmod{p}. Then we have (2a,p)=1, and so there exists some integer t such that s+2at \equiv 0 \pmod{p}. This can be found by solving the equation.

Let a_{1} = a + tp^{k}.

Then we have

a_{1}^{2} = a^{2} + 2atp^{k} +t^{2}p^{2k}
=-b^{2} -1 +sp^{k}+2atp^{k} +t^{2}p^{2k}
\equiv -b^{2} -1  + (s+2at)p^{k} \pmod{p^{k+1}}
\equiv -b^{2} -1 \pmod{p^{k+1}}.

Hence this case follows by induction.

(iii) m is an odd positive integer

The case m=1 is trivial. So let

m = \prod_{i=1}^{r}p_{i}^{k_{i}},

where the p_{i} are odd primes, and k_{i} \geq 1 are integers.

Then for each i, we have integers a_{i},b_{i} such that

a_{i}^{2} + b_{i}^{2} +1 \equiv 0 \pmod{p_{i}^{k_{i}}}.

We can then use the Chinese remainder theorem to find integers a,b such that

a \equiv a_{i} \pmod{p_{i}^{k_{i}}}, b \equiv b_{i} \pmod{p_{i}^{k_{i}}}

for each 1 \leq i \leq r. It follows that

a^{2} + b^{2} + 1 \equiv 0 \pmod{m}.

Lemma 2
If every odd positive integer is the sum of four squares, then every positive integer is the sum of four squares.

Proof
If some integer n is the sum of four squares, say

n= a^{2} + b^{2} + c^{2} +d^{2}.

Then we have

2n = (a+b)^{2} + (a-b)^{2} + (c+d)^{2} + (c-d)^{2}.

We can continue like this to show that 2^{k}n is the sum of four squares for any k \geq 0.
As any positive integer is of the form 2^{k}n, for some k \geq 0, and some odd integer n, the lemma follows.

Lemma 3
Let B_{r}(\textbf{0}) be the ball of radius r in \mathbb{R}^{4}. Then

\text{vol}(B_{r}(\textbf{0}))= \pi^{2}r^{4}/2.

Proof
It is not hard to see that the volume of this ball is equal to

\int_{-r}^{r}\frac{4}{3}\pi(r^{2}-z^{2})^{3/2}\text{d}z.

Solve this by using the substitution z = r\sin{\theta}.

We are now ready to prove the main theorem
Proof
By lemma 2, it suffices to prove for odd positive integers. Let m be an odd positive integer. By lemma 1, there exist integers a,b such that

a^{2} + b^{2} + 1 \equiv 0 \pmod{m}.

Let \Gamma \subset \mathbb{Z}^{4} be the lattice with basis vectors

\textbf{a}_{1} = (m,0,0,0)
\textbf{a}_{2} = (0,m,0,0)
\textbf{a}_{3} = (a,b,1,0)
\textbf{a}_{4} = (b,-a,0,1).

We have \text{det}(\Gamma) = m^{2}, and u \in \Gamma can be written as

\textbf{u} = u_{1}\textbf{a}_{1} +u_{2}\textbf{a}_{2} +u_{3}\textbf{a}_{3} +u_{4}\textbf{a}_{4}
(u_{1}m+u_{3}a+u_{4}b)\textbf{e}_{1}+(u_{2}m+u_{3}b-u_{4}a)\textbf{e}_{2}+u_{3}\textbf{e}_{3}+u_{4}\textbf{e}_{4},

with u_{1},\ldots,u_{4} \in \mathbb{Z}.
So

|\textbf{u}|^{2} = (u_{1}m+u_{3}a+u_{4}b)^{2} + (u_{2}m+u_{3}b-u_{4}a)^{2} + u_{3}^{2} + u_{4}^{2}
\equiv u_{3}(a^{2} + b^{2} + 1) + u_{4}(a^{2} + b^{2} + 1) \pmod{m}
\equiv 0 \pmod{m},

for all \textbf{u} \in \Gamma.

Let K = B_{\sqrt{2m}}(\textbf{0}) be the ball of radius 2m in \mathbb{R}^{4}. It is clear this is a symmetric convex body, amd has volume

2\pi^{2}m^{2} > 16m^{2} = 2^{4}\text{det}(\Gamma).

Hence we can apply Minkowski’s first theorem, and we have K contains some non-trivial lattice point

\textbf{u} =  u_{1}\textbf{a}_{1} +u_{2}\textbf{a}_{2} +u_{3}\textbf{a}_{3} +u_{4}\textbf{a}_{4}
=  v_{1}\textbf{e}_{1} + v_{2}\textbf{e}_{2} + v_{3}\textbf{e}_{3} + v_{4}\textbf{e}_{4},

for integers u_{1},\ldots,u_{4},v_{1},\ldots,v_{4}.
Now we have

|\textbf{u}|^{2}\equiv 0 \pmod{m},

and we have

0 < |\textbf{u}|^{2} < 2m,

since \textbf{u} \in K. So it follows that |\textbf{u}|^{2} = m, and therefore

m = v_{1}^{2} + v_{2}^{2} + v_{3}^{2} + v_{4}^{2}.

This proves the theorem.

Advertisement