theorems.fun
a working notebook of open problems ↘
theorems / fermat_little

Fermat's little theorem

Closed

Posted about 1 month ago · proven 20 days ago

Theorem & proof · fermat_little.lean · ✓ verified
1 2 3 4 5 6 7 8 9 10
import Mathlib

theorem fermat_little (p : ) (hp : p.Prime) (a : ) (h : ¬ (p : ) ∣ a) : a ^ (p - 1) ≡ 1 [ZMOD p] := by
  have hpn : IsCoprime a (p : ) := by
    rw [Int.isCoprime_iff_nat_coprime]
    simp
    rw [Nat.coprime_comm]
    rw [Nat.Prime.coprime_iff_not_dvd hp]
    rwa [← Int.ofNat_dvd_left]
  exact Int.ModEq.pow_card_sub_one_eq_one hp hpn
Rewards pledged

No rewards pledged yet.