The zero monomial corresponds to the zero finitely supported function.
A monomial maps to zero exactly when it is the zero monomial.
Zero equals a mapped monomial exactly when that monomial is zero.
A unit monomial corresponds to Mathlib's single-variable exponent.
The componentwise exponent equivalence on pairs of monomials.
Equations
Instances For
The pair embedding applies the monomial equivalence to each component.
Interpret an executable sparse polynomial as a Mathlib multivariate polynomial by summing its canonical support.
Equations
- HexMvPolyMathlib.toMvPolynomial p = ∑ m ∈ p.monomials.toFinset, (MvPolynomial.monomial (HexMvPolyMathlib.monoEquiv m)) (Hex.MvPoly.coeff m p)
Instances For
The canonical-support sum used by the forward conversion.
Forward conversion preserves every coefficient.
Forward conversion preserves a single executable monomial.
Adding one executable term is addition by the corresponding Mathlib monomial, including coefficient cancellation.
Constructing from a term stream agrees with folding the corresponding Mathlib monomials. Duplicate monomials sum and cancellations disappear on both sides.
Rebuild an executable sparse polynomial from a Mathlib multivariate polynomial's finite support.
Equations
- HexMvPolyMathlib.ofMvPolynomial p = Hex.MvPoly.ofTerms (List.map (fun (d : Fin n →₀ ℕ) => (HexMvPolyMathlib.monoEquiv.symm d, MvPolynomial.coeff d p)) p.support.toList)
Instances For
Backward conversion preserves every coefficient.
Converting a Mathlib polynomial to the executable representation and back recovers the original polynomial.
Converting an executable polynomial to Mathlib and back recovers the canonical executable polynomial.
Forward conversion sends the executable zero to Mathlib zero.
Forward conversion preserves addition.
Forward conversion sends executable constants to Mathlib constants.
Forward conversion sends executable variables to Mathlib variables.
Forward conversion preserves the multiplicative identity.
Forward conversion preserves multiplication.
Forward conversion is injective.
Forward conversion is surjective.
The executable sparse representation is ring-equivalent to Mathlib's multivariate polynomials.
Equations
- HexMvPolyMathlib.equiv = { toFun := HexMvPolyMathlib.toMvPolynomial, invFun := HexMvPolyMathlib.ofMvPolynomial, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯, map_add' := ⋯ }
Instances For
The ring equivalence applies as toMvPolynomial.
The inverse ring equivalence applies as ofMvPolynomial.
Natural casts are executable constant polynomials.
Equations
- HexMvPolyMathlib.instNatCastMvPoly = { natCast := fun (k : ℕ) => Hex.MvPoly.C ↑k }
Natural scalar multiplication uses one executable constant product.
Equations
- HexMvPolyMathlib.instSMulNatMvPoly = { smul := fun (k : ℕ) (p : Hex.MvPoly n R cmp) => Hex.MvPoly.C ↑k * p }
Conversion to Mathlib preserves natural scalar multiplication.
Conversion to Mathlib preserves natural powers.
Conversion to Mathlib preserves natural-number casts.
Mathlib's commutative-semiring structure, transported along the exact representation equivalence while retaining every executable operation.
Equations
- One or more equations did not get rendered due to their size.
Forward conversion preserves coefficientwise negation.
Forward conversion preserves subtraction.
Integer casts are executable constant polynomials.
Equations
- HexMvPolyMathlib.instIntCastMvPoly = { intCast := fun (z : ℤ) => Hex.MvPoly.C ↑z }
Integer scalar multiplication uses one executable constant product.
Equations
- HexMvPolyMathlib.instSMulIntMvPoly = { smul := fun (z : ℤ) (p : Hex.MvPoly n R cmp) => Hex.MvPoly.C ↑z * p }
Conversion to Mathlib preserves integer scalar multiplication.
Conversion to Mathlib preserves integer casts.
Mathlib's commutative-ring structure, transported along the exact representation equivalence while retaining every executable operation.
Equations
- One or more equations did not get rendered due to their size.
Executable constant polynomials packaged as a ring homomorphism.
Equations
- HexMvPolyMathlib.constantHom = { toFun := Hex.MvPoly.C, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }
Instances For
The constant homomorphism builds the executable constant polynomial.
The coefficient ring acts through executable constant polynomials.
Equations
- HexMvPolyMathlib.instAlgebraMvPoly = { smul := fun (r : R) (p : Hex.MvPoly n R cmp) => Hex.MvPoly.C r * p, algebraMap := HexMvPolyMathlib.constantHom, commutes' := ⋯, smul_def' := ⋯ }
The transported algebra map is executable constant-polynomial construction.
Conversion to Mathlib preserves algebra scalar multiplication.
The exact representation equivalence as an equivalence of
R-algebras.
Equations
Instances For
The algebra equivalence applies as toMvPolynomial.
The inverse algebra equivalence applies as ofMvPolynomial.