N is a Carmichael number if it is a composite integer greater than 1
for which every unit a in ZMod N satisfies a ^ (N - 1) = 1.
Instances For
The exponent s in the Miller-Rabin decomposition N - 1 = 2^s * d,
defined as the 2-adic valuation of N - 1.
Instances For
The odd part d in the Miller-Rabin decomposition N - 1 = 2^s * d.
Instances For
The Miller-Rabin decomposition: N - 1 = 2 ^ millerRabinS N * millerRabinD N.
Lemma 11.6 (Sutherland): writing a prime p = 2^s t + 1 with t odd, for
any integer a nonzero mod p, exactly one of the following holds:
(i) a^t ≡ 1 (mod p); (ii) a^{2^i t} ≡ -1 (mod p) for some 0 ≤ i < s.
An integer a is a Miller-Rabin witness for the compositeness of N if
a is nonzero mod N, a^d ≢ 1, and a^(2^r · d) ≢ -1 for every
0 ≤ r < s, where N - 1 = 2^s · d with d odd.
Instances For
The set of Miller-Rabin witnesses in [1, N-1].
Instances For
The set of Miller-Rabin liars (non-witnesses) in [1, N-1].
Instances For
The Miller-Rabin witness set and liar set together partition [1, N-1].
A residue from [1, N-1] is nonzero in ZMod N whenever N > 1.
Any Miller-Rabin liar for N (with N > 1) is coprime to N.
The 2-adic valuation of a natural number, computed recursively by
dividing by 2 while the input is even.
Instances For
2 ^ twoAdicVal n divides n.
n = 2 ^ twoAdicVal n * (n / 2 ^ twoAdicVal n): extracting the 2-adic
factor of n.
One iteration of the Miller-Rabin primality test for a candidate N with
a base a: succeeds iff a^d ≡ 1 or a^(2^r · d) ≡ -1 for some r < s,
where N - 1 = 2^s · d.
Instances For
The full Miller-Rabin test: run millerRabinStep on each witness in the
list and report true iff every one returns true.
Instances For
The Miller-Rabin decomposition (restatement): N - 1 = 2 ^ millerRabinS N * millerRabinD N.
A projective z-coordinate Pz is zero modulo N if N divides Pz.
Instances For
A projective z-coordinate Pz is nonzero modulo N if N does not
divide Pz.
Instances For
A projective z-coordinate Pz is strongly nonzero modulo N if
gcd(Pz, N) = 1.
Instances For
If Pz is strongly nonzero mod N and p is a prime divisor of N,
then p ∤ Pz.
Strongly nonzero mod N implies nonzero mod N, provided N > 1.
When N is prime, "strongly nonzero mod N" coincides with "nonzero
mod N".
The hypotheses of the Goldwasser-Kilian primality criterion (Theorem 11.13
of Sutherland): N, M > 1, M > (N^{1/4}+1)^2, N coprime to the
discriminant of W, the multiple MP is zero mod N, and (M/ℓ)P is
strongly nonzero mod N for every prime ℓ ∣ M.
- hzero : IsZeroModN zMP N
- hstrong (ℓ : ℕ) : Nat.Prime ℓ → ℓ ∣ M → IsStronglyNonzeroModN (zMlP ℓ) N
Instances For
If N is coprime to the discriminant of W and p is a prime divisor
of N, then the discriminant maps to a nonzero element of ZMod p.
Under the Goldwasser-Kilian hypotheses, for any prime p ∣ N, the
reduction of the point modulo p is annihilated by M and not by M/ℓ
for any prime ℓ ∣ M.
Under the Goldwasser-Kilian hypotheses, for any prime p ∣ N, the
reduction of the point modulo p has additive order exactly M.
Under the Goldwasser-Kilian hypotheses, for every prime p ∣ N the
order parameter M is bounded by the Hasse interval upper bound
(√p + 1)^2.
Theorem 11.13 (Goldwasser-Kilian, Sutherland): Let E/ℚ be an elliptic
curve and M, N > 1 with M > (N^{1/4}+1)^2 and N coprime to Δ(E). If
MP is zero mod N and (M/ℓ)P is strongly nonzero mod N for every
prime ℓ ∣ M, then N is prime.