← LibraryFactoring Polynomials over the IntegersEngineering · MathematicsLesson 272/385← PrevNext →
ArticlePublished 7 Aug 20262 min readBy Kevin Jogininteger polynomial factorisationLLLrecombinationZassenhaus

Polynomial Factorisation

Factoring Polynomials over the Integers

The modular-lift-recombine pipeline, the exponential recombination problem, and the LLL-based algorithm that makes factorisation polynomial time.

Engineering / MathematicsPolynomial Factorisation2 min readKV-MATH-0569

Factoring a polynomial over the integers reduces to the finite field case plus lifting, but the reduction leaves a combinatorial problem behind. Removing that problem is the celebrated application of lattice reduction.

The classical pipeline

SquarefreeFactor mod pHensel liftRecombine

Zassenhaus factorisation

  1. PreprocessRemove content and repeated factors.
  2. Choose a primeNot dividing the leading coefficient or the discriminant.
  3. Factor modulo pUsing the finite field pipeline.
  4. LiftBy Hensel lifting past the Mignotte bound.
  5. RecombineDetermine which products of modular factors are true integer factors.

The recombination problem

The classical algorithm is therefore exponential in the worst case despite every individual stage being polynomial. In practice it is usually fast, because random polynomials do not behave this way.

The LLL-based algorithm

Instead of searching combinations, construct a lattice in which a true factor corresponds to a short vector, then apply LLL.

Integer polynomial factorisation algorithms
AlgorithmWorst caseTypical case
ZassenhausExponential in the modular factor countFast; usually few factors to recombine
LLL-basedPolynomialSlower constant factor
HybridPolynomialFast — try recombination briefly, fall back to LLL

Why this result mattered

Choosing the prime well

Trying several primes and keeping the one with the fewest modular factors materially reduces recombination work. Since the number of modular factors varies considerably between primes, this cheap heuristic is always worth applying.

Source. Henri Cohen, A Course in Computational Algebraic Number Theory, Springer GTM 138 — 3.5.2-3.5.4. Structural reference unverified: the source file was not available during authoring; chapter and section numbers are taken from the published edition and have not been checked against a physical copy.

Continue learning

Hensel Lifting for Polynomial FactorsArticle · MathematicsNEXT LESSON →Factoring Polynomials over Algebraic Number FieldsArticle · MathematicsMignotte Bounds on Polynomial FactorsArticle · MathematicsRoot Finding over the Reals and Complex NumbersArticle · Mathematics