Lucas primality certificates #
Proves Nat.Prime p by the Lucas test from a primitive root and the prime factors of p - 1.
A more kernel-efficient version of b ^ e % m, computed four bits of e at a time by
Nat.pow. Replace with Nat.powMod once
lean4#15167 is available.
Equations
Instances For
Compiled code runs core's Nat.powMod in place of powMod since it is faster there.
lucasCheck p a factorization checks that a ^ (p - 1) % p = 1, that
a ^ ((p - 1) / q) % p ≠ 1 for each (q, e) ∈ factorization, and that the q ^ e multiply to
p - 1.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The factorization of p - 1 into the prime factors of w, if each of them divides p - 1
and lucasCheck passes with the root of w.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Proves Nat.Prime p from the primitive root root and the factorization of p - 1 in
factorization, each prime factor with its exponent and proof of primality.
Equations
- One or more equations did not get rendered due to their size.