Carmichael numbers #
This file defines Carmichael numbers and proves Korselt's criterion about them.
Main definitions #
Nat.IsCarmichael: a predicate for Carmicheal numbers
Main results #
Nat.isCarmichael_iff_korselt: Korselt's criterion for Carmichael numbersNat.isCarmichael_561:561is a Carmichael number
TODO #
- Prove (in a computationally efficient manner) that there are no Carmichael numbers
less than
561.
References #
We say a natural number n is a Carmichael number if it is greater than 2, composite and
for all natural numbers b coprime to n we have n ∣ b ^ (n - 1) - 1.
Equations
- n.IsCarmichael = (2 < n ∧ ¬Nat.Prime n ∧ ∀ (b : ℕ), b.Coprime n → n.ProbablePrime b)
Instances For
theorem Nat.IsCarmichael.probablePrime_of_coprime {n b : ℕ} (h : n.IsCarmichael) (hb : b.Coprime n) :
n.ProbablePrime b
A Carmichael number is squarefree.
theorem Nat.IsCarmichael.prime_sub_one_dvd {n p : ℕ} (h : n.IsCarmichael) (hp : Prime p) (hpn : p ∣ n) :
Korselt's criterion for Carmichael numbers:
n is a Carmichael number if and only if it is greater than two, composite, squarefree, and for
each prime divisor p of n, we have p - 1 ∣ n - 1.
theorem Nat.isCarmichael_iff_korselt_primeFactorsList {n : ℕ} :
n.IsCarmichael ↔ 2 < n ∧ ¬Prime n ∧ n.primeFactorsList.Nodup ∧ ∀ p ∈ n.primeFactorsList, p - 1 ∣ n - 1
Korselt's criterion stated in a form suitable for concrete calculations.