Click here for part 1 containing propositions 1, 2 and 3.

Proposition 4

Claim: If a and b are relatively prime then every factor of a2+b2 is a sum of squares.

First, let a and b be a relatively prime pair; that is their greatest common divider (gcd) is 1.

Then let a2+b2=π0. π0 may or may not have the following factors:

Factor pairs of \pi_0

Factor pairs of π0

Choosing a factor of π0, say x, we get that

Equation 1 a= xm±c,b= xn±d,

with c, d12|x| and m, nR. So

Equation 2 a2+b2=m2x2±2mxc+c2+n2x2±2nxd+d2=Ax+(c2+d2),

with A=m2x+2mc+n2x+2nd. Since x divides the left hand side of equation 2, x must also divide the right hand side and most importantly c2+d2, say c2+d2=yx.

The next part of the proof is split into two cases that depend on the choices of c and d.

c, d are not relatively prime (gcd1)

If c and d are not relatively prime, then their gcd is relatively prime to x. To prove this let α=gcd of c and d. Since α is a factor of both c and d they can be rewritten as:

Equation 3 c=αe,d=αf,

for a relatively prime pair of positive integers e and f which must be relatively prime to ensure that c and d are relatively prime. Plugging these into equation 1 we have that

Equation 4 a= mx±αe,b= nx±αf,

which shows that α (gcd of c and d) is relatively prime to x otherwise a and b would have a common factor which violates the condition that they are themselves relatively prime.

Additionally, we have that

Equation 5 c2+d2=α2e2+α2f2=α2(e2+f2),

is equal to yx for some integer y. This implies that α2 divides y since it divides c2+d2 and it follows that

Equation 6 e2+f2=zx,

for an integer z such that z=yα2 for a relatively prime e and f and z no more than half of x, since

Equation 7 zx=e2+f2c2+d2(x2)2+(x2)2=12x2,

which follows since e and f are some factor of c and d and c, d12|x|.

Now assume that x is not a sum of squares. Proposition 3 states that

If a number which can be written as a sum of two squares is divisible by a number which is not a sum of two squares, then the quotient has a factor which is not a sum of two squares.

Since zx is a sum of squares (from equation 7) and is divisible by x which is not a sum of squares, then from proposition 3 there must exist a factor, say w that divides z that is not a sum of squares.

This results in infinite descent; for a given x which is not a sum of squares there exists a smaller number w also not the sum of squares but both divide e2+f2, a sum of squares. Since the smallest integer factor of π0 is 1, there cannot exist a smaller number w that is divisible by a sum of squares since any non-zero sum of squares is at least 1, so x has to be a sum of squares.

Since x can be any factor of a2+b2 then all factors are a sum of squares, as proposed.

c, d are relatively prime

In this case, c and d can be used instead of e and f in equation equation 7 and the arguments that follow still hold true.

Example

Let a=19 and b=9. Then a2+b2=192+92=442.

Factor pairs of 442

Factor pairs of 442

It can be shown that all factors of a2+b2 are sum of squares:

Factors of 442 and their sum of squares

Factors of 442 and their sum of squares

Proposition 5

Claim: Every prime of the form 4n+1 is a sum of two squares.

To say a prime number is in the form p=4n+1 is equivalent to saying p1 mod 4. Fermat’s Little Theorem guarantees that the numbers 14n, 24n, 34n, , (4n)4n1 mod 4. Since all elements of the sequence are divisible by p, so are their differences:

p| 24n14n,p| 34n24n,p| 44n34n,p| (4n)4n(4n1)4n.

Now each of these differences can be factorised as follows:

24n14n, 34n24n, =(22n+12n)(22n12n), (32n+22n)(32n22n), 

So since p divides each of the differences it must also divide at least one of the pair of brackets (by Euclid’s Lemma):

Equation 1 a4nb4n=(a2n+b2n)(a2nb2n).

If p divides all of the first brackets (with the sum of two squares) then Fermat’s Sum of Two Squares proof is complete; we have the sum of two relatively prime squares that is divisible by a prime p. Now proposition 4 states that:

If a and b are relatively prime, then every factor of a2+b2 is a sum of squares,

so p is a sum of squares since we are assuming it divides a sum of squares as originally proposed.

However, it could be the case that p divides the second pair of brackets. We will show that this is not possible by using the method of Finite Differences.

Assume p divides all of the first consecutive differences of the second brackets, that is p| 22n1, 32n22n, , then p can also divide the 2nd differences: p| 32n2(2)2n+1, 42n2(3)2n+22n,  and in general, divide the kth difference. From section 3, it was shown that the kth difference of the sequence 1k, 2k, 3k,  is equal to k!. Substituting 2n instead of k would show that the 2nth difference would be equal to (2n!):

(4n)2n(12n)(4n1)2n+(22n)(4n2)2n(32n)(4n3)2n+=2n!,

which is not divisible by p since p=4n+1>2n×2n1× 2×1, so p cannot divide the second bracket and is therefore, a sum of two squares.

Example

Take the first 4 prime numbers of the form 4n+1; 5, 13, 17, 29. It can be easily shown that they are themselves sum of squares:

4n + 1 primes and their sums of squares

4n+1 primes and their sums of squares

Although we consider Euler’s proof to be the most interesting, there are a handful of other proofs that use ideas from many different areas of Mathematics including Calculus and Topology.