Lucas primality certificate with two possible prime factors
ProvedErdos287.prime_of_lucas_two_factorsegyptian-fractionserdos-problemsnumber-theory
A candidate n is prime if n−1 is a prime times a power of two and a Lucas witness passes the full exponent check and the two checks obtained by dividing the exponent by the possible prime factors.
Preamble
import Mathlib
Formal statement
theorem Erdos287.prime_of_lucas_two_factors (n p a g : ℕ) (hp : p.Prime) (hfactor : n - 1 = p * 2 ^ a)
(hfull : (g : ZMod n) ^ (n - 1) = 1)
(htwo : (g : ZMod n) ^ ((n - 1) / 2) ≠ 1)
(hprime : (g : ZMod n) ^ ((n - 1) / p) ≠ 1) :
n.Prime := by sorry
Source
Erdős Problem #287 finite certificate ladder; specialization of Lucas primality.