Documentation

HexNumberFieldTowerMathlib.FactorGeneric.Yun

Monic normalisation only rescales by a unit: the interpretation of Norm.monic f over is associated to the interpretation of f.

Associated complex polynomials have the same root multiplicity at every point.

Over the root multiplicity of a gcd at each point is the minimum of the root multiplicities of its arguments.

theorem Hex.NumberTower.monicGcd_dvd {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (f g : DensePoly (Arithmetic.Coeff levels)) (hf : f 0) :

The monic normalisation of the executable gcd DensePoly.gcd f g divides both f and g in the executable polynomial ring.

theorem Hex.NumberTower.rawPolynomial_monicGcd_ne_zero {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (f g : DensePoly (Arithmetic.Coeff levels)) (hf : Norm.rawPolynomial levels f 0) :

The monic executable gcd interprets to a nonzero complex polynomial whenever its first argument does.

The executable monic gcd tracks complex root multiplicities: at every z, the interpretation of Norm.monic (DensePoly.gcd f g) has root multiplicity the minimum of those of f and g.

theorem Hex.NumberTower.rawPolynomial_div_mul {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (dividend divisor : DensePoly (Arithmetic.Coeff levels)) (hdivisor : divisor dividend) :
Norm.rawPolynomial levels (dividend / divisor) * Norm.rawPolynomial levels divisor = Norm.rawPolynomial levels dividend

For an exact executable division the interpretations reconstruct the dividend: interpreting dividend / divisor and multiplying by the interpreted divisor recovers the interpreted dividend.

theorem Hex.NumberTower.rawPolynomial_div_ne_zero {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (dividend divisor : DensePoly (Arithmetic.Coeff levels)) (hdivisor : divisor dividend) (hdividend : Norm.rawPolynomial levels dividend 0) :
Norm.rawPolynomial levels (dividend / divisor) 0

An exact executable quotient of a semantically nonzero dividend is semantically nonzero.

theorem Hex.NumberTower.rootMultiplicity_monicDiv {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (dividend divisor : DensePoly (Arithmetic.Coeff levels)) (hdivisor : divisor dividend) (hdividend : Norm.rawPolynomial levels dividend 0) (z : ) :

Root multiplicities subtract across the monic exact quotient: at every z, the multiplicity of Norm.monic (dividend / divisor) is the dividend's multiplicity minus the divisor's.

theorem Hex.NumberTower.rawPolynomial_monicDiv_ne_zero {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (dividend divisor : DensePoly (Arithmetic.Coeff levels)) (hdivisor : divisor dividend) (hdividend : Norm.rawPolynomial levels dividend 0) :
Norm.rawPolynomial levels (Norm.monic (dividend / divisor)) 0

The monic normalisation of an exact quotient of a semantically nonzero dividend is semantically nonzero.

structure Hex.NumberTower.YunInvariant {levels : List Level} (z : ) (r k : ) (w repeated : DensePoly (Arithmetic.Coeff levels)) :

Loop invariant of Yun's algorithm tracked at one complex root z of multiplicity r in the original input. Before emitting the component of multiplicity k, the working polynomial w carries z simply exactly when k ≤ r, and the repeated part carries the remaining multiplicity r - k.

Instances For
    theorem Hex.NumberTower.YunInvariant.step {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (z : ) (r k : ) (w repeated : DensePoly (Arithmetic.Coeff levels)) (invariant : YunInvariant z r k w repeated) :
    have shared := Norm.monic (w.gcd repeated); have nextRepeated := Norm.monic (repeated / shared); YunInvariant z r (k + 1) shared nextRepeated

    One Yun iteration preserves the invariant: replacing w by the monic gcd with the repeated part and dividing that gcd out of the repeated part advances the multiplicity counter from k to k + 1.

    theorem Hex.NumberTower.YunInvariant.component {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (z : ) (r k : ) (w repeated : DensePoly (Arithmetic.Coeff levels)) (invariant : YunInvariant z r k w repeated) :
    have shared := Norm.monic (w.gcd repeated); have component := Norm.monic (w / shared); Polynomial.rootMultiplicity z (Norm.rawPolynomial levels component) = if k = r then 1 else 0

    The component emitted at counter k carries z as a simple root exactly when k is the multiplicity of z in the original input, and avoids z otherwise.

    theorem Hex.NumberTower.YunInvariant.init {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (f : DensePoly (Arithmetic.Coeff levels)) (hf : Norm.rawPolynomial levels f 0) (hdegree : (Norm.rawPolynomial levels f).natDegree 0) (z : ) :
    have normalized := Norm.monic f; have repeated := Norm.monic (normalized.gcd (Norm.derivative levels normalized)); have distinct := Norm.monic (normalized / repeated); YunInvariant z (Polynomial.rootMultiplicity z (Norm.rawPolynomial levels f)) 1 distinct repeated

    The Yun setup establishes the invariant at counter 1: over a characteristic-zero coefficient field, dividing the monic input by its gcd with the derivative leaves each root exactly once, and the gcd retains the remaining multiplicity.

    A nonzero interpreted polynomial with a root has positive executable degree. Keeping this transport separate prevents the recursive Yun proof from re-elaborating the coefficient-field construction at every induction step.

    theorem Hex.NumberTower.rawPolynomial_eq_map {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (f : DensePoly (Arithmetic.Coeff levels)) :

    The raw complex interpretation is coefficientwise mapping through the coefficient denotation homomorphism.

    theorem Hex.NumberTower.degree_pos_of_rawPolynomial_root {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (f : DensePoly (Arithmetic.Coeff levels)) (hf : Norm.rawPolynomial levels f 0) {z : } (hroot : (Norm.rawPolynomial levels f).IsRoot z) :

    A semantically nonzero executable polynomial with a complex root has positive executable degree.

    theorem Hex.NumberTower.mem_yunAux_of_mem {levels : List Level} (w repeated : DensePoly (Arithmetic.Coeff levels)) (k fuel : ) (out : Array (Array (Array ) × )) {entry : Array (Array ) × } (hentry : entry out.toList) :
    entry (Factor.yunAux levels w repeated k fuel out).toList

    Entries already accumulated survive the rest of the Yun loop: the accumulator only grows.

    theorem Hex.NumberTower.yunAux_sound {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (z : ) (r : ) (w repeated : DensePoly (Arithmetic.Coeff levels)) (k fuel : ) (out : Array (Array (Array ) × )) (invariant : YunInvariant z r k w repeated) (hOut : entryout.toList, (Norm.rawPolynomial levels (Factor.rawPoly levels entry.1)).IsRoot zentry.2 = r) (entry : Array (Array ) × ) :
    entry (Factor.yunAux levels w repeated k fuel out).toList(Norm.rawPolynomial levels (Factor.rawPoly levels entry.1)).IsRoot zentry.2 = r

    Soundness of the Yun loop at one root: assuming the invariant, every emitted component that vanishes at z is labelled with exactly the multiplicity r of z in the original input.

    theorem Hex.NumberTower.yunAux_rootMultiplicity_le_one {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (z : ) (r : ) (w repeated : DensePoly (Arithmetic.Coeff levels)) (k fuel : ) (out : Array (Array (Array ) × )) (invariant : YunInvariant z r k w repeated) (hOut : entryout.toList, Polynomial.rootMultiplicity z (Norm.rawPolynomial levels (Factor.rawPoly levels entry.1)) 1) (entry : Array (Array ) × ) :
    entry (Factor.yunAux levels w repeated k fuel out).toListPolynomial.rootMultiplicity z (Norm.rawPolynomial levels (Factor.rawPoly levels entry.1)) 1

    Squarefreeness of the emitted components: assuming the invariant, every component produced by the Yun loop carries z with multiplicity at most one.

    theorem Hex.NumberTower.yunAux_complete {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (z : ) (r : ) (w repeated : DensePoly (Arithmetic.Coeff levels)) (k fuel : ) (out : Array (Array (Array ) × )) (invariant : YunInvariant z r k w repeated) (hindex : k r) (hfuel : r < k + fuel) :
    entry(Factor.yunAux levels w repeated k fuel out).toList, (Norm.rawPolynomial levels (Factor.rawPoly levels entry.1)).IsRoot z entry.2 = r

    Completeness of the Yun loop at one root: with enough fuel, some emitted component vanishes at z and is labelled with its multiplicity r.

    theorem Hex.NumberTower.yunAux_positive {levels : List Level} (w repeated : DensePoly (Arithmetic.Coeff levels)) (multiplicity fuel : ) (out : Array (Array (Array ) × )) (hMultiplicity : 0 < multiplicity) (hOut : componentout.toList, 0 < (Factor.rawPoly levels component.1).natDegree 0 < component.2) (component : Array (Array ) × ) :
    component (Factor.yunAux levels w repeated multiplicity fuel out).toList0 < (Factor.rawPoly levels component.1).natDegree 0 < component.2

    The Yun loop only emits nonconstant components with positive multiplicity labels.

    theorem Hex.NumberTower.yunAux_multiplicities {levels : List Level} (w repeated : DensePoly (Arithmetic.Coeff levels)) (multiplicity fuel : ) (out : Array (Array (Array ) × )) (hpairwise : List.Pairwise (fun (a b : Array (Array ) × ) => a.2 < b.2) out.toList) (hOut : entryout.toList, entry.2 < multiplicity) :
    List.Pairwise (fun (a b : Array (Array ) × ) => a.2 < b.2) (Factor.yunAux levels w repeated multiplicity fuel out).toList entry(Factor.yunAux levels w repeated multiplicity fuel out).toList, entry.2 < multiplicity + fuel

    Multiplicity labels emitted by the Yun loop are strictly increasing and bounded by the starting counter plus the remaining fuel.

    theorem Hex.NumberTower.yunAux_monic {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (w repeated : DensePoly (Arithmetic.Coeff levels)) (multiplicity fuel : ) (out : Array (Array (Array ) × )) (hOut : entryout.toList, (Factor.rawPoly levels entry.1).leadingCoeff = 1) (entry : Array (Array ) × ) :
    entry (Factor.yunAux levels w repeated multiplicity fuel out).toList(Factor.rawPoly levels entry.1).leadingCoeff = 1

    Every component emitted by the Yun loop is monic in the executable sense: its raw leading coefficient is 1.

    The multiplicity of any single root of a nonzero complex polynomial is bounded by its degree.

    theorem Hex.NumberTower.yun_sound {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (f : Array (Array )) (hdegree : 0 < (Factor.rawPoly levels f).natDegree) (z : ) (entry : Array (Array ) × ) (hentry : entry (Factor.yunRaw levels f).toList) (hroot : (Norm.rawPolynomial levels (Factor.rawPoly levels entry.1)).IsRoot z) :

    Every root of an emitted tower Yun component is a root of the input with the component's stored multiplicity.

    theorem Hex.NumberTower.yun_complete {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (f : Array (Array )) (hdegree : 0 < (Factor.rawPoly levels f).natDegree) (z : ) (hroot : (Norm.rawPolynomial levels (Factor.rawPoly levels f)).IsRoot z) :
    entry(Factor.yunRaw levels f).toList, (Norm.rawPolynomial levels (Factor.rawPoly levels entry.1)).IsRoot z entry.2 = Polynomial.rootMultiplicity z (Norm.rawPolynomial levels (Factor.rawPoly levels f))

    Every root of a positive-degree tower polynomial occurs in an emitted Yun component at its exact multiplicity.

    theorem Hex.NumberTower.yun_rootMultiplicity_le_one {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (f : Array (Array )) (hdegree : 0 < (Factor.rawPoly levels f).natDegree) (entry : Array (Array ) × ) (hentry : entry (Factor.yunRaw levels f).toList) (z : ) :

    Every emitted Yun component has only simple roots over .

    theorem Hex.NumberTower.yun_positive {levels : List Level} (f : Array (Array )) (component : Array (Array ) × ) (hcomponent : component (Factor.yunRaw levels f).toList) :
    0 < (Factor.rawPoly levels component.1).natDegree 0 < component.2

    Every emitted tower Yun component has positive degree and positive stored multiplicity.

    theorem Hex.NumberTower.yun_multiplicities {levels : List Level} (f : Array (Array )) :
    List.Pairwise (fun (a b : Array (Array ) × ) => a.2 < b.2) (Factor.yunRaw levels f).toList

    Yun emits components in strictly increasing multiplicity order.

    theorem Hex.NumberTower.yun_monic {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (f : Array (Array )) (component : Array (Array ) × ) (hcomponent : component (Factor.yunRaw levels f).toList) :
    (Factor.rawPoly levels component.1).leadingCoeff = 1

    Every tower Yun component is monic in executable coordinates.

    theorem Hex.NumberTower.yun_squarefree {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (f : Array (Array )) (hdegree : 0 < (Factor.rawPoly levels f).natDegree) (component : Array (Array ) × ) (hcomponent : component (Factor.yunRaw levels f).toList) :
    Norm.isSquarefree levels component.1 = true

    Every tower Yun component passes the executable squarefreeness test.

    theorem Hex.NumberTower.yun_coprime {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (f : Array (Array )) (hdegree : 0 < (Factor.rawPoly levels f).natDegree) (a b : Array (Array ) × ) (ha : a (Factor.yunRaw levels f).toList) (hb : b (Factor.yunRaw levels f).toList) (hmultiplicity : a.2 < b.2) :
    ((Factor.rawPoly levels a.1).gcd (Factor.rawPoly levels b.1)).size 1

    Distinct tower Yun components pass the executable coprimality test.

    Root multiplicities scale linearly under powers of a nonzero complex polynomial.

    theorem Hex.NumberTower.rootMultiplicity_list_prod_complex (polys : List (Polynomial )) (hnonzero : Ppolys, P 0) (z : ) :

    Root multiplicities add across a product of nonzero complex polynomials.

    theorem Hex.NumberTower.rawPolynomial_polyPow {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (f : DensePoly (Arithmetic.Coeff levels)) (n : ) :

    Semantic interpretation turns the executable power Factor.polyPow into the complex polynomial power.

    theorem Hex.NumberTower.rawPolynomial_yunFold {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (components : List (Array (Array ) × )) (acc : DensePoly (Arithmetic.Coeff levels)) :
    Norm.rawPolynomial levels (List.foldl (fun (product : DensePoly (Arithmetic.Coeff levels)) (component : Array (Array ) × ) => product * Factor.polyPow (Factor.rawPoly levels component.1) component.2) acc components) = (List.map (fun (component : Array (Array ) × ) => Norm.rawPolynomial levels (Factor.rawPoly levels component.1) ^ component.2) components).prod * Norm.rawPolynomial levels acc

    The executable fold multiplying labelled component powers interprets to the product of interpreted component powers times the accumulator.

    theorem Hex.NumberTower.yunMultiplicity_sum {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (f : Array (Array )) (hdegree : 0 < (Factor.rawPoly levels f).natDegree) (z : ) (components : List (Array (Array ) × )) (hcomponents : entrycomponents, entry (Factor.yunRaw levels f).toList) (hpairwise : List.Pairwise (fun (a b : Array (Array ) × ) => a.2 < b.2) components) (hcomplete : (Norm.rawPolynomial levels (Factor.rawPoly levels f)).IsRoot zentrycomponents, (Norm.rawPolynomial levels (Factor.rawPoly levels entry.1)).IsRoot z) :
    (List.map (fun (entry : Array (Array ) × ) => entry.2 * Polynomial.rootMultiplicity z (Norm.rawPolynomial levels (Factor.rawPoly levels entry.1))) components).sum = Polynomial.rootMultiplicity z (Norm.rawPolynomial levels (Factor.rawPoly levels f))

    Multiplicity bookkeeping for the weighted Yun product: at every root z of the input, the labels of the (squarefree, strictly ordered, jointly complete) components weighted by their own multiplicities at z sum to the input's multiplicity at z.

    theorem Hex.NumberTower.yun_rawPolynomial_monic {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (f : Array (Array )) (entry : Array (Array ) × ) (hentry : entry (Factor.yunRaw levels f).toList) :
    (Norm.rawPolynomial levels (Factor.rawPoly levels entry.1)).Monic

    Every component emitted by Factor.yunRaw interprets to a monic complex polynomial.

    theorem Hex.NumberTower.yun_product {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (f : Array (Array )) (hdegree : 0 < (Factor.rawPoly levels f).natDegree) :

    The powered product of all tower Yun components reconstructs the monic input exactly.

    theorem Hex.NumberTower.checkYun_yunRaw {levels : List Level} (hvalid : LevelsValid levels) (hinjective : LevelSemantics.DenoteInjective levels) (hinv : ∀ (a : Arithmetic.Coeff levels), LevelSemantics.coeffDenote levels a⁻¹ = (LevelSemantics.coeffDenote levels a)⁻¹) (f : Array (Array )) :
    Factor.checkYun levels f (Factor.yunRaw levels f) = true

    The executable Yun decomposition always passes its full internal certificate check.