polynomial

polynomial α is the type of univariate polynomials over α.

Polynomials should be seen as (semi-)rings with the additional constructor X. The embedding from α is called C.

polynomial.C

C a is the constant polynomial a.

polynomial.X

X is the polynomial variable (aka indeterminant).

polynomial.coeff

coeff p n is the coefficient of X^n in p

polynomial.degree

degree p is the degree of the polynomial p, i.e. the largest X-exponent in p. degree p = some n when p 0 and n is the highest power of X that appears in p, otherwise degree 0 =.

polynomial.nat_degree

nat_degree p forces degree p to ℕ, by defining nat_degree 0 = 0.

polynomial.eval₂

Evaluate a polynomial p given a ring hom f from the scalar ring to the target and a value x for the variable in the target

polynomial.eval

eval x p is the evaluation of the polynomial p at x

polynomial.is_root

is_root p x implies x is a root of p. The evaluation of p at x is zero

polynomial.leading_coeff

leading_coeff p gives the coefficient of the highest power of X in p

polynomial.monic

a polynomial is monic if its leading coefficient is 1

polynomial.map

map f p maps a polynomial p across a ring hom f

polynomial.div_X

dix_X p return a polynomial q such that q * X + C (p.coeff 0) = p. It can be used in a semiring where the usual division algorithm is not possible

polynomial.div_by_monic

div_by_monic gives the quotient of p by a monic polynomial q.

polynomial.mod_by_monic

mod_by_monic gives the remainder of p by a monic polynomial q.

polynomial.roots

roots p noncomputably gives a finset containing all the roots of p

polynomial.nth_roots

nth_roots n a noncomputably returns the solutions to x ^ n = a

polynomial.derivative

derivative p formal derivative of the polynomial p