# For a proof of the three-square theorem without using Dirichlet's theorem on primes in arithmetic progressions

The three-square theorem states that $n\in\mathbb N=\{0,1,2,\ldots\}$ is the sum of three squares if and only if it is not of the form $4^k(8m+7)$ ($k,m\in\mathbb N$). This was first proved by Legendre during 1797-1798. In 1837 Dirichlet proved his famous theorem on primes in arithmetic progressions. Now I can only find proofs of Legendre's three-square theorem using Dirichlet's theorem, see, e.g., M. B. Nathanson's book "Additive Number Theory-The Classical Bases" (GTM 164, Springer, 1996).

Legendre's original proof did not involve Dirichlet's theorem which was proved later. A proof without using Dirichlet's theorem might be self-contained and hence suitable for the course of elementary number theory.

QUESTION: Where can I find a proof of the three-square theorem without using Dirichlet's theorem?

• I think the question is addressed in Vicky Neale's outreaching book "closing the gap" about Zhang's 2013 breakthrough and subsequent Polymath8b project. If I remember correctly, she uses quadratic forms as GH suggests in his answer below. – Sylvain JULIEN Jun 16 '18 at 22:10

A nice transparent proof (without Dirichlet's theorem) can be found in Serre's book "A course in arithmetic". Very roughly, the proof goes as follows. Assume that $n$ satisfies the necessary local conditions. Step 1: There exists a positive integer $t$ such that $t^2 n$ is the sum of three squares. This relies on the theory of quadratic forms over $\mathbb{Q}$. Step 2: The minimal $t$ that works in Step 1 is $t=1$. This relies on the following simple but key property: for any $(x_1,x_2,x_3)\in\mathbb{Q}^3$ there exists $(y_1,y_2,y_3)\in\mathbb{Z}^3$ such that $\sum (x_i-y_i)^2<1$.