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
theorem Polynomial.trailingDegree_lt_wf {R : Type u} [Semiring R] :
WellFounded fun (p q : Polynomial R) => p.trailingDegree < q.trailingDegree
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
@[instance_reducible]
instance Polynomial.TrailingMonic.decidable {R : Type u} [Semiring R] {p : Polynomial R} [DecidableEq R] :
@[simp]
theorem Polynomial.TrailingMonic.trailingCoeff {R : Type u} [Semiring R] {p : Polynomial R} (hp : p.TrailingMonic) :
@[simp]
@[simp]
theorem Polynomial.trailingDegree_eq_natTrailingDegree {R : Type u} [Semiring R] {p : Polynomial R} (hp : p ≠ 0) :
theorem Polynomial.trailingDegree_eq_iff_natTrailingDegree_eq {R : Type u} [Semiring R] {p : Polynomial R} {n : ℕ} (hp : p ≠ 0) :
theorem Polynomial.trailingDegree_eq_iff_natTrailingDegree_eq_of_pos {R : Type u} [Semiring R] {p : Polynomial R} {n : ℕ} (hn : n ≠ 0) :
theorem Polynomial.natTrailingDegree_eq_of_trailingDegree_eq_some {R : Type u} [Semiring R] {p : Polynomial R} {n : ℕ} (h : p.trailingDegree = ↑n) :
@[simp]
theorem Polynomial.natTrailingDegree_le_trailingDegree {R : Type u} [Semiring R] {p : Polynomial R} :
theorem Polynomial.natTrailingDegree_eq_of_trailingDegree_eq {R : Type u} {S : Type v} [Semiring R] {p : Polynomial R} [Semiring S] {q : Polynomial S} (h : p.trailingDegree = q.trailingDegree) :
theorem Polynomial.trailingDegree_le_of_ne_zero {R : Type u} {n : ℕ} [Semiring R] {p : Polynomial R} (h : p.coeff n ≠ 0) :
theorem Polynomial.natTrailingDegree_le_of_ne_zero {R : Type u} {n : ℕ} [Semiring R] {p : Polynomial R} (h : p.coeff n ≠ 0) :
@[simp]
@[simp]
@[simp]
@[simp]
theorem Polynomial.trailingDegree_le_trailingDegree {R : Type u} [Semiring R] {p q : Polynomial R} (h : q.coeff p.natTrailingDegree ≠ 0) :
theorem Polynomial.trailingCoeff_eq_coeff_zero {R : Type u} [Semiring R] {p : Polynomial R} (h : p.coeff 0 ≠ 0) :
theorem Polynomial.trailingDegree_ne_of_natTrailingDegree_ne {R : Type u} [Semiring R] {p : Polynomial R} {n : ℕ} :
p.natTrailingDegree ≠ n → p.trailingDegree ≠ ↑n
theorem Polynomial.natTrailingDegree_le_of_trailingDegree_le {R : Type u} [Semiring R] {p : Polynomial R} {n : ℕ} {hp : p ≠ 0} (H : ↑n ≤ p.trailingDegree) :
theorem Polynomial.natTrailingDegree_le_natTrailingDegree {R : Type u} [Semiring R] {p q : Polynomial R} (hq : q ≠ 0) (hpq : p.trailingDegree ≤ q.trailingDegree) :
@[simp]
theorem Polynomial.natTrailingDegree_monomial {R : Type u} {a : R} {n : ℕ} [Semiring R] (ha : a ≠ 0) :
@[simp]
@[simp]
@[simp]
@[simp]
theorem Polynomial.coeff_eq_zero_of_lt_trailingDegree {R : Type u} {n : ℕ} [Semiring R] {p : Polynomial R} (h : ↑n < p.trailingDegree) :
theorem Polynomial.coeff_eq_zero_of_lt_natTrailingDegree {R : Type u} [Semiring R] {p : Polynomial R} {n : ℕ} (h : n < p.natTrailingDegree) :
@[simp]
theorem Polynomial.coeff_natTrailingDegree_pred_eq_zero {R : Type u} [Semiring R] {p : Polynomial R} {hp : 0 < ↑p.natTrailingDegree} :
@[simp]
theorem Polynomial.natTrailingDegree_mem_support_of_nonzero {R : Type u} [Semiring R] {p : Polynomial R} :
p ≠ 0 → p.natTrailingDegree ∈ p.support
theorem Polynomial.natTrailingDegree_le_of_mem_supp {R : Type u} [Semiring R] {p : Polynomial R} (a : ℕ) :
a ∈ p.support → p.natTrailingDegree ≤ a
theorem Polynomial.natTrailingDegree_eq_support_min' {R : Type u} [Semiring R] {p : Polynomial R} (h : p ≠ 0) :
theorem Polynomial.le_natTrailingDegree {R : Type u} {n : ℕ} [Semiring R] {p : Polynomial R} (hp : p ≠ 0) (hn : ∀ m < n, p.coeff m = 0) :
theorem Polynomial.natTrailingDegree_mul_X_pow {R : Type u} [Semiring R] {p : Polynomial R} (hp : p ≠ 0) (n : ℕ) :
theorem Polynomial.le_natTrailingDegree_mul {R : Type u} [Semiring R] {p q : Polynomial R} (h : p * q ≠ 0) :
theorem Polynomial.coeff_mul_natTrailingDegree_add_natTrailingDegree {R : Type u} [Semiring R] {p q : Polynomial R} :
theorem Polynomial.trailingDegree_mul' {R : Type u} [Semiring R] {p q : Polynomial R} (h : p.trailingCoeff * q.trailingCoeff ≠ 0) :
theorem Polynomial.natTrailingDegree_mul' {R : Type u} [Semiring R] {p q : Polynomial R} (h : p.trailingCoeff * q.trailingCoeff ≠ 0) :
theorem Polynomial.natTrailingDegree_mul {R : Type u} [Semiring R] {p q : Polynomial R} [NoZeroDivisors R] (hp : p ≠ 0) (hq : q ≠ 0) :
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
The second-lowest coefficient, or 0 for constants
Equations
- p.nextCoeffUp = if p.natTrailingDegree = 0 then 0 else p.coeff (p.natTrailingDegree + 1)
Instances For
@[simp]
theorem Polynomial.nextCoeffUp_of_constantCoeff_eq_zero {R : Type u} [Semiring R] (p : Polynomial R) (hp : p.coeff 0 = 0) :
theorem Polynomial.coeff_natTrailingDegree_eq_zero_of_trailingDegree_lt {R : Type u} [Semiring R] {p q : Polynomial R} (h : p.trailingDegree < q.trailingDegree) :
theorem Polynomial.ne_zero_of_trailingDegree_lt {R : Type u} [Semiring R] {p : Polynomial R} {n : ℕ∞} (h : p.trailingDegree < n) :
theorem Polynomial.natTrailingDegree_eq_zero_of_constantCoeff_ne_zero {R : Type u} [Semiring R] {p : Polynomial R} (h : constantCoeff p ≠ 0) :
theorem Polynomial.Monic.eq_X_pow_iff_natDegree_le_natTrailingDegree {R : Type u} [Semiring R] {p : Polynomial R} (h₁ : p.Monic) :
theorem Polynomial.Monic.eq_X_pow_iff_natTrailingDegree_eq_natDegree {R : Type u} [Semiring R] {p : Polynomial R} (h₁ : p.Monic) :