It is a classical result of number theory that every prime number p \equiv 1 \text{ mod }4 is a sum of two squares. I stumbled across the following absurd proof of this fact at, apparently due to Prof Roger Heath-Brown of Oxford.

Consider the set S = \{(x,y,z) \in \mathbb{N}^3 : x^2+4yz = p\}. This is clearly finite and nonempty for p \equiv 1 \text{ mod } 4.

Apply to it the following map:

(x,y,z) \mapsto \begin{cases} (x+2z, z,y-x-z) \text{ if } x<y-z \\ (2y-x,y,x-y+z) \text{ if }y-z<x<2y\\ (x-2y, x-y+z, y) \text{ if } x>2y \end{cases}

One can check that this defines a map from S to S, and furthermore that it is an involution (applying it twice gives the identity), with the unique fixed point (1,1,\frac{p-1}{4}), so in particular S is odd, so the involution (x,y,z) \mapsto (x,z,y) must also have a fixed point, giving a value y with x^2 + (2y)^2 = p.

I’m really not sure why this works. I suppose our crazy involution looks slightly like the kind of thing appearing in the theory of reduction of quadratic forms…. so maybe some connection with modular actions…. I don’t know… perhaps, like all good magic, I don’t yet want to see how this trick is done until I’ve resolved to attempt to perform it myself.


However, I guess if anyone preparing for the part IB “Groups Rings and Modules” questions feels like writing something outrageous in an exam, this might be useful.