Documentation

HexBerlekampZassenhausMathlib.FactorSoundness

Every polynomial factor emitted by the default executable factorization is irreducible in the executable Hex.ZPoly sense.

Every polynomial factor emitted by the default executable factorization is irreducible after transport to Polynomial.

Every polynomial factor emitted by the default executable factorization has positive leading coefficient.

The normalized irreducible factorization produced for a nonzero polynomial.

The product reconstructs the input. Every recorded factor is primitive, has positive leading coefficient, and is irreducible after transport to Polynomial; multiplicities are positive; distinct entries are not associates; and the scalar is the signed content of the input.

The hypothesis f ≠ 0 is necessary because the factorization of zero is degenerate: its scalar and product are zero, while zero is not primitive.

The sign-normalization side condition for the default executable factorization: every recorded polynomial factor is fixed by normalizeFactorSign. This is the hψ_norm clause that uniqueness/checker callers would otherwise reconstruct from the executable Hex.factorize_entry_normalizeFactorSign_id.

The nonconstant side condition for the default executable factorization: every recorded polynomial factor has positive degree. This is the hψ_nonconst clause uniqueness/checker callers would otherwise reconstruct.

Positive degree is not derivable from shouldRecordPolynomialFactor alone; a constant like Hex.DensePoly.C 2 passes the recording filter, has positive leading coefficient, and is sign-normalized. The constant case is excluded by primitivity (content 1 forces a constant to be ±1), so this carries the f ≠ 0 side condition that Hex.factorize_entries_primitive_of_ne_zero needs (the self-certifying path). The constant-exclusion argument itself is Hex.degree_pos_of_primitive_norm_record.

theorem HexBerlekampZassenhausMathlib.factorize_unique_of_product (f : Hex.ZPoly) (φ : Hex.Factorization) (hf_ne : f 0) (hproduct : φ.product = f) (hφ_norm : entryφ.factors, Hex.normalizeFactorSign entry.1 = entry.1) (hψ_norm : entryf.factorize.factors, Hex.normalizeFactorSign entry.1 = entry.1) (hφ_nonconst : entryφ.factors, 0 < Hex.DensePoly.natDegree entry.1) (hψ_nonconst : entryf.factorize.factors, 0 < Hex.DensePoly.natDegree entry.1) (hirr : entryφ.factors, entry.1.Irreducible) :

Uniqueness specialised against the default executable factorization, so callers only provide the competing product, irreducibility, sign-normalization, and nonconstant-factor facts, plus that the input is nonzero. The default factorization's own well-formedness is supplied by factorize_irreducible_of_nonUnit and its sibling lemmas.

theorem HexBerlekampZassenhausMathlib.factorize_unique_of_product_default (f : Hex.ZPoly) (φ : Hex.Factorization) (hf_ne : f 0) (hproduct : φ.product = f) (hφ_norm : entryφ.factors, Hex.normalizeFactorSign entry.1 = entry.1) (hφ_nonconst : entryφ.factors, 0 < Hex.DensePoly.natDegree entry.1) (hirr : entryφ.factors, entry.1.Irreducible) :

Default-specialised sibling of factorize_unique_of_product that discharges the default factorization's own sign-normalization and nonconstant side conditions internally, so callers no longer supply hψ_norm or hψ_nonconst. The nonconstant clause needs only f ≠ 0 (the same hf_ne already supplied), via factorize_entries_degree_pos; hψ_norm is discharged unconditionally.

The executable irreducibility checker Hex.ZPoly.isIrreducible agrees with the Hex.ZPoly.Irreducible class.

isIrreducible runs factorize and checks the result is a single primitive factor of multiplicity 1 (with a ±1 scalar), so this is exactly the statement that the default factorization is a correct irreducible factorization. The degree-0 (constant) arm is the elementary-primality characterisation (irreducible_C_of_isNatPrime / isNatPrime_natAbs_of_irreducible_C); the positive-degree arm composes factorize_irreducible_of_nonUnit (forward) with factorize_unique_of_product_default (backward, which pins the factor count to the normalizedFactors cardinality).

@[simp]

The executable factorization predicate agrees with Mathlib irreducibility over Polynomial.

@[instance_reducible]

Mathlib irreducibility over Polynomial is decidable through the executable Berlekamp-Zassenhaus factorization surface.

Equations