wilson_theorem_generalization
Provednumber-theoryprime-numbersproved
Wilson's theorem: n is prime iff (n-1)! ≡ -1 (mod n). Proved. Generalizations to Wilson primes (p² | (p-1)!+1) are open: only Wilson primes known are 5, 13, 563.
Preamble
import Mathlib
Formal statement
import Mathlib
theorem wilson_theorem_generalization (n : ℕ) (hn : 2 ≤ n) :
Nat.Prime n ↔ (n - 1).factorial % n = n - 1 := by
sorrySource