Alphabeta Math
TheoremStatement: Literature-sourcedProof: AI-adaptedSession-authored (Fable 5 assisted)precheck passjudge pass (deepseek-v4-pro + gpt-5.6-terra)audited 2026-08-26
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'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 n0 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,aZ, da means a=dq for some qZ (Divisibility in Z: da when a=dq for some integer q).

[F3]

An integer p is prime when p>1 and dp 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 nZ with n>1 and put S:={dZ:dn 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 SZ 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.1

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

assume-contra
2.1

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.

step 1.1L4F1construct
3.1

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 n0T and n00, this forces n0>1.

step 2.1F1algebra
4.1

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

step 3.1L3F2choose
5.1

Here k1, since k0 would give n0=qk0 against n0>1; and k<n0, since step 4.1 gives q prime, so [F3] gives q>1, hence q2, and therefore n0=qk2k=k+k>k.

step 4.1F3algebra
6.1

Since 0k<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].

step 2.1step 5.1L1
7.1

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

step 4.1step 6.1L2F1discharge-contradiction

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 n0 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 m7(mod8) are not sums of three integer squares and its corollary Positive integers 4am with m7(mod8) need four nonzero squares exhibit the family 4am with m7(mod8); they do not assert the converse classification.

Depends on

Used by

Dependency tree · two levels

27 results within two dependency steps of this one, each drawn at its shortest distance from it. An arrow runs from a result to what uses it, so the chart reads left to right and ends at this result, which carries a heavier outline. Every node is a link to that result. Click elsewhere on the chart to enlarge it.

Sources