Proof of the sum of two squares theorem
Builds on Fermat's theorem on sums of two squaresBrahmagupta–Fibonacci identityP-adic valuationP-adic valuation of a productFirst supplement to quadratic reciprocityLegendre symbolQuadratic residueModular multiplicative inverseBézout's identityEuclid's lemmaEvery integer is a square times a square-free integerSquare-free integerExistence of prime factorizationMathematical induction
Proof
Let be the p-adic valuation. Call a sum of two squares if with integers .
Lemma. Let be prime with . Then and .
- Suppose . Then , and Bézout's identity gives a modular inverse with .
- Multiplying by gives . So is a quadratic residue modulo , and as a Legendre symbol.
- But is odd, so the first supplement gives . This contradiction shows .
- Then , and by Euclid's lemma.
If is a sum of two squares, then is even for each prime .
- Fix such a prime . We use strong induction on . Let .
- If , then , which is even.
- If , the lemma gives and with integers . Then with , and .
- By the induction hypothesis, is even. By the valuation of a product, is even.
If is even for each prime , then is a sum of two squares.
- By the square times square-free decomposition, with positive integers , and square-free.
- Let be a prime. If , then , as . Then is odd, which is excluded. So .
- By existence of prime factorization, with primes , where . By step 10, each is or a prime .
- Each is a sum of two squares: , and the others by Fermat's theorem on sums of two squares.
- By the Brahmagupta–Fibonacci identity, a product of two sums of two squares is a sum of two squares. By induction on , is a sum of two squares. For , .
- Write . Then , a sum of two squares.
Idea
A prime cannot divide without dividing both and , because is not a square modulo . So such primes come off in pairs. Conversely, the remaining primes are sums of two squares, and the Brahmagupta–Fibonacci identity multiplies them together.
Reading path
To understand this page from the ground up, read these 143 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 Fermat's theorem on sums of two squares by Thue's lemma, Proof of Euclid's lemma, Proof that R[x] is an integral domain iff R is, Proof of the Brahmagupta–Fibonacci identity, Proof that a function is bijective iff it has a two-sided inverse, Proof that every positive integer is a square times a square-free integer, Proof of the degree of a product over an integral domain, Proof of strong induction from ordinary induction, Proof that the p-adic valuation of a product is the sum of the valuations, Proof of the fundamental theorem of arithmetic, Proof of the complement principle, Proof that −1 is a square modulo p if and only if p is not 3 modulo 4, 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
- Modular multiplicative inverse 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
- P-adic valuation definition
- Prime factorization definition
- Square-free integer 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 that every positive integer is a square times a square-free integer proof
- Proof of the commutativity of addition by induction proof
- Order on the natural numbers definition
- Subset definition
- Cartesian product definition
- Disjoint sets definition
- Divisibility in a commutative ring definition
- Proof of the Brahmagupta–Fibonacci identity proof
- Degree of a polynomial definition
- Field definition
- Polynomial evaluation definition
- Integral domain definition
- Uniqueness quantifier definition
- Proof that congruence is compatible with powers proof
- Integers modulo n definition
- Every integer is a square times a square-free integer statement
- Binary relation definition
- Commutativity of addition statement
- Brahmagupta–Fibonacci identity statement
- Proof of cancellation in an integral domain proof
- Proof of strong induction from ordinary induction proof
- Leading coefficient definition
- Root of a polynomial definition
- Evaluation homomorphism definition
- Congruence is compatible with powers statement
- Strong induction statement
- Monic polynomial definition
- 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
- Proof of the pigeonhole principle proof
- Generalized Euclid's lemma statement
- 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
- Proof that the p-adic valuation of a product is the sum of the valuations proof
- Fermat's little theorem statement
- Fundamental theorem of arithmetic statement
- P-adic valuation of a product 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
- Proof that −1 is a square modulo p if and only if p is not 3 modulo 4 proof
- −1 is a square modulo p if and only if p is not 3 modulo 4 statement
- Fermat's theorem on sums of two squares statement
- Proof of the sum of two squares theorem proof
Where this leads
1 page builds on this one.
Further reading
- Web https://wstein.org/ent/ent.pdf, Section 5.7, Theorem 5.7.1
About this page
| Tag | 4XAHPWNPM3 |
|---|---|
| URI | m2://4XAHPWNPM3 |
| Kind | proof |
| Writing | W0 stub |
| MSC | 11E25 |
| Proves | Sum of two squares theorem |
| Uses | Fermat's theorem on sums of two squares, Brahmagupta–Fibonacci identity, P-adic valuation, P-adic valuation of a product, First supplement to quadratic reciprocity, Legendre symbol, Quadratic residue, Modular multiplicative inverse, Bézout's identity, Euclid's lemma, Every integer is a square times a square-free integer, Square-free integer, Existence of prime factorization, Mathematical induction |
| 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)
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.