]> Number Fields - Sum of Two Squares

Sum of Two Squares

Theorem: Every prime p=1 (mod4 ) is a sum of two squares.

Proof: Let p=4 m+1 . By Wilson's Theorem, n=(2 m)! is a square root of -1 modulo p. (Alternatively, if g is a primitive root of p * we may take n=g m.)

Thus pn 2 +1 =(n+i)(ni). Therefore p is not irreducible, because it does not divide either of these factors.

Or is it? We overlooked a detail: how do we know primes and irreducibles are the same thing in [i]?

We answer this by showing [i] is euclidean with respect to the norm N(x+yi)=x 2 +y 2 . That is, for any a,b[i] and b nonzero, we find q,r[i] with a=bq+r and N(r)<N(b).

We find q with N(a/bq)<1 via a geometric argument. The gaussian integers form a lattice, and a/b lies within norm 1 of at least one of the points on this lattice, and we can take any of them to be q.

Thus [i] is euclidean and hence a UFD, so all irreducibles are prime.

Now we're sure p is reducible, namely p=(a+bi)(c+di) for nonunits a+bi,c+di. Taking norms gives p 2 =(a 2 +b 2 )(c 2 +d 2 ). Since neither factor of p has norm 1, we conclude that p=a 2 +b 2 =c 2 +d 2

Armed with this result, we can now easily describe the units and primes of [i]. The units are simply ±1 ,±i, by considering elements of norm 1. As for the primes, if p=3 (mod4 ) is a prime in [i] then it is also prime in [i] since in this case p cannot be the sum of two squares. Also if a 2 +b 2 is prime, then a+bi is also a prime.

We claim there are no other primes. To see this, let π=a+bi be some prime in [i]. Then N(π)=p 1 p 2 ...p k for some primes p i in . This implies πp for some prime p in , and hence N(π)=p or N(π)=p 2 . In the first case we have a 2 +b 2 =p, and in the second, we see that p/π is an integer of norm 1 implying that π is an associate of p. In the latter case, we must have p=3 (mod4 ) otherwise it would contradict what we proved above.

We can also show that a positive integer is the sum of two squares if and only if it has the form a 2 b where b is squarefree and no prime factors equal to 3 modulo 4. This follows from the algebraic identity (a 2 +b 2 )(c 2 +d 2 )=(adbc) 2 +(ac+bd) 2 , and the fact that the existence of nontrivial solutions of x 2 +y 2 =0 modp implies we can find a square root of -1 modulo p, which is impossible if p=3 mod4 .