Alphabeta Math
TheoremStatement: Literature-sourcedProof: AI-adaptedprecheck passjudge pass (deepseek-v4-pro + claude-opus-5[1m])audited 2026-08-24
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.

Fermat's two-square theorem for primes

Statement

A prime p is a sum of two integer squares if and only if p=2 or p≡1(mod4) (Representations and primitive representations as sums of two squares).

Facts & Assumptions

Given: A prime p.

[F1]

A representation of a nonnegative integer n as a sum of two squares is an ordered pair (x,y)∈Z2 such that n=x2+y2 (Representations and primitive representations as sums of two squares).

[L1]

If p is prime, p∤a, then there are nonzero integers r,s with ∣r∣,∣s∣<p and ra≡s(modp) (Thue's lemma on small nonzero representatives).

[L2]

For an odd prime p, (−1/p)=1 if and only if p≡1(mod4) (First supplement: (−1/p)=(−1)(p−1)/2).

[F2]

For an odd prime p, (a/p)=1 means that p∤a and a is a quadratic residue modulo p (The Legendre symbol, including its zero value).

[F3]

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

Proof

technique · direct
1.1givenF1algebra

If an odd prime satisfies p=x2+y2, the square residues modulo 4 show that x,y have opposite parity and hence p≡1(mod4).

1.2F1algebra

The remaining even prime has the representation 2=12+12.

1.3givenL2F2F3choose

For the converse direction, suppose p≡1(mod4). Then p is odd, and [L2] and [F2] provide an integer a with a2≡−1(modp) and p∤a.

2.1step 1.3L1F3

Apply [L1] to this a to obtain nonzero integers r,s with ∣r∣,∣s∣<p and ra≡s(modp).

3.1step 1.3step 2.1F1F3algebra

Squaring the congruence in step 2.1 and using a2≡−1 gives p∣r2+s2. Moreover 0<r2+s2<p+p=2p. The only positive multiple of p below 2p is p, so p=r2+s2.

4.1step 1.1step 1.2step 3.1∎

Step 1.1 proves necessity for odd primes, step 1.2 handles p=2, and step 3.1 proves sufficiency when p≡1(mod4).

Depends on

Used by

Dependency tree · two levels

16 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