File: Mathlib/Algebra/Polynomial/Degree/TrailingDegree.lean

full_name: Polynomial.trailingDegree
code: /-- `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 = ⊤`. -/
def trailingDegree (p : R[X]) : ℕ∞ 
goal: ℕ∞

full_name: Polynomial.trailingDegree_lt_wf
code: theorem trailingDegree_lt_wf : WellFounded fun p q : R[X] => trailingDegree p < trailingDegree q 
goal: WellFounded fun p q => p.trailingDegree < q.trailingDegree

full_name: Polynomial.natTrailingDegree
code: /-- `natTrailingDegree p` forces `trailingDegree p` to `ℕ`, by defining
`natTrailingDegree ⊤ = 0`. -/
def natTrailingDegree (p : R[X]) : ℕ 
goal: ℕ

full_name: Polynomial.trailingCoeff
code: /-- `trailingCoeff p` gives the coefficient of the smallest power of `X` in `p`-/
def trailingCoeff (p : R[X]) : R 
goal: R

full_name: Polynomial.TrailingMonic
code: /-- a polynomial is `monic_at` if its trailing coefficient is 1 -/
def TrailingMonic (p : R[X]) 
goal: Prop

full_name: Polynomial.TrailingMonic.def
code: theorem TrailingMonic.def : TrailingMonic p ↔ trailingCoeff p = 1 
goal: p.TrailingMonic ↔ p.trailingCoeff = 1

full_name: Polynomial.TrailingMonic.decidable
code: instance TrailingMonic.decidable [DecidableEq R] : Decidable (TrailingMonic p) 
goal: Decidable p.TrailingMonic

full_name: Polynomial.TrailingMonic.trailingCoeff
code: @[simp]
theorem TrailingMonic.trailingCoeff {p : R[X]} (hp : p.TrailingMonic) : trailingCoeff p = 1 
goal: p.trailingCoeff = 1

full_name: Polynomial.trailingDegree_zero
code: @[simp]
theorem trailingDegree_zero : trailingDegree (0 : R[X]) = ⊤ 
goal: Polynomial.trailingDegree 0 = ⊤

full_name: Polynomial.trailingCoeff_zero
code: @[simp]
theorem trailingCoeff_zero : trailingCoeff (0 : R[X]) = 0 
goal: Polynomial.trailingCoeff 0 = 0

full_name: Polynomial.natTrailingDegree_zero
code: @[simp]
theorem natTrailingDegree_zero : natTrailingDegree (0 : R[X]) = 0 
goal: Polynomial.natTrailingDegree 0 = 0

full_name: Polynomial.trailingDegree_eq_top
code: @[simp]
theorem trailingDegree_eq_top : trailingDegree p = ⊤ ↔ p = 0 
goal: p.trailingDegree = ⊤ ↔ p = 0

full_name: Polynomial.trailingDegree_eq_natTrailingDegree
code: theorem trailingDegree_eq_natTrailingDegree (hp : p ≠ 0) :
    trailingDegree p = (natTrailingDegree p : ℕ∞) 
goal: p.trailingDegree = ↑p.natTrailingDegree

full_name: Polynomial.trailingDegree_eq_iff_natTrailingDegree_eq
code: theorem trailingDegree_eq_iff_natTrailingDegree_eq {p : R[X]} {n : ℕ} (hp : p ≠ 0) :
    p.trailingDegree = n ↔ p.natTrailingDegree = n 
goal: p.trailingDegree = ↑n ↔ p.natTrailingDegree = n

full_name: Polynomial.trailingDegree_eq_iff_natTrailingDegree_eq_of_pos
code: theorem trailingDegree_eq_iff_natTrailingDegree_eq_of_pos {p : R[X]} {n : ℕ} (hn : n ≠ 0) :
    p.trailingDegree = n ↔ p.natTrailingDegree = n 
goal: p.trailingDegree = ↑n ↔ p.natTrailingDegree = n

full_name: Polynomial.natTrailingDegree_eq_of_trailingDegree_eq_some
code: theorem natTrailingDegree_eq_of_trailingDegree_eq_some {p : R[X]} {n : ℕ}
    (h : trailingDegree p = n) : natTrailingDegree p = n 
goal: p.natTrailingDegree = n

full_name: Polynomial.natTrailingDegree_le_trailingDegree
code: @[simp]
theorem natTrailingDegree_le_trailingDegree : ↑(natTrailingDegree p) ≤ trailingDegree p 
goal: ↑p.natTrailingDegree ≤ p.trailingDegree

full_name: Polynomial.natTrailingDegree_eq_of_trailingDegree_eq
code: theorem natTrailingDegree_eq_of_trailingDegree_eq [Semiring S] {q : S[X]}
    (h : trailingDegree p = trailingDegree q) : natTrailingDegree p = natTrailingDegree q 
goal: p.natTrailingDegree = q.natTrailingDegree

full_name: Polynomial.trailingDegree_le_of_ne_zero
code: theorem trailingDegree_le_of_ne_zero (h : coeff p n ≠ 0) : trailingDegree p ≤ n 
goal: p.trailingDegree ≤ ↑n

full_name: Polynomial.natTrailingDegree_le_of_ne_zero
code: theorem natTrailingDegree_le_of_ne_zero (h : coeff p n ≠ 0) : natTrailingDegree p ≤ n 
goal: p.natTrailingDegree ≤ n

full_name: Polynomial.coeff_natTrailingDegree_eq_zero
code: @[simp] lemma coeff_natTrailingDegree_eq_zero : coeff p p.natTrailingDegree = 0 ↔ p = 0 
goal: p.coeff p.natTrailingDegree = 0 ↔ p = 0

full_name: Polynomial.coeff_natTrailingDegree_ne_zero
code: lemma coeff_natTrailingDegree_ne_zero : coeff p p.natTrailingDegree ≠ 0 ↔ p ≠ 0 
goal: p.coeff p.natTrailingDegree ≠ 0 ↔ p ≠ 0

full_name: Polynomial.trailingDegree_eq_zero
code: @[simp]
lemma trailingDegree_eq_zero : trailingDegree p = 0 ↔ coeff p 0 ≠ 0 
goal: p.trailingDegree = 0 ↔ p.coeff 0 ≠ 0

full_name: Polynomial.natTrailingDegree_eq_zero
code: @[simp] lemma natTrailingDegree_eq_zero : natTrailingDegree p = 0 ↔ p = 0 ∨ coeff p 0 ≠ 0 
goal: p.natTrailingDegree = 0 ↔ p = 0 ∨ p.coeff 0 ≠ 0

full_name: Polynomial.natTrailingDegree_ne_zero
code: lemma natTrailingDegree_ne_zero : natTrailingDegree p ≠ 0 ↔ p ≠ 0 ∧ coeff p 0 = 0 
goal: p.natTrailingDegree ≠ 0 ↔ p ≠ 0 ∧ p.coeff 0 = 0

full_name: Polynomial.trailingDegree_ne_zero
code: lemma trailingDegree_ne_zero : trailingDegree p ≠ 0 ↔ coeff p 0 = 0 
goal: p.trailingDegree ≠ 0 ↔ p.coeff 0 = 0

full_name: Polynomial.trailingDegree_le_trailingDegree
code: @[simp] theorem trailingDegree_le_trailingDegree (h : coeff q (natTrailingDegree p) ≠ 0) :
    trailingDegree q ≤ trailingDegree p 
goal: q.trailingDegree ≤ p.trailingDegree

full_name: Polynomial.trailingDegree_ne_of_natTrailingDegree_ne
code: theorem trailingDegree_ne_of_natTrailingDegree_ne {n : ℕ} :
    p.natTrailingDegree ≠ n → trailingDegree p ≠ n 
goal: p.natTrailingDegree ≠ n → p.trailingDegree ≠ ↑n

full_name: Polynomial.natTrailingDegree_le_of_trailingDegree_le
code: theorem natTrailingDegree_le_of_trailingDegree_le {n : ℕ} {hp : p ≠ 0}
    (H : (n : ℕ∞) ≤ trailingDegree p) : n ≤ natTrailingDegree p 
goal: n ≤ p.natTrailingDegree

full_name: Polynomial.natTrailingDegree_le_natTrailingDegree
code: theorem natTrailingDegree_le_natTrailingDegree (hq : q ≠ 0)
    (hpq : p.trailingDegree ≤ q.trailingDegree) : p.natTrailingDegree ≤ q.natTrailingDegree 
goal: p.natTrailingDegree ≤ q.natTrailingDegree

full_name: Polynomial.trailingDegree_monomial
code: @[simp]
theorem trailingDegree_monomial (ha : a ≠ 0) : trailingDegree (monomial n a) = n 
goal: ((Polynomial.monomial n) a).trailingDegree = ↑n

full_name: Polynomial.natTrailingDegree_monomial
code: theorem natTrailingDegree_monomial (ha : a ≠ 0) : natTrailingDegree (monomial n a) = n 
goal: ((Polynomial.monomial n) a).natTrailingDegree = n

full_name: Polynomial.natTrailingDegree_monomial_le
code: theorem natTrailingDegree_monomial_le : natTrailingDegree (monomial n a) ≤ n 
goal: ((Polynomial.monomial n) a).natTrailingDegree ≤ n

full_name: Polynomial.le_trailingDegree_monomial
code: theorem le_trailingDegree_monomial : ↑n ≤ trailingDegree (monomial n a) 
goal: ↑n ≤ ((Polynomial.monomial n) a).trailingDegree

full_name: Polynomial.trailingDegree_C
code: @[simp]
theorem trailingDegree_C (ha : a ≠ 0) : trailingDegree (C a) = (0 : ℕ∞) 
goal: (Polynomial.C a).trailingDegree = 0

full_name: Polynomial.le_trailingDegree_C
code: theorem le_trailingDegree_C : (0 : ℕ∞) ≤ trailingDegree (C a) 
goal: 0 ≤ (Polynomial.C a).trailingDegree

full_name: Polynomial.trailingDegree_one_le
code: theorem trailingDegree_one_le : (0 : ℕ∞) ≤ trailingDegree (1 : R[X]) 
goal: 0 ≤ Polynomial.trailingDegree 1

full_name: Polynomial.natTrailingDegree_C
code: @[simp]
theorem natTrailingDegree_C (a : R) : natTrailingDegree (C a) = 0 
goal: (Polynomial.C a).natTrailingDegree = 0

full_name: Polynomial.natTrailingDegree_one
code: @[simp]
theorem natTrailingDegree_one : natTrailingDegree (1 : R[X]) = 0 
goal: Polynomial.natTrailingDegree 1 = 0

full_name: Polynomial.natTrailingDegree_natCast
code: @[simp]
theorem natTrailingDegree_natCast (n : ℕ) : natTrailingDegree (n : R[X]) = 0 
goal: (↑n).natTrailingDegree = 0

full_name: Polynomial.trailingDegree_C_mul_X_pow
code: @[simp]
theorem trailingDegree_C_mul_X_pow (n : ℕ) (ha : a ≠ 0) : trailingDegree (C a * X ^ n) = n 
goal: (Polynomial.C a * Polynomial.X ^ n).trailingDegree = ↑n

full_name: Polynomial.le_trailingDegree_C_mul_X_pow
code: theorem le_trailingDegree_C_mul_X_pow (n : ℕ) (a : R) :
    (n : ℕ∞) ≤ trailingDegree (C a * X ^ n) 
goal: ↑n ≤ (Polynomial.C a * Polynomial.X ^ n).trailingDegree

full_name: Polynomial.coeff_eq_zero_of_lt_trailingDegree
code: theorem coeff_eq_zero_of_lt_trailingDegree (h : (n : ℕ∞) < trailingDegree p) : coeff p n = 0 
goal: p.coeff n = 0

full_name: Polynomial.coeff_eq_zero_of_lt_natTrailingDegree
code: theorem coeff_eq_zero_of_lt_natTrailingDegree {p : R[X]} {n : ℕ} (h : n < p.natTrailingDegree) :
    p.coeff n = 0 
goal: p.coeff n = 0

full_name: Polynomial.coeff_natTrailingDegree_pred_eq_zero
code: @[simp]
theorem coeff_natTrailingDegree_pred_eq_zero {p : R[X]} {hp : (0 : ℕ∞) < natTrailingDegree p} :
    p.coeff (p.natTrailingDegree - 1) = 0 
goal: p.coeff (p.natTrailingDegree - 1) = 0

full_name: Polynomial.le_trailingDegree_X_pow
code: theorem le_trailingDegree_X_pow (n : ℕ) : (n : ℕ∞) ≤ trailingDegree (X ^ n : R[X]) 
goal: ↑n ≤ (Polynomial.X ^ n).trailingDegree

full_name: Polynomial.le_trailingDegree_X
code: theorem le_trailingDegree_X : (1 : ℕ∞) ≤ trailingDegree (X : R[X]) 
goal: 1 ≤ Polynomial.X.trailingDegree

full_name: Polynomial.natTrailingDegree_X_le
code: theorem natTrailingDegree_X_le : (X : R[X]).natTrailingDegree ≤ 1 
goal: Polynomial.X.natTrailingDegree ≤ 1

full_name: Polynomial.trailingCoeff_eq_zero
code: @[simp]
theorem trailingCoeff_eq_zero : trailingCoeff p = 0 ↔ p = 0 
goal: p.trailingCoeff = 0 ↔ p = 0

full_name: Polynomial.trailingCoeff_nonzero_iff_nonzero
code: theorem trailingCoeff_nonzero_iff_nonzero : trailingCoeff p ≠ 0 ↔ p ≠ 0 
goal: p.trailingCoeff ≠ 0 ↔ p ≠ 0

full_name: Polynomial.natTrailingDegree_mem_support_of_nonzero
code: theorem natTrailingDegree_mem_support_of_nonzero : p ≠ 0 → natTrailingDegree p ∈ p.support 
goal: p ≠ 0 → p.natTrailingDegree ∈ p.support

full_name: Polynomial.natTrailingDegree_le_of_mem_supp
code: theorem natTrailingDegree_le_of_mem_supp (a : ℕ) : a ∈ p.support → natTrailingDegree p ≤ a 
goal: a ∈ p.support → p.natTrailingDegree ≤ a

full_name: Polynomial.natTrailingDegree_eq_support_min'
code: theorem natTrailingDegree_eq_support_min' (h : p ≠ 0) :
    natTrailingDegree p = p.support.min' (nonempty_support_iff.mpr h) 
goal: p.natTrailingDegree = p.support.min' ⋯

full_name: Polynomial.le_natTrailingDegree
code: theorem le_natTrailingDegree (hp : p ≠ 0) (hn : ∀ m < n, p.coeff m = 0) :
    n ≤ p.natTrailingDegree 
goal: n ≤ p.natTrailingDegree

full_name: Polynomial.natTrailingDegree_le_natDegree
code: theorem natTrailingDegree_le_natDegree (p : R[X]) : p.natTrailingDegree ≤ p.natDegree 
goal: p.natTrailingDegree ≤ p.natDegree

full_name: Polynomial.natTrailingDegree_mul_X_pow
code: theorem natTrailingDegree_mul_X_pow {p : R[X]} (hp : p ≠ 0) (n : ℕ) :
    (p * X ^ n).natTrailingDegree = p.natTrailingDegree + n 
goal: (p * Polynomial.X ^ n).natTrailingDegree = p.natTrailingDegree + n

full_name: Polynomial.le_trailingDegree_mul
code: theorem le_trailingDegree_mul : p.trailingDegree + q.trailingDegree ≤ (p * q).trailingDegree 
goal: p.trailingDegree + q.trailingDegree ≤ (p * q).trailingDegree

full_name: Polynomial.le_natTrailingDegree_mul
code: theorem le_natTrailingDegree_mul (h : p * q ≠ 0) :
    p.natTrailingDegree + q.natTrailingDegree ≤ (p * q).natTrailingDegree 
goal: p.natTrailingDegree + q.natTrailingDegree ≤ (p * q).natTrailingDegree

full_name: Polynomial.coeff_mul_natTrailingDegree_add_natTrailingDegree
code: theorem coeff_mul_natTrailingDegree_add_natTrailingDegree : (p * q).coeff
    (p.natTrailingDegree + q.natTrailingDegree) = p.trailingCoeff * q.trailingCoeff 
goal: (p * q).coeff (p.natTrailingDegree + q.natTrailingDegree) = p.trailingCoeff * q.trailingCoeff

full_name: Polynomial.trailingDegree_mul'
code: theorem trailingDegree_mul' (h : p.trailingCoeff * q.trailingCoeff ≠ 0) :
    (p * q).trailingDegree = p.trailingDegree + q.trailingDegree 
goal: (p * q).trailingDegree = p.trailingDegree + q.trailingDegree

full_name: Polynomial.natTrailingDegree_mul'
code: theorem natTrailingDegree_mul' (h : p.trailingCoeff * q.trailingCoeff ≠ 0) :
    (p * q).natTrailingDegree = p.natTrailingDegree + q.natTrailingDegree 
goal: (p * q).natTrailingDegree = p.natTrailingDegree + q.natTrailingDegree

full_name: Polynomial.natTrailingDegree_mul
code: theorem natTrailingDegree_mul [NoZeroDivisors R] (hp : p ≠ 0) (hq : q ≠ 0) :
    (p * q).natTrailingDegree = p.natTrailingDegree + q.natTrailingDegree 
goal: (p * q).natTrailingDegree = p.natTrailingDegree + q.natTrailingDegree

full_name: Polynomial.trailingDegree_one
code: @[simp]
theorem trailingDegree_one : trailingDegree (1 : R[X]) = (0 : ℕ∞) 
goal: Polynomial.trailingDegree 1 = 0

full_name: Polynomial.trailingDegree_X
code: @[simp]
theorem trailingDegree_X : trailingDegree (X : R[X]) = 1 
goal: Polynomial.X.trailingDegree = 1

full_name: Polynomial.natTrailingDegree_X
code: @[simp]
theorem natTrailingDegree_X : (X : R[X]).natTrailingDegree = 1 
goal: Polynomial.X.natTrailingDegree = 1

full_name: Polynomial.trailingDegree_X_pow
code: @[simp]
lemma trailingDegree_X_pow (n : ℕ) :
    (X ^ n : R[X]).trailingDegree = n 
goal: (Polynomial.X ^ n).trailingDegree = ↑n

full_name: Polynomial.natTrailingDegree_X_pow
code: @[simp]
lemma natTrailingDegree_X_pow (n : ℕ) :
    (X ^ n : R[X]).natTrailingDegree = n 
goal: (Polynomial.X ^ n).natTrailingDegree = n

full_name: Polynomial.trailingDegree_neg
code: @[simp]
theorem trailingDegree_neg (p : R[X]) : trailingDegree (-p) = trailingDegree p 
goal: (-p).trailingDegree = p.trailingDegree

full_name: Polynomial.natTrailingDegree_neg
code: @[simp]
theorem natTrailingDegree_neg (p : R[X]) : natTrailingDegree (-p) = natTrailingDegree p 
goal: (-p).natTrailingDegree = p.natTrailingDegree

full_name: Polynomial.natTrailingDegree_intCast
code: @[simp]
theorem natTrailingDegree_intCast (n : ℤ) : natTrailingDegree (n : R[X]) = 0 
goal: (↑n).natTrailingDegree = 0

full_name: Polynomial.nextCoeffUp
code: /-- The second-lowest coefficient, or 0 for constants -/
def nextCoeffUp (p : R[X]) : R 
goal: R

full_name: Polynomial.nextCoeffUp_zero
code: @[simp] lemma nextCoeffUp_zero : nextCoeffUp (0 : R[X]) = 0 
goal: Polynomial.nextCoeffUp 0 = 0

full_name: Polynomial.nextCoeffUp_C_eq_zero
code: @[simp]
theorem nextCoeffUp_C_eq_zero (c : R) : nextCoeffUp (C c) = 0 
goal: (Polynomial.C c).nextCoeffUp = 0

full_name: Polynomial.nextCoeffUp_of_constantCoeff_eq_zero
code: theorem nextCoeffUp_of_constantCoeff_eq_zero (p : R[X]) (hp : coeff p 0 = 0) :
    nextCoeffUp p = p.coeff (p.natTrailingDegree + 1) 
goal: p.nextCoeffUp = p.coeff (p.natTrailingDegree + 1)

full_name: Polynomial.coeff_natTrailingDegree_eq_zero_of_trailingDegree_lt
code: theorem coeff_natTrailingDegree_eq_zero_of_trailingDegree_lt
    (h : trailingDegree p < trailingDegree q) : coeff q (natTrailingDegree p) = 0 
goal: q.coeff p.natTrailingDegree = 0

full_name: Polynomial.ne_zero_of_trailingDegree_lt
code: theorem ne_zero_of_trailingDegree_lt {n : ℕ∞} (h : trailingDegree p < n) : p ≠ 0 
goal: p ≠ 0

full_name: Polynomial.natTrailingDegree_eq_zero_of_constantCoeff_ne_zero
code: lemma natTrailingDegree_eq_zero_of_constantCoeff_ne_zero (h : constantCoeff p ≠ 0) :
    p.natTrailingDegree = 0 
goal: p.natTrailingDegree = 0

full_name: Polynomial.Monic.eq_X_pow_iff_natDegree_le_natTrailingDegree
code: lemma eq_X_pow_iff_natDegree_le_natTrailingDegree (h₁ : p.Monic) :
    p = X ^ p.natDegree ↔ p.natDegree ≤ p.natTrailingDegree 
goal: p = Polynomial.X ^ p.natDegree ↔ p.natDegree ≤ p.natTrailingDegree

full_name: Polynomial.Monic.eq_X_pow_iff_natTrailingDegree_eq_natDegree
code: lemma eq_X_pow_iff_natTrailingDegree_eq_natDegree (h₁ : p.Monic) :
    p = X ^ p.natDegree ↔ p.natTrailingDegree = p.natDegree 
goal: p = Polynomial.X ^ p.natDegree ↔ p.natTrailingDegree = p.natDegree