Definition
A number-theoretic characterization stating that a positive integer p is prime if and only if (p − 1)! ≡ −1 (mod p); equivalently, the factorial of p − 1 is congruent to −1 modulo p precisely for prime p.
Principle
Principle
Primality is detected by the residue of the factorial of all smaller positive integers modulo p; the multiplicative structure of the field Z/pZ causes each nonzero residue to pair with its inverse, leaving −1 when p is prime.
Demonstration
Demonstration
For p = 5, compute (p − 1)! = 4! = 24 and observe 24 ≡ −1 (mod 5) because 24 = 5·4 + (−1); similarly 2! = 2 ≡ −1 (mod 3) and 1! = 1 ≡ −1 (mod 2) after interpreting −1 mod p.
Misapplication
Misapplication
Using Wilson's Theorem as a practical primality test for large integers without considering factorial growth or modular reduction cost; treating the theorem as an efficient algorithm rather than a theoretical characterization.
Consequence
Consequence
Gives a precise, if computationally impractical, primality criterion and reveals structural information about invertible elements modulo p; it also motivates study of exceptional primes (Wilson primes) and factorial residues.
Reversal
Reversal
Negating the statement would assert that if (p − 1)! ≡ −1 (mod p) then p is composite, which is false; the proper logical reversal is the biconditional already present — the theorem is self-converse for positive integers p.
Boundary
Boundary
Applies to positive integers p ≥ 2 and congruences modulo p; it does not give efficient primality certificates for large p, and its direct form is not meaningful for composite moduli or for non-integer moduli.
Semantic Tension
Semantic Tension
Competes conceptually with Fermat's Little Theorem: both characterize properties of primes via modular arithmetic, but Fermat uses exponentiation a^{p−1} while Wilson uses factorials; one is algorithmically useful, the other is more structural.
Synthesis
Synthesis
Wilson's Theorem is a definitive structural test for primality expressed by a factorial congruence: it arises from pairing inverses in the multiplicative group modulo a prime and, while impractical for large-scale testing, it links combinatorial factorial structure to algebraic properties of Z/pZ.