Fermat's theorem on sums of two squares states that an odd prime number can be expressed as the sum of two integer squares if and only if it is congruent to 1 modulo 4. This elegant result bridges elementary number theory with the richer world of Gaussian integers and has inspired countless proofs, generalizations, and applications. Below we explore the theorem’s statement, its historical roots, several proof ideas, illustrative examples, and its relevance to modern mathematics That's the whole idea..
Introduction
Fermat's theorem on sums of two squares is a cornerstone result in number theory that answers a simple‑sounding question: Which primes can be written as (p = a^{2}+b^{2}) with (a,b\in\mathbb{Z})? Pierre de Fermat first noted the pattern in the 17th century, but a rigorous proof eluded mathematicians for over a century. The theorem not only classifies a special subset of primes but also introduces the idea that factoring in the ring of Gaussian integers (\mathbb{Z}[i]) behaves much like ordinary integer factorization, a insight that paved the way for algebraic number theory.
This is the bit that actually matters in practice The details matter here..
Historical Background
- Fermat’s Observation (circa 1640): In a letter to Marin Mersenne, Fermat claimed that every prime of the form (4k+1) is a sum of two squares, while no prime of the form (4k+3) can be expressed that way. He supplied no proof, noting only that the theorem was “true but difficult to demonstrate.”
- Euler’s First Proof (1749): Leonhard Euler provided the first complete proof using infinite descent, a technique Fermat himself favored. Euler’s argument relied on properties of quadratic residues and the fact that if a prime divides a sum of two squares, then under certain conditions it must itself be a sum of two squares.
- Lagrange’s Contribution (1775): Joseph-Louis Lagrange gave an alternative proof based on the theory of quadratic forms, showing that the binary quadratic form (x^{2}+y^{2}) represents exactly those integers whose prime factors of the form (4k+3) appear with even exponent.
- Gaussian Integer Proof (19th century): The advent of complex numbers allowed mathematicians such as Carl Friedrich Gauss to reinterpret the theorem in (\mathbb{Z}[i]). In this ring, the norm (N(a+bi)=a^{2}+b^{2}) is multiplicative, and the theorem becomes a statement about the factorization of primes: a rational prime (p) remains prime in (\mathbb{Z}[i]) iff (p\equiv3\pmod{4}); otherwise it splits as a product of two conjugate Gaussian primes.
These successive proofs illustrate how the theorem evolved from a curious numerical pattern to a gateway for deeper algebraic structures And that's really what it comes down to..
Statement of the Theorem
Theorem (Fermat’s theorem on sums of two squares).
Let (p) be an odd prime. Then there exist integers (a,b) such that
[ p = a^{2}+b^{2} ]
if and only if (p\equiv1\pmod{4}).
Worth adding, the representation (up to order and sign) is unique Worth knowing..
The “if and only if” condition separates the odd primes into two disjoint classes:
- (p\equiv1\pmod{4}): expressible as a sum of two squares (e.g., (5=1^{2}+2^{2}), (13=2^{2}+3^{2})).
- (p\equiv3\pmod{4}): never expressible as a sum of two squares (e.g., (3,7,11,19)).
The prime (2) is a special case: (2=1^{2}+1^{2}) and fits the pattern because (2\equiv2\pmod{4}) is treated separately.
Proof Overview
Several approaches exist; we outline three of the most instructive.
1. Proof via Infinite Descent (Euler)
- Assume a prime (p\equiv1\pmod{4}) is not a sum of two squares.
- Show that there exists a smaller positive integer (m<p) with the same property, leading to an infinite descending chain—impossible.
- The key step uses the fact that (-1) is a quadratic residue modulo (p) when (p\equiv1\pmod{4}); thus there is an integer (x) such that (x^{2}\equiv-1\pmod{p}).
- Consider the set (S={a+bi\mid a,b\in\mathbb{Z},; a^{2}+b^{2}<p}) and examine the product ((x+i)(x-i)=x^{2}+1).
- By manipulating congruences and applying the well‑ordering principle, one derives a contradiction, proving that (p) must be a sum of two squares.
2. Proof Using Quadratic Forms (Lagrange)
- Represent an integer (n) by the binary quadratic form (Q(x,y)=x^{2}+y^{2}).
- Show that the discriminant of (Q) is (-4).
- Apply the theory of genera: a prime (p) is represented by (Q) iff the Legendre symbol (\left(\frac{-1}{p}\right)=1).
- Since (\left(\frac{-1}{p}\right)=(-1)^{\frac{p-1}{2}}), the symbol equals (+1) exactly when (p\equiv1\pmod{4}).
- Conversely, if (p\equiv3\pmod{4}), the symbol is (-1), so (p) cannot be represented.
3. Proof via Gaussian Integers (Gauss)
- Define the norm (N(z)=z\overline{z}=a^{2}+b^{2}) for (z=a+bi\in\mathbb{Z}[i]).
- Observe that (N) is multiplicative: (N(zw)=N(z)N(w)).
- Show that the only units in (\mathbb{Z}[i]) are (\pm1,\pm i), each of norm 1.
- Key lemma: An odd rational prime (p) remains prime in (\mathbb{Z}[i]) iff (p\equiv3\pmod{4}).
- If (p\equiv3\pmod{4}), then (-1) is a non‑residue modulo (p), so the equation (x^{2}+y^{2}\equiv0\pmod{p}) has only the trivial solution, implying (p) cannot factor nontrivially.
- If (p\equiv1\pmod{4}), there exists (x) with (x^{2}\equiv-1\pmod{p}); then (p\mid(x+i)(x-i)) but (p) divides neither factor, so (p) splits: (p=\pi\overline{\pi}) for some non‑unit (\pi\in\mathbb{Z}[i]).
- Taking norms gives (