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 — Examples
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
- Lagrange Four Square Theorem
- 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
3 · Logical flowchart
4 · Definitions, theorems and proofs
None yet.
5 · Examples, counterexamples and false statements
through all four bilinear coordinates
Example
Take the representations and , so and . The four bilinear forms of Euler's four-square product identity evaluate to
and . Every coordinate is computed below, the vanishing one included: is a value the formula returns and not a coordinate that has been left out.
Facts & Assumptions
Given: The quadruples 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 all integers , setting , , and gives (Euler's four-square product identity).
Verification
The two data are representations: and .
Substituting and into the formulas of [L1] gives , , and .
Their squares sum to , and , so is a representation of in the sense of [F1] and the identity is confirmed on this pair.
Remarks
A negative coordinate is not a defect. The third coordinate is , and only its square enters the sum, so represents the same integer as and the two representations are equivalent up to signs. They are distinct ordered quadruples. The formulas are not arranged to produce nonnegative outputs, and no step of the identity or of the descent needs them to be.
The two intersecting square sets modulo give
Example
Let and work with the representatives . Put
Then and , each with elements, and . Taking the common value , which is and is also congruent to , gives
This is the mechanism behind Every nonzero residue modulo an odd prime is a sum of two squares at , written out at : two subsets of the residues, each of size , cannot be disjoint. That proposition supplies such a common value for every odd prime, and For every prime the congruence is solvable cites it rather than repeating the count.
Facts & Assumptions
Given: The prime and the sets and displayed above.
For , means (Congruence modulo an integer: when , including the moduli and ).
For every prime there are integers with (For every prime the congruence is solvable).
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).
Verification
Since and have the same square and modulo , every square residue is for some with ; computing, , , , , and , so .
For the same six values of , , , , , and modulo , so .
Comparing the two displayed lists, ; taking with from step 1.1 and from step 2.1 gives , hence , an instance of [L1] at .
The nonempty intersection exhibited in step 3.1 is exactly what [L2] asserts at for an arbitrary odd prime, since is the set of residues of at ; the argument at therefore instantiates the cited proposition rather than adding to it.
Remarks
Why is a good modulus for this. Here and is not in , so is not itself a square modulo and no pair with works. The example is therefore not a disguised one-square case: two squares are genuinely needed, which is what the cited proposition provides.
Other solutions exist. The intersection has the further common values and : the value is and also modulo , giving , and the value is and also , giving . So the solution pair is not unique; the cited proposition asserts that at least one common value exists and says nothing about how many do.
Least absolute remainders modulo and modulo
Example
Write for the least absolute remainder of modulo (The least absolute remainder modulo a positive integer). For :
Modulo the odd modulus every entry satisfies strictly, the largest value of being . Modulo the even modulus the entry attains and hence ; here and are congruent modulo , and the normalisation is what selects rather than .
Facts & Assumptions
Given: The moduli and and the integers .
For , means (Congruence modulo an integer: when , including the moduli and ).
For an integer and there is exactly one integer with and , and consequently (The least absolute remainder modulo a positive integer).
Verification
For the condition of [L1] is , that is ; each listed value is congruent to its argument, since , , and are multiples of while are their own remainders, so the first table is correct and throughout.
For the condition of [L1] is , that is ; the listed values are congruent to their arguments because , and are multiples of while are their own remainders, so the second table is correct.
At and the value gives , so the bound of [L1] is attained with equality; the alternative is congruent to modulo and satisfies , which the strict left-hand inequality of [L1] excludes, so the normalisation is what makes the remainder unique here.
Remarks
Only an even modulus produces the tie. The equality requires to be twice an integer, so for odd the bound is automatically strict, as the first table shows. This is exactly the boundary that The centred residue quadruple of has norm with has to exclude by a separate argument: the norm estimate there gives only , and equality in all four centred coordinates at once is exactly the case that a separate argument must rule out.
Descending from to in two steps
Example
Start from the prime and the multiplier , with
Centring the coordinates modulo gives , whose norm is , so the multiplier drops to . Euler's identity applied to and gives , each coordinate divisible by ; dividing by gives
Repeating with : the centred quadruple is , of norm , so ; the identity applied to and gives , and dividing by gives
The two steps use an odd modulus and then an even one, so both parities occur.
Facts & Assumptions
Given: The prime , the multiplier , and the representation .
A representation of a nonnegative integer as a sum of four squares is an ordered quadruple with (Representations as sums 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).
If is prime, and , then the least absolute remainders of modulo satisfy for an integer with (The centred residue quadruple of has norm with ).
For an integer and there is exactly one integer with and , and consequently (The least absolute remainder modulo a positive integer).
For all integers , setting , , and gives (Euler's four-square product identity).
Verification
The starting datum is a representation: and , with as [L1] and [L2] require.
By [L3] with modulus , the least absolute remainders of are , since is a multiple of and holds for ; their norm is , so the integer of [L2] is , and indeed .
Applying [L4] to and gives , , and , whose squares sum to ; each coordinate is divisible by , and dividing gives with , which is the conclusion of [L1] at .
Repeating with and , for which : by [L3] with modulus the least absolute remainders of are , since is admitted for ; their norm is , so [L2] gives with .
Applying [L4] to and gives , , and , whose squares sum to ; each coordinate is divisible by , and dividing gives with , a representation of itself.
So two applications of the descent carry to and then to , the moduli used being and .
Remarks
The even step is where the tie could have bitten. At the centred coordinates attain , so the estimate is an equality in two of the four coordinates. That is admissible: what The centred residue quadruple of has norm with excludes is equality in all four at once, and here two coordinates centre to .
The starting representation is not the minimal one. The descent does not require the multiplier to come from Some multiple with is a sum of four squares; any with for which is a sum of four squares will do, and was taken to make two steps rather than one.
Four essentially different four-square representations of
Example
The integer has the four-square representations
Their multisets of absolute values are , , and , which are pairwise distinct, so no two of the four are obtained from one another by permuting coordinates or changing signs: they are essentially different in the sense of Representations as sums of four squares.
Facts & Assumptions
Given: The integer and the four displayed quadruples.
A representation of a nonnegative integer as a sum of four squares is an ordered quadruple with ; two representations are equivalent up to signs and order exactly when their multisets of absolute values coincide, and essentially different otherwise (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).
Verification
Each display is an identity: , , and , so all four quadruples are representations of in the sense of [F1], whose existence [L1] guarantees in advance.
The multisets , , and are pairwise distinct, since the first two differ in their largest entry, the third contains and the others do not, and the fourth is the only one with no entry ; by the criterion in [F1] the four representations are pairwise essentially different.
Remarks
Existence and multiplicity are different questions. Lagrange's four-square theorem: every nonnegative integer is a sum of four integer squares asserts that a representation exists. How many essentially different representations a given integer has is not settled by it, and nothing above computes that number for : the four displayed are exhibited, not claimed to be all.
FALSE: a prime has one four-square representation up to order and signs
Statement
False claim: for every prime (Prime and composite integers: is prime when and its only positive divisors are and ), any two representations of as a sum of four integer squares (Representations as sums of four squares) are equivalent up to signs and order; that is, a prime has exactly one four-square representation up to permuting the coordinates and changing their signs.
Facts & Assumptions
Given: The integer and the quadruples and .
The false claim: for every prime , any two representations of as a sum of four integer squares are equivalent up to signs and order.
A representation of a nonnegative integer as a sum of four squares is an ordered quadruple with ; two representations are equivalent up to signs and order exactly when their multisets of absolute values coincide (Representations as sums of four squares).
An integer is prime when and with force or (Prime and composite integers: is prime when and its only positive divisors are and ).
Refutation
The integer is prime: , and if with integers then , so ; but , so none of divides , and by [F2] its only positive divisors are and .
Both displays are representations of : and .
The multisets of absolute values are and , which differ — the first contains and the second does not — so by the criterion in [F1] the two representations of step 1.2 are not equivalent up to signs and order; with step 1.1 this contradicts [A1] at , and the claim is false.
Remarks
Where the claim comes from. For two squares the corresponding statement is true: A prime congruent to modulo has one two-square representation up to signs and order says that a prime congruent to modulo has one representation as a sum of two squares up to signs and order. The claim refuted above is that statement with two coordinates replaced by four.
What survives of the analogy. Nothing of the two-square proof transfers. It turns on such a prime having a primitive two-square representation whose factorisation is controlled, and with four coordinates the extra room admits genuinely different multisets of absolute values; is one witness and not a special one.
Building a representation of from its prime factors
Example
Factor and take the prime representations
Multiplying the first two with the identity of Euler's four-square product identity, applied to and , gives and
Multiplying that result by the third, applied to and , gives and
This is the route the proof of Lagrange's four-square theorem: every nonnegative integer is a sum of four integer squares takes: prime factors first, then closure under products.
Facts & Assumptions
Given: The factorisation and the three displayed prime representations.
A representation of a nonnegative integer as a sum of four squares is an ordered quadruple with (Representations as sums of four 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).
For all integers , setting , , and gives (Euler's four-square product identity).
Verification
The three displays are representations: , and ; also and , so .
Applying [L2] to and gives , , and , whose squares sum to .
Applying [L2] to and gives , , and , whose squares sum to .
So is a representation of in the sense of [F1]; the two multiplications are the two instances of [L1] that the factorisation calls for, and the identity has supplied an explicit quadruple at each.
Remarks
Negative intermediate coordinates are harmless. The quadruple produced at the first multiplication has two negative entries, and they are carried into the second multiplication unchanged. Only squares are read off at the end, and the identity of Euler's four-square product identity holds for negative inputs as it does for positive ones.
The order of multiplication is a choice. Multiplying and first, or and first, produces different quadruples for the same ; the construction is not canonical, and Sums of four squares are closed under products claims existence rather than a preferred witness.
and are not sums of three integer squares
Statement refuted
False claim: every nonnegative integer is a sum of three integer squares, that is, for every there are integers with .
The integers and refute it. Both are excluded by Positive integers with are not sums of three integer squares, as and with ; and for the exclusion can also be seen by a finite search, which is carried out below so that the witness does not rest on the obstruction alone.
Facts & Assumptions
Given: The integers and .
The false claim: for every integer there are integers with .
For , means (Congruence modulo an integer: when , including the moduli and ).
For and a positive integer with , there are no integers with (Positive integers with are not sums of three integer squares).
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).
Counterexample
Since , we have by [F1], so a representation would give , which [L2] excludes; hence is not a sum of three integer squares.
The same conclusion by finite search: in each square is at most , so each lies in , and the sums of three members of that set are and , none of which is .
For : since we have , so a representation would by [L3] have , and all even, say , , ; then gives , contradicting step 1.1.
So neither nor is a sum of three integer squares, and [A1] is false; the two are the instances and of [L1] at .
Remarks
Two independent routes for . Step 1.1 argues by residues modulo and step 1.2 by exhausting the finitely many candidates. The second uses no lemma about squares at all, so the non-existence claim does not depend on the congruence argument being right.
Why needs the halving step. The residue of modulo is , which is attainable by a sum of three squares, so the congruence argument does not apply to directly. It is the divisibility by , and the fact that this forces all three coordinates even, that reduces to .
and are sums of three squares and is not
Statement refuted
False claim: if two nonnegative integers are each a sum of three integer squares, then so is their product.
The pair , refutes it: and , while satisfies and is therefore excluded by Positive integers with are not sums of three integer squares.
Facts & Assumptions
Given: The integers , and .
The false claim: if and are nonnegative integers, each a sum of three integer squares, then is a sum of three integer squares.
For , means (Congruence modulo an integer: when , including the moduli and ).
For and a positive integer with , there are no integers with (Positive integers with are not sums of three integer squares).
Counterexample
Both factors are sums of three integer squares: and .
The product is , and , so by [F1]; taking and , which is a positive integer congruent to modulo , [L1] gives that no integers satisfy .
So and are sums of three integer squares while is not, and [A1] is false.
Remarks
The failure is not universal. Some products of three-square integers are again sums of three squares: is one. The claim refuted above is that this always happens, and a single product for which it fails is what settles it.
What this separates. Sums of two squares are closed under products by the Brahmagupta–Fibonacci identity (Sums of two squares are closed under products), and sums of four squares by Sums of four squares are closed under products. Three squares admit no such product identity, and this pair is why: an identity expressing as a sum of three squares of integer bilinear forms would make a sum of three squares.
and have four-square representations with no zero coordinate
Example
The integers and have the four-square representations
and in each of them every coordinate is nonzero. That is not an accident of these two displays: no representation of either integer can have a vanishing coordinate, because deleting a zero coordinate would exhibit the integer as a sum of three squares, which Positive integers with are not sums of three integer squares forbids for and for . The two are the cases and of Positive integers with need four nonzero squares at .
Facts & Assumptions
Given: The integers 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 and a positive integer with , in every representation of as a sum of four integer squares all four coordinates are nonzero (Positive integers with need four nonzero 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).
Verification
Both displays are representations in the sense of [F1], whose existence [L2] guarantees in advance: and ; and in each the four coordinates and are all nonzero.
The integer is positive and , so by [F2]; moreover and , so both integers have the form required by [L1] and [L3] with and or .
If a representation of or of had a vanishing coordinate, deleting it would leave three integers whose squares sum to or to respectively, and by step 1.2 this is what [L3] excludes; so no representation of either integer has a vanishing coordinate.
Hence and each have a four-square representation, displayed in step 1.1, and every such representation has all four coordinates nonzero, which is [L1] at and at .
Remarks
Why both and are shown. The obstruction is stated for , and its induction has a base case and a step. The witness exercises the base case and the first instance of the step, where the coordinates of a putative three-square representation are halved.
Sources
- Keith Conrad, Proofs by Descent, §6, Lemma 6.2
- Keith Conrad, Proofs by Descent, §6, Lemma 6.4
- Keith Conrad, Proofs by Descent, §6, Theorem 6.6 (Step 2)
- Keith Conrad, Proofs by Descent, §6, Theorem 6.6
- Keith Conrad, Proofs by Descent, §6, Example 6.1
- Evan Dummit, Number Theory (part 9): The Geometry of Numbers, §9.1.3