Trailing degree of univariate polynomials #
Main definitions #
trailingDegree p: the multiplicity ofXin the polynomialpnatTrailingDegree: a variant oftrailingDegreethat takes values in the natural numberstrailingCoeff: the coefficient at indexnatTrailingDegree p
Converts most results about degree, natDegree and leadingCoeff to results about the bottom
end of a polynomial
trailingDegree p is the multiplicity of x in the polynomial p, i.e. the smallest
X-exponent in p.
trailingDegree p = some n when p ≠ 0 and n is the smallest power of X that appears
in p, otherwise
trailingDegree 0 = ⊤.
Equations
- p.trailingDegree = p.support.min
Instances For
natTrailingDegree p forces trailingDegree p to ℕ, by defining
natTrailingDegree ⊤ = 0.
Equations
Instances For
trailingCoeff p gives the coefficient of the smallest power of X in p.
Equations
- p.trailingCoeff = p.coeff p.natTrailingDegree
Instances For
a polynomial is monic_at if its trailing coefficient is 1
Equations
- p.TrailingMonic = (p.trailingCoeff = 1)
Instances For
Alias of Polynomial.trailingCoeff_ne_zero.
Alias of Polynomial.natTrailingDegree_mem_support_of_ne_zero.
The second-lowest coefficient, or 0 for constants
Equations
- p.nextCoeffUp = if p.natTrailingDegree = 0 then 0 else p.coeff (p.natTrailingDegree + 1)