Proof of Lagrange's four square theorem using Cauchy-Davenport Theorem Cauchy used the Cauchy-Davenport theorem to prove that $ax^2 + by^2 + c \equiv 0 \pmod p$ has solutions provided that $abc \neq 0$. Lagrange used this result to
establish his four squares theorem. I would like to know some references regarding these results. Thanks in advance.
 A: To show that $ ax^2 + by^2 + c \equiv 0 \pmod{p} $ has a solution, we can use the pigeonhole principle. Assuming that $ a, b \neq 0 \pmod{p} $ and that $ p $ is odd, there are $ (p+1)/2 $ perfect squares modulo p. Since $ x \to ax $ and $ x \to bx $ are permutations of $ \mathbb{Z}/p\mathbb{Z} $, this implies that $ ax^2 $ and $ -by^2 - c $ take $ (p+1)/2 $ distinct values each. If they did not agree for any $ x, y $, $ \mathbb{Z}/p\mathbb{Z} $ would have $ p+1 $ elements: contradiction. For the case $ p = 2 $, it suffices to check that $ (0, 1) $ is a solution of $ x^2 + y^2 + 1 \equiv 0 \pmod{2} $.
To prove Lagrange's theorem from this, we note that by a result of Euler, the product of sums of four squares is itself a sum of four squares. Therefore, it suffices to prove the result for prime $ p $. By our above result, $ x^2 + y^2 + 1 \equiv 0 \pmod{p} $ has a solution, therefore there are integers $ x, y, n $ such that $ x^2 + y^2 + 1 = np $. Without loss of generality (choosing $ x, y < p/2 $) we may assume that $ n < p $. Now, let $ k $ be the smallest positive integer such that $ x_1^2 + x_2^2 + x_3^2 + x_4^2 = kp $ for some $ a, b, c, d $. Assume $ k > 1 $, and consider for each $ x_i $ the unique integer $ y_i $ which satisfies $ x_i \equiv y_i \pmod{k} $ and $ (-k+1)/2 \leq y_i \leq k/2 $. Then, we have $ y_1^2 + y_2^2 + y_3^2 + y_4^2 = kq $ for some $ q \leq k $. We first rule out two cases: if we have $ y_i = k/2 $ for all $ i $, then we must have that $ kp $ is a multiple of $ k^2 $, which contradicts the primality of $ p $ and the fact that $ k \leq n < p $. Likewise, we cannot have that $ y_i = 0 $ for all $ i $. These give us that $ q \neq k $, therefore the inequality is strict; moreover, we have that $ q > 0 $.
Now, an appeal to the result of Euler mentioned above tells us that we have
$$ k^2 pq = z_1^2 + z_2^2 + z_3^2 + z_4^2 $$
for some $ z_i $. Furthermore, the explicit expressions of the $ z_i $ (which I will not type here, you may look up Euler's four square theorem) allow us to deduce that we have $ k | z_i $ for all $ i $. Therefore,
$$ pq =  \left( \frac{z_1}{k} \right)^2 + \left( \frac{z_2}{k} \right)^2 + \left( \frac{z_3}{k} \right)^2 + \left( \frac{z_4}{k} \right)^2 $$
This contradicts the minimality of $ k $, since $ q < k $. Therefore, we must have $ k = 1 $.
