The four-square theorem states that every nonnegative integer can be written as a sum of four integer squares:
For instance, At first this is surprising. Squares are sparse, and there are genuine congruence obstructions to representing every integer by two or three squares. Yet four squares suffice for every nonnegative integer. The proof combines two ideas that at first look unrelated. Algebra says that a sum of four squares remains a sum of four squares after multiplication. Geometry says that, for every prime
, one can construct a lattice in
whose vectors have squared length divisible by
, and whose density forces a nonzero vector of squared length strictly below
. A positive multiple of
smaller than
can only be
itself.
The guiding principle is therefore simple: first make divisibility automatic by putting integer vectors into the right lattice; then make the vector small by volume. The exact representation is forced by combining those two pieces of information.
The first ingredient is the four-square identity. If and
, then their product is again a sum of four squares:
This identity is most naturally understood through quaternions. Write , where
. Its norm is
, and quaternion multiplication satisfies
. Expanding the coordinates of
gives the displayed identity. Thus it is not an isolated algebraic trick: it is the multiplicativity of Euclidean squared length in the quaternion algebra.
Every positive integer has a prime factorization . Consequently, once every prime is known to be a sum of four squares, the four-square identity shows that every prime power, and hence every positive integer, is a sum of four squares. The theorem therefore reduces to the claim that every prime is a sum of four squares. The prime
is immediate, since
; we now fix an odd prime
.
Congruence Solution
The exact equation is difficult to solve directly. Instead, we first seek the weaker congruence
This alone is easy to arrange. The decisive issue is size. If we can also find a nonzero vector satisfying , then its squared length is a positive multiple of
in an interval containing only one such multiple. It must therefore equal
. Thus the proof has an arithmetic half and a geometric half: build a lattice in which the squared norm is always divisible by
, then use geometry to force a sufficiently short nonzero lattice vector.
We first need integers satisfying
Let be the set of quadratic residues, including
. Since each nonzero square has two square roots,
. The translated set
has the same size. Together these two subsets have total cardinality
, greater than the size of
, so they overlap. Hence there are
with
modulo
, which gives the desired relation.
This little pigeonhole argument gives a two-by-two matrix which reverses squared length modulo :
Equivalently, .
Lattice
Use the chosen to define a sublattice
by
The choice is designed so that the first two coordinates contribute the negative of the squared length of the last two coordinates modulo :
Therefore every lattice vector satisfies Rather than finding a single modular solution, we have created an entire lattice all of whose points satisfy the desired divisibility condition.
To apply Minkowski’s theorem we need its covolume. A basis of is
Indeed, the congruences say that any vector in can be written as
for integers
. The basis matrix is block upper triangular, hence its determinant is
. Thus
Equivalently, the two independent congruences modulo impose index
inside
.
Minkowski Theorem
We now use a continuous version of the pigeonhole principle. If is a full-rank lattice with covolume
, and if a convex centrally symmetric body
satisfies
then contains a nonzero point of
. This is Minkowski’s convex body theorem. One proof starts from Blichfeldt’s lemma: a measurable set of volume greater than
contains two distinct points differing by a lattice vector, because otherwise their reductions modulo
would fit disjointly inside a fundamental domain. Apply this to
. The volume hypothesis produces distinct
with
. Since
is symmetric and convex,
, and hence
Thus contains a nonzero lattice point.
Let Its volume is
Since
, Minkowski’s theorem applies as soon as
, or equivalently
At the same time, we want , so that any nonzero lattice point in the ball has squared length strictly below
. These requirements are compatible because
. Choose
with
Minkowski now supplies a nonzero vector . Its squared length is positive, divisible by
, and bounded by
. Thus
We have proved that every odd prime is a sum of four squares. Together with the case and the four-square identity, this proves Lagrange’s theorem: Every nonnegative integer is a sum of four integer squares
Conclusion
The sum of four squares is the quadratic form . For a prime
, the proof first solves the weaker congruence
on an entire lattice. It then uses the fact that the lattice has covolume
to force a nonzero point in a ball whose squared radius has size comparable with
. Finally, divisibility and smallness collapse all possibilities:
This “congruence plus size” mechanism appears repeatedly in number theory. One constructs an object constrained modulo some integer, then uses geometry, approximation, or an inequality to trap it in an interval so short that only one allowed multiple can occur.
There is also a dimensional reason that four squares fit this proof so well. The lattice has covolume , because two congruence conditions have been imposed. A four-dimensional ball has volume proportional to
. To overcome a covolume of order
, one needs
of order
, hence
of order
. But the squared radius is exactly the value of the four-square form. Dimension four is therefore quantitatively aligned with the desired equation.
Here is the summary of the argument:
For an odd prime , choose
with
, and define
Then for every
, while
. A four-ball with
has volume greater than
, so Minkowski gives a nonzero lattice vector inside it. Its value of
is a positive multiple of
smaller than
, and therefore equals
. Quaternionic norm multiplicativity then extends prime representations to all positive integers.