Proof of Fermat's theorem on sums of two squares by Thue's lemma
Builds on Prime numberFirst supplement to quadratic reciprocityLegendre symbolQuadratic residuePigeonhole principleIrrationality of square roots of non-squaresCongruence modulo n
Proof
Let be an odd prime. Congruences are modulo the stated modulus.
If , then .
- An even integer has square . An odd integer has square .
- So is , or modulo .
- Since is odd, is or modulo . With , step 2 leaves only .
If , then .
- Since is even, the first supplement to quadratic reciprocity gives , a Legendre symbol.
- So is a quadratic residue modulo : there is an integer with .
- Let be the largest integer with . Since is prime, it is not a perfect square, so by irrationality of square roots of non-squares.
- Let be the set of pairs of integers with . It has elements.
- Map to the residue of modulo . There are only residues. By the pigeonhole principle, two distinct pairs have .
- Put and . Then , the pair is not , and .
- By steps 5 and 9, .
- By steps 6 and 9, .
- The only multiple of strictly between and is . So .
Idea
Squares are or modulo , which gives one direction. For the other, is a square modulo . The pigeonhole principle finds small and with , so divides , and smallness forces .
Reading path
To understand this page from the ground up, read these 130 pages in order. The foundations come first. The path takes the proofs Proof of Bézout's identity, Proof of cancellation in an integral domain, Proof of the generalized Euclid's lemma, Proof of the commutativity of addition by induction, Proof of Fermat's little theorem by rearrangement, Proof that a composition of injections is injective, Proof of Euclid's lemma, Proof that R[x] is an integral domain iff R is, Proof that a function is bijective iff it has a two-sided inverse, Proof of the degree of a product over an integral domain, Proof of strong induction from ordinary induction, Proof of the fundamental theorem of arithmetic, Proof of the complement principle, Proof of the pigeonhole principle, Proof that the integers modulo a prime form a field, Proof that a composition of surjections is surjective, Proof that congruence is compatible with addition, Proof of Euler's criterion by counting quadratic residues, Proof of the existence of prime factorization, Proof that a polynomial over a field has at most as many roots as its degree, Proof of the remainder theorem, Proof that congruence is compatible with multiplication, Proof of the rule of sum, Proof of the well-ordering principle from strong induction, Proof of the division algorithm, Proof of the first supplement to quadratic reciprocity from Euler's criterion, Proof of the bijection principle, Proof of the irrationality of square roots of non-squares, Proof of the factor theorem, Proof of the existence of a prime divisor, Proof that congruence is compatible with powers.
- Cardinality of a finite set definition
- Definition by recursion concept
- Divisibility definition
- Element definition
- Group concept
- Mathematical induction concept
- Natural numbers object
- Peano axioms concept
- Proposition concept
- Rational numbers object
- Real numbers object
- Congruence modulo n definition
- Greatest common divisor definition
- Prime number definition
- Set definition
- Ring definition
- Successor function definition
- Conjunction definition
- Implication definition
- Predicate definition
- Irrational number definition
- Quadratic residue definition
- Residue class definition
- Coprime integers definition
- Proof that congruence is compatible with addition proof
- Proof that congruence is compatible with multiplication proof
- Prime factorization definition
- Empty set object
- Ordered pair definition
- Addition of natural numbers definition
- Commutative ring definition
- Intersection definition
- Polynomial ring definition
- Ring homomorphism definition
- Unit of a ring definition
- Zero divisor definition
- The successor function is injective statement
- Zero is not a successor statement
- Existential quantifier definition
- Universal quantifier definition
- Legendre symbol definition
- Congruence is compatible with addition statement
- Congruence is compatible with multiplication statement
- Proof of the commutativity of addition by induction proof
- Cartesian product definition
- Order on the natural numbers definition
- Subset definition
- Disjoint sets definition
- Divisibility in a commutative ring definition
- Degree of a polynomial definition
- Field definition
- Polynomial evaluation definition
- Integral domain definition
- Uniqueness quantifier definition
- Integers modulo n definition
- Proof that congruence is compatible with powers proof
- Binary relation definition
- Commutativity of addition statement
- Proof of cancellation in an integral domain proof
- Leading coefficient definition
- Proof of strong induction from ordinary induction proof
- Root of a polynomial definition
- Evaluation homomorphism definition
- Congruence is compatible with powers statement
- Monic polynomial definition
- Strong induction statement
- Function definition
- Cancellation in an integral domain statement
- Multiplicity of a root definition
- Proof of the degree of a product over an integral domain proof
- Proof of the remainder theorem proof
- Codomain definition
- Function composition definition
- Identity function definition
- Injective function definition
- Image of a set definition
- Proof of the well-ordering principle from strong induction proof
- Division algorithm for polynomials statement
- Degree of a product statement
- Left inverse definition
- Right inverse definition
- Surjective function definition
- Proof that a composition of injections is injective proof
- Well-ordering principle statement
- Remainder theorem statement
- Proof that R[x] is an integral domain iff R is proof
- Proof that a composition of surjections is surjective proof
- Composition of injections is injective statement
- Bijective function definition
- Proof of the existence of a prime divisor proof
- Proof of the division algorithm proof
- Proof of the factor theorem proof
- R[x] is an integral domain iff R is statement
- Composition of surjections is surjective statement
- Proof that a function is bijective iff it has a two-sided inverse proof
- Existence of a prime divisor statement
- Division algorithm statement
- Proof of the rule of sum proof
- Factor theorem statement
- Bijective iff it has a two-sided inverse statement
- Rule of sum statement
- Proof of Bézout's identity proof
- Proof of the existence of prime factorization proof
- Proof that a polynomial over a field has at most as many roots as its degree proof
- Proof of the bijection principle proof
- Bézout's identity statement
- Proof of the complement principle proof
- Existence of prime factorization statement
- A polynomial over a field has at most as many roots as its degree statement
- Bijection principle statement
- Complement principle statement
- Proof of the generalized Euclid's lemma proof
- Proof that the integers modulo a prime form a field proof
- Integers modulo a prime form a field statement
- Generalized Euclid's lemma statement
- Proof of the pigeonhole principle proof
- Pigeonhole principle statement
- Proof of Euclid's lemma proof
- Euclid's lemma statement
- Proof of Fermat's little theorem by rearrangement proof
- Proof of the fundamental theorem of arithmetic proof
- Fermat's little theorem statement
- Fundamental theorem of arithmetic statement
- Proof of Euler's criterion by counting quadratic residues proof
- Proof of the irrationality of square roots of non-squares proof
- Euler's criterion statement
- Irrationality of square roots of non-squares statement
- Proof of the first supplement to quadratic reciprocity from Euler's criterion proof
- First supplement to quadratic reciprocity statement
- Proof of Fermat's theorem on sums of two squares by Thue's lemma proof
Where this leads
5 pages build on this one.
Further reading
About this page
| Tag | 7AAS7DK6MA |
|---|---|
| URI | m2://7AAS7DK6MA |
| Kind | proof |
| Writing | W0 stub |
| MSC | 11E25 |
| Proves | Fermat's theorem on sums of two squares |
| Uses | Prime number, First supplement to quadratic reciprocity, Legendre symbol, Quadratic residue, Pigeonhole principle, Irrationality of square roots of non-squares, Congruence modulo n |
| Changed | 4 November 2026 |
Markdown · JSON · Edit on GitHub
What this page needs for W1
- an inventory row: the row of the inventory that the node accounts for (0 of 1)
- a source with a locator (0 of 1)
The writing levels say how complete the text of a page is. They do not measure its truth.
What links here
No page links to this page yet.