How statement and proof provenance work
The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.
- Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
- AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
- AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.
These labels describe origin, not correctness: citations and verification chips remain separate evidence.
Lagrange Four Square Theorem
1 · Prerequisites
- Binary Operations, Monoids, Groups and Subgroups
- Congruences, the Integers Modulo n and the Chinese Remainder Theorem
- Construction of the Natural Numbers
- Construction of the Real Numbers via Cauchy Sequences
- Construction of the Real Numbers via Dedekind Cuts
- Cosets, Index and Lagrange's Theorem
- Countability and Uncountability
- Cyclic Groups and Direct Products
- Divisibility, Greatest Common Divisors and Bézout's Identity
- Finite Counting, Factorials and Binomial Coefficients
- Foundations of the Real Numbers for Analysis
- Group Homomorphisms and the Isomorphism Theorems
- Normal Subgroups and Quotient Groups
- Polynomial Rings, the Division Algorithm and Roots
- Primes, Euclid's Lemma and the Fundamental Theorem of Arithmetic
- Primitive Roots and Unit Groups Modulo N
- Quadratic Reciprocity and the Jacobi Symbol
- Quadratic Residues and the Legendre Symbol
- Relations, Functions, and Quotients
- Rings, Subrings, Integral Domains and Fields
- Roots, Rational Powers, and Classical Inequalities
- Sums of Two Squares
- The Fundamental Theorem of Finite Abelian Groups
- The ZFC Axioms and the Basic Set Constructions
2 · Summary
Division with remainder for a nonzero divisor, the divisibility relation with its linearity and transitivity, and congruence modulo an integer together with its compatibility with addition and multiplication are the working tools here. From the theory of quadratic residues the development takes the proposition that for an odd prime and an integer with there are integers with , used at , and the criterion deciding when an odd integer is a square modulo a power of two, used at modulus . Cancellation of a nonzero factor in , the fact that a nonempty set of integers bounded below has a least element, the existence of a prime divisor of any integer above , and induction over supply the minimality and induction arguments.
A representation of a nonnegative integer as a sum of four squares is an ordered integer quadruple, and Euler's product identity in a fixed sign pattern makes such representations closed under multiplication. For a prime the congruence is solvable; replacing a solution by its least absolute remainders produces a multiple with that is a sum of four squares. The centred residue quadruple of a representation of has norm with , and the identity carries the representation down to , so the least admissible multiplier is and every prime is a sum of four squares; closure under products extends this to every nonnegative integer. A congruence argument modulo then shows that every positive integer of the form with is no sum of three squares.
3 · Logical flowchart
4 · Definitions, theorems and proofs
Representations as sums of four squares
Definition
Let be a nonnegative integer. A representation of as a sum of four squares is an ordered quadruple with . The integer is a sum of four integer squares when at least one such quadruple exists.
Two representations and of the same are equivalent up to signs and order when one is obtained from the other by permuting the four coordinates and independently changing the sign of any of them, and essentially different when they are not so equivalent. Since changing a sign does not change an absolute value and permuting the coordinates permutes them, two representations are equivalent exactly when the multisets and coincide.
Remarks
The coordinates range over all of . They may be zero, they may be negative, and they may repeat. So an integer written as a sum of one, two or three squares is a sum of four squares as well, its remaining coordinates being ; and is an admissible coordinate wherever is, with the same square. This matters where the identity of Euler's four-square product identity is applied, since its output coordinates are frequently negative or zero even when its inputs are not.
Only nonnegative is defined. A square is nonnegative and a sum of four nonnegative integers is nonnegative, so no negative integer admits a quadruple and the definition would be vacuous there.
The value . A sum of four squares vanishes exactly when each square vanishes, so and is the only representation of . Every representation of a positive integer therefore has at least one nonzero coordinate.
Agreement with the two-square convention. The convention here is the one Representations and primitive representations as sums of two squares uses for pairs: a representation is an ordered tuple, so order and sign are recorded, and equivalence up to signs and order is what quotients them out. The only change is the number of coordinates. That every nonnegative integer has at least one representation is Lagrange's four-square theorem: every nonnegative integer is a sum of four integer squares; the definition itself asserts nothing about existence.
Euler's four-square product identity
Statement
Let and be integers, and set
Then
Facts & Assumptions
Given: Integers , and defined by the four displayed formulas.
Proof
Expanding the left-hand side term by term gives the sixteen products with and , each with coefficient .
Squaring gives .
Squaring gives .
Squaring gives .
Squaring gives .
The terms occurring in steps 1.2 to 1.5 are the sixteen products of step 1.1, each occurring once: contributes the pairs with , those with or , those with or , and those with or .
The remaining terms of steps 1.2 to 1.5 cancel in six pairs of coordinate pairs: and from against their negatives in ; and from against their negatives in ; and from against their negatives in ; and from against their negatives in ; and from against their negatives in ; and and from against their negatives in .
Adding steps 1.2 to 1.5 and using steps 2.1 and 2.2, the sum equals the sixteen products of step 1.1, which is the left-hand side; since the computation used only the ring axioms, it is an identity of polynomials with integer coefficients and holds for every choice of the eight integers, negative or zero included.
Sums of four squares are closed under products
Statement
Let and be nonnegative integers. If each of and is a sum of four integer squares (Representations as sums of four squares), then is a sum of four integer squares.
Facts & Assumptions
Given: Nonnegative integers and , each a sum of four integer squares.
A representation of a nonnegative integer as a sum of four squares is an ordered quadruple with ; the integer is a sum of four integer squares when at least one such quadruple exists (Representations as sums of four squares).
For all integers , setting , , and gives (Euler's four-square product identity).
Proof
Fix quadruples and of integers with and , which the hypothesis supplies.
With formed from those eight integers by the displayed formulas, .
The four integers therefore form a quadruple in whose squares sum to , so is a sum of four integer squares; no coordinate is required to be positive or nonzero, so the argument is unaffected when a vanishes or is negative, and it covers and , whose quadruple satisfies the hypothesis and returns .
Remarks
What the identity does and does not give. The four coordinates are determined by the two chosen quadruples, so a different choice of representation of or of generally produces a different representation of . The statement asserts existence only; it makes no claim about how many representations has, nor that every representation of arises this way.
Why the closure is needed. Reducing Lagrange's four-square theorem: every nonnegative integer is a sum of four integer squares to Every prime is a sum of four integer squares requires exactly this: a factorisation of into primes is useless unless the property being proved is inherited by products.
For every prime the congruence is solvable
Statement
Let be a prime (Prime and composite integers: is prime when and its only positive divisors are and ). Then there are integers with , the congruence being that of Congruence modulo an integer: when , including the moduli and .
Facts & Assumptions
Given: A prime .
An integer is prime when and with force or ; in words, exceeds , and its only positive divisors are and (Prime and composite integers: is prime when and its only positive divisors are and ).
For , means (Congruence modulo an integer: when , including the moduli and ).
For , means for some (Divisibility in : when for some integer ).
Let be an odd prime and let with . Then there are integers such that (Every nonzero residue modulo an odd prime is a sum of two squares).
The group of units of the commutative monoid is ; equivalently, for the condition holds exactly when or ( is a commutative monoid whose group of units is ; equivalently holds exactly for and ).
Proof
If then is a positive divisor of , so [F1] forces or , and leaves ; hence either or is odd, and these two cases exhaust the primes.
In the case , take and : then and , so .
In the case odd, : otherwise for some integer by [F3], hence , so and [L2] gives or , both contradicting from [F1].
For the odd case, apply [L1] to the odd prime with , whose hypothesis is step 1.3: there are integers with .
For the odd case, since , so adding this to step 2.1 through [L3] gives .
Both cases produce integers with , and by step 1.1 no prime falls outside them.
Remarks
Where the odd case comes from. For odd the work is done by Every nonzero residue modulo an odd prime is a sum of two squares at : the set of square classes modulo , the zero class included, and the set of classes for are two subsets of with elements each, so they meet, and a common value gives . The hypothesis of that proposition is what step 1.3 discharges, by an argument that does not use oddness; oddness is needed only to make the proposition applicable at all.
Why is separate. The cited proposition is stated for odd primes, so it says nothing at ; the pair settles that case by computation rather than by weakening the proposition's hypothesis.
The least absolute remainder modulo a positive integer
Statement
Let be an integer with and let . Then there is exactly one integer with
that is, exactly one integer satisfying and , and consequently . Call this the least absolute remainder of modulo .
Facts & Assumptions
Given: An integer with and an integer .
For , means (Congruence modulo an integer: when , including the moduli and ).
For , means for some (Divisibility in : when for some integer ).
For with there is exactly one pair of integers with and ; moreover holds exactly when (Division with remainder for any nonzero divisor: for and there are unique with and ).
If and , then and (If and then and ; hence the set of divisors of a nonzero integer is bounded above by ).
Proof
Since , the modulus is nonzero and , so [L1] supplies exactly one pair of integers with and .
Define when , and otherwise; the two branches are mutually exclusive and exhaustive, so is a well-defined integer.
In either branch is an integer multiple of , since and ; hence and .
In either branch : the first branch gives from and its own condition, while the second has and , so satisfies .
From it follows that , and squaring the inequality between nonnegative integers gives .
If an integer also satisfies and , then and for integers by [F1] and [F2], so and ; adding to gives , so , and were then [L2] would give ; hence .
So exists by steps 3.1 and 3.2, is unique by step 4.2, and satisfies by step 4.1.
Remarks
Where the tie falls. The normalisation is deliberately half-open on the right: is permitted and is not. The case can arise only for even , where may equal the integer with ; then and are congruent modulo with , and the convention keeps . Without the half-open choice both values would satisfy and the uniqueness clause would be false as stated.
The bound is stated in integers. Writing rather than avoids introducing a quotient that need not be an integer, and it is the form the estimates in Some multiple with is a sum of four squares and The centred residue quadruple of has norm with use. The inequality is an equality exactly when .
Some multiple with is a sum of four squares
Statement
Let be a prime (Prime and composite integers: is prime when and its only positive divisors are and ). Then there is an integer with for which is a sum of four integer squares (Representations as sums of four squares).
Facts & Assumptions
Given: A prime .
An integer is prime when and with force or ; in words, exceeds , and its only positive divisors are and (Prime and composite integers: is prime when and its only positive divisors are and ).
A representation of a nonnegative integer as a sum of four squares is an ordered quadruple with (Representations as sums of four squares).
For , means (Congruence modulo an integer: when , including the moduli and ).
For , means for some (Divisibility in : when for some integer ).
For every prime there are integers with (For every prime the congruence is solvable).
For an integer and there is exactly one integer with and , and consequently (The least absolute remainder modulo a positive integer).
Proof
Fix integers with , which [L1] supplies for the prime .
Since by [F1], the modulus satisfies the hypothesis of [L2]; let and be the least absolute remainders of and modulo , so that , , and .
By [L3] applied to the products and and then to the sums, , and ; hence , which by [F3] and [F4] says .
Write with , as [F4] permits; the left-hand side is at least because and , and , so .
Multiplying step 4.1 by and using the two bounds of step 2.1 gives ; since by [F1] we have , so , whence , and .
The equation of step 4.1 exhibits the quadruple as a representation of , so is a sum of four integer squares with .
Remarks
Why the centring is needed. The pair produced by [L1] is subject to no size condition, so can be an arbitrarily large multiple of . Replacing by their least absolute remainders leaves the congruence class untouched and buys the two bounds and , which is what forces the multiplier below .
The bound is not tight, and does not need to be. What the coordinate bounds give at step 5.1 is , and only the weaker is used. The comparison needs just , which every prime satisfies, so needs no separate treatment even though the coordinate bound can be attained there, at .
The case . Nothing excludes it, and it is the case in which the prime is already a sum of four squares.
The centred residue quadruple of has norm with
Statement
Let be a prime (Prime and composite integers: is prime when and its only positive divisors are and ), let be an integer with , and let be integers with . Write for the least absolute remainders of modulo (The least absolute remainder modulo a positive integer). Then there is an integer with and
Facts & Assumptions
Given: A prime , an integer with , integers with , and the least absolute remainders of modulo .
An integer is prime when and with force or ; in words, exceeds , and its only positive divisors are and (Prime and composite integers: is prime when and its only positive divisors are and ).
For , means (Congruence modulo an integer: when , including the moduli and ).
For , means for some (Divisibility in : when for some integer ).
For an integer and there is exactly one integer with and , and consequently (The least absolute remainder modulo a positive integer).
Divisibility is linear: and imply for all ; in particular and (Divisibility is reflexive and transitive on , and is linear: if and then for all integers ; also implies , and ).
If and , then (The integers have no zero divisors; multiplicative cancellation).
Proof
Since the hypothesis of [L1] holds, so are defined and satisfy , , , together with , and the same three conditions for , and .
By [L2] applied to the products , , , and then to the sums, , and since ; so by [F2] the modulus divides , and by [F3] there is an integer with .
The left-hand side of step 2.1 is a sum of squares, hence at least , and , so .
Summing the four bounds , , , of step 1.1 gives , hence and, dividing by the positive integer , .
If then forces , so [F2] and step 1.1 give , , and ; writing , , , with [F3] then gives .
If then step 3.2 holds with equality, so each of the four bounds of step 1.1 is an equality: and likewise for , , .
In the case , cancelling the nonzero factor in step 4.1 by [L4] gives , so is a positive divisor of and [F1] forces or , both excluded by ; hence .
In the case of step 4.2, with gives or , and the normalisation of step 1.1 leaves ; so with a positive integer, and the same argument gives .
Still in the case , gives for some integer by [F2] and [F3], so , which divides; the same holds for , and .
In the same case, summing the four differences of step 6.1 and using [L3], divides , and divides , so .
Still in the case , writing as [F3] permits and cancelling the nonzero factor by [L4] gives , so is a positive divisor of and [F1] forces or , both excluded by ; hence .
Therefore by step 5.1, by step 3.2 and by step 8.1, that is , with from step 2.1.
Remarks
The two excluded values are excluded for the same reason. Both and end in , which the hypotheses rule out. They differ in how they get there: says the four coordinates are already multiples of , while says each is congruent to half of , and the second is possible only when is even.
Why the even case cannot be waved away. The normalisation admits , so for even a centred coordinate really can attain the bound , and then the estimate of step 3.2 gives only rather than . Steps 4.2 to 8.1 are what remove the remaining value. An alternative treatment halves all four coordinates first so that only odd moduli are descended through; the route taken here keeps the modulus arbitrary and pays for it with this one extra argument.
Descent step: a smaller multiple of is a sum of four squares
Statement
Let be a prime (Prime and composite integers: is prime when and its only positive divisors are and ), let be an integer with , and suppose is a sum of four integer squares (Representations as sums of four squares). Then there is an integer with for which is a sum of four integer squares.
Facts & Assumptions
Given: A prime , an integer with , and a representation of as a sum of four integer squares.
An integer is prime when and with force or (Prime and composite integers: is prime when and its only positive divisors are and ).
A representation of a nonnegative integer as a sum of four squares is an ordered quadruple with (Representations as sums of four squares).
For , means (Congruence modulo an integer: when , including the moduli and ).
For , means for some (Divisibility in : when for some integer ).
For all integers , setting , , and gives (Euler's four-square product identity).
For an integer and there is exactly one integer with and , and consequently (The least absolute remainder modulo a positive integer).
If is prime, and for integers , then the least absolute remainders of modulo satisfy for an integer with (The centred residue quadruple of has norm with ).
If are nonzero then ; consequently, if and , then (The integers have no zero divisors; multiplicative cancellation).
Proof
Fix integers with , which the hypothesis supplies.
Since , [L2] applies with modulus ; let be the least absolute remainders of modulo , so , , and modulo .
By [L3] applied to , and the representation of step 1.1, there is an integer with and .
Put ; substituting the congruences of step 2.1 and using [L4] gives , and by [F3], so .
Put , and ; the same substitution and [L4] give , and modulo .
Applying [L1] to and produces exactly the four quantities of steps 3.2 and 3.3 as , so .
By [F3] and [F4] the congruences of steps 3.2 and 3.3 say , , and ; write , , , with .
Substituting step 4.2 into step 4.1 gives .
Since is nonzero, by [L5], so cancelling in step 5.1 by [L5] gives .
The quadruple therefore represents as a sum of four integer squares, with from step 3.1.
Remarks
The sign pattern is doing the work. Steps 3.2 and 3.3 substitute , , , into the four bilinear forms of [L1] and read off that all four become divisible by : the first because it becomes the norm , the other three because they become expressions in which the terms cancel identically. That is a property of this particular choice of signs, and Why the descent fixes one sign pattern in the four-square identity records which other choices share it.
The hypothesis is used twice. It gives the modulus of [L2] and it is part of what [L3] needs; and it is not a restriction in practice, since is the case in which itself is already a sum of four squares and no descent is wanted.
Every prime is a sum of four integer squares
Statement
Every prime is a sum of four integer squares. That is, for every prime (Prime and composite integers: is prime when and its only positive divisors are and ) there is a quadruple with (Representations as sums of four squares).
Facts & Assumptions
Given: A prime .
An integer is prime when and with force or (Prime and composite integers: is prime when and its only positive divisors are and ).
A representation of a nonnegative integer as a sum of four squares is an ordered quadruple with (Representations as sums of four squares).
For every prime there is an integer with for which is a sum of four integer squares (Some multiple with is a sum of four squares).
If is prime, and is a sum of four integer squares, then there is an integer with for which is a sum of four integer squares (Descent step: a smaller multiple of is a sum of four squares).
Let be nonempty. If has an upper bound, it has a greatest element; if has a lower bound, it has a least element. In each case the element is unique (A nonempty set of integers bounded above has a greatest element, and a nonempty set of integers bounded below has a least element).
Proof
Suppose, for contradiction, that the prime is not a sum of four integer squares.
Let be the set of integers with for which is a sum of four integer squares; is nonempty by [L1].
The set is bounded below by , so [L3] gives it a least element , and because .
The value is impossible: it would make a sum of four integer squares, against step 1.1. Hence , and with step 2.1 this gives .
Applying [L2] to the prime and the multiplier , whose hypotheses and " is a sum of four integer squares" are step 3.1 and membership of in , gives an integer with for which is a sum of four integer squares.
Then , so while , contradicting the leastness of ; the assumption of step 1.1 therefore fails, and is a sum of four integer squares.
Remarks
What makes the descent terminate. The proof does not iterate the descent lemma; it applies it once, to the least multiplier, and reads the contradiction off leastness. The least element is supplied by [L3], for a set of integers bounded below, so no appeal to an infinite descending chain is needed and no infinite regress is written.
Where the hypothesis that is prime enters. Twice, through [L1] and through [L2]. In [L1] it supplies the congruence and the bound used to obtain a multiplier below ; in the construction underlying [L2] it is used when a positive divisor of is forced to be or . For a composite modulus the multiplier can stall above , so the statement proved here is genuinely about primes; the passage from primes to all nonnegative integers is Lagrange's four-square theorem: every nonnegative integer is a sum of four integer squares, and it uses Sums of four squares are closed under products rather than a further descent.
Lagrange's four-square theorem: every nonnegative integer is a sum of four integer squares
Statement
Every nonnegative integer is a sum of four integer squares. That is, for every integer there is a quadruple with (Representations as sums of four squares).
Facts & Assumptions
Given: The nonnegative integers.
A representation of a nonnegative integer as a sum of four squares is an ordered quadruple with (Representations as sums of four squares).
For , means for some (Divisibility in : when for some integer ).
An integer is prime when and with force or (Prime and composite integers: is prime when and its only positive divisors are and ).
Every prime is a sum of four integer squares. (Every prime is a sum of four integer squares).
Let and be nonnegative integers; if each of and is a sum of four integer squares, then is a sum of four integer squares (Sums of four squares are closed under products).
Let with and put . Then is nonempty and has a least element , and is prime; in particular every integer greater than has a prime divisor (Every integer has a prime divisor; indeed the least divisor of that exceeds is prime).
Let be nonempty. If has an upper bound, it has a greatest element; if has a lower bound, it has a least element. In each case the element is unique (A nonempty set of integers bounded above has a greatest element, and a nonempty set of integers bounded below has a least element).
Proof
Suppose, for contradiction, that not every nonnegative integer is a sum of four integer squares.
Let be the set of nonnegative integers that are not sums of four integer squares; by step 1.1 it is nonempty, and it is bounded below by , so [L4] gives it a least element .
Neither nor lies in , since and are representations in the sense of [F1]; as and , this forces .
By [L3] the integer has a prime divisor , and by [F2] there is an integer with .
Here , since would give against ; and , since step 4.1 gives prime, so [F3] gives , hence , and therefore .
Since and is least in , the integer is not in , so is a sum of four integer squares; and is a sum of four integer squares by [L1].
Both factors of are nonnegative and are sums of four integer squares, so [L2] makes one, contradicting ; the assumption of step 1.1 therefore fails, and every nonnegative integer is a sum of four integer squares.
Remarks
Why and are treated by hand. The proof factors through a prime divisor, and neither small value has one: is a product of no primes at all and is not a product of primes. Both are covered instead by the explicit quadruples in step 3.1, which the definition admits because coordinates may vanish.
Negative integers are outside the statement, not an omission. A square is nonnegative, and so is any sum of squares, so no negative integer is a sum of four integer squares, and the hypothesis is the exact range where the conclusion can hold.
Four is not improvable. Some integers admit no representation with a vanishing coordinate, so they are not sums of three squares. The proposition Positive integers with are not sums of three integer squares and its corollary Positive integers with need four nonzero squares exhibit the family with ; they do not assert the converse classification.
Why the descent fixes one sign pattern in the four-square identity
The four bilinear forms in Euler's four-square product identity are not the only ones that turn a product of two sums of four squares into a sum of four squares. Euler also recorded the variant with the same first coordinate and
which is the form Dummit's Lemma 1 displays, and the norm of a product of quaternions gives a third,
which is the route MIT's Lecture 22 takes. All three are polynomial identities in the eight variables, so any of them proves that a product of two sums of four squares is again one.
The descent asks more of the identity than that. In Descent step: a smaller multiple of is a sum of four squares the second quadruple is congruent to the first coordinatewise modulo , and what the proof needs is that all four output coordinates then become divisible by . Substituting , , , modulo and writing for , the pattern fixed in Euler's four-square product identity gives
and the first of these is the multiple , hence also modulo . Euler's second pattern behaves the same way: its last three coordinates become , and , all identically . The quaternion pattern does not: under the same substitution its coordinates become , , and , and the hypotheses of Descent step: a smaller multiple of is a sum of four squares — that divides and that the second quadruple is the centred residue quadruple of the first — do not force , , or to vanish modulo .
So the choice of signs is load-bearing for the divisibility step written here, and it is displayed rather than summarised for that reason. This says nothing about whether some other argument can descend with the quaternion pattern; a proof organised around quaternion divisibility rather than around congruences between bilinear forms is a different argument with a different bookkeeping, and nothing above bears on it.
A square is congruent to , or modulo
Statement
Call an integer even when divides it and odd otherwise (Divisibility in : when for some integer ). Let . Then is congruent to , to or to modulo (Congruence modulo an integer: when , including the moduli and ). More precisely, if is odd then , and if is even then or .
Consequently, if is odd then , and if is even then .
Facts & Assumptions
Given: An integer .
For , means (Congruence modulo an integer: when , including the moduli and ).
For , means for some (Divisibility in : when for some integer ).
For with there is exactly one pair of integers with and ; moreover holds exactly when (Division with remainder for any nonzero divisor: for and there are unique with and ).
Let be odd. For , the congruence is soluble if and only if (Unit square criterion and root count modulo powers of two).
Divisibility is transitive: and imply (Divisibility is reflexive and transitive on , and is linear: if and then for all integers ; also implies , and ).
Proof
By [L1] with there is exactly one pair with and , so or ; that is, for an integer , or for an integer , and these are the even and odd cases.
In the odd case, gives , so is odd; the congruence has the solution , so [L2] applied with and gives .
In the even case, gives , and by [L1] with applied to the integer is itself either or for an integer .
If then , so and .
If then , so , whence and .
Steps 1.2, 2.1 and 2.2 cover every integer , so is congruent to , to or to modulo , with occurring exactly in the odd case.
For the modulo- consequence: in the odd case and , so [L3] gives and ; in the even case either , whence by [L3], or for an integer , whence directly, so in both.
Remarks
Where the odd case comes from. The published criterion Unit square criterion and root count modulo powers of two says that for an odd is a square modulo exactly when . Reading it at in the direction "soluble implies ", with and the solution already in hand, is the whole odd case. The elementary route is also short — gives with even — and the citation is used instead because the criterion is the general statement of which this is the special case.
Which residues actually occur. All three do: , and realise the residues , and . So the list cannot be shortened, and the modulo- classification of squares is exactly this list.
No sum of three integer squares is congruent to modulo
Statement
There are no integers with (Congruence modulo an integer: when , including the moduli and ). In fact, the residues modulo attained by sums of three integer squares are exactly .
Facts & Assumptions
Given: Integers .
For , means (Congruence modulo an integer: when , including the moduli and ).
For every integer : if is odd then , and if is even then or (A square is congruent to , or modulo ).
For with there is exactly one pair of integers with and ; moreover holds exactly when (Division with remainder for any nonzero divisor: for and there are unique with and ).
Proof
By [L3] with each of is even or odd; let be how many of the three are odd, so is , , or , and these four values exhaust the possibilities.
By [L1], each odd coordinate contributes a square congruent to modulo , and each even coordinate contributes a square congruent to or to modulo .
If then, adding the three contributions by [L2], .
If then with equal to or , so the sum is congruent to or to .
If then with each equal to or , giving , , or ; since , the sum is congruent to or to .
If then with each equal to or , giving , , or ; since and modulo , the sum is congruent to or to .
Steps 2.1 to 2.4 cover the four values of listed in step 1.1 and show that every sum of three squares is congruent to one of , never to , modulo . Conversely, the triples , , , , , and have sums of squares , respectively. Thus the attained residues are exactly the seven listed classes, and is not attained.
Remarks
Why the cases are counted by parity rather than listed by value. Enumerating the possible triples of residues from would give ten unordered choices; grouping them by how many coordinates are odd gives four, because the odd coordinates contribute a fixed residue and only the even ones branch. The exhaustiveness is then visible from step 1.1 alone.
Every listed residue is attained. Taking to be , , , , , and gives sums , so the second sentence of the Statement is an equality of sets and not merely an inclusion.
If divides then , and are all even
Statement
Let and suppose (Divisibility in : when for some integer ). Then , and are all even.
Facts & Assumptions
Given: Integers with .
For , means (Congruence modulo an integer: when , including the moduli and ).
For , means for some (Divisibility in : when for some integer ).
For every integer : if is odd then , and if is even then (A square is congruent to , or modulo ).
For with there is exactly one pair of integers with and ; moreover holds exactly when (Division with remainder for any nonzero divisor: for and there are unique with and ).
Proof
By [L3] with each of is even or odd; let be how many of the three are odd, so is one of .
By [L1], modulo each odd coordinate contributes a square congruent to and each even coordinate contributes a square congruent to .
Adding the three contributions by [L2], , since the odd coordinates each contribute and the remaining ones contribute .
The hypothesis says by [F1] and [F2]; subtracting this from step 2.1 by the difference clause of [L2] gives , that is .
Since , [L3] applied with and has the unique pair , and it says holds exactly when ; so step 3.1 forces , meaning none of is odd, that is , and are all even.
Remarks
The modulus cannot be relaxed to . Divisibility of by leaves and both possible, and realises the second, so dividing the sum does not force the coordinates even. It is the count being pinned to a single residue modulo that makes the argument work, and that needs the modulus .
Where it is used. This is the halving step of Positive integers with are not sums of three integer squares: it is what licenses passing from a representation of to one of .
Positive integers with are not sums of three integer squares
Statement
Let and let be a positive integer with (Congruence modulo an integer: when , including the moduli and ). Then there are no integers with , where is the natural power of in the commutative monoid (Powers : natural exponents in a monoid and integer exponents in a group, with , is a commutative monoid whose group of units is ; equivalently holds exactly for and ).
Facts & Assumptions
Given: A positive integer with .
For , means (Congruence modulo an integer: when , including the moduli and ).
For , means for some (Divisibility in : when for some integer ).
There are no integers with (No sum of three integer squares is congruent to modulo ).
If and , then , and are all even (If divides then , and are all even).
If are nonzero then ; consequently, if and , then (The integers have no zero divisors; multiplicative cancellation).
In a monoid the natural powers of satisfy and for , where is the successor on (Powers : natural exponents in a monoid and integer exponents in a group, with ).
is a commutative monoid ( is a commutative monoid whose group of units is ; equivalently holds exactly for and ).
Let . If and whenever , then (The principle of mathematical induction).
Proof
Let be the set of such that for every positive integer with there are no integers with .
Base case : by [L4] in the monoid of [L5], , so and a representation would give by the hypothesis , which [L1] excludes.
Induction step: let , let be a positive integer with , and suppose integers satisfy ; by [L4] and [L5], , so and hence by [F2].
By [L2] the coordinates , , are then all even, so , and for integers .
Substituting gives , and cancelling the nonzero factor by [L3] yields , which contradicts since is a positive integer congruent to modulo .
So no such exist and ; with the base case of step 1.2, [L6] gives , which is the assertion.
Remarks
Three descriptions of the same integers. For a positive , the condition says for an integer , and because ; so the integers excluded here are exactly those of the form with a natural number and a nonnegative integer, which is how Dummit writes them. Crisman's phrase for the same set, an even power of two times an odd number congruent to seven modulo eight, is a third description: and every is odd.
Only one direction is proved. The statement says these integers are not sums of three squares. Its converse, that every other nonnegative integer is a sum of three squares, is Legendre's three-square theorem; it is not available from this page's declared prerequisites, and nothing here uses it. In particular the argument above rules out no integer beyond the ones named.
Why the induction is on the exponent. The base case is a congruence computation modulo and nothing more. The step is where the work is: it needs that a sum of three squares divisible by has all coordinates even, which is If divides then , and are all even, since without it the halved coordinates need not be integers.
Positive integers with need four nonzero squares
Statement
Let , let be a positive integer with (Congruence modulo an integer: when , including the moduli and ), and put , the power being the natural power in the commutative monoid (Powers : natural exponents in a monoid and integer exponents in a group, with , is a commutative monoid whose group of units is ; equivalently holds exactly for and ). Then is a sum of four integer squares, and in every representation of (Representations as sums of four squares) all four coordinates are nonzero.
Facts & Assumptions
Given: A natural number , a positive integer with , and .
A representation of a nonnegative integer as a sum of four squares is an ordered quadruple with (Representations as sums of four squares).
Every nonnegative integer is a sum of four integer squares (Lagrange's four-square theorem: every nonnegative integer is a sum of four integer squares).
For and a positive integer with , there are no integers with (Positive integers with are not sums of three integer squares).
In a monoid the natural powers of satisfy and for , where is the successor on (Powers : natural exponents in a monoid and integer exponents in a group, with ).
is a commutative monoid ( is a commutative monoid whose group of units is ; equivalently holds exactly for and ).
The order on is total, implies , and , imply (The integers form a totally ordered ring).
The embedding of into is injective, preserves order, and has image exactly the nonnegative integers (The naturals embed in the integers).
On , the strict order is membership and whenever (On the order is membership: ).
One has exactly when (Discreteness: is the immediate successor), and (The natural numbers (von Neumann)).
Let . If and whenever , then (The principle of mathematical induction).
Proof
The integers satisfy , and every positive integer is at least : the first because the embedded natural number is nonnegative and differs from the embedded natural number , which is the integer , by injectivity in [L6]; and if then [L6] writes as the image of a unique natural , with , so [L7] gives , hence , and [L8] turns this into , which order preservation in [L6] carries to .
Suppose, for contradiction, that some quadruple satisfies with for at least one index .
Let . Since by [L3] in the monoid of [L4], the set contains . If , then by [L3], and both factors are at least : by the hypothesis , and step 1.1 gives because is a positive integer. Thus both factors are positive, so [L5] gives , and step 1.1 then gives . Hence , and [L9] yields .
Since is positive, step 1.1 gives ; and step 2.1 gives . So both factors in are positive, [L5] gives , and in particular is nonnegative.
By [L1] applied to the nonnegative integer of step 3.1, is a sum of four integer squares, so a representation in the sense of [F1] exists.
Under the assumption of step 1.2, deleting the coordinate leaves three integers , the other coordinates in any order, with , which [L2] excludes; the assumption therefore fails, so every representation of has all four coordinates nonzero, and by step 4.1 at least one representation exists.
Remarks
What the two clauses say together. Four squares suffice for , by Lagrange's four-square theorem: every nonnegative integer is a sum of four integer squares, and three do not, by Positive integers with are not sums of three integer squares; the second clause is the sharper form of the latter, since a representation with a zero coordinate is exactly a representation of by three squares with a fourth coordinate added. So for these the number four in Lagrange's theorem cannot be lowered.
The smallest instances. Taking and gives ; taking and gives ; and taking and gives , so the statement is not about alone.
5 · Examples, counterexamples and false statements
None yet.
Sources
- Keith Conrad, Proofs by Descent, §6
- MIT 18.781 Theory of Numbers, Lecture 22: Four Squares Theorem
- Keith Conrad, Proofs by Descent, §6, Lemma 6.2
- Evan Dummit, Number Theory (part 9): The Geometry of Numbers, §9.1.2, Lemma 1
- Keith Conrad, Proofs by Descent, §6, Lemma 6.4
- Evan Dummit, Number Theory (part 9): The Geometry of Numbers, §9.1.2, Lemma 2
- Keith Conrad, Proofs by Descent, §6, Theorem 6.6 (Step 2)
- MIT 18.781 Theory of Numbers, Lecture 22, Lemma 81
- Keith Conrad, Proofs by Descent, §6, Theorem 6.6 (Step 1)
- MIT 18.781 Theory of Numbers, Lecture 22, Theorem 80
- Keith Conrad, Proofs by Descent, §6, Theorem 6.6
- Karl-Dieter Crisman, Number Theory: In Context and Interactive, §14.2, Fact 14.2.2
- Keith Conrad, Proofs by Descent, §6, Remarks 6.3 and 6.7
- Evan Dummit, Number Theory (part 9): The Geometry of Numbers, §9.1.3
- Karl-Dieter Crisman, Number Theory: In Context and Interactive, §14.2
- Karl-Dieter Crisman, Number Theory: In Context and Interactive, §14.2, Fact 14.2.1