Lagrange's four-square theorem 2026-10-13
Every nonnegative integer is a sum of squares with four terms, with zero terms allowed. Precisely, for every integer , there exist nonnegative integers such thatAllowing arbitrary integer roots gives the same statement: changing a root to its absolute value leaves the resulting square number unchanged. Four is a uniform upper bound on the number of nonzero terms, rather than a demand for four positive terms. Repeated square numbers are allowed. Conrad states the positive case and explicitly explains the role of zero terms; follows by taking all four roots zero. [ref]
https://kconrad.math.uconn.edu/blurbs/ugradnumthy/descent.pdf. Keith Conrad, Proofs by Descent, Section 6, opening paragraph and Theorem 6.6
The small cases make the convention visible:In particular, could not be a sum of squares with four strictly positive roots, since each term would be at least one. Geometrically, a square of integer side length has area : the theorem says that any nonnegative whole-number total area can be split into at most four such square areas. It does not assert that those squares tile one larger square or a prescribed rectangle.
Why does the fourth term matter? Two square numbers do not suffice for : in modular arithmetic, a square number has remainder zero or one modulo four, so their sum cannot be three modulo four. The sum of two squares theorem gives a complete criterion for the positive integers representable with two terms. Even three terms leave gaps. A square number has remainder or modulo eight; adding three of these, with repetition allowed, never gives seven modulo eight. Thus cannot be sums of three square numbers, although Lagrange's four-square theorem represents all of them with four. This also proves that the bound four cannot be reduced to three.
The modulo-eight obstruction is not the only way that three terms can fail. For example, needs four: if three square numbers added to , their remainders modulo four would force all three roots even. Dividing by four would then express as a sum of three square numbers, contradicting the preceding calculation. These short checks explain the examples without requiring a full classification of sums of three square numbers.
The practical benefit of Lagrange's four-square theorem is an existence guarantee for a family of Diophantine equations: for every nonnegative integer , the displayed equation has an integer solution. It does not specify a unique solution. For instance, . To find a representation by a finite search, enumerate and test the sum. The floor function supplies a finite bound because no single term can exceed , and sorting roots removes duplicate orderings without discarding any possible sum. The theorem guarantees that the search succeeds.
A greedy algorithm that repeatedly subtracts the largest available square number need not find four terms: for it chooses , while uses four. The appeal of the theorem is this gap between local choices and a global promise: individual square numbers become farther apart, and two or three terms leave arithmetic obstructions, yet four terms cover every nonnegative integer.
For historical orientation, Conrad dates Lagrange's four-square theorem to and identifies the memoir as Démonstration d'un théorème d'arithmétique: it appeared in the Berlin Academy's volume for the year , published in , pages –. Keeping the volume year and publication year distinct avoids an apparent conflict between dates. [ref]
https://kconrad.math.uconn.edu/blurbs/ugradnumthy/descent.pdf. Keith Conrad, Proofs by Descent, Theorem 6.6 and reference 11
Past exam of the mathematics course of the University of Cambridge 2006 iii Paper 7 1 ii Solution Created 2026-10-03 Updated 2026-10-14
Use the given integer satisfying . The Euclidean lattice under consideration has basis , because every vector in it is uniquely with . Its fundamental parallelogram therefore has areaWe use the following two-dimensional form of the Minkowski convex body theorem: a convex, centrally symmetric measurable subset of of area strictly greater than four times the covolume of a full-rank Euclidean lattice contains a nonzero vector of that lattice. Apply it to the closed disk of squared radius . Its area is , so it contains a nonzero lattice vector satisfyingOn the other hand the defining modular congruence and implyThere is exactly one positive multiple of strictly below , so . Neither coordinate can be zero, since a prime is not the square of an integer. This congruence lattice proof of the prime sum of two squares proves the required case of the sum of two squares theorem without assuming any conclusion at the critical area .
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 1 1G iii Solution Created 2026-09-24 Updated 2026-09-25
The quadratic form factors as a sum of two squares:The change of variableshas determinant , so its matrix is a unimodular matrix and it maps bijectively to itself. The original equation is therefore equivalent toThe sum of two squares theorem also decides this systematically: , and every prime factor congruent to modulo occurs to an even power, vacuously here. Thus is a sum of two integer squares. Explicitly,Inverting the change of variables gives, for example, . ConsequentlyThis is the unimodular reduction of a discriminant-minus-four form to two squares.
Sum of two squares 2026-10-20
A representation with integers . Signs, ordering, and whether zero is allowed must be specified when counting representations. The sum of two squares theorem characterizes which nonnegative integers have such a representation.

