Module docstring
{"# Multivariate polynomials
This file defines polynomial rings over a base ring (or even semiring),
with variables from a general type σ (which could be infinite).
Important definitions
Let R be a commutative ring (or a semiring) and let σ be an arbitrary
type. This file creates the type MvPolynomial σ R, which mathematicians
might denote $R[X_i : i \in σ]$. It is the type of multivariate
(a.k.a. multivariable) polynomials, with variables
corresponding to the terms in σ, and coefficients in R.
Notation
In the definitions below, we use the following notation:
σ : Type*(indexing the variables)R : Type*[CommSemiring R](the coefficients)s : σ →₀ ℕ, a function fromσtoℕwhich is zero away from a finite set. This will give rise to a monomial inMvPolynomial σ Rwhich mathematicians might callX^sa : Ri : σ, with corresponding monomialX i, often denotedX_iby mathematiciansp : MvPolynomial σ R
Definitions
MvPolynomial σ R: the type of polynomials with variables of typeσand coefficients in the commutative semiringRmonomial s a: the monomial which mathematically would be denoteda * X^sC a: the constant polynomial with valueaX i: the degree one monomial corresponding to i; mathematically this might be denotedXᵢ.coeff s p: the coefficient ofsinp.
Implementation notes
Recall that if Y has a zero, then X →₀ Y is the type of functions from X to Y with finite
support, i.e. such that only finitely many elements of X get sent to non-zero terms in Y.
The definition of MvPolynomial σ R is (σ →₀ ℕ) →₀ R; here σ →₀ ℕ denotes the space of all
monomials in the variables, and the function to R sends a monomial to its coefficient in
the polynomial being represented.
Tags
polynomial, multivariate polynomial, multivariable polynomial
"}