Fermat’s Sum of Two Squares Theorem
Fermat’s Sum of Two Squares Theorem states that any odd prime number of the form p=4n+1 (p is congruent to 1 mod 4) can be expressed as a sum of two squares:
p=x2+y2,
where x,y∈Z.
Although the proof is named after Pierre de Fermat it was first proposed by Albert Girard in 1625. Neither Mathematicians could provide a proof and for 100 years it was still not formally proven. Euler succeeded in providing an elementary proof in 1749 by method of Infinite Descent and bringing together other supplementary ideas from Number Theory such as Fermat’s Little Theorem, Finite Differences and the Diophantus’ Identity.
The proof is split into 5 propositions that each build up to proving the general statement for the theorem. Although more simple proofs do exist (such as Zagier’s one-line proof), Euler’s is completely elementary and more elegant in its approach.
Proposition 1
Claim: The product of two numbers, each of which is a sum of two squares, is itself a sum of two squares.
To prove this, ideas from Diophantus have to be borrowed:
The Brahmagupta-Fibonacci Identity (also known as The Diophantus Identity)
The Brahmagupta-Fibonacci identity expresses two sums of two squared numbers multiplied together. This is then expressed as a sum of two squares in two different ways.
(a2+b2)(c2+d2)= (ac−bd)2+(ad+bc)2= (ac+bd)2+(ad−bc)2.
For example (12+42)(22+72)=(−26)2+152=302+(−1)2.
It is clear that for any a, b, p, q the following is true:
(a2+b2)(p2+q2)=(ap+bq)2+(aq−bp)2.
Proposition 2
Claim: If a number, which is a sum of two squares, is divisible by a prime which is also a sum of two squares, then its quotient is also a sum of two squares.
The proposition can be expressed mathematically as:
Equation 1 a2+b2p2+q2=N, N∈R,
assuming that a2+b2 is divisible by p2+q2 (prime). By using an intermediate step, we can write
Equation 2 (pb−aq)(pb+aq)=p2b2+pbaq−aqpb−a2q2=p2(a2+b2)−a2(p2+q2).By rearranging equation 1, we get a2+b2=N(p2+q2). Then rewriting p2(a2+b2)−a2(p2+q2) we get:
p2(N(p2+q2))−a2(p2+q2).As p2+q2 is common, clearly this shows that p2+q2 divides both terms. Therefore as the right hand side of equation 2 divides by p2+q2, then it follows that the left hand side must also be divisible. \ Since (p2+q2) is a prime number, by Euclid’s Lemma, it divides one of the two factors (pb−aq)(pb+aq). We will consider the case of (p2+q2) dividing the factor (pb−aq). Using the Diophantus identity:
Equation 3 (a2+b2)(p2+q2)=(ap+bq)2+(aq−bp)2,we know that (p2+q2) is a divisor of the left hand side from our initial assumption. Now looking at the right hand side, we notice that (aq−bp)2 can be rewritten as
(aq−bp)2=((−1)(pb−aq))2=(pb−aq)2.As we know that (pb−aq) is divisible by (p2+q2), then the square must also be divisible. Therefore, in order to satisfy the equality of Diophantus’ identity, (ap+bq)2 must also be divisible by (p2+q2). Hence, we can divide equation 3 by (p2+q2)2 to obtain:
a2+b2p2+q2=(ap+bqp2+q2)2+(aq−bpp2+q2)2.As a result, we have proved that a number which is a sum of two squares that is divisible by a prime which is also a sum of two squares, is itself, a sum of two squares. Note that selecting the second factor (pb+aq) and presenting a similar argument yields the same result. In this case, you would need to use Diophantus’ alternative identity (a2+b2)(p2+q2)=(ap−bq)2+(aq+bp)2 and see that the term (aq+bp)2 is divisible by the prime (p2+q2).
Example
Let a = 2, b = 10, p = 2 and q = 3. Substituting our values into equation 1, we see that:
a2+b2p2+q2=22+10222+32=10413=8=22+22.Proposition 3
Claim: If a number can be written as a sum of two squares and 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.
To show the above statement is true, we will be proving it by contradiction and show that if all the factors of a2+b2 can be expressed as a sum of two squares, then some factor x is a sum of two squares.
Assume x divides a2+b2, we have the following:
Equation 1 a2+b2x=p1,p2,p3,…,pn,for n∈N and p prime. By rearranging equation 1 we get:
a2+b2=x×(p1,p2,p3,…,pn).There are two cases that could occur:
Where all p1,p2,p3,…,pn can be written as a sum of two squares,
Where at least one of the numbers p1pn cannot be written as a sum of two squares.
If the second case is satisfied then we have proved the proposition.
- In case 1 we can use proposition 2 which states:
If a number, which is a sum of two squares, is divisible by a prime which is also a sum of two squares, then its quotient is also a sum of two squares, say z2+r2.
Thus, we have assumed that the prime numbers p1,p2,p3,…,pn can be written as a sum of two squares, so by dividing a prime number p we get the following:
a2+b2p1=x×(p2,p3,…,pn)=z2+r2,carrying this out for p2 as well will give us the following result:
a2+b2p1×p2=z2+r2p2=x×(p3,…,pn)=t2+h2.If this is carried on until we reach the prime pn we will see the following:
a2+b2p1×p2×p3×⋯×pn=l2+m2=x.From the above result we can conclude that x has to be a sum of two squares, and there by contradiction we stated that x is not a sum of two squares and then there exists a pn which is not a sum of two squares.
Example
Let a=b=12 and x=24, then
a2+b2x⇒122+12224=28824=12.Now, if we split 12 up into its factors we obtain the following:
We see that some factors of 12 are not the sum of squares, as stated by the proposition. For example; 3, 4, 6 and 12.
Click here for propositions 4 and 5.