hex-berlekamp-zassenhaus implements complete factorization of univariate
integer polynomials. The executable library is Mathlib-free; its semantic,
completeness, and irreducibility proofs live in
HexBerlekampZassenhausMathlib.
The normative design is
HexBerlekampZassenhaus/SPEC/hex-berlekamp-zassenhaus.md.
This file is a short map for development work.
ZPoly.factorize normalizes the input once, then dispatches through:
- direct-coordinate classical recombination;
- direct-coordinate CLD lattice recombination after a typed classical decline;
- exhaustive integer trial division as the total backstop.
Both modular tiers share one DirectPrimePlan and one original-coordinate
recovery model. Each constructs the Hensel lift required by its own precision
bound from that cached modular factorization. Finite-field factors are monic
by convention, but the integral toMonic coordinate transform is not part of
the production route.
Every optional modular result is checked by exact product reconstruction before the dispatcher accepts it.
SquareFreeInput.leandefines the primitive square-free problem indexed by every direct plan and lift.PrimeSelection.lean,ChoosePrimeData.lean, andModular/PrimePlan.leanimplement direct modular planning.Hensel/DirectLift.leandefines the plan-indexed recovery lift.Classical/contains the sole production classical search and its typed outcomes.BhksCandidates.lean,BhksRecover.lean, andLattice.leanimplement CLD construction, recovery, and the unconditional trial backstop.Dispatch.leancontains the public tier entry points andZPoly.factorize, together with the typed dispatch result and trace.
DirectFactorTrace reports the tier, an optional typed classical decline, and
the ClassicalStats generated by the same run that produced the answer.
The direct Hensel facts are in Hensel/DirectLift.lean. Direct support and
CLD adequacy are organized around the mathematical objects they establish:
Lattice/DirectSupport.lean;Lattice/DirectRecovery.lean;Lattice/DirectAdequacy.lean;LatticeFactorization.lean;LatticeTotality.lean.
The classical completeness proof is in Classical/. General mathematical
objects are kept in:
FactorBound.lean;Factorization.lean;ModularPolynomial.lean;IrreducibilityCertificate.lean;ModPPartition.lean.
There is no generic “public surface” module and no duplicate monic-coordinate CLD recovery stack.
Run:
lake build
Then run the existing Berlekamp–Zassenhaus conformance/oracle check, benchmark import lint, and benchmark verification check. Changes to the factorizer also rerun the public Hex rows of the stored polynomial-factorization corpus comparison. Recorded external-system observations are not rerun merely because Hex changes.
Never introduce an axiom or native_decide. Do not replace proof obligations
with sorry.