A finite prime-factor-list interface for Lucas primality certificates
ProvedGoldbachPrimalityCertificate.lucas_from_prime_listThis is a finite-factor-list interface to Mathlib's existing Lucas primality
theorem. Suppose a list of proved primes has product p - 1, and an element
a modulo p satisfies a^(p-1) = 1 while a^((p-1)/r) ≠ 1 for every listed
factor r. Then p is prime. Repeated factors are allowed.
The proof establishes that every prime dividing the product occurs in the list:
induction uses the prime-divides-product property, followed by equality of two
primes when one divides the other. The list conditions therefore provide all
the hypotheses of lucas_primality.
This wrapper is intended for explicit generated certificates, whose factor primalities and modular equalities are proved in Lean. Factorizations and modular answers produced by a search program are not trusted. The mathematical primality criterion is the known Lucas/Pratt method, already present in Mathlib; the contribution is a reusable finite-data interface.
import Mathlib.NumberTheory.LucasPrimality import Mathlib.Algebra.BigOperators.Group.List.Defs set_option autoImplicit false
theorem GoldbachPrimalityCertificate.lucas_from_prime_list (p : ℕ) (a : ZMod p) (factors : List ℕ)
(hp : ∀ r ∈ factors, Nat.Prime r) (hprod : factors.prod = p - 1)
(ha : a ^ (p - 1) = 1)
(hd : ∀ r ∈ factors, a ^ ((p - 1) / r) ≠ 1) : Nat.Prime p := by sorry