mathlib documentation

data.polynomial.degree.trailing_degree

Trailing degree of univariate polynomials #

Main definitions #

Converts most results about degree, nat_degree and leading_coeff to results about the bottom end of a polynomial

def polynomial.trailing_degree {R : Type u} [semiring R] (p : R[X]) :

trailing_degree p is the multiplicity of x in the polynomial p, i.e. the smallest X-exponent in p. trailing_degree p = some n when p ≠ 0 and n is the smallest power of X that appears in p, otherwise trailing_degree 0 = ⊤.

Equations
def polynomial.nat_trailing_degree {R : Type u} [semiring R] (p : R[X]) :

nat_trailing_degree p forces trailing_degree p to , by defining nat_trailing_degree ⊤ = 0.

Equations
def polynomial.trailing_coeff {R : Type u} [semiring R] (p : R[X]) :
R

trailing_coeff p gives the coefficient of the smallest power of X in p

Equations
def polynomial.trailing_monic {R : Type u} [semiring R] (p : R[X]) :
Prop

a polynomial is monic_at if its trailing coefficient is 1

Equations
@[protected, instance]
Equations
@[simp]
theorem polynomial.trailing_monic.trailing_coeff {R : Type u} [semiring R] {p : R[X]} (hp : p.trailing_monic) :
@[simp]
@[simp]
theorem polynomial.trailing_coeff_zero {R : Type u} [semiring R] :
@[simp]
theorem polynomial.trailing_degree_eq_top {R : Type u} [semiring R] {p : R[X]} :
theorem polynomial.le_trailing_degree_of_ne_zero {R : Type u} {n : } [semiring R] {p : R[X]} (h : p.coeff n 0) :
theorem polynomial.nat_trailing_degree_le_of_ne_zero {R : Type u} {n : } [semiring R] {p : R[X]} (h : p.coeff n 0) :
@[simp]
theorem polynomial.trailing_degree_monomial {R : Type u} {a : R} {n : } [semiring R] (ha : a 0) :
theorem polynomial.nat_trailing_degree_monomial {R : Type u} {a : R} {n : } [semiring R] (ha : a 0) :
@[simp]
theorem polynomial.trailing_degree_C {R : Type u} {a : R} [semiring R] (ha : a 0) :
@[simp]
@[simp]
@[simp]
@[simp]
theorem polynomial.trailing_degree_C_mul_X_pow {R : Type u} {a : R} [semiring R] (n : ) (ha : a 0) :
theorem polynomial.coeff_eq_zero_of_trailing_degree_lt {R : Type u} {n : } [semiring R] {p : R[X]} (h : n < p.trailing_degree) :
p.coeff n = 0
theorem polynomial.coeff_eq_zero_of_lt_nat_trailing_degree {R : Type u} [semiring R] {p : R[X]} {n : } (h : n < p.nat_trailing_degree) :
p.coeff n = 0
@[simp]
@[simp]
theorem polynomial.trailing_coeff_eq_zero {R : Type u} [semiring R] {p : R[X]} :
@[simp]
@[simp]
theorem polynomial.trailing_degree_neg {R : Type u} [ring R] (p : R[X]) :
@[simp]
def polynomial.next_coeff_up {R : Type u} [semiring R] (p : R[X]) :
R

The second-lowest coefficient, or 0 for constants

Equations
@[simp]
theorem polynomial.next_coeff_up_C_eq_zero {R : Type u} [semiring R] (c : R) :
theorem polynomial.ne_zero_of_trailing_degree_lt {R : Type u} [semiring R] {p : R[X]} {n : with_top } (h : p.trailing_degree < n) :
p 0