Fermats_Little_Theorem
Provedfermat-s-little-theoremnumber-theoryproofwiki
If p is prime and p does not divide n, then n^{p-1} ≡ 1 (mod p).
Preamble
import Mathlib.Data.ZMod.Basic import Mathlib.FieldTheory.Finite.Basic import Mathlib.Tactic
Formal statement
theorem Fermats_Little_Theorem (p : ℕ) (hp : Nat.Prime p) (n : ℤ) (hn : ¬ (p : ℤ) ∣ n) : n ^ (p - 1) ≡ 1 [ZMOD p] := by sorry
Source