Alphabeta Math
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.

✓ 14 results · all verified · 14 also independently AI-judged
Every result on this page is machine-checked by a proof checker and read in full and owner-audited; the judge is an additional, independent cross-model AI review of the proofs; all 14 also cleared it.

Lagrange Four Square Theorem

1 · Prerequisites

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 p and an integer a with p∤a there are integers x,y with x2+y2≡a(modp), used at a=−1, and the criterion deciding when an odd integer is a square modulo a power of two, used at modulus 8. Cancellation of a nonzero factor in Z, the fact that a nonempty set of integers bounded below has a least element, the existence of a prime divisor of any integer above 1, and induction over N 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 p the congruence x2+y2+1≡0(modp) is solvable; replacing a solution by its least absolute remainders produces a multiple pm with 1≤m<p that is a sum of four squares. The centred residue quadruple of a representation of pm has norm mn with 1≤n<m, and the identity carries the representation down to pn, so the least admissible multiplier is 1 and every prime is a sum of four squares; closure under products extends this to every nonnegative integer. A congruence argument modulo 8 then shows that every positive integer of the form 4am with m≡7(mod8) is no sum of three squares.

3 · Logical flowchart

4 · Definitions, theorems and proofs

DefinitionDefinition: Literature-sourcedProof: Not applicablejudge pass (deepseek-v4-pro + gpt-5.6-terra)audited 2026-08-26Open item page →

Representations as sums of four squares

Definition

Let n be a nonnegative integer. A representation of n as a sum of four squares is an ordered quadruple (a,b,c,d)∈Z4 with n=a2+b2+c2+d2. The integer n is a sum of four integer squares when at least one such quadruple exists.

Two representations (a,b,c,d) and (a′,b′,c′,d′) of the same n 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 {∣a∣,∣b∣,∣c∣,∣d∣} and {∣a′∣,∣b′∣,∣c′∣,∣d′∣} coincide.

Remarks

The coordinates range over all of Z. 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 0; and −1 is an admissible coordinate wherever 1 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 n 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 0. A sum of four squares vanishes exactly when each square vanishes, so 0=02+02+02+02 and (0,0,0,0) is the only representation of 0. 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.

LemmaStatement: Literature-sourcedProof: AI-generatedprecheck passjudge pass (deepseek-v4-pro + gpt-5.6-terra)audited 2026-08-26Open item page →

Euler's four-square product identity

Statement

Let x1,x2,x3,x4 and y1,y2,y3,y4 be integers, and set

z1=x1y1+x2y2+x3y3+x4y4,z2=x1y2−x2y1−x3y4+x4y3,z3=x1y3+x2y4−x3y1−x4y2,z4=x1y4−x2y3+x3y2−x4y1.

Then

(x12+x22+x32+x42)(y12+y22+y32+y42)=z12+z22+z32+z42.

Facts & Assumptions

Given: Integers x1,x2,x3,x4,y1,y2,y3,y4, and z1,z2,z3,z4 defined by the four displayed formulas.

Proof

technique · direct
1.1givenalgebra

Expanding the left-hand side term by term gives the sixteen products xi2yj2 with 1≤i≤4 and 1≤j≤4, each with coefficient 1.

1.2givenalgebra

Squaring z1 gives z12=x12y12+x22y22+x32y32+x42y42+2(x1x2y1y2+x1x3y1y3+x1x4y1y4+x2x3y2y3+x2x4y2y4+x3x4y3y4).

1.3givenalgebra

Squaring z2 gives z22=x12y22+x22y12+x32y42+x42y32+2(−x1x2y1y2−x1x3y2y4+x1x4y2y3+x2x3y1y4−x2x4y1y3−x3x4y3y4).

1.4givenalgebra

Squaring z3 gives z32=x12y32+x22y42+x32y12+x42y22+2(x1x2y3y4−x1x3y1y3−x1x4y2y3−x2x3y1y4−x2x4y2y4+x3x4y1y2).

1.5givenalgebra

Squaring z4 gives z42=x12y42+x22y32+x32y22+x42y12+2(−x1x2y3y4+x1x3y2y4−x1x4y1y4−x2x3y2y3+x2x4y1y3−x3x4y1y2).

2.1step 1.1step 1.2step 1.3step 1.4step 1.5algebra

The terms xi2yj2 occurring in steps 1.2 to 1.5 are the sixteen products of step 1.1, each occurring once: z12 contributes the pairs (i,j) with i=j, z22 those with {i,j}={1,2} or {3,4}, z32 those with {i,j}={1,3} or {2,4}, and z42 those with {i,j}={1,4} or {2,3}.

2.2step 1.2step 1.3step 1.4step 1.5algebra

The remaining terms of steps 1.2 to 1.5 cancel in six pairs of coordinate pairs: 2x1x2y1y2 and 2x3x4y3y4 from z12 against their negatives in z22; 2x1x3y1y3 and 2x2x4y2y4 from z12 against their negatives in z32; 2x1x4y1y4 and 2x2x3y2y3 from z12 against their negatives in z42; 2x1x4y2y3 and 2x2x3y1y4 from z22 against their negatives in z32; 2x1x3y2y4 and 2x2x4y1y3 from z42 against their negatives in z22; and 2x1x2y3y4 and 2x3x4y1y2 from z32 against their negatives in z42.

3.1step 2.1step 2.2algebra∎

Adding steps 1.2 to 1.5 and using steps 2.1 and 2.2, the sum z12+z22+z32+z42 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.

CorollaryStatement: Literature-sourcedProof: AI-adaptedprecheck passjudge pass (deepseek-v4-pro + gpt-5.6-terra)audited 2026-08-26Open item page →

Sums of four squares are closed under products

Statement

Let m and n be nonnegative integers. If each of m and n is a sum of four integer squares (Representations as sums of four squares), then mn is a sum of four integer squares.

Facts & Assumptions

Given: Nonnegative integers m and n, each a sum of four integer squares.

[F1]

A representation of a nonnegative integer n as a sum of four squares is an ordered quadruple (a,b,c,d)∈Z4 with n=a2+b2+c2+d2; the integer is a sum of four integer squares when at least one such quadruple exists (Representations as sums of four squares).

[L1]

For all integers x1,…,x4,y1,…,y4, setting z1=x1y1+x2y2+x3y3+x4y4, z2=x1y2−x2y1−x3y4+x4y3, z3=x1y3+x2y4−x3y1−x4y2 and z4=x1y4−x2y3+x3y2−x4y1 gives (x12+x22+x32+x42)(y12+y22+y32+y42)=z12+z22+z32+z42 (Euler's four-square product identity).

Proof

technique · direct
1.1givenF1choose

Fix quadruples (x1,x2,x3,x4) and (y1,y2,y3,y4) of integers with m=x12+x22+x32+x42 and n=y12+y22+y32+y42, which the hypothesis supplies.

2.1step 1.1L1

With z1,z2,z3,z4 formed from those eight integers by the displayed formulas, mn=(x12+x22+x32+x42)(y12+y22+y32+y42)=z12+z22+z32+z42.

3.1step 2.1F1algebra∎

The four integers z1,z2,z3,z4 therefore form a quadruple in Z4 whose squares sum to mn, so mn is a sum of four integer squares; no coordinate is required to be positive or nonzero, so the argument is unaffected when a zi vanishes or is negative, and it covers m=0 and n=0, whose quadruple (0,0,0,0) satisfies the hypothesis and returns z1=z2=z3=z4=0.

Remarks

What the identity does and does not give. The four coordinates zi are determined by the two chosen quadruples, so a different choice of representation of m or of n generally produces a different representation of mn. The statement asserts existence only; it makes no claim about how many representations mn has, nor that every representation of mn 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 n into primes is useless unless the property being proved is inherited by products.

LemmaStatement: Literature-sourcedProof: AI-adaptedprecheck passjudge pass (deepseek-v4-pro + gpt-5.6-terra)audited 2026-08-26Open item page →

For every prime p the congruence x2+y2+1≡0(modp) is solvable

Facts & Assumptions

Given: A prime p.

[F1]

An integer p is prime when p>1 and d∣p with d>0 force d=1 or d=p; in words, p exceeds 1, and its only positive divisors are 1 and p (Prime and composite integers: p is prime when p>1 and its only positive divisors are 1 and p).

[F2]

For a,b,n∈Z, a≡b(modn) means n∣(a−b) (Congruence modulo an integer: a≡b(modn) when n∣(a−b), including the moduli 0 and 1).

[F3]

For d,a∈Z, d∣a means a=dq for some q∈Z (Divisibility in Z: d∣a when a=dq for some integer q).

[L1]

Let p be an odd prime and let a∈Z with p∤a. Then there are integers x,y such that x2+y2≡a(modp) (Every nonzero residue modulo an odd prime is a sum of two squares).

[L2]

The group of units of the commutative monoid (Z,⋅,1) is {1,−1}; equivalently, for u∈Z the condition u∣1 holds exactly when u=1 or u=−1 ((Z,⋅,1) is a commutative monoid whose group of units is {1,−1}; equivalently u∣1 holds exactly for u=1 and u=−1).

[L3]

If a≡a′(modn) and b≡b′(modn), then a+b≡a′+b′(modn), a−b≡a′−b′(modn) and ab≡a′b′(modn) (Congruent integers may be added, subtracted and multiplied: representative changes preserve both arithmetic operations).

Proof

technique · cases
1.1givenF1algebra

If 2∣p then 2 is a positive divisor of p, so [F1] forces 2=1 or 2=p, and 2≠1 leaves p=2; hence either p=2 or p is odd, and these two cases exhaust the primes.

1.2assume-case twoF2algebra

In the case p=2, take x=1 and y=0: then x2+y2+1=1+0+1=2 and 2∣(2−0), so x2+y2+1≡0(mod2).

1.3assume-case oddF1F3L2algebra

In the case p odd, p∤−1: otherwise −1=pq for some integer q by [F3], hence 1=p(−q), so p∣1 and [L2] gives p=1 or p=−1, both contradicting p>1 from [F1].

2.1step 1.3L1

For the odd case, apply [L1] to the odd prime p with a=−1, whose hypothesis p∤−1 is step 1.3: there are integers x,y with x2+y2≡−1(modp).

3.1step 2.1L3F2algebra

For the odd case, 1≡1(modp) since p∣0, so adding this to step 2.1 through [L3] gives x2+y2+1≡−1+1=0(modp).

4.1step 1.2step 3.1cases-exhaustive∎

Both cases produce integers x,y with x2+y2+1≡0(modp), and by step 1.1 no prime falls outside them.

Remarks

Where the odd case comes from. For odd p the work is done by Every nonzero residue modulo an odd prime is a sum of two squares at a=−1: the set Q of square classes modulo p, the zero class included, and the set of classes −1−z for z∈Q are two subsets of Z/p with (p+1)/2 elements each, so they meet, and a common value gives x2≡−1−y2. The hypothesis p∤a 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 p=2 is separate. The cited proposition is stated for odd primes, so it says nothing at p=2; the pair (1,0) settles that case by computation rather than by weakening the proposition's hypothesis.

LemmaStatement: AI-adaptedProof: AI-adaptedprecheck passjudge pass (deepseek-v4-pro + gpt-5.6-terra)audited 2026-08-26Open item page →

The least absolute remainder modulo a positive integer

Statement

Let m be an integer with m≥1 and let a∈Z. Then there is exactly one integer r with

a≡r(modm)and−m<2r≤m,

that is, exactly one integer r satisfying a≡r(modm) and −m<2r≤m, and consequently 4r2≤m2. Call this r the least absolute remainder of a modulo m.

Facts & Assumptions

Given: An integer m with m≥1 and an integer a.

[F1]

For a,b,n∈Z, a≡b(modn) means n∣(a−b) (Congruence modulo an integer: a≡b(modn) when n∣(a−b), including the moduli 0 and 1).

[F2]

For d,a∈Z, d∣a means a=dq for some q∈Z (Divisibility in Z: d∣a when a=dq for some integer q).

[L1]

For a,b∈Z with b≠0 there is exactly one pair (q,r) of integers with a=qb+r and 0≤r<∣b∣; moreover b∣a holds exactly when r=0 (Division with remainder for any nonzero divisor: for a∈Z and b≠0 there are unique q,r∈Z with a=qb+r and 0≤r<∣b∣).

Proof

technique · direct
1.1givenL1algebra

Since m≥1, the modulus is nonzero and ∣m∣=m, so [L1] supplies exactly one pair (q,r0) of integers with a=qm+r0 and 0≤r0<m.

2.1step 1.1construct

Define r:=r0 when 2r0≤m, and r:=r0−m otherwise; the two branches are mutually exclusive and exhaustive, so r is a well-defined integer.

3.1step 2.1F1F2algebra

In either branch a−r is an integer multiple of m, since a−r0=qm and a−(r0−m)=(q+1)m; hence m∣(a−r) and a≡r(modm).

3.2step 2.1algebra

In either branch −m<2r≤m: the first branch gives 0≤2r0≤m from r0≥0 and its own condition, while the second has 2r0>m and 2r0<2m, so 2r=2r0−2m satisfies −m<2r<0.

4.1step 3.2algebra

From −m<2r≤m it follows that ∣2r∣≤m, and squaring the inequality between nonnegative integers gives 4r2=(2r)2≤m2.

4.2step 3.2F1F2L2algebra

If an integer r′ also satisfies a≡r′(modm) and −m<2r′≤m, then a−r=mq1 and a−r′=mq2 for integers q1,q2 by [F1] and [F2], so r−r′=m(q2−q1) and m∣(r−r′); adding −m<2r≤m to −m≤−2r′<m gives −2m<2(r−r′)<2m, so ∣r−r′∣<m, and were r−r′≠0 then [L2] would give m=∣m∣≤∣r−r′∣<m; hence r=r′.

5.1step 3.1step 3.2step 4.1step 4.2∎

So r exists by steps 3.1 and 3.2, is unique by step 4.2, and satisfies 4r2≤m2 by step 4.1.

Remarks

Where the tie falls. The normalisation is deliberately half-open on the right: 2r=m is permitted and 2r=−m is not. The case ∣2r∣=m can arise only for even m, where r0 may equal the integer t with m=2t; then t and t−m are congruent modulo m with ∣t∣=∣t−m∣, and the convention keeps t. Without the half-open choice both values would satisfy ∣2r∣≤m and the uniqueness clause would be false as stated.

The bound is stated in integers. Writing 4r2≤m2 rather than ∣r∣≤m/2 avoids introducing a quotient that need not be an integer, and it is the form the estimates in Some multiple pm with 1≤m<p is a sum of four squares and The centred residue quadruple of pm=a2+b2+c2+d2 has norm mn with 1≤n<m use. The inequality 4r2≤m2 is an equality exactly when 2r=m.

LemmaStatement: Literature-sourcedProof: AI-adaptedprecheck passjudge pass (deepseek-v4-pro + gpt-5.6-terra)audited 2026-08-26Open item page →

Some multiple pm with 1≤m<p is a sum of four squares

Statement

Let p be a prime (Prime and composite integers: p is prime when p>1 and its only positive divisors are 1 and p). Then there is an integer m with 1≤m<p for which pm is a sum of four integer squares (Representations as sums of four squares).

Facts & Assumptions

Given: A prime p.

[F1]

An integer p is prime when p>1 and d∣p with d>0 force d=1 or d=p; in words, p exceeds 1, and its only positive divisors are 1 and p (Prime and composite integers: p is prime when p>1 and its only positive divisors are 1 and p).

[F2]

A representation of a nonnegative integer n as a sum of four squares is an ordered quadruple (a,b,c,d)∈Z4 with n=a2+b2+c2+d2 (Representations as sums of four squares).

[F3]

For a,b,n∈Z, a≡b(modn) means n∣(a−b) (Congruence modulo an integer: a≡b(modn) when n∣(a−b), including the moduli 0 and 1).

[F4]

For d,a∈Z, d∣a means a=dq for some q∈Z (Divisibility in Z: d∣a when a=dq for some integer q).

[L1]

For every prime p there are integers x,y with x2+y2+1≡0(modp) (For every prime p the congruence x2+y2+1≡0(modp) is solvable).

[L2]

For an integer m≥1 and a∈Z there is exactly one integer r with a≡r(modm) and −m<2r≤m, and consequently 4r2≤m2 (The least absolute remainder modulo a positive integer).

[L3]

If a≡a′(modn) and b≡b′(modn), then a+b≡a′+b′(modn) and ab≡a′b′(modn) (Congruent integers may be added, subtracted and multiplied: representative changes preserve both arithmetic operations).

Proof

technique · direct
1.1givenL1choose

Fix integers u,v with u2+v2+1≡0(modp), which [L1] supplies for the prime p.

2.1step 1.1F1L2construct

Since p>1 by [F1], the modulus p satisfies the hypothesis of [L2]; let x and y be the least absolute remainders of u and v modulo p, so that x≡u(modp), y≡v(modp), 4x2≤p2 and 4y2≤p2.

3.1step 1.1step 2.1L3F3F4algebra

By [L3] applied to the products x⋅x and y⋅y and then to the sums, x2+y2+1≡u2+v2+1(modp), and u2+v2+1≡0(modp); hence x2+y2+1≡0(modp), which by [F3] and [F4] says p∣x2+y2+1.

4.1step 3.1F4algebra

Write x2+y2+1=pm with m∈Z, as [F4] permits; the left-hand side is at least 1 because x2≥0 and y2≥0, and p>0, so m≥1.

5.1step 2.1step 4.1F1algebra

Multiplying step 4.1 by 4 and using the two bounds of step 2.1 gives 4pm=4x2+4y2+4≤p2+p2+4=2p2+4; since p≥2 by [F1] we have p2≥4, so 2p2+4≤3p2<4p2, whence 4pm<4p2, pm<p2 and m<p.

6.1step 4.1step 5.1F2∎

The equation pm=x2+y2+12+02 of step 4.1 exhibits the quadruple (x,y,1,0)∈Z4 as a representation of pm, so pm is a sum of four integer squares with 1≤m<p.

Remarks

Why the centring is needed. The pair (u,v) produced by [L1] is subject to no size condition, so u2+v2+1 can be an arbitrarily large multiple of p. Replacing u,v by their least absolute remainders leaves the congruence class untouched and buys the two bounds 4x2≤p2 and 4y2≤p2, which is what forces the multiplier below p.

The bound is not tight, and does not need to be. What the coordinate bounds give at step 5.1 is 4pm≤2p2+4, and only the weaker 4pm<4p2 is used. The comparison 2p2+4<4p2 needs just p2>2, which every prime satisfies, so p=2 needs no separate treatment even though the coordinate bound 4x2≤p2 can be attained there, at x=±1.

The case m=1. Nothing excludes it, and it is the case p=x2+y2+1 in which the prime is already a sum of four squares.

LemmaStatement: AI-adaptedProof: AI-adaptedprecheck passjudge pass (deepseek-v4-pro + gpt-5.6-terra)audited 2026-08-26Open item page →

The centred residue quadruple of pm=a2+b2+c2+d2 has norm mn with 1≤n<m

Statement

Let p be a prime (Prime and composite integers: p is prime when p>1 and its only positive divisors are 1 and p), let m be an integer with 1<m<p, and let a,b,c,d be integers with pm=a2+b2+c2+d2. Write a′,b′,c′,d′ for the least absolute remainders of a,b,c,d modulo m (The least absolute remainder modulo a positive integer). Then there is an integer n with 1≤n<m and

a′2+b′2+c′2+d′2=mn.

Facts & Assumptions

Given: A prime p, an integer m with 1<m<p, integers a,b,c,d with pm=a2+b2+c2+d2, and the least absolute remainders a′,b′,c′,d′ of a,b,c,d modulo m.

[F1]

An integer p is prime when p>1 and d∣p with d>0 force d=1 or d=p; in words, p exceeds 1, and its only positive divisors are 1 and p (Prime and composite integers: p is prime when p>1 and its only positive divisors are 1 and p).

[F2]

For a,b,n∈Z, a≡b(modn) means n∣(a−b) (Congruence modulo an integer: a≡b(modn) when n∣(a−b), including the moduli 0 and 1).

[F3]

For d,a∈Z, d∣a means a=dq for some q∈Z (Divisibility in Z: d∣a when a=dq for some integer q).

[L1]

For an integer m≥1 and a∈Z there is exactly one integer r with a≡r(modm) and −m<2r≤m, and consequently 4r2≤m2 (The least absolute remainder modulo a positive integer).

[L2]

If a≡a′(modn) and b≡b′(modn), then a+b≡a′+b′(modn) and ab≡a′b′(modn) (Congruent integers may be added, subtracted and multiplied: representative changes preserve both arithmetic operations).

[L3]

Divisibility is linear: d∣a and d∣b imply d∣ax+by for all x,y∈Z; in particular d∣a+b and d∣a−b (Divisibility is reflexive and transitive on Z, and is linear: if d∣a and d∣b then d∣ax+by for all integers x,y; also d∣a implies d∣ac, −d∣a and d∣−a).

[L4]

If xz=yz and z≠0, then x=y (The integers have no zero divisors; multiplicative cancellation).

Proof

technique · direct
1.1givenL1construct

Since m>1 the hypothesis m≥1 of [L1] holds, so a′,b′,c′,d′ are defined and satisfy a≡a′(modm), b≡b′(modm), c≡c′(modm), d≡d′(modm) together with −m<2a′≤m, 4a′2≤m2 and the same three conditions for b′, c′ and d′.

2.1givenstep 1.1L2F2F3algebra

By [L2] applied to the products a⋅a, b⋅b, c⋅c, d⋅d and then to the sums, a′2+b′2+c′2+d′2≡a2+b2+c2+d2=pm(modm), and pm≡0(modm) since m∣pm; so by [F2] the modulus m divides a′2+b′2+c′2+d′2, and by [F3] there is an integer n with a′2+b′2+c′2+d′2=mn.

3.1step 2.1algebra

The left-hand side of step 2.1 is a sum of squares, hence at least 0, and m>0, so n≥0.

3.2step 1.1step 2.1algebra

Summing the four bounds 4a′2≤m2, 4b′2≤m2, 4c′2≤m2, 4d′2≤m2 of step 1.1 gives 4mn≤4m2, hence mn≤m2 and, dividing by the positive integer m, n≤m.

4.1step 2.1step 3.1F2F3algebra

If n=0 then a′2+b′2+c′2+d′2=0 forces a′=b′=c′=d′=0, so [F2] and step 1.1 give m∣a, m∣b, m∣c and m∣d; writing a=mα, b=mβ, c=mγ, d=mδ with [F3] then gives pm=m2(α2+β2+γ2+δ2).

4.2step 3.2step 1.1algebra

If n=m then step 3.2 holds with equality, so each of the four bounds of step 1.1 is an equality: 4a′2=m2 and likewise for b′, c′, d′.

5.1step 4.1F1L4algebra

In the case n=0, cancelling the nonzero factor m in step 4.1 by [L4] gives p=m(α2+β2+γ2+δ2), so m is a positive divisor of p and [F1] forces m=1 or m=p, both excluded by 1<m<p; hence n≥1.

5.2step 4.2step 1.1algebra

In the case of step 4.2, m2=(2a′)2 with m>0 gives 2a′=m or 2a′=−m, and the normalisation −m<2a′≤m of step 1.1 leaves 2a′=m; so m=2s with s:=a′ a positive integer, and the same argument gives b′=c′=d′=s.

6.1step 5.2step 1.1F2F3algebra

Still in the case n=m, a≡s(modm) gives a=s+mt=s(1+2t) for some integer t by [F2] and [F3], so a2−s2=s2((1+2t)2−1)=4s2t(t+1), which m2=4s2 divides; the same holds for b, c and d.

7.1step 6.1L3algebra

In the same case, summing the four differences of step 6.1 and using [L3], m2 divides (a2+b2+c2+d2)−4s2=pm−m2, and m2 divides m2, so m2∣pm.

8.1step 7.1F1F3L4algebra

Still in the case n=m, writing pm=m2k as [F3] permits and cancelling the nonzero factor m by [L4] gives p=mk, so m is a positive divisor of p and [F1] forces m=1 or m=p, both excluded by 1<m<p; hence n≠m.

9.1step 2.1step 3.2step 5.1step 8.1∎

Therefore n≥1 by step 5.1, n≤m by step 3.2 and n≠m by step 8.1, that is 1≤n<m, with a′2+b′2+c′2+d′2=mn from step 2.1.

Remarks

The two excluded values are excluded for the same reason. Both n=0 and n=m end in m∣p, which the hypotheses 1<m<p rule out. They differ in how they get there: n=0 says the four coordinates are already multiples of m, while n=m says each is congruent to half of m, and the second is possible only when m is even.

Why the even case cannot be waved away. The normalisation −m<2r≤m admits 2r=m, so for even m a centred coordinate really can attain the bound 4r2=m2, and then the estimate of step 3.2 gives only n≤m rather than n<m. 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.

LemmaStatement: Literature-sourcedProof: AI-adaptedprecheck passjudge pass (deepseek-v4-pro + gpt-5.6-terra)audited 2026-08-26Open item page →

Descent step: a smaller multiple of p is a sum of four squares

Statement

Let p be a prime (Prime and composite integers: p is prime when p>1 and its only positive divisors are 1 and p), let m be an integer with 1<m<p, and suppose pm is a sum of four integer squares (Representations as sums of four squares). Then there is an integer n with 1≤n<m for which pn is a sum of four integer squares.

Facts & Assumptions

Given: A prime p, an integer m with 1<m<p, and a representation of pm as a sum of four integer squares.

[F1]

An integer p is prime when p>1 and d∣p with d>0 force d=1 or d=p (Prime and composite integers: p is prime when p>1 and its only positive divisors are 1 and p).

[F2]

A representation of a nonnegative integer n as a sum of four squares is an ordered quadruple (a,b,c,d)∈Z4 with n=a2+b2+c2+d2 (Representations as sums of four squares).

[F3]

For a,b,n∈Z, a≡b(modn) means n∣(a−b) (Congruence modulo an integer: a≡b(modn) when n∣(a−b), including the moduli 0 and 1).

[F4]

For d,a∈Z, d∣a means a=dq for some q∈Z (Divisibility in Z: d∣a when a=dq for some integer q).

[L1]

For all integers x1,…,x4,y1,…,y4, setting z1=x1y1+x2y2+x3y3+x4y4, z2=x1y2−x2y1−x3y4+x4y3, z3=x1y3+x2y4−x3y1−x4y2 and z4=x1y4−x2y3+x3y2−x4y1 gives (x12+x22+x32+x42)(y12+y22+y32+y42)=z12+z22+z32+z42 (Euler's four-square product identity).

[L2]

For an integer m≥1 and a∈Z there is exactly one integer r with a≡r(modm) and −m<2r≤m, and consequently 4r2≤m2 (The least absolute remainder modulo a positive integer).

[L3]

If p is prime, 1<m<p and pm=a2+b2+c2+d2 for integers a,b,c,d, then the least absolute remainders a′,b′,c′,d′ of a,b,c,d modulo m satisfy a′2+b′2+c′2+d′2=mn for an integer n with 1≤n<m (The centred residue quadruple of pm=a2+b2+c2+d2 has norm mn with 1≤n<m).

[L4]

If a≡a′(modn) and b≡b′(modn), then a+b≡a′+b′(modn), a−b≡a′−b′(modn) and ab≡a′b′(modn) (Congruent integers may be added, subtracted and multiplied: representative changes preserve both arithmetic operations).

[L5]

If x,y∈Z are nonzero then xy≠0; consequently, if xz=yz and z≠0, then x=y (The integers have no zero divisors; multiplicative cancellation).

Proof

technique · direct
1.1givenF2choose

Fix integers a,b,c,d with pm=a2+b2+c2+d2, which the hypothesis supplies.

2.1step 1.1L2construct

Since m>1, [L2] applies with modulus m; let a′,b′,c′,d′ be the least absolute remainders of a,b,c,d modulo m, so a≡a′, b≡b′, c≡c′ and d≡d′ modulo m.

3.1step 1.1step 2.1L3F1

By [L3] applied to p, m and the representation of step 1.1, there is an integer n with 1≤n<m and a′2+b′2+c′2+d′2=mn.

3.2step 1.1step 2.1L4F3algebra

Put A=aa′+bb′+cc′+dd′; substituting the congruences of step 2.1 and using [L4] gives A≡a2+b2+c2+d2(modm), and a2+b2+c2+d2=pm≡0(modm) by [F3], so A≡0(modm).

3.3step 2.1L4F3algebra

Put B=ab′−ba′−cd′+dc′, C=ac′+bd′−ca′−db′ and D=ad′−bc′+cb′−da′; the same substitution and [L4] give B≡ab−ba−cd+dc=0, C≡ac+bd−ca−db=0 and D≡ad−bc+cb−da=0 modulo m.

4.1step 1.1step 2.1step 3.1L1

Applying [L1] to x=(a,b,c,d) and y=(a′,b′,c′,d′) produces exactly the four quantities A,B,C,D of steps 3.2 and 3.3 as z1,z2,z3,z4, so (pm)(mn)=A2+B2+C2+D2.

4.2step 3.2step 3.3F3F4construct

By [F3] and [F4] the congruences of steps 3.2 and 3.3 say m∣A, m∣B, m∣C and m∣D; write A=mA1, B=mB1, C=mC1, D=mD1 with A1,B1,C1,D1∈Z.

5.1step 4.1step 4.2algebra

Substituting step 4.2 into step 4.1 gives pm2n=m2(A12+B12+C12+D12).

6.1step 5.1L5algebra

Since m>1 is nonzero, m2≠0 by [L5], so cancelling m2 in step 5.1 by [L5] gives pn=A12+B12+C12+D12.

7.1step 3.1step 6.1F2∎

The quadruple (A1,B1,C1,D1)∈Z4 therefore represents pn as a sum of four integer squares, with 1≤n<m from step 3.1.

Remarks

The sign pattern is doing the work. Steps 3.2 and 3.3 substitute a′≡a, b′≡b, c′≡c, d′≡d into the four bilinear forms of [L1] and read off that all four become divisible by m: the first because it becomes the norm pm, 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 m>1 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 m=1 is the case in which p itself is already a sum of four squares and no descent is wanted.

TheoremStatement: Literature-sourcedProof: AI-adaptedprecheck passjudge pass (deepseek-v4-pro + gpt-5.6-terra)audited 2026-08-26Open item page →

Every prime is a sum of four integer squares

Statement

Every prime is a sum of four integer squares. That is, for every prime p (Prime and composite integers: p is prime when p>1 and its only positive divisors are 1 and p) there is a quadruple (a,b,c,d)∈Z4 with p=a2+b2+c2+d2 (Representations as sums of four squares).

Facts & Assumptions

Given: A prime p.

[F1]

An integer p is prime when p>1 and d∣p with d>0 force d=1 or d=p (Prime and composite integers: p is prime when p>1 and its only positive divisors are 1 and p).

[F2]

A representation of a nonnegative integer n as a sum of four squares is an ordered quadruple (a,b,c,d)∈Z4 with n=a2+b2+c2+d2 (Representations as sums of four squares).

[L1]

For every prime p there is an integer m with 1≤m<p for which pm is a sum of four integer squares (Some multiple pm with 1≤m<p is a sum of four squares).

[L2]

If p is prime, 1<m<p and pm is a sum of four integer squares, then there is an integer n with 1≤n<m for which pn is a sum of four integer squares (Descent step: a smaller multiple of p is a sum of four squares).

[L3]

Let S⊆Z be nonempty. If S has an upper bound, it has a greatest element; if S 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

technique · contradiction
1.1assume-contra

Suppose, for contradiction, that the prime p is not a sum of four integer squares.

1.2givenF1F2L1construct

Let S be the set of integers m with 1≤m<p for which pm is a sum of four integer squares; S is nonempty by [L1].

2.1step 1.2L3

The set S is bounded below by 1, so [L3] gives it a least element m0, and 1≤m0<p because m0∈S.

3.1step 1.1step 2.1F2algebra

The value m0=1 is impossible: it would make p=p⋅1 a sum of four integer squares, against step 1.1. Hence m0>1, and with step 2.1 this gives 1<m0<p.

4.1step 2.1step 3.1L2

Applying [L2] to the prime p and the multiplier m0, whose hypotheses 1<m0<p and "pm0 is a sum of four integer squares" are step 3.1 and membership of m0 in S, gives an integer n with 1≤n<m0 for which pn is a sum of four integer squares.

5.1step 2.1step 4.1F2algebradischarge-contradiction∎

Then 1≤n<m0<p, so n∈S while n<m0, contradicting the leastness of m0; the assumption of step 1.1 therefore fails, and p 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 p is prime enters. Twice, through [L1] and through [L2]. In [L1] it supplies the congruence and the bound p≥2 used to obtain a multiplier below p; in the construction underlying [L2] it is used when a positive divisor of p is forced to be 1 or p. For a composite modulus the multiplier can stall above 1, 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.

TheoremStatement: Literature-sourcedProof: AI-adaptedprecheck passjudge pass (deepseek-v4-pro + gpt-5.6-terra)audited 2026-08-26Open item page →

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 n≥0 there is a quadruple (a,b,c,d)∈Z4 with n=a2+b2+c2+d2 (Representations as sums of four squares).

Facts & Assumptions

Given: The nonnegative integers.

[F1]

A representation of a nonnegative integer n as a sum of four squares is an ordered quadruple (a,b,c,d)∈Z4 with n=a2+b2+c2+d2 (Representations as sums of four squares).

[F2]

For d,a∈Z, d∣a means a=dq for some q∈Z (Divisibility in Z: d∣a when a=dq for some integer q).

[F3]

An integer p is prime when p>1 and d∣p with d>0 force d=1 or d=p (Prime and composite integers: p is prime when p>1 and its only positive divisors are 1 and p).

[L1]

Every prime is a sum of four integer squares. (Every prime is a sum of four integer squares).

[L2]

Let m and n be nonnegative integers; if each of m and n is a sum of four integer squares, then mn is a sum of four integer squares (Sums of four squares are closed under products).

[L3]

Let n∈Z with n>1 and put S:={d∈Z:d∣n and d>1}. Then S is nonempty and has a least element q, and q is prime; in particular every integer greater than 1 has a prime divisor (Every integer n>1 has a prime divisor; indeed the least divisor of n that exceeds 1 is prime).

[L4]

Let S⊆Z be nonempty. If S has an upper bound, it has a greatest element; if S 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

technique · contradiction
1.1assume-contra

Suppose, for contradiction, that not every nonnegative integer is a sum of four integer squares.

2.1step 1.1L4F1construct

Let T 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 0, so [L4] gives it a least element n0.

3.1step 2.1F1algebra

Neither 0 nor 1 lies in T, since 0=02+02+02+02 and 1=12+02+02+02 are representations in the sense of [F1]; as n0∈T and n0≥0, this forces n0>1.

4.1step 3.1L3F2choose

By [L3] the integer n0>1 has a prime divisor q, and by [F2] there is an integer k with n0=qk.

5.1step 4.1F3algebra

Here k≥1, since k≤0 would give n0=qk≤0 against n0>1; and k<n0, since step 4.1 gives q prime, so [F3] gives q>1, hence q≥2, and therefore n0=qk≥2k=k+k>k.

6.1step 2.1step 5.1L1

Since 0≤k<n0 and n0 is least in T, the integer k is not in T, so k is a sum of four integer squares; and q is a sum of four integer squares by [L1].

7.1step 4.1step 6.1L2F1discharge-contradiction∎

Both factors of n0=qk are nonnegative and are sums of four integer squares, so [L2] makes n0 one, contradicting n0∈T; the assumption of step 1.1 therefore fails, and every nonnegative integer is a sum of four integer squares.

Remarks

Why 0 and 1 are treated by hand. The proof factors n0 through a prime divisor, and neither small value has one: 1 is a product of no primes at all and 0 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 n≥0 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 4am with m≡7(mod8) are not sums of three integer squares and its corollary Positive integers 4am with m≡7(mod8) need four nonzero squares exhibit the family 4am with m≡7(mod8); they do not assert the converse classification.

RemarkRemark: AI-adaptedProof: Not applicablejudge pass (deepseek-v4-pro + gpt-5.6-terra)audited 2026-08-26Open item page →

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

z2=x1y2−x2y1+x3y4−x4y3,z3=x1y3−x2y4−x3y1+x4y2,z4=x1y4+x2y3−x3y2−x4y1,

which is the form Dummit's Lemma 1 displays, and the norm of a product of quaternions gives a third,

z1=x1y1−x2y2−x3y3−x4y4,z2=x1y2+x2y1+x3y4−x4y3,z3=x1y3−x2y4+x3y1+x4y2,z4=x1y4+x2y3−x3y2+x4y1,

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 p is a sum of four squares the second quadruple is congruent to the first coordinatewise modulo m, and what the proof needs is that all four output coordinates then become divisible by m. Substituting y1≡x1, y2≡x2, y3≡x3, y4≡x4 modulo m and writing (a,b,c,d) for (x1,x2,x3,x4), the pattern fixed in Euler's four-square product identity gives

z1≡a2+b2+c2+d2,z2≡ab−ba−cd+dc=0,z3≡ac+bd−ca−db=0,z4≡ad−bc+cb−da=0(modm),

and the first of these is the multiple pm, hence also 0 modulo m. Euler's second pattern behaves the same way: its last three coordinates become ab−ba+cd−dc, ac−bd−ca+db and ad+bc−cb−da, all identically 0. The quaternion pattern does not: under the same substitution its coordinates become a2−b2−c2−d2, 2ab, 2ac and 2ad, and the hypotheses of Descent step: a smaller multiple of p is a sum of four squares — that m divides a2+b2+c2+d2 and that the second quadruple is the centred residue quadruple of the first — do not force z1, z2, z3 or z4 to vanish modulo m.

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.

LemmaStatement: AI-adaptedProof: AI-adaptedprecheck passjudge pass (deepseek-v4-pro + gpt-5.6-terra)audited 2026-08-26Open item page →

A square is congruent to 0, 1 or 4 modulo 8

Statement

Call an integer even when 2 divides it and odd otherwise (Divisibility in Z: d∣a when a=dq for some integer q). Let x∈Z. Then x2 is congruent to 0, to 1 or to 4 modulo 8 (Congruence modulo an integer: a≡b(modn) when n∣(a−b), including the moduli 0 and 1). More precisely, if x is odd then x2≡1(mod8), and if x is even then x2≡0(mod8) or x2≡4(mod8).

Consequently, if x is odd then x2≡1(mod4), and if x is even then x2≡0(mod4).

Facts & Assumptions

Given: An integer x.

[F1]

For a,b,n∈Z, a≡b(modn) means n∣(a−b) (Congruence modulo an integer: a≡b(modn) when n∣(a−b), including the moduli 0 and 1).

[F2]

For d,a∈Z, d∣a means a=dq for some q∈Z (Divisibility in Z: d∣a when a=dq for some integer q).

[L1]

For a,b∈Z with b≠0 there is exactly one pair (q,r) of integers with a=qb+r and 0≤r<∣b∣; moreover b∣a holds exactly when r=0 (Division with remainder for any nonzero divisor: for a∈Z and b≠0 there are unique q,r∈Z with a=qb+r and 0≤r<∣b∣).

[L2]

Let a be odd. For k≥3, the congruence x2≡a(mod2k) is soluble if and only if a≡1(mod8) (Unit square criterion and root count modulo powers of two).

Proof

technique · cases
1.1givenL1algebra

By [L1] with b=2 there is exactly one pair (q,r) with x=2q+r and 0≤r<2, so r=0 or r=1; that is, x=2u for an integer u, or x=2u+1 for an integer u, and these are the even and odd cases.

1.2assume-case oddL2F1algebra

In the odd case, x=2u+1 gives x2=2(2u2+2u)+1, so x2 is odd; the congruence t2≡x2(mod23) has the solution t=x, so [L2] applied with a=x2 and k=3 gives x2≡1(mod8).

1.3assume-case evenL1algebra

In the even case, x=2u gives x2=4u2, and by [L1] with b=2 applied to u the integer u is itself either 2v or 2v+1 for an integer v.

2.1step 1.3assume-case uevenF1F2algebra

If u=2v then x2=16v2=8⋅2v2, so 8∣x2−0 and x2≡0(mod8).

2.2step 1.3assume-case uoddF1F2algebra

If u=2v+1 then u2=2(2v2+2v)+1, so x2=4u2=8(2v2+2v)+4, whence 8∣x2−4 and x2≡4(mod8).

3.1step 1.2step 2.1step 2.2algebra

Steps 1.2, 2.1 and 2.2 cover every integer x, so x2 is congruent to 0, to 1 or to 4 modulo 8, with 1 occurring exactly in the odd case.

4.1step 3.1step 1.2step 2.1step 2.2L3F1F2cases-exhaustive∎

For the modulo-4 consequence: in the odd case 8∣x2−1 and 4∣8, so [L3] gives 4∣x2−1 and x2≡1(mod4); in the even case either 8∣x2, whence 4∣x2 by [L3], or x2=8w+4=4(2w+1) for an integer w, whence 4∣x2 directly, so x2≡0(mod4) 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 k≥3 an odd a is a square modulo 2k exactly when a≡1(mod8). Reading it at k=3 in the direction "soluble implies a≡1(mod8)", with a=x2 and the solution t=x already in hand, is the whole odd case. The elementary route is also short — x=2u+1 gives x2=4u(u+1)+1 with u(u+1) 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: 0=02, 1=12 and 4=22 realise the residues 0, 1 and 4. So the list cannot be shortened, and the modulo-8 classification of squares is exactly this list.

LemmaStatement: AI-adaptedProof: AI-adaptedprecheck passjudge pass (deepseek-v4-pro + gpt-5.6-terra)audited 2026-08-26Open item page →

No sum of three integer squares is congruent to 7 modulo 8

Statement

There are no integers x,y,z with x2+y2+z2≡7(mod8) (Congruence modulo an integer: a≡b(modn) when n∣(a−b), including the moduli 0 and 1). In fact, the residues modulo 8 attained by sums of three integer squares are exactly 0,1,2,3,4,5,6.

Facts & Assumptions

Given: Integers x,y,z.

[F1]

For a,b,n∈Z, a≡b(modn) means n∣(a−b) (Congruence modulo an integer: a≡b(modn) when n∣(a−b), including the moduli 0 and 1).

[L1]

For every integer x: if x is odd then x2≡1(mod8), and if x is even then x2≡0(mod8) or x2≡4(mod8) (A square is congruent to 0, 1 or 4 modulo 8).

[L2]

If a≡a′(modn) and b≡b′(modn), then a+b≡a′+b′(modn) (Congruent integers may be added, subtracted and multiplied: representative changes preserve both arithmetic operations).

[L3]

For a,b∈Z with b≠0 there is exactly one pair (q,r) of integers with a=qb+r and 0≤r<∣b∣; moreover b∣a holds exactly when r=0 (Division with remainder for any nonzero divisor: for a∈Z and b≠0 there are unique q,r∈Z with a=qb+r and 0≤r<∣b∣).

Proof

technique · cases
1.1givenL3construct

By [L3] with b=2 each of x,y,z is even or odd; let t be how many of the three are odd, so t is 0, 1, 2 or 3, and these four values exhaust the possibilities.

1.2L1

By [L1], each odd coordinate contributes a square congruent to 1 modulo 8, and each even coordinate contributes a square congruent to 0 or to 4 modulo 8.

2.1step 1.1step 1.2assume-case threeL2F1algebra

If t=3 then, adding the three contributions by [L2], x2+y2+z2≡1+1+1=3(mod8).

2.2step 1.1step 1.2assume-case twoL2F1algebra

If t=2 then x2+y2+z2≡1+1+e(mod8) with e equal to 0 or 4, so the sum is congruent to 2 or to 6.

2.3step 1.1step 1.2assume-case oneL2F1algebra

If t=1 then x2+y2+z2≡1+e1+e2(mod8) with each ei equal to 0 or 4, giving 1, 5, 5 or 9; since 9≡1(mod8), the sum is congruent to 1 or to 5.

2.4step 1.1step 1.2assume-case zeroL2F1algebra

If t=0 then x2+y2+z2≡e1+e2+e3(mod8) with each ei equal to 0 or 4, giving 0, 4, 8 or 12; since 8≡0 and 12≡4 modulo 8, the sum is congruent to 0 or to 4.

3.1step 2.1step 2.2step 2.3step 2.4F1algebracases-exhaustive∎

Steps 2.1 to 2.4 cover the four values of t listed in step 1.1 and show that every sum of three squares is congruent to one of 0,1,2,3,4,5,6, never to 7, modulo 8. Conversely, the triples (0,0,0), (1,0,0), (1,1,0), (1,1,1), (2,0,0), (2,1,0) and (2,1,1) have sums of squares 0,1,2,3,4,5,6, respectively. Thus the attained residues are exactly the seven listed classes, and 7 is not attained.

Remarks

Why the cases are counted by parity rather than listed by value. Enumerating the possible triples of residues from {0,1,4} 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 (x,y,z) to be (0,0,0), (1,0,0), (1,1,0), (1,1,1), (2,0,0), (2,1,0) and (2,1,1) gives sums 0,1,2,3,4,5,6, so the second sentence of the Statement is an equality of sets and not merely an inclusion.

LemmaStatement: AI-adaptedProof: AI-adaptedprecheck passjudge pass (deepseek-v4-pro + gpt-5.6-terra)audited 2026-08-26Open item page →

If 4 divides x2+y2+z2 then x, y and z are all even

Statement

Let x,y,z∈Z and suppose 4∣x2+y2+z2 (Divisibility in Z: d∣a when a=dq for some integer q). Then x, y and z are all even.

Facts & Assumptions

Given: Integers x,y,z with 4∣x2+y2+z2.

[F1]

For a,b,n∈Z, a≡b(modn) means n∣(a−b) (Congruence modulo an integer: a≡b(modn) when n∣(a−b), including the moduli 0 and 1).

[F2]

For d,a∈Z, d∣a means a=dq for some q∈Z (Divisibility in Z: d∣a when a=dq for some integer q).

[L1]

For every integer x: if x is odd then x2≡1(mod4), and if x is even then x2≡0(mod4) (A square is congruent to 0, 1 or 4 modulo 8).

[L2]

If a≡a′(modn) and b≡b′(modn), then a+b≡a′+b′(modn) and a−b≡a′−b′(modn) (Congruent integers may be added, subtracted and multiplied: representative changes preserve both arithmetic operations).

[L3]

For a,b∈Z with b≠0 there is exactly one pair (q,r) of integers with a=qb+r and 0≤r<∣b∣; moreover b∣a holds exactly when r=0 (Division with remainder for any nonzero divisor: for a∈Z and b≠0 there are unique q,r∈Z with a=qb+r and 0≤r<∣b∣).

Proof

technique · direct
1.1givenL3construct

By [L3] with b=2 each of x,y,z is even or odd; let t be how many of the three are odd, so t is one of 0,1,2,3.

1.2L1

By [L1], modulo 4 each odd coordinate contributes a square congruent to 1 and each even coordinate contributes a square congruent to 0.

2.1step 1.1step 1.2L2F1algebra

Adding the three contributions by [L2], x2+y2+z2≡t(mod4), since the t odd coordinates each contribute 1 and the remaining ones contribute 0.

3.1givenstep 2.1L2F1F2algebra

The hypothesis 4∣x2+y2+z2 says x2+y2+z2≡0(mod4) by [F1] and [F2]; subtracting this from step 2.1 by the difference clause of [L2] gives 0≡t(mod4), that is 4∣t.

4.1step 1.1step 3.1L3algebra∎

Since 0≤t<4, [L3] applied with a=t and b=4 has the unique pair (q,r)=(0,t), and it says 4∣t holds exactly when r=0; so step 3.1 forces t=0, meaning none of x,y,z is odd, that is x, y and z are all even.

Remarks

The modulus cannot be relaxed to 2. Divisibility of x2+y2+z2 by 2 leaves t=0 and t=2 both possible, and 12+12+02=2 realises the second, so 2 dividing the sum does not force the coordinates even. It is the count t being pinned to a single residue modulo 4 that makes the argument work, and that needs the modulus 4.

Where it is used. This is the halving step of Positive integers 4am with m≡7(mod8) are not sums of three integer squares: it is what licenses passing from a representation of 4σ(a)m to one of 4am.

PropositionStatement: Literature-sourcedProof: AI-adaptedprecheck passjudge pass (deepseek-v4-pro + gpt-5.6-terra)audited 2026-08-26Open item page →

Positive integers 4am with m≡7(mod8) are not sums of three integer squares

Statement

Let a∈N and let m be a positive integer with m≡7(mod8) (Congruence modulo an integer: a≡b(modn) when n∣(a−b), including the moduli 0 and 1). Then there are no integers x,y,z with 4am=x2+y2+z2, where 4a is the natural power of 4 in the commutative monoid (Z,⋅,1) (Powers gn: natural exponents in a monoid and integer exponents in a group, with g0=e, (Z,⋅,1) is a commutative monoid whose group of units is {1,−1}; equivalently u∣1 holds exactly for u=1 and u=−1).

Facts & Assumptions

Given: A positive integer m with m≡7(mod8).

[F1]

For a,b,n∈Z, a≡b(modn) means n∣(a−b) (Congruence modulo an integer: a≡b(modn) when n∣(a−b), including the moduli 0 and 1).

[F2]

For d,a∈Z, d∣a means a=dq for some q∈Z (Divisibility in Z: d∣a when a=dq for some integer q).

[L1]

There are no integers x,y,z with x2+y2+z2≡7(mod8) (No sum of three integer squares is congruent to 7 modulo 8).

[L2]

If x,y,z∈Z and 4∣x2+y2+z2, then x, y and z are all even (If 4 divides x2+y2+z2 then x, y and z are all even).

[L3]

If x,y∈Z are nonzero then xy≠0; consequently, if xz=yz and z≠0, then x=y (The integers have no zero divisors; multiplicative cancellation).

[L4]

In a monoid (M,⋅,e) the natural powers of g∈M satisfy g0=e and gσ(n)=gn⋅g for n∈N, where σ is the successor on N (Powers gn: natural exponents in a monoid and integer exponents in a group, with g0=e).

[L6]

Let S⊆N. If 0∈S and σ(n)∈S whenever n∈S, then S=N (The principle of mathematical induction).

Proof

technique · induction
1.1givenconstruct

Let S be the set of a∈N such that for every positive integer m with m≡7(mod8) there are no integers x,y,z with 4am=x2+y2+z2.

1.2baseL1L4L5F1algebra

Base case 0∈S: by [L4] in the monoid of [L5], 40=1, so 40m=m and a representation m=x2+y2+z2 would give x2+y2+z2≡7(mod8) by the hypothesis m≡7(mod8), which [L1] excludes.

2.1step 1.1ihL4L5F2algebra

Induction step: let a∈S, let m be a positive integer with m≡7(mod8), and suppose integers x,y,z satisfy 4σ(a)m=x2+y2+z2; by [L4] and [L5], 4σ(a)=4a⋅4, so x2+y2+z2=4⋅(4am) and hence 4∣x2+y2+z2 by [F2].

3.1step 2.1L2construct

By [L2] the coordinates x, y, z are then all even, so x=2x′, y=2y′ and z=2z′ for integers x′,y′,z′.

4.1step 2.1step 3.1L3algebra

Substituting gives 4⋅(4am)=x2+y2+z2=4(x′2+y′2+z′2), and cancelling the nonzero factor 4 by [L3] yields 4am=x′2+y′2+z′2, which contradicts a∈S since m is a positive integer congruent to 7 modulo 8.

5.1step 1.2step 4.1L6discharge-induction∎

So no such x,y,z exist and σ(a)∈S; with the base case of step 1.2, [L6] gives S=N, which is the assertion.

Remarks

Three descriptions of the same integers. For a positive m, the condition m≡7(mod8) says m=8b+7 for an integer b, and b≥0 because 8b+7>0; so the integers excluded here are exactly those of the form 4a(8b+7) with a a natural number and b 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: 4a=22a and every m≡7(mod8) 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 8 and nothing more. The step is where the work is: it needs that a sum of three squares divisible by 4 has all coordinates even, which is If 4 divides x2+y2+z2 then x, y and z are all even, since without it the halved coordinates need not be integers.

CorollaryStatement: AI-adaptedProof: AI-adaptedprecheck passjudge pass (deepseek-v4-pro + gpt-5.6-terra)audited 2026-08-26Open item page →

Positive integers 4am with m≡7(mod8) need four nonzero squares

Statement

Let a∈N, let m be a positive integer with m≡7(mod8) (Congruence modulo an integer: a≡b(modn) when n∣(a−b), including the moduli 0 and 1), and put n=4am, the power being the natural power in the commutative monoid (Z,⋅,1) (Powers gn: natural exponents in a monoid and integer exponents in a group, with g0=e, (Z,⋅,1) is a commutative monoid whose group of units is {1,−1}; equivalently u∣1 holds exactly for u=1 and u=−1). Then n is a sum of four integer squares, and in every representation (x1,x2,x3,x4)∈Z4 of n (Representations as sums of four squares) all four coordinates are nonzero.

Facts & Assumptions

Given: A natural number a, a positive integer m with m≡7(mod8), and n=4am.

[F1]

A representation of a nonnegative integer n as a sum of four squares is an ordered quadruple (a,b,c,d)∈Z4 with n=a2+b2+c2+d2 (Representations as sums of four squares).

[L1]

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).

[L2]

For a∈N and a positive integer m with m≡7(mod8), there are no integers x,y,z with 4am=x2+y2+z2 (Positive integers 4am with m≡7(mod8) are not sums of three integer squares).

[L3]

In a monoid (M,⋅,e) the natural powers of g∈M satisfy g0=e and gσ(n)=gn⋅g for n∈N, where σ is the successor on N (Powers gn: natural exponents in a monoid and integer exponents in a group, with g0=e).

[L5]

The order on Z is total, x≤y implies x+z≤y+z, and 0<x, 0<y imply 0<xy (The integers form a totally ordered ring).

[L6]

The embedding of N into Z is injective, preserves order, and has image exactly the nonnegative integers (The naturals embed in the integers).

[L7]

On N, the strict order is membership and 0∈n whenever n≠0 (On N the order is membership: m<n  ⟺  m∈n).

[L8]

One has m<n exactly when σ(m)≤n (Discreteness: σ(n) is the immediate successor), and 1=σ(0) (The natural numbers N (von Neumann)).

[L9]

Let S⊆N. If 0∈S and σ(n)∈S whenever n∈S, then S=N (The principle of mathematical induction).

Proof

technique · contradiction
1.1L6L7L8

The integers satisfy 0<1, and every positive integer is at least 1: the first because the embedded natural number 1 is nonnegative and differs from the embedded natural number 0, which is the integer 0, by injectivity in [L6]; and if y>0 then [L6] writes y as the image of a unique natural t, with t≠0, so [L7] gives 0∈t, hence 0<t, and [L8] turns this into 1=σ(0)≤t, which order preservation in [L6] carries to 1≤y.

1.2assume-contra

Suppose, for contradiction, that some quadruple (x1,x2,x3,x4)∈Z4 satisfies n=x12+x22+x32+x42 with xj=0 for at least one index j.

2.1step 1.1L3L4L5L9

Let U={a∈N:4a≥1}. Since 40=1 by [L3] in the monoid of [L4], the set U contains 0. If a∈U, then 4σ(a)=4a⋅4 by [L3], and both factors are at least 1: 4a≥1 by the hypothesis a∈U, and step 1.1 gives 4≥1 because 4 is a positive integer. Thus both factors are positive, so [L5] gives 4σ(a)>0, and step 1.1 then gives 4σ(a)≥1. Hence σ(a)∈U, and [L9] yields U=N.

3.1step 1.1step 2.1L5

Since m is positive, step 1.1 gives m≥1; and step 2.1 gives 4a≥1. So both factors in n=4am are positive, [L5] gives n>0, and in particular n is nonnegative.

4.1step 3.1L1F1

By [L1] applied to the nonnegative integer n of step 3.1, n is a sum of four integer squares, so a representation in the sense of [F1] exists.

5.1step 4.1step 1.2L2F1algebradischarge-contradiction∎

Under the assumption of step 1.2, deleting the coordinate xj leaves three integers y1,y2,y3, the other coordinates in any order, with y12+y22+y32=x12+x22+x32+x42−xj2=n=4am, which [L2] excludes; the assumption therefore fails, so every representation of n 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 n, by Lagrange's four-square theorem: every nonnegative integer is a sum of four integer squares, and three do not, by Positive integers 4am with m≡7(mod8) 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 n by three squares with a fourth coordinate added. So for these n the number four in Lagrange's theorem cannot be lowered.

The smallest instances. Taking a=0 and m=7 gives n=7; taking a=1 and m=7 gives n=28; and taking a=0 and m=15 gives n=15, so the statement is not about 7 alone.

5 · Examples, counterexamples and false statements

None yet.

Sources