Math 2.0

Number theory Proof

Proof of Lagrange's four-square theorem by descent

Builds on Euler's four-square identityExistence of prime factorizationPigeonhole principleWell-ordering principleEuclid's lemmaDivision algorithmCongruence modulo nPrime numberProof by infinite descentMathematical induction

Proof

Call an integer a 4-sum if it is x12+x22+x32+x42x_1^2 + x_2^2 + x_3^2 + x_4^2 with integers xix_i.

Reduction to odd primes.

  1. By Euler's four-square identity, the product of two 4-sums is a 4-sum.
  2. We have 0=02+02+02+020 = 0^2 + 0^2 + 0^2 + 0^2, 1=12+02+02+021 = 1^2 + 0^2 + 0^2 + 0^2 and 2=12+12+02+022 = 1^2 + 1^2 + 0^2 + 0^2.
  3. Each n≥1n \ge 1 is a product of primes, by existence of prime factorization. By step 1 and induction on the number of factors, it suffices to show that each odd prime pp is a 4-sum.

A multiple of pp that is a 4-sum. Fix an odd prime pp and put h=(p−1)/2h = (p - 1)/2.

  1. If 0≤a<a′≤h0 \le a < a' \le h and a2≡a′2(modp)a^2 \equiv a'^2 \pmod p, then p∣(a′−a)(a′+a)p \mid (a' - a)(a' + a). But 0<a′−a<p0 < a' - a < p and 0<a′+a<p0 < a' + a < p, against Euclid's lemma.
  2. So the h+1h + 1 numbers a2a^2 with 0≤a≤h0 \le a \le h are distinct modulo pp. Likewise the h+1h + 1 numbers −1−b2-1 - b^2 with 0≤b≤h0 \le b \le h are distinct modulo pp.
  3. Together these are 2h+2=p+12h + 2 = p + 1 numbers, with only pp residues. By the pigeonhole principle and step 5, some a2≡−1−b2(modp)a^2 \equiv -1 - b^2 \pmod p.
  4. So a2+b2+12+02=n0pa^2 + b^2 + 1^2 + 0^2 = n_0 p for an integer n0≥1n_0 \ge 1. Also n0p≤2h2+1<p2n_0 p \le 2h^2 + 1 < p^2, so n0<pn_0 < p.

Descent.

  1. By the well-ordering principle, let mm be the least positive integer with mpmp a 4-sum. By step 7, 1≤m<p1 \le m < p. Write mp=∑ixi2mp = \sum_i x_i^2. We show m=1m = 1, arguing by descent.
  2. Suppose mm is even. Then ∑ixi2\sum_i x_i^2 is even, so an even number of the xix_i are odd. Renumber so that x1≡x2x_1 \equiv x_2 and x3≡x4(mod2)x_3 \equiv x_4 \pmod 2.
  3. Then m2p=(x1+x22)2+(x1−x22)2+(x3+x42)2+(x3−x42)2\frac{m}{2} p = \left(\frac{x_1 + x_2}{2}\right)^2 + \left(\frac{x_1 - x_2}{2}\right)^2 + \left(\frac{x_3 + x_4}{2}\right)^2 + \left(\frac{x_3 - x_4}{2}\right)^2, with integer terms. This contradicts the minimality of mm. So mm is odd.
  4. Suppose m>1m > 1, so m≥3m \ge 3. By the division algorithm, choose yi≡xi(modm)y_i \equiv x_i \pmod m with ∣yi∣<m/2\abs{y_i} < m/2. This is possible as mm is odd.
  5. Then ∑iyi2≡∑ixi2=mp≡0(modm)\sum_i y_i^2 \equiv \sum_i x_i^2 = mp \equiv 0 \pmod m. Write ∑iyi2=mr\sum_i y_i^2 = mr with r≥0r \ge 0. Since each yi2<m2/4y_i^2 < m^2/4, we get mr<m2mr < m^2, so r<mr < m.
  6. If r=0r = 0, every yi=0y_i = 0, so m∣xim \mid x_i for each ii. Then m2∣mpm^2 \mid mp, so m∣pm \mid p. This is impossible for 1<m<p1 < m < p. So 1≤r<m1 \le r < m.
  7. Apply Euler's identity with ai=xia_i = x_i and b=(y1,−y2,−y3,−y4)b = (y_1, -y_2, -y_3, -y_4). Then (mp)(mr)=z12+z22+z32+z42(mp)(mr) = z_1^2 + z_2^2 + z_3^2 + z_4^2 with z1=x1y1+x2y2+x3y3+x4y4,z2=−x1y2+x2y1−x3y4+x4y3,z_1 = x_1y_1 + x_2y_2 + x_3y_3 + x_4y_4, \quad z_2 = -x_1y_2 + x_2y_1 - x_3y_4 + x_4y_3, z3=−x1y3+x2y4+x3y1−x4y2,z4=−x1y4−x2y3+x3y2+x4y1.z_3 = -x_1y_3 + x_2y_4 + x_3y_1 - x_4y_2, \quad z_4 = -x_1y_4 - x_2y_3 + x_3y_2 + x_4y_1.
  8. Modulo mm, replace each yiy_i by xix_i. Then z1≡∑ixi2≡0z_1 \equiv \sum_i x_i^2 \equiv 0. In z2z_2, z3z_3, z4z_4 the terms cancel in pairs, for example z2≡−x1x2+x2x1−x3x4+x4x3=0z_2 \equiv -x_1x_2 + x_2x_1 - x_3x_4 + x_4x_3 = 0.
  9. So mm divides each ziz_i. Dividing step 14 by m2m^2 gives rp=∑i(zi/m)2rp = \sum_i (z_i/m)^2, a 4-sum.
  10. Since 1≤r<m1 \le r < m, this contradicts the minimality of mm. So m=1m = 1, and pp is a 4-sum.
  11. By step 3, every natural number nn is a sum of four squares.

Idea

Euler's identity reduces the problem to primes. The pigeonhole principle gives a multiple mpmp of pp that is a sum of four squares. If m>1m > 1, reducing the xix_i modulo mm and using the identity again gives a smaller multiple, so the least such mm is 11.

Reading path

To understand this page from the ground up, read these 81 pages in order. The foundations come first. The path takes the proofs Proof of Bézout's identity, Proof of the generalized Euclid's lemma, Proof of the commutativity of addition by induction, Proof that a composition of injections is injective, Proof of Euclid's lemma, Proof that a function is bijective iff it has a two-sided inverse, Proof of Euler's four-square identity by expansion, Proof of strong induction from ordinary induction, Proof of the complement principle, Proof of the pigeonhole principle, Proof that a composition of surjections is surjective, Proof of the existence of prime factorization, Proof of the rule of sum, Proof of the well-ordering principle from strong induction, Proof of the division algorithm, Proof of the bijection principle, Proof of the existence of a prime divisor.

  1. Cardinality of a finite set definition
  2. Definition by recursion concept
  3. Divisibility definition
  4. Element definition
  5. Group concept
  6. Mathematical induction concept
  7. Natural numbers object
  8. Peano axioms concept
  9. Proof by infinite descent concept
  10. Proposition concept
  11. Congruence modulo n definition
  12. Greatest common divisor definition
  13. Prime number definition
  14. Set definition
  15. Ring definition
  16. Successor function definition
  17. Conjunction definition
  18. Implication definition
  19. Predicate definition
  20. Coprime integers definition
  21. Prime factorization definition
  22. Empty set object
  23. Ordered pair definition
  24. Addition of natural numbers definition
  25. Commutative ring definition
  26. Intersection definition
  27. The successor function is injective statement
  28. Zero is not a successor statement
  29. Existential quantifier definition
  30. Universal quantifier definition
  31. Cartesian product definition
  32. Disjoint sets definition
  33. Proof of the commutativity of addition by induction proof
  34. Order on the natural numbers definition
  35. Proof of Euler's four-square identity by expansion proof
  36. Subset definition
  37. Uniqueness quantifier definition
  38. Binary relation definition
  39. Commutativity of addition statement
  40. Euler's four-square identity statement
  41. Proof of strong induction from ordinary induction proof
  42. Function definition
  43. Strong induction statement
  44. Codomain definition
  45. Function composition definition
  46. Identity function definition
  47. Injective function definition
  48. Image of a set definition
  49. Proof of the well-ordering principle from strong induction proof
  50. Surjective function definition
  51. Left inverse definition
  52. Right inverse definition
  53. Proof that a composition of injections is injective proof
  54. Well-ordering principle statement
  55. Proof that a composition of surjections is surjective proof
  56. Bijective function definition
  57. Composition of injections is injective statement
  58. Proof of the existence of a prime divisor proof
  59. Proof of the division algorithm proof
  60. Composition of surjections is surjective statement
  61. Proof of the rule of sum proof
  62. Proof that a function is bijective iff it has a two-sided inverse proof
  63. Existence of a prime divisor statement
  64. Division algorithm statement
  65. Rule of sum statement
  66. Bijective iff it has a two-sided inverse statement
  67. Proof of the existence of prime factorization proof
  68. Proof of Bézout's identity proof
  69. Proof of the complement principle proof
  70. Proof of the bijection principle proof
  71. Bézout's identity statement
  72. Existence of prime factorization statement
  73. Complement principle statement
  74. Bijection principle statement
  75. Proof of the generalized Euclid's lemma proof
  76. Generalized Euclid's lemma statement
  77. Proof of the pigeonhole principle proof
  78. Pigeonhole principle statement
  79. Proof of Euclid's lemma proof
  80. Euclid's lemma statement
  81. Proof of Lagrange's four-square theorem by descent proof

Where this leads

4 pages build on this one.

Further reading

  1. Web https://en.wikipedia.org/wiki/Lagrange%27s_four-square_theorem, The classical proof
About this page
TagGBQDYYA8SE
URIm2://GBQDYYA8SE
Kindproof
WritingW0 stub
MSC11E25
ProvesLagrange's four-square theorem
UsesEuler's four-square identity, Existence of prime factorization, Pigeonhole principle, Well-ordering principle, Euclid's lemma, Division algorithm, Congruence modulo n, Prime number, Proof by infinite descent, Mathematical induction
Changed4 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.