Substituting any q into the zero polynomial gives 0.
Substituting q into a constant polynomial leaves the constant fixed.
Substituting q into X returns q; X is the identity of
composition.
Composing the constant polynomial 1 with any q yields 1: the
multiplicative identity of FpPoly is fixed by substitution. This is the
base case for composing an iterated product of linear factors (see
compose_primeFieldLinearProduct).
DensePoly.compose f q agrees with the iterative Horner form.
The constant embedding C is additive: C (a + b) = C a + C b.
The constant embedding C turns a difference of scalars into a
difference of constant polynomials. Used to push coefficient subtractions
through products such as f * (X - C c).
The constant embedding C turns a product of scalars into a product
of constant polynomials. Used to normalise constant coefficients when
expanding products of linear factors.
Substituting w into a monomial gives the coefficient times a power of w.
This is the monomial case that Polynomial.induction_on' asks for on the
Mathlib side, so it is what lets a Mathlib ring homomorphism be identified with
the executable substitution.
compose (linearPow X k) w = linearPow w k.
Recursive sum form of compose. The compose-power-sum
Σ_{k=base}^{base+n-1} C(coeff k) · linearPow w k recursively builds up
the polynomial substitution: each step adds a single
C(coeff base) · linearPow w base term and recurses with base + 1.
This shape is matched by Berlekamp's matrix-action sum after replacing
linearPow w with the reduced powModMonic columns.
Equations
- Hex.FpPoly.composeCoeffPowerSumUpTo coeff 0 x✝¹ x✝ = 0
- Hex.FpPoly.composeCoeffPowerSumUpTo coeff n.succ x✝¹ x✝ = Hex.DensePoly.C (coeff x✝¹) * x✝.linearPow x✝¹ + Hex.FpPoly.composeCoeffPowerSumUpTo coeff n (x✝¹ + 1) x✝
Instances For
The local FpPoly power-sum accumulator built from linearPow agrees
with the shared DensePoly.composeCoeffPowerSumUpTo. Callers use this to
transfer the explicit compose-as-sum characterization onto the DensePoly
API that downstream files import.
compose f w equals composeCoeffPowerSumUpTo evaluated up to any
upper bound that is at least f.size. Out-of-range coefficients of f
vanish, so the recursion safely extends past f.size.
compose distributes over subtraction.
Substitution is additive. Follows from Hex.FpPoly.compose_sub, since
f + h = f - (0 - h) and substitution fixes zero.
Narrow specialisation needed by the witness-substitution caller:
substituting w for X in a - X yields compose a w - w.
The linearPow X k - X substitution: substituting w
for X in linearPow X k - X yields linearPow w k - w.
Composition distributes over multiplication by a linear factor:
substituting w into a * (X - C c) gives (compose a w) * (w - C c).
This is the inductive step for composing an iterated product of linear
factors ∏ (X - C cᵢ) (see compose_foldl_X_sub_C).
Substituting w into a left-fold product of linear factors
∏ (X - C c) equals the same fold with each X replaced by w. The
transport law underlying composition of the prime-field linear product.
Specialisation to the canonical prime-field linear product starting from
init = 1: substituting w into the variable form gives the witness form.
A strictly positive power of the zero polynomial is zero. This discharges the vanishing-coefficient case when substituting into the compose power-sum form for the Frobenius identity.
Substituting the polynomial indeterminate into w returns w.
Together with Hex.FpPoly.compose_X, this says that FpPoly.X is the
two-sided identity for polynomial composition.
Compose-form Frobenius: substituting linearPow X p for X in w
yields linearPow w p, over F_p. This is Freshman's dream packaged
through the polynomial composition surface: viewed as
w = ∑_i a_i X^i, the right-hand side equals ∑_i a_i X^(p·i).