# Sum of four squares modulo a prime

With $p$ a prime integer, I am interested in showing the existence of four non-negative integers $\alpha_0,\alpha_1,\alpha_2,\alpha_3$, not all zero, such that $$\alpha_0^2+\alpha_1^2+\alpha_2^2+\alpha_3^2\equiv 0\mod p.$$ I am, of course, aware of the Lagrange four square theorem of which this is a special case. However, the fact that I am concerned with only prime $p$, and also that I have the looser modulo condition, leads me to hope that there is a simpler, more direct way of proving this.

My thoughts so far have been directed towards trying to tie quadratic residues into some sort of pigeonhole principle argument. That hasn't panned out. This question is motivated by a (double-star) problem in Herstein's Topics in Algebra. Ideally I am looking for hints rather than anything fleshed out. Thanks in advance.

• Just a quick idea: If $p \equiv 1 \pmod{4}$, let $i$ be the element such that $i^2 \equiv - 1\pmod{p}$. Then, you can take $\alpha_0 = \alpha_1 = 1$ and $\alpha_2 = \alpha_3 = i$. Nov 21, 2012 at 5:31

If $p$ is an odd prime, then there are numbers $x,y$ such that $$1 + x^2 + y^2 = m p,$$ where $0 < m < p.$
Note that Theorem 86 on the same page says you may take $y = 0$ if $p = 4k+1.$
I would characterize the proof, roughly, as counting the squares $\pmod p,$ but care is needed.
• Sorry, my first iteration of that comment was worded really clumsily. Your post pointed me in exactly the right direction. The problem in Topics in Algebra is 3.4.13b in my edition, showing quaternions over $\mathbb{Z}/p\mathbb{Z}$ are not a division ring. Nov 21, 2012 at 6:59