Alphabeta Math
TheoremStatement: Literature-sourcedProof: AI-adaptedSession-authored (Fable 5 assisted)precheck passaudited 2026-07-31
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.

Wilson's theorem: for every prime pp, (p1)!1(modp)(p-1)!\equiv-1\pmod p

Statement

For every prime pp,

(p1)!1(modp).(p-1)!\equiv-1\pmod p.

Facts & Assumptions

Given: A prime pp.

[L1]

The unit classes modulo pp other than [1]p[1]_p and [1]p[-1]_p occur in disjoint inverse pairs, while those displayed classes are the only self-inverse ones; at p=2p=2 they coincide (In (Z/p)×(\mathbb{Z}/p)^\times, inversion pairs every class except [1]p[1]_p and [1]p[-1]_p, which are the only self-inverse classes).

[L5]

The quotient Z/p\mathbb Z/p is a field, so every nonzero class is a unit (For every prime pp, the two operations on Z/p\mathbb{Z}/p make it a field).

[F1]

Products of residue classes are computed by multiplying representatives: [a]p[b]p=[ab]p[a]_p[b]_p=[ab]_p (Addition and multiplication on Z/n\mathbb{Z}/n by [a]n+[b]n=[a+b]n[a]_n+[b]_n=[a+b]_n and [a]n[b]n=[ab]n[a]_n[b]_n=[ab]_n).

Proof

technique · direct
1.1

By [L5], the nonzero classes are exactly the unit classes. Multiply them all and regroup by [L1]: every two-element inverse pair contributes [1]p[1]_p. If the two displayed self-inverse classes are distinct, their contribution is [1]p[1]p=[1]p[1]_p[-1]_p=[-1]_p; if they coincide, their single common contribution is itself [1]p[-1]_p. Thus in every case the product of all nonzero classes is [1]p[-1]_p.

L1L3L5
2.1

By [L2] and [F1], that same class product is [(p1)!]p[(p-1)!]_p. Therefore [(p1)!]p=[1]p[(p-1)!]_p=[-1]_p, which is exactly (p1)!1(modp)(p-1)!\equiv-1\pmod p by [L4].

step 1.1L2L4F1

Depends on

Used by

Nothing in the library uses this result yet.

Dependency tree · next 3 levels

Direct dependencies and their dependencies through the next three levels: 108 results over 31 levels. An arrow runs from a result to what uses it, and this result sits at the bottom with a heavier outline. Click the chart to enlarge it.

Sources