Post · 2 min read· p. 100

Happy St Patrick’s Day and Sum of Squares

A short proof of the sum of two square theorem

images9

Neil L. is not a computer scientist–he is a Leprechaun. Since this Tuesday is St. Patrick’s Day it seems right to talk about him. As long as you look at him he cannot escape, but the moment you look away, he vanishes. I thought in the same spirit I would share a wonderfully simple proof that I read recently, it is due to Zaiger. The proof is based on a trick that reminded me a bit of Neil: when you read the proof carefully it clearly works, but if you look away it seems magical.

Theorem 1 Every prime p≡1 mod 4{p \equiv 1 \bmod 4} is the sum of two squares.

There are many proofs of this theorem, but the following is definitely very cool. It is based on a simple, but powerful parity principle.

Proof: Let p=4k+1{p=4k+1} be a prime. Consider the finite set S={(x,y,z)∣x2+4yz=p}{S = \{ (x,y,z) \mid x^{2} + 4yz = p \} } where x,y,z{x,y,z} are natural numbers. This set has two involutions: the obvious f{f} that sends (x,y,z){(x,y,z)} to (x,z,y){(x,z,y)} and the following: g{g} that sends (x,y,z){(x,y,z)} to:

  1. (x+2z,z,y−x−z){(x+2z,z,y-x-z)}, if x<y−z{x < y-z};
  2. (2y−x,y,x−y+z){(2y-x,y,x-y+z)}, if y−z<x<2y{y-z < x < 2y};
  3. (x−2y,x−y+z,y){(x-2y,x-y+z,y)}, if x>2y{x>2y}.

Any fixed point of f{f} is of the form (x,y,y){(x,y,y)} and yields a representation of p{p} as a sum of two squares:

x2+4y2=p.\displaystyle x^{2} + 4y^{2} = p.

The mapping g{g} has one fixed point (1,1,k){(1,1,k)}. This shows that S{S} has odd cardinality; therefore, f{f} must have a fixed point. □\Box

Magic.

Open Problems

Have a happy St. Patrick’s Day.