---
tag: 0KYYSMEVHH
kind: statement
role: theorem
name: Lagrange's four-square theorem
msc: ["11E25"]
uses: [08WTN6SCQ6]
sources:
  - url: https://en.wikipedia.org/wiki/Lagrange%27s_four-square_theorem
    locator: lead section
  - url: https://en.wikipedia.org/wiki/Lagrange%27s_four-square_theorem
    locator: Historical development
same_as:
  wikidata: Q756946
  wikipedia: Lagrange's four-square theorem
---

## Statement

Each natural number $n$ is a sum of four squares of integers: $n = a^2 + b^2 + c^2 + d^2$ for some integers $a$, $b$, $c$ and $d$.

## Remarks

For example, $7 = 4 + 1 + 1 + 1$ and $15 = 9 + 4 + 1 + 1$.
Three squares are not enough: $7$ is not a sum of three squares, by [[Legendre's three-square theorem|0B64Q7XNE3]].
By [[Euler's four-square identity|08WTN6SCQ6]], it is enough to prove the theorem for primes.
Other proofs use [[Minkowski's theorem|0K387S2PKQ]] or the Hurwitz quaternions.

## History

Diophantus knew examples, and Bachet stated the theorem in his Latin translation of the Arithmetica of 1621.
Lagrange gave the first proof in 1770.

## Explanations

### L1 human

Every whole number is a sum of at most four perfect squares, if you allow $0$ as a square.
Some numbers, such as $7$, $15$ and $23$, need all four.
