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 \(a^2 + b^2\) is a sum of squares.

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

Then let \(a^2 + b^2 = {\pi}_0\). \({\pi}_0\) may or may not have the following factors:

Factor pairs of \pi_0

Factor pairs of \(\pi_0\)

Choosing a factor of \(\pi_0\), say \(x\), we get that

Equation 1 \[\begin{equation} \begin{split} & a =\ xm \pm c, \\ & b =\ xn \pm d, \end{split} \label{prop4 eq:1} \end{equation}\]

with \(c, \ d \le \frac{1}{2}|x|\) and \(m,\ n \in \mathbb{R}\). So

Equation 2 \[\begin{equation} a^2 + b^2 = m^2x^2 \pm 2mxc + c^2 + n^2x^2 \pm 2nxd + d^2 = Ax + \left(c^2 + d^2 \right), \label{prop4 eq:2} \end{equation}\]

with \(A = m^2x +2mc + n^2x + 2nd\). Since \(x\) divides the left hand side of equation 2, \(x\) must also divide the right hand side and most importantly \(c^2 + d^2\), say \(c^2 + d^2 = 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 \(\left(\gcd \ne 1\right)\)

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

Equation 3 \[\begin{equation*} \begin{split} & c = \alpha e, \\ & d = \alpha f, \end{split} \label{prop4 eq:3} \end{equation*}\]

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 \[\begin{equation*} \begin{split} & a =\ mx \pm \alpha e, \\ & b =\ nx \pm \alpha f, \end{split} \label{prop4 eq:4} \end{equation*}\]

which shows that \(\alpha\) (\(\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 \[\begin{equation*} \begin{split} c^2 + d^2 = \alpha^2 e^2 + \alpha^2 f^2 = \alpha^2 \left(e^2 + f^2 \right), \end{split} \label{prop4 eq:5} \end{equation*}\]

is equal to \(yx\) for some integer \(y\). This implies that \(\alpha^2\) divides \(y\) since it divides \(c^2 + d^2\) and it follows that

Equation 6 \[\begin{equation*} \begin{split} e^2 + f^2 = zx, \end{split} \label{prop4 eq:6} \end{equation*}\]

for an integer \(z\) such that \(z = \frac{y}{\alpha^2}\) for a relatively prime \(e\) and \(f\) and \(z\) no more than half of \(x\), since

Equation 7 \[\begin{equation} \begin{split} zx = e^2 + f^2 \le c^2 + d^2 \le \left(\frac{x}{2}\right)^2 + \left(\frac{x}{2}\right)^2 = \frac{1}{2}x^2, \end{split} \label{prop4 eq:7} \end{equation}\]

which follows since \(e\) and \(f\) are some factor of \(c\) and \(d\) and \(c,\ d \le \frac{1}{2}|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 \(e^2 + f^2\), a sum of squares. Since the smallest integer factor of \(\pi_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 \(a^2 + b^2\) 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 \(a^2 + b^2 = 19^2 + 9^2 = 442.\)

Factor pairs of 442

Factor pairs of 442

It can be shown that all factors of \(a^2 + b^2\) 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 \(p \equiv 1\) mod \(4\). Fermat’s Little Theorem guarantees that the numbers \(1^{4n},\ 2^{4n},\ 3^{4n},\ \dots,\ (4n)^{4n} \equiv 1\) mod \(4\). Since all elements of the sequence are divisible by \(p\), so are their differences:

\[\begin{equation*} \begin{gathered} p|\ 2^{4n}-1^{4n},\\ p|\ 3^{4n}-2^{4n},\\ p|\ 4^{4n}-3^{4n},\\ \vdots\\ p|\ (4n)^{4n}-(4n-1)^{4n}. \end{gathered} \end{equation*}\]

Now each of these differences can be factorised as follows:

\[\begin{equation*} 2^{4n}-1^{4n},\ 3^{4n}-2^{4n},\ \dots = (2^{2n}+1^{2n})(2^{2n}-1^{2n}),\ (3^{2n}+2^{2n})(3^{2n}-2^{2n}),\ \dots \end{equation*}\]

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 \[\begin{equation} a^{4n} - b^{4n} = (a^{2n} + b^{2n})(a^{2n} - b^{2n}). \label{prop5 eq:1} \end{equation}\]

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 \(a^2 + b^2\) 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|\ 2^{2n} - 1,\ 3^{2n} - 2^{2n},\ \dots\), then \(p\) can also divide the \(2^{nd}\) differences: \(p|\ 3^{2n} - 2(2)^{2n} + 1,\ 4^{2n} - 2(3)^{2n} + 2^{2n},\ \dots\) and in general, divide the \(k^{th}\) difference. From section 3, it was shown that the \(k^{th}\) difference of the sequence \(1^k,\ 2^k,\ 3^k,\ \dots\) is equal to \(k!\). Substituting \(2n\) instead of \(k\) would show that the \(2n^{th}\) difference would be equal to \((2n!)\):

\[\begin{equation*} (4n)^{2n} - \binom{1}{2n}(4n - 1)^{2n} + \binom{2}{2n}(4n - 2)^{2n} - \binom{3}{2n}(4n - 3)^{2n} + \dots = 2n!, \end{equation*}\]

which is not divisible by \(p\) since \(p = 4n+1 > 2n \times 2n-1 \times \dots\ 2 \times 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.