Convert raw flattened coefficient arrays to a runtime-indexed tower polynomial.
Equations
- Hex.NumberTower.Factor.rawPoly levels f = Hex.DensePoly.ofCoeffs (Array.map (Hex.NumberTower.Arithmetic.Coeff.ofData levels) f)
Instances For
Extract flattened coefficient arrays from a runtime-indexed tower polynomial.
Equations
Instances For
Fuel-bounded Yun loop. Here w is the product of the factors whose
multiplicity is still at least the current index, while repeated contains
their remaining copies. Dividing w by their gcd emits the squarefree
component of exactly that multiplicity.
Equations
- One or more equations did not get rendered due to their size.
- Hex.NumberTower.Factor.yunAux levels w repeated multiplicity 0 out = out
Instances For
Polynomial power used by reconstruction checks, computed by repeated squaring so high multiplicities do not induce a linear multiplication chain.
Equations
Instances For
Self-check a Yun decomposition: multiplicities are positive and strictly increasing, the monic squarefree components are pairwise coprime, and their powered product reconstructs the monic input. Polynomials of degree zero have the unique empty decomposition.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Recover the rational polynomial stored by base-tower raw coordinates.
Equations
- Hex.NumberTower.Factor.toRatPoly f = Hex.DensePoly.ofCoeffs (Array.map (fun (coefficient : Array Rat) => coefficient.getD 0 0) f)
Instances For
Complete factorization of a monic squarefree rational polynomial. The Berlekamp–Zassenhaus entries are expanded by multiplicity before their monic normalizations are checked against the input. The recursive caller admits only squarefree inputs, so the companion proves that this expansion contains one copy of each irreducible factor; expanding here also makes reconstruction independent of that semantic fact.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The newest generator as a runtime-indexed element. A linear level already lies in the lower field, so its generator is the negative constant term of its monic relation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Embed a lower-tail polynomial into the current level. Mixed-radix order places lower coordinates in the first top-generator block.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Start recovery division with the monic shifted component when it has smaller degree than the lifted norm factor. The remaining Euclidean chain uses exactly the reference gcd's remaining fuel and remainder representative.
Equations
Instances For
Recover current-level factors from irreducible lower factors of a squarefree Trager norm, then undo the selected generator shift.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Recursive Trager factorization of one monic squarefree component. The recursion is structural in the tower height; every proper level performs one bounded one-level norm search and recurses only on the lower tail.
Equations
- One or more equations did not get rendered due to their size.
- Hex.NumberTower.Factor.factorSquarefree? [] x✝ = Hex.NumberTower.Factor.factorRat? (Hex.NumberTower.Factor.toRatPoly x✝)
Instances For
Runtime factorization payload before re-indexing coefficients by a public
NumberTower.
The leading scalar's raw coordinates.
Raw monic factors, canonically sorted, each with its multiplicity.
Instances For
Lexicographic order on rational lists.
Equations
- Hex.NumberTower.Factor.ratListLess [] [] = false
- Hex.NumberTower.Factor.ratListLess [] (head :: tail) = true
- Hex.NumberTower.Factor.ratListLess (head :: tail) [] = false
- Hex.NumberTower.Factor.ratListLess (a :: as) (b :: bs) = if a < b then true else if b < a then false else Hex.NumberTower.Factor.ratListLess as bs
Instances For
Flatten polynomial coefficient coordinates for canonical sorting. Each coefficient carries its length, so the key remains injective even for malformed raw inputs whose coordinate blocks do not have the tower width.
Equations
- Hex.NumberTower.Factor.flattenPoly f = List.flatMap (fun (coefficient : Array Rat) => ↑coefficient.size :: coefficient.toList) f.toList
Instances For
Canonical lexicographic factor order.
Equations
Instances For
Check that every pair of factors is in strict canonical order. Strictness ensures each irreducible occurs once, with its multiplicity stored in the paired natural number.
Equations
- Hex.NumberTower.Factor.factorsSorted factors = decide (List.Pairwise (fun (a b : Array (Array Rat) × Nat) => Hex.NumberTower.Factor.factorLess a.fst b.fst = true) factors.toList)
Instances For
Executable recursive irreducibility checker for a monic squarefree raw tower polynomial. The rational base delegates to the integer-polynomial checker shared by rational factorization; proper towers accept exactly a singleton Trager reconstruction.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Append all irreducible factors of one Yun component, carrying the Yun multiplicity into the accumulated factor list.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Full executable raw factorization certificate check. At proper tower levels, “irreducible” means a piece the recursive Trager checker cannot split; the Mathlib companion supplies the semantic irreducibility theorem. Cheap reconstruction and canonical-order checks precede recursive replay.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Produce a canonical factorization candidate with checked Yun multiplicities and recursive Trager recovery. The public dependent constructor performs the one full executable certificate replay.
Equations
- One or more equations did not get rendered due to their size.