Mathlib.Data.ZMod.Factorial
1 declarations. Mathlib docs · Source
Facts about factorials in ZMod
We collect facts about factorials in context of modular arithmetic.
Main statements
ZMod.cast_descFactorial: For natural numbersnandp, wherenis less than or equal topthe descending factorial of(p - 1)takenntimes modulopequals(-1) ^ n * n!.
See also
For the prime case and involving factorial rather than descFactorial, see Wilson's theorem:
Nat.prime_iff_fac_equiv_neg_one
theorem ZMod.cast_descFactorial E3 #
∀ {n p : ℕ}, n ≤ p → ↑((p - 1).descFactorial n) = (-1) ^ n * ↑n.factorial