Monad operations on MvPolynomial #
This file defines two monadic operations on MvPolynomial. Given p : MvPolynomial σ R,
MvPolynomial.bind₁andMvPolynomial.join₁operate on the variable typeσ.MvPolynomial.bind₂andMvPolynomial.join₂operate on the coefficient typeR.
MvPolynomial.bind₁ f φwithf : σ → MvPolynomial τ Randφ : MvPolynomial σ R, is the polynomialφ(f 1, ..., f i, ...) : MvPolynomial τ R.MvPolynomial.join₁ φwithφ : MvPolynomial (MvPolynomial σ R) Rcollapsesφto aMvPolynomial σ R, by evaluatingφunder the mapX f ↦ fforf : MvPolynomial σ R. In other words, if you have a polynomialφin a set of variables indexed by a polynomial ring, you evaluate the polynomial in these indexing polynomials.MvPolynomial.bind₂ f φwithf : R →+* MvPolynomial σ Sandφ : MvPolynomial σ Ris theMvPolynomial σ Sobtained fromφby mapping the coefficients ofφthroughfand considering the resulting polynomial as polynomial expression inMvPolynomial σ R.MvPolynomial.join₂ φwithφ : MvPolynomial σ (MvPolynomial σ R)collapsesφto aMvPolynomial σ R, by consideringφas polynomial expression inMvPolynomial σ R.
These operations themselves have algebraic structure: MvPolynomial.bind₁
and MvPolynomial.join₁ are algebra homs and
MvPolynomial.bind₂ and MvPolynomial.join₂ are ring homs.
They interact in convenient ways with MvPolynomial.rename, MvPolynomial.map,
MvPolynomial.vars, and other polynomial operations.
Indeed, MvPolynomial.rename is the "map" operation for the (bind₁, join₁) pair,
whereas MvPolynomial.map is the "map" operation for the other pair.
Implementation notes #
We add a LawfulMonad instance for the (bind₁, join₁) pair.
The second pair cannot be instantiated as a Monad,
since it is not a monad in Type but in CommRingCat (or rather CommSemiRingCat).
bind₁ is the "left-hand side" bind operation on MvPolynomial, operating on the variable type.
Given a polynomial p : MvPolynomial σ R and a map f : σ → MvPolynomial τ R taking variables
in p to polynomials in the variable type τ, bind₁ f p replaces each variable in p with
its value under f, producing a new polynomial in τ. The coefficient type remains the same.
This operation is an algebra hom.
Equations
Instances For
bind₂ is the "right-hand side" bind operation on MvPolynomial,
operating on the coefficient type.
Given a polynomial p : MvPolynomial σ R and
a map f : R → MvPolynomial σ S taking coefficients in p to polynomials over a new ring S,
bind₂ f p replaces each coefficient in p with its value under f,
producing a new polynomial over S.
The variable type remains the same. This operation is a ring hom.
Equations
Instances For
join₁ is the monadic join operation corresponding to MvPolynomial.bind₁. Given a polynomial p
with coefficients in R whose variables are polynomials in σ with coefficients in R,
join₁ p collapses p to a polynomial with variables in σ and coefficients in R.
This operation is an algebra hom.
Equations
Instances For
join₂ is the monadic join operation corresponding to MvPolynomial.bind₂. Given a polynomial p
with variables in σ whose coefficients are polynomials in σ with coefficients in R,
join₂ p collapses p to a polynomial with variables in σ and coefficients in R.
This operation is a ring hom.
Equations
Instances For
Alias of MvPolynomial.eval₂Hom_C_eq_bind₁.
Equations
- One or more equations did not get rendered due to their size.