Lagrange's Four Squares Theorem

Revision as of 07:01, 16 September 2025 by Abdulwaheed (talk | contribs) (Correcting any error would be highly appreciated)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Theorem

\[

\forall n \in \mathbb{N}, \ \exists \, a,b,c,d \in \mathbb{Z} \ \big| \ n = a^{2} + b^{2} + c^{2} + d^{2}. \]

proof: \[ \text{If } \exists \, a,b \in \mathbb{Z} \ \big| \ n = 4a(8b+7), \] then \[ n \equiv 0 \pmod{4} \ \text{or} \ n \equiv 3 \pmod{4}, \] when \(a \neq 0\) or \(a=0\), respectively.

Else, \[ n \equiv 1 \pmod{4} \ \text{or} \ n \equiv 2 \pmod{4}, \] so \(n\) can be expressed as a sum of three squares. Since \[ n = x^{2} + y^{2} + z^{2} \quad \text{(by Legendre's three square theorem)}, \] this implies \[ n = 0^{2} + x^{2} + y^{2} + z^{2}, \] a sum of four squares.

---

For the case \(n \equiv 3 \pmod{4}\): since \(n-1\) is expressible as a sum of three squares (because \(n-1 \equiv 2 \pmod{4}\)), by Legendre's three square theorem, \[ \exists \, x,y,z \in \mathbb{Z} \ \big| \ n-1 = x^{2} + y^{2} + z^{2}. \] Thus, \[ n = 1^{2} + x^{2} + y^{2} + z^{2}, \] which is a sum of four squares.

---

For the case \(n \equiv 0 \pmod{4}\): note that \[ n = 4m = 2^{2} m. \] If a sum of four squares exists for \(m\), then it exists for \(n\) as well, since \[ m = a^{2} + b^{2} + c^{2} + d^{2} \ \Longrightarrow \ n = 4m = (2a)^{2} + (2b)^{2} + (2c)^{2} + (2d)^{2}. \] Repeatedly dividing \(n\) by \(4\) will eventually yield a number congruent to \(1 \pmod{4}, \ 2 \pmod{4}, \ \text{or } 3 \pmod{4},\) which can be expressed as a sum of four squares by the previous three steps.

\[ \Box \]