# 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

## 1 Answer

I am not sure if Legendre's proof was complete (see this related MO entry), but surely Gauss gave a proof without Dirichlet's theorem (which came decades later).

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$.

• I cannot find Serre's book at present since I'm out of Nanjing. The two-step proof described by you looks like the proof in Section 5 of my talk maths.nju.edu.cn/~zwsun/Three-Square-Theorem.pdf. Though Step 2 does not involve Dirichlet's theorem, the whole proof still need that (see the details in the proof mentioned in my talk). – Zhi-Wei Sun Jun 16 '18 at 23:37
• From the wikipedia article en.wikipedia.org/wiki/Legendre%27s_three-square_theorem: "In 1801, C. F. Gauss had obtained a more general result containing Legendre theorem of 1797–8 as a corollary. In particular, Gauss counted the number of solutions of the expression of an integer as a sum of three squares, and this is a generalisation of yet another result of Legendre whose proof is incomplete. This last fact appears to be the reason for later incorrect claims according to which Legendre's proof of the three-square theorem was defective and had to be completed by Gauss." – Zhi-Wei Sun Jun 16 '18 at 23:51
• @Zhi-WeiSun: I trust Serre and Weil more than Wikipedia. Serre's book proves Dirichlet's theorem, but later in the book (besides, I have read that book). Weil's historical book discusses issues with Legendre's proof of the three square theorem (not Gauss's refined version which relates the problem to class numbers). – GH from MO Jun 17 '18 at 0:56
• I have asked one of my students to check the proof of the three-square theorem in Serre's book. Instead of the use of Dirichlet's theorem, it uses the Hasse-Minkowski local-global theorem which was again not known to Legendre or Gauss. – Zhi-Wei Sun Jun 17 '18 at 3:26
• @Zhi-WeiSun: Your question was "Where can I find a proof of the three-square theorem without using Dirichlet's theorem?". I just answered that. Serre's book has such a proof. BTW I don't think Legendre or Gauss had a simpler proof than Serre's book. – GH from MO Jun 17 '18 at 4:46