The executable sparse representation is ring-equivalent to the executable dense representation, by the core library's conversions.
Equations
- HexSparsePolyMathlib.denseEquiv = { toFun := Hex.SparsePoly.toDense, invFun := Hex.SparsePoly.ofDense, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯, map_add' := ⋯ }
Instances For
The ring isomorphism denseEquiv is computed by
Hex.SparsePoly.toDense in the forward direction.
The inverse of denseEquiv is computed by
Hex.SparsePoly.ofDense.
The executable sparse representation is ring-equivalent to Mathlib polynomials.
Instances For
The ring isomorphism equiv is computed by converting to the
dense representation and reading it as a Mathlib polynomial. Not simp:
the correspondence lemmas below are keyed on equiv s directly, and
unfolding first would preempt them.
The inverse of equiv rebuilds the dense representation and
converts it to canonical sparse form.
The two equivalences agree across the dense conversion.
equiv preserves coefficients; the identification is exact,
coefficient by coefficient.
The stored exponents of the canonical representation are exactly
Mathlib's support: the headline sense in which the representation is
sparse.
Evaluation corresponds: Mathlib evaluation of the image is the executable gap-Horner evaluation.
Differentiation corresponds: Mathlib's derivative of the image is the image of the executable derivative.
Composition corresponds: Mathlib's comp of the images is the
image of the executable composition.
Exponent substitution corresponds to composition with X ^ k.
Argument scaling corresponds to composition with C a * X.
Monomials correspond.
Constants correspond.
The variable corresponds.
The executable degree corresponds to Mathlib's natDegree, with
the zero polynomial mapping to 0.
The leading coefficient corresponds.
Monicity corresponds.