Boolean equality on packed GF(2) polynomials, computed by decide
on the decidable propositional equality.
Equations
- Hex.GF2Poly.instBEq = { beq := fun (p q : Hex.GF2Poly) => decide (p = q) }
instBEq is lawful: its boolean equality agrees with propositional
equality in both directions, via of_decide_eq_true and decide_eq_true.
The polynomial X^(2^k) - X reduced modulo f. Since the packed
representation is over characteristic two, subtraction collapses to addition.
Equations
- f.frobeniusDiffMod k = f.xpow2kMod k + Hex.GF2Poly.monomial 1 % f
Instances For
Positive divisors of n strictly below n, listed in ascending order.
Equations
- Hex.GF2Poly.properDivisors n = List.filter (fun (d : Nat) => decide (n % d = 0)) (List.map Nat.succ (List.range (n - 1)))
Instances For
The maximal proper divisors of n: those proper divisors not strictly
below any other proper divisor of n.
Equations
- Hex.GF2Poly.maximalProperDivisors n = List.filter (fun (d : Nat) => !(Hex.GF2Poly.properDivisors n).any fun (e : Nat) => decide (d < e) && decide (e % d = 0)) (Hex.GF2Poly.properDivisors n)
Instances For
true exactly when g is a nonzero constant polynomial.
Instances For
The divisibility leg of Rabin's criterion: f divides X^(2^n) - X,
with n = deg(f), exactly when the reduced remainder vanishes.
Equations
- f.rabinDividesTest = (f.frobeniusDiffMod f.natDegree).isZero
Instances For
The gcd leg of Rabin's criterion at a single maximal proper divisor d.
Equations
- f.rabinCoprimeTest d = (f.gcd (f.frobeniusDiffMod d)).isUnitPolynomial
Instances For
Per-divisor Rabin gcd outcomes for downstream factorization use.
Equations
- f.rabinWitnesses = List.map (fun (d : Nat) => (d, f.rabinCoprimeTest d)) (Hex.GF2Poly.maximalProperDivisors f.natDegree)
Instances For
Checking all stored Rabin witnesses is the same as checking the Rabin coprime test over every maximal proper divisor.
Rabin's executable irreducibility test: f must be nonconstant, divide
X^(2^n) - X, and be coprime to X^(2^d) - X for every maximal proper
divisor d of n = deg(f).
Equations
Instances For
Bezout evidence that one Rabin gcd leg is coprime.
Instances For
Self-describing certificate data for Rabin irreducibility checking.
The bezout array is indexed in the same order as maximalProperDivisors n.
Each witness proves coprimality of f and X^(2^d) - X mod f by the
executable identity left * f + right * (X^(2^d) - X mod f) = 1.
- n : Nat
The degree
n = deg(f)whose maximal proper divisors index the checks. The chain of
X^(2^d) - X mod fresidues, one per relevant divisor ofn.- bezout : Array RabinBezoutWitness
Bezout witnesses, indexed like
maximalProperDivisors n.
Instances For
Read the certified X^(2^k) mod f witness, if present.
Instances For
Certificate pow witnesses are backed directly by the pow-chain array.
Read the Bezout witness for the i-th maximal proper divisor, if present.
Instances For
Certificate Bezout witnesses are backed directly by the Bezout array.
The Rabin difference polynomial represented by a certificate pow-chain
entry. Equivalently powWitness + (X mod f) since char 2 collapses
subtraction to addition.
Equations
- f.certifiedFrobeniusDiffMod powWitness = powWitness + Hex.GF2Poly.monomial 1 % f
Instances For
Check one Bezout witness for a Rabin maximal-proper-divisor leg.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Check all Bezout witnesses against maximalProperDivisors cert.n.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Executable checker for a Rabin irreducibility certificate.
It validates the self-described n, recomputes every pow-chain entry,
checks the divisibility leg X^(2^n) ≡ X mod f, and verifies each Bezout
identity for the maximal proper divisors of n.
Consumer-facing soundness target: checkIrreducibilityCertificate_imp_irreducible
in HexGF2/RabinSoundness.lean lifts a true outcome to GF2Poly.Irreducible f.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Linear-time pow-chain check: each entry must be the squaring step of the
previous, with the first entry equal to X mod f.
This is logically equivalent to checkPowChain but uses only O(n)
squarings during kernel reduction, where checkPowChain recomputes
xpow2kMod f k from scratch for each k and is O(n^2). The linear
form is intended for kernel-reducible decide checks on certificates
whose modulus has degree comparable to a few machine words.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Linear-time variant of checkIrreducibilityCertificate. The only
difference is that it uses checkPowChainLinear for the pow-chain leg.
Consumer-facing soundness target: checkIrreducibilityCertificateLinear_imp_irreducible
in HexGF2/RabinSoundness.lean lifts a true outcome to GF2Poly.Irreducible f.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The executable Rabin divisibility test is definitionally the zero-remainder
test for X^(2^deg f) - X modulo f.
A successful quadratic pow-chain check certifies every stored
X^(2^k) mod f value up to the certificate degree.
The executable certificate checker is sound against the parallel
rabinTest Bool predicate.
The irreducibility-level theorem is provided in HexGF2/RabinSoundness.lean
as checkIrreducibilityCertificate_imp_irreducible.
A successful linear pow-chain check certifies every stored
X^(2^k) mod f value up to the certificate degree.
A successful linear irreducibility certificate checker implies the executable Rabin test succeeds.