Lagrange's four-square theorem
Lagrange's four-square theorem, also known as Bachet's conjecture, states that any natural number can be represented as the sum of four integer squares
where the four numbers a0, a1, a2, a3 are integers. For illustration, 3, 31 and 310 can be represented as the sum of four squares as follows:
- 3 = 12 + 12 + 12 + 02
- 31 = 52 + 22 + 12 + 12
- 310 = 172 + 42 + 22 + 12.
Adrien-Marie Legendre improved on the theorem in 1798 with his three-square theorem, by stating that a positive integer can be expressed as the sum of three squares if and only if it is not of the form 4k(8m + 7). His proof was incomplete, leaving a gap which was later filled by Carl Friedrich Gauss.
The formula is also linked to Descartes' theorem of four "kissing circles", which involves the sum of the squares of the curvatures of four circles. This is also linked to Apollonian gaskets, which were more recently related to the Ramanujan–Petersson conjecture.
Proof using the Hurwitz integers
One of the ways to prove the theorem relies on Hurwitz quaternions, which are the analog of integers for quaternions. The Hurwitz quaternions consist of all quaternions with integer components and all quaternions with half-integer components. These two sets can be combined into a single formula
where E0, E1, E2, E3 are integers. Thus, the quaternion components a0, a1, a2, a3 are either all integers or all half-integers, depending on whether E0 is even or odd, respectively. The set of Hurwitz quaternions forms a ring; that is to say, the sum or product of any two Hurwitz quaternions is likewise a Hurwitz quaternion.
where is the conjugate of α. Note that the norm of a Hurwitz quaternion is always an integer. (If the coefficients are half-integer, then their squares are a number, equivalent to 1 modulo 4, divided by 4, so the sum is again an integer.)
Since quaternion multiplication is associative, and real numbers commute with other quaternions, the norm of a product of quaternions equals the product of the norms:
For any , . It follows easily that α is a unit in the ring of Hurwitz quaternions if and only if N(α) = 1.
Since any natural number can be factored into powers of primes, the four-square theorem holds for all natural numbers if it is true for all prime numbers. It is true for 2 = 02 + 02 + 12 + 12. To show this for an odd prime integer p, represent it as a quaternion (p, 0, 0, 0) and assume for now (as we shall show later) that it is not a Hurwitz irreducible; that is, it can be factored into two non-unit Hurwitz quaternions
- p = αβ.
The norms of p, α, β are integers such that
and N(α),N(β) > 1. This shows that both N(α) and N(β) are equal to p (since they are integers), and p is the sum of four squares
If it happens that the α chosen has half-integer coefficients, it can be replaced by another Hurwitz quaternion. Choose ω = (±1 ± i ± j ± k)/2 in such a way that γ ≡ ω + α has even integer coefficients. Then
Since γ has even integer coefficients, will have integer coefficients and can be used instead of the original α to give a representation of p as the sum of four squares.
As for showing that p is not a Hurwitz irreducible, Lagrange proved that any odd prime p divides at least one number of the form u = 1 + l2 + m2, where l and m are integers. This can be seen as follows: since p is prime, can hold for integers a, b, only when . Thus, the set of squares contains (p + 1)/2 distinct residues modulo p. Likewise, contains (p + 1)/2 residues. Since there are only p residues in total, and , the sets X and Y must intersect.
The number u can be factored in Hurwitz quaternions:
- 1 + l2 + m2 = (1 + l i + m j)(1 − l i − m j).
The norm on Hurwitz quaternions satisfies a form of the Euclidean property: for any quaternion with rational coefficients we can choose a Hurwitz quaternion so that by first choosing so that and then so that for 1, 2, 3. Then we obtain
It follows that for any Hurwitz quaternions α, β with α ≠ 0, there exists a Hurwitz quaternion γ such that
The ring H of Hurwitz quaternions is not commutative, hence it is not an actual Euclidean domain, and it does not have unique factorization in the usual sense. Nevertheless, the property above implies that every right ideal is principal. Thus, there is a Hurwitz quaternion α such that
- αH = pH + (1 − l i − m j)H.
In particular, p = αβ for some Hurwitz quaternion β. If β were a unit, 1 − l i − m j would be a multiple of p, however this is impossible as 1/p − l/p i − m/p j is not a Hurwitz quaternion for p > 2. Similarly, if α were a unit, we would have
- (1 + l i + m j)H = (1 + l i + m j)pH + (1 + l i + m j)(1 − l i − m j)H ⊆ pH
as p divides 1 + l2 + m2, which again contradicts the fact that 1/p + l/p i + m/p j is not a Hurwitz quaternion. Thus, p is not Hurwitz irreducible, as claimed.
Lagrange's four-square theorem is a special case of the Fermat polygonal number theorem and Waring's problem. Another possible generalisation is the following problem: Given natural numbers a, b, c, d, can we solve
- n = ax12 + bx22 + cx32 + dx42
for all positive integers n in integers x1, x2, x3, x4? The case a = b = c = d = 1 is answered in the positive by Lagrange's four-square theorem. The general solution was given by Ramanujan. He proved that if we assume, without loss of generality, that a ≤ b ≤ c ≤ d then there are exactly 54 possible choices for a, b, c, d such that the problem is solvable in integers x1, x2, x3, x4 for all n. (Ramanujan listed a 55th possibility a = 1, b = 2, c = 5, d = 5, but in this case the problem is not solvable if n = 15.)
Michael O. Rabin and Jeffrey Shallit have found randomized polynomial-time algorithms for computing a representation n = x12 + x22 + x32 + x42 for a given integer n, in expected running time O((logn)2).
The sequence of positive integers whose representation as a sum of four squares is unique (up to order) is:
- 1, 2, 3, 5, 6, 7, 8, 11, 14, 15, 23, 24, 32, 56, 96, 128, 224, 384, 512, 896 ... (sequence A006431 in OEIS).
These integers consist of the seven odd numbers 1, 3, 5, 7, 11, 15, 23 and all numbers of the form 2 × 4k, 6 × 4k or 14 × 4k.
The sequence of positive integers which cannot be represented as a sum of four non-zero squares is:
- 1, 2, 3, 5, 6, 8, 9, 11, 14, 17, 24, 29, 32, 41, 56, 96, 128, 224, 384, 512, 896 ... (sequence A000534 in OEIS).
These integers consist of the eight odd numbers 1, 3, 5, 9, 11, 17, 29, 41 and all numbers of the form 2 × 4n, 6 × 4n or 14 × 4n.
- Lagrange's three-square theorem
- Euler's four-square identity
- 15 and 290 theorems
- Jacobi's four-square theorem
- The Ramanujan Conhecture and some Diophantine Equations, Peter Sarnak, lecture at Tata Institute of Fundamental Research, of the ICTS lecture series. Bangalore, 2013 via youtube.
- Stillwell J (2003). Elements of Number Theory. New York: Springer-Verlag. pp. 138–157. ISBN 0-387-95587-9.
- Myung-Hwan Kim REPRESENTATIONS OF BINARY FORMS BY QUINARY QUADRATIC FORMS
- M. O. Rabin, J. O. Shallit, Randomized Algorithms in Number Theory, Communications on Pure and Applied Mathematics 39 (1986), no. S1, pp. S239–S256. doi:10.1002/cpa.3160390713
- Ireland and Rosen (1990). A Classical Introduction to Modern Number Theory. Springer-Verlag. ISBN 0-387-97329-X.