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

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

full_name: Polynomial.supDegree_eq_degree
code: theorem supDegree_eq_degree (p : R[X]) : p.toFinsupp.supDegree WithBot.some = p.degree 
goal: AddMonoidAlgebra.supDegree WithBot.some p.toFinsupp = p.degree

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

full_name: Polynomial.instWellFoundedRelation
code: instance : WellFoundedRelation R[X] 
goal: WellFoundedRelation R[X]

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

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

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

full_name: Polynomial.monic_of_subsingleton
code: @[nontriviality]
theorem monic_of_subsingleton [Subsingleton R] (p : R[X]) : Monic p 
goal: p.Monic

full_name: Polynomial.Monic.def
code: theorem Monic.def : Monic p ↔ leadingCoeff p = 1 
goal: p.Monic ↔ p.leadingCoeff = 1

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

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

full_name: Polynomial.Monic.coeff_natDegree
code: theorem Monic.coeff_natDegree {p : R[X]} (hp : p.Monic) : p.coeff p.natDegree = 1 
goal: p.coeff p.natDegree = 1

full_name: Polynomial.degree_zero
code: @[simp]
theorem degree_zero : degree (0 : R[X]) = ⊥ 
goal: Polynomial.degree 0 = ⊥

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

full_name: Polynomial.coeff_natDegree
code: @[simp]
theorem coeff_natDegree : coeff p (natDegree p) = leadingCoeff p 
goal: p.coeff p.natDegree = p.leadingCoeff

full_name: Polynomial.degree_eq_bot
code: @[simp]
theorem degree_eq_bot : degree p = ⊥ ↔ p = 0 
goal: p.degree = ⊥ ↔ p = 0

full_name: Polynomial.degree_ne_bot
code: theorem degree_ne_bot : degree p ≠ ⊥ ↔ p ≠ 0 
goal: p.degree ≠ ⊥ ↔ p ≠ 0

full_name: Polynomial.degree_of_subsingleton
code: @[nontriviality]
theorem degree_of_subsingleton [Subsingleton R] : degree p = ⊥ 
goal: p.degree = ⊥

full_name: Polynomial.natDegree_of_subsingleton
code: @[nontriviality]
theorem natDegree_of_subsingleton [Subsingleton R] : natDegree p = 0 
goal: p.natDegree = 0

full_name: Polynomial.degree_eq_natDegree
code: theorem degree_eq_natDegree (hp : p ≠ 0) : degree p = (natDegree p : WithBot ℕ) 
goal: p.degree = ↑p.natDegree

full_name: Polynomial.supDegree_eq_natDegree
code: theorem supDegree_eq_natDegree (p : R[X]) : p.toFinsupp.supDegree id = p.natDegree 
goal: AddMonoidAlgebra.supDegree id p.toFinsupp = p.natDegree

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

full_name: Polynomial.degree_eq_iff_natDegree_eq_of_pos
code: theorem degree_eq_iff_natDegree_eq_of_pos {p : R[X]} {n : ℕ} (hn : 0 < n) :
    p.degree = n ↔ p.natDegree = n 
goal: p.degree = ↑n ↔ p.natDegree = n

full_name: Polynomial.natDegree_eq_of_degree_eq_some
code: theorem natDegree_eq_of_degree_eq_some {p : R[X]} {n : ℕ} (h : degree p = n) : natDegree p = n 
goal: p.natDegree = n

full_name: Polynomial.degree_ne_of_natDegree_ne
code: theorem degree_ne_of_natDegree_ne {n : ℕ} : p.natDegree ≠ n → degree p ≠ n 
goal: p.natDegree ≠ n → p.degree ≠ ↑n

full_name: Polynomial.degree_le_natDegree
code: @[simp]
theorem degree_le_natDegree : degree p ≤ natDegree p 
goal: p.degree ≤ ↑p.natDegree

full_name: Polynomial.natDegree_eq_of_degree_eq
code: theorem natDegree_eq_of_degree_eq [Semiring S] {q : S[X]} (h : degree p = degree q) :
    natDegree p = natDegree q 
goal: p.natDegree = q.natDegree

full_name: Polynomial.le_degree_of_ne_zero
code: theorem le_degree_of_ne_zero (h : coeff p n ≠ 0) : (n : WithBot ℕ) ≤ degree p 
goal: ↑n ≤ p.degree

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

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

full_name: Polynomial.degree_eq_of_le_of_coeff_ne_zero
code: theorem degree_eq_of_le_of_coeff_ne_zero (pn : p.degree ≤ n) (p1 : p.coeff n ≠ 0) : p.degree = n 
goal: p.degree = ↑n

full_name: Polynomial.natDegree_eq_of_le_of_coeff_ne_zero
code: theorem natDegree_eq_of_le_of_coeff_ne_zero (pn : p.natDegree ≤ n) (p1 : p.coeff n ≠ 0) :
    p.natDegree = n 
goal: p.natDegree = n

full_name: Polynomial.degree_mono
code: theorem degree_mono [Semiring S] {f : R[X]} {g : S[X]} (h : f.support ⊆ g.support) :
    f.degree ≤ g.degree 
goal: f.degree ≤ g.degree

full_name: Polynomial.supp_subset_range
code: theorem supp_subset_range (h : natDegree p < m) : p.support ⊆ Finset.range m 
goal: p.support ⊆ Finset.range m

full_name: Polynomial.supp_subset_range_natDegree_succ
code: theorem supp_subset_range_natDegree_succ : p.support ⊆ Finset.range (natDegree p + 1) 
goal: p.support ⊆ Finset.range (p.natDegree + 1)

full_name: Polynomial.degree_le_degree
code: theorem degree_le_degree (h : coeff q (natDegree p) ≠ 0) : degree p ≤ degree q 
goal: p.degree ≤ q.degree

full_name: Polynomial.natDegree_le_iff_degree_le
code: theorem natDegree_le_iff_degree_le {n : ℕ} : natDegree p ≤ n ↔ degree p ≤ n 
goal: p.natDegree ≤ n ↔ p.degree ≤ ↑n

full_name: Polynomial.natDegree_lt_iff_degree_lt
code: theorem natDegree_lt_iff_degree_lt (hp : p ≠ 0) : p.natDegree < n ↔ p.degree < ↑n 
goal: p.natDegree < n ↔ p.degree < ↑n

full_name: Polynomial.natDegree_le_natDegree
code: theorem natDegree_le_natDegree [Semiring S] {q : S[X]} (hpq : p.degree ≤ q.degree) :
    p.natDegree ≤ q.natDegree 
goal: p.natDegree ≤ q.natDegree

full_name: Polynomial.natDegree_lt_natDegree
code: theorem natDegree_lt_natDegree {p q : R[X]} (hp : p ≠ 0) (hpq : p.degree < q.degree) :
    p.natDegree < q.natDegree 
goal: p.natDegree < q.natDegree

full_name: Polynomial.degree_C
code: @[simp]
theorem degree_C (ha : a ≠ 0) : degree (C a) = (0 : WithBot ℕ) 
goal: (Polynomial.C a).degree = 0

full_name: Polynomial.degree_C_le
code: theorem degree_C_le : degree (C a) ≤ 0 
goal: (Polynomial.C a).degree ≤ 0

full_name: Polynomial.degree_C_lt
code: theorem degree_C_lt : degree (C a) < 1 
goal: (Polynomial.C a).degree < 1

full_name: Polynomial.degree_one_le
code: theorem degree_one_le : degree (1 : R[X]) ≤ (0 : WithBot ℕ) 
goal: Polynomial.degree 1 ≤ 0

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

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

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

full_name: Polynomial.degree_natCast_le
code: theorem degree_natCast_le (n : ℕ) : degree (n : R[X]) ≤ 0 
goal: (↑n).degree ≤ 0

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

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

full_name: Polynomial.degree_C_mul_X
code: theorem degree_C_mul_X (ha : a ≠ 0) : degree (C a * X) = 1 
goal: (Polynomial.C a * Polynomial.X).degree = 1

full_name: Polynomial.degree_monomial_le
code: theorem degree_monomial_le (n : ℕ) (a : R) : degree (monomial n a) ≤ n 
goal: ((Polynomial.monomial n) a).degree ≤ ↑n

full_name: Polynomial.degree_C_mul_X_pow_le
code: theorem degree_C_mul_X_pow_le (n : ℕ) (a : R) : degree (C a * X ^ n) ≤ n 
goal: (Polynomial.C a * Polynomial.X ^ n).degree ≤ ↑n

full_name: Polynomial.degree_C_mul_X_le
code: theorem degree_C_mul_X_le (a : R) : degree (C a * X) ≤ 1 
goal: (Polynomial.C a * Polynomial.X).degree ≤ 1

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

full_name: Polynomial.natDegree_C_mul_X
code: @[simp]
theorem natDegree_C_mul_X (a : R) (ha : a ≠ 0) : natDegree (C a * X) = 1 
goal: (Polynomial.C a * Polynomial.X).natDegree = 1

full_name: Polynomial.natDegree_monomial
code: @[simp]
theorem natDegree_monomial [DecidableEq R] (i : ℕ) (r : R) :
    natDegree (monomial i r) = if r = 0 then 0 else i 
goal: ((Polynomial.monomial i) r).natDegree = if r = 0 then 0 else i

full_name: Polynomial.natDegree_monomial_le
code: theorem natDegree_monomial_le (a : R) {m : ℕ} : (monomial m a).natDegree ≤ m 
goal: ((Polynomial.monomial m) a).natDegree ≤ m

full_name: Polynomial.natDegree_monomial_eq
code: theorem natDegree_monomial_eq (i : ℕ) {r : R} (r0 : r ≠ 0) : (monomial i r).natDegree = i 
goal: ((Polynomial.monomial i) r).natDegree = i

full_name: Polynomial.coeff_eq_zero_of_degree_lt
code: theorem coeff_eq_zero_of_degree_lt (h : degree p < n) : coeff p n = 0 
goal: p.coeff n = 0

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

full_name: Polynomial.ext_iff_natDegree_le
code: theorem ext_iff_natDegree_le {p q : R[X]} {n : ℕ} (hp : p.natDegree ≤ n) (hq : q.natDegree ≤ n) :
    p = q ↔ ∀ i ≤ n, p.coeff i = q.coeff i 
goal: p = q ↔ ∀ i ≤ n, p.coeff i = q.coeff i

full_name: Polynomial.ext_iff_degree_le
code: theorem ext_iff_degree_le {p q : R[X]} {n : ℕ} (hp : p.degree ≤ n) (hq : q.degree ≤ n) :
    p = q ↔ ∀ i ≤ n, p.coeff i = q.coeff i 
goal: p = q ↔ ∀ i ≤ n, p.coeff i = q.coeff i

full_name: Polynomial.coeff_natDegree_succ_eq_zero
code: @[simp]
theorem coeff_natDegree_succ_eq_zero {p : R[X]} : p.coeff (p.natDegree + 1) = 0 
goal: p.coeff (p.natDegree + 1) = 0

full_name: Polynomial.ite_le_natDegree_coeff
code: theorem ite_le_natDegree_coeff (p : R[X]) (n : ℕ) (I : Decidable (n < 1 + natDegree p)) :
    @ite _ (n < 1 + natDegree p) I (coeff p n) 0 = coeff p n 
goal: (if n < 1 + p.natDegree then p.coeff n else 0) = p.coeff n

full_name: Polynomial.as_sum_support
code: theorem as_sum_support (p : R[X]) : p = ∑ i ∈ p.support, monomial i (p.coeff i) 
goal: p = ∑ i ∈ p.support, (Polynomial.monomial i) (p.coeff i)

full_name: Polynomial.as_sum_support_C_mul_X_pow
code: theorem as_sum_support_C_mul_X_pow (p : R[X]) : p = ∑ i ∈ p.support, C (p.coeff i) * X ^ i 
goal: p = ∑ i ∈ p.support, Polynomial.C (p.coeff i) * Polynomial.X ^ i

full_name: Polynomial.sum_over_range'
code: /-- We can reexpress a sum over `p.support` as a sum over `range n`,
for any `n` satisfying `p.natDegree < n`.
-/
theorem sum_over_range' [AddCommMonoid S] (p : R[X]) {f : ℕ → R → S} (h : ∀ n, f n 0 = 0) (n : ℕ)
    (w : p.natDegree < n) : p.sum f = ∑ a ∈ range n, f a (coeff p a) 
goal: p.sum f = ∑ a ∈ Finset.range n, f a (p.coeff a)

full_name: Polynomial.sum_over_range
code: /-- We can reexpress a sum over `p.support` as a sum over `range (p.natDegree + 1)`.
-/
theorem sum_over_range [AddCommMonoid S] (p : R[X]) {f : ℕ → R → S} (h : ∀ n, f n 0 = 0) :
    p.sum f = ∑ a ∈ range (p.natDegree + 1), f a (coeff p a) 
goal: p.sum f = ∑ a ∈ Finset.range (p.natDegree + 1), f a (p.coeff a)

full_name: Polynomial.sum_fin
code: theorem sum_fin [AddCommMonoid S] (f : ℕ → R → S) (hf : ∀ i, f i 0 = 0) {n : ℕ} {p : R[X]}
    (hn : p.degree < n) : (∑ i : Fin n, f i (p.coeff i)) = p.sum f 
goal: ∑ i : Fin n, f (↑i) (p.coeff ↑i) = p.sum f

full_name: Polynomial.as_sum_range'
code: theorem as_sum_range' (p : R[X]) (n : ℕ) (w : p.natDegree < n) :
    p = ∑ i ∈ range n, monomial i (coeff p i) 
goal: p = ∑ i ∈ Finset.range n, (Polynomial.monomial i) (p.coeff i)

full_name: Polynomial.as_sum_range
code: theorem as_sum_range (p : R[X]) : p = ∑ i ∈ range (p.natDegree + 1), monomial i (coeff p i) 
goal: p = ∑ i ∈ Finset.range (p.natDegree + 1), (Polynomial.monomial i) (p.coeff i)

full_name: Polynomial.as_sum_range_C_mul_X_pow
code: theorem as_sum_range_C_mul_X_pow (p : R[X]) :
    p = ∑ i ∈ range (p.natDegree + 1), C (coeff p i) * X ^ i 
goal: p = ∑ i ∈ Finset.range (p.natDegree + 1), Polynomial.C (p.coeff i) * Polynomial.X ^ i

full_name: Polynomial.coeff_ne_zero_of_eq_degree
code: theorem coeff_ne_zero_of_eq_degree (hn : degree p = n) : coeff p n ≠ 0 
goal: p.coeff n ≠ 0

full_name: Polynomial.eq_X_add_C_of_degree_le_one
code: theorem eq_X_add_C_of_degree_le_one (h : degree p ≤ 1) : p = C (p.coeff 1) * X + C (p.coeff 0) 
goal: p = Polynomial.C (p.coeff 1) * Polynomial.X + Polynomial.C (p.coeff 0)

full_name: Polynomial.eq_X_add_C_of_degree_eq_one
code: theorem eq_X_add_C_of_degree_eq_one (h : degree p = 1) :
    p = C p.leadingCoeff * X + C (p.coeff 0) 
goal: p = Polynomial.C p.leadingCoeff * Polynomial.X + Polynomial.C (p.coeff 0)

full_name: Polynomial.eq_X_add_C_of_natDegree_le_one
code: theorem eq_X_add_C_of_natDegree_le_one (h : natDegree p ≤ 1) :
    p = C (p.coeff 1) * X + C (p.coeff 0) 
goal: p = Polynomial.C (p.coeff 1) * Polynomial.X + Polynomial.C (p.coeff 0)

full_name: Polynomial.Monic.eq_X_add_C
code: theorem Monic.eq_X_add_C (hm : p.Monic) (hnd : p.natDegree = 1) : p = X + C (p.coeff 0) 
goal: p = Polynomial.X + Polynomial.C (p.coeff 0)

full_name: Polynomial.exists_eq_X_add_C_of_natDegree_le_one
code: theorem exists_eq_X_add_C_of_natDegree_le_one (h : natDegree p ≤ 1) : ∃ a b, p = C a * X + C b 
goal: ∃ a b, p = Polynomial.C a * Polynomial.X + Polynomial.C b

full_name: Polynomial.degree_X_pow_le
code: theorem degree_X_pow_le (n : ℕ) : degree (X ^ n : R[X]) ≤ n 
goal: (Polynomial.X ^ n).degree ≤ ↑n

full_name: Polynomial.degree_X_le
code: theorem degree_X_le : degree (X : R[X]) ≤ 1 
goal: Polynomial.X.degree ≤ 1

full_name: Polynomial.natDegree_X_le
code: theorem natDegree_X_le : (X : R[X]).natDegree ≤ 1 
goal: Polynomial.X.natDegree ≤ 1

full_name: Polynomial.mem_support_C_mul_X_pow
code: theorem mem_support_C_mul_X_pow {n a : ℕ} {c : R} (h : a ∈ support (C c * X ^ n)) : a = n 
goal: a = n

full_name: Polynomial.card_support_C_mul_X_pow_le_one
code: theorem card_support_C_mul_X_pow_le_one {c : R} {n : ℕ} : card (support (C c * X ^ n)) ≤ 1 
goal: (Polynomial.C c * Polynomial.X ^ n).support.card ≤ 1

full_name: Polynomial.card_supp_le_succ_natDegree
code: theorem card_supp_le_succ_natDegree (p : R[X]) : p.support.card ≤ p.natDegree + 1 
goal: p.support.card ≤ p.natDegree + 1

full_name: Polynomial.le_degree_of_mem_supp
code: theorem le_degree_of_mem_supp (a : ℕ) : a ∈ p.support → ↑a ≤ degree p 
goal: a ∈ p.support → ↑a ≤ p.degree

full_name: Polynomial.nonempty_support_iff
code: theorem nonempty_support_iff : p.support.Nonempty ↔ p ≠ 0 
goal: p.support.Nonempty ↔ p ≠ 0

full_name: Polynomial.degree_one
code: @[simp]
theorem degree_one : degree (1 : R[X]) = (0 : WithBot ℕ) 
goal: Polynomial.degree 1 = 0

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

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

full_name: Polynomial.coeff_mul_X_sub_C
code: theorem coeff_mul_X_sub_C {p : R[X]} {r : R} {a : ℕ} :
    coeff (p * (X - C r)) (a + 1) = coeff p a - coeff p (a + 1) * r 
goal: (p * (Polynomial.X - Polynomial.C r)).coeff (a + 1) = p.coeff a - p.coeff (a + 1) * r

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

full_name: Polynomial.degree_neg_le_of_le
code: theorem degree_neg_le_of_le {a : WithBot ℕ} {p : R[X]} (hp : degree p ≤ a) : degree (-p) ≤ a 
goal: (-p).degree ≤ a

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

full_name: Polynomial.natDegree_neg_le_of_le
code: theorem natDegree_neg_le_of_le {p : R[X]} (hp : natDegree p ≤ m) : natDegree (-p) ≤ m 
goal: (-p).natDegree ≤ m

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

full_name: Polynomial.degree_intCast_le
code: theorem degree_intCast_le (n : ℤ) : degree (n : R[X]) ≤ 0 
goal: (↑n).degree ≤ 0

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

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

full_name: Polynomial.nextCoeff_eq_zero
code: lemma nextCoeff_eq_zero :
    p.nextCoeff = 0 ↔ p.natDegree = 0 ∨ 0 < p.natDegree ∧ p.coeff (p.natDegree - 1) = 0 
goal: p.nextCoeff = 0 ↔ p.natDegree = 0 ∨ 0 < p.natDegree ∧ p.coeff (p.natDegree - 1) = 0

full_name: Polynomial.nextCoeff_ne_zero
code: lemma nextCoeff_ne_zero : p.nextCoeff ≠ 0 ↔ p.natDegree ≠ 0 ∧ p.coeff (p.natDegree - 1) ≠ 0 
goal: p.nextCoeff ≠ 0 ↔ p.natDegree ≠ 0 ∧ p.coeff (p.natDegree - 1) ≠ 0

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

full_name: Polynomial.nextCoeff_of_natDegree_pos
code: theorem nextCoeff_of_natDegree_pos (hp : 0 < p.natDegree) :
    nextCoeff p = p.coeff (p.natDegree - 1) 
goal: p.nextCoeff = p.coeff (p.natDegree - 1)

full_name: Polynomial.coeff_natDegree_eq_zero_of_degree_lt
code: theorem coeff_natDegree_eq_zero_of_degree_lt (h : degree p < degree q) :
    coeff p (natDegree q) = 0 
goal: p.coeff q.natDegree = 0

full_name: Polynomial.ne_zero_of_degree_gt
code: theorem ne_zero_of_degree_gt {n : WithBot ℕ} (h : n < degree p) : p ≠ 0 
goal: p ≠ 0

full_name: Polynomial.ne_zero_of_degree_ge_degree
code: theorem ne_zero_of_degree_ge_degree (hpq : p.degree ≤ q.degree) (hp : p ≠ 0) : q ≠ 0 
goal: q ≠ 0

full_name: Polynomial.ne_zero_of_natDegree_gt
code: theorem ne_zero_of_natDegree_gt {n : ℕ} (h : n < natDegree p) : p ≠ 0 
goal: p ≠ 0

full_name: Polynomial.degree_lt_degree
code: theorem degree_lt_degree (h : natDegree p < natDegree q) : degree p < degree q 
goal: p.degree < q.degree

full_name: Polynomial.natDegree_lt_natDegree_iff
code: theorem natDegree_lt_natDegree_iff (hp : p ≠ 0) : natDegree p < natDegree q ↔ degree p < degree q 
goal: p.natDegree < q.natDegree ↔ p.degree < q.degree

full_name: Polynomial.eq_C_of_degree_le_zero
code: theorem eq_C_of_degree_le_zero (h : degree p ≤ 0) : p = C (coeff p 0) 
goal: p = Polynomial.C (p.coeff 0)

full_name: Polynomial.eq_C_of_degree_eq_zero
code: theorem eq_C_of_degree_eq_zero (h : degree p = 0) : p = C (coeff p 0) 
goal: p = Polynomial.C (p.coeff 0)

full_name: Polynomial.degree_le_zero_iff
code: theorem degree_le_zero_iff : degree p ≤ 0 ↔ p = C (coeff p 0) 
goal: p.degree ≤ 0 ↔ p = Polynomial.C (p.coeff 0)

full_name: Polynomial.degree_add_le
code: theorem degree_add_le (p q : R[X]) : degree (p + q) ≤ max (degree p) (degree q) 
goal: (p + q).degree ≤ max p.degree q.degree

full_name: Polynomial.degree_add_le_of_degree_le
code: theorem degree_add_le_of_degree_le {p q : R[X]} {n : ℕ} (hp : degree p ≤ n) (hq : degree q ≤ n) :
    degree (p + q) ≤ n 
goal: (p + q).degree ≤ ↑n

full_name: Polynomial.degree_add_le_of_le
code: theorem degree_add_le_of_le {a b : WithBot ℕ} (hp : degree p ≤ a) (hq : degree q ≤ b) :
    degree (p + q) ≤ max a b 
goal: (p + q).degree ≤ max a b

full_name: Polynomial.natDegree_add_le
code: theorem natDegree_add_le (p q : R[X]) : natDegree (p + q) ≤ max (natDegree p) (natDegree q) 
goal: (p + q).natDegree ≤ max p.natDegree q.natDegree

full_name: Polynomial.natDegree_add_le_of_degree_le
code: theorem natDegree_add_le_of_degree_le {p q : R[X]} {n : ℕ} (hp : natDegree p ≤ n)
    (hq : natDegree q ≤ n) : natDegree (p + q) ≤ n 
goal: (p + q).natDegree ≤ n

full_name: Polynomial.natDegree_add_le_of_le
code: theorem natDegree_add_le_of_le (hp : natDegree p ≤ m) (hq : natDegree q ≤ n) :
    natDegree (p + q) ≤ max m n 
goal: (p + q).natDegree ≤ max m n

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

full_name: Polynomial.leadingCoeff_eq_zero
code: @[simp]
theorem leadingCoeff_eq_zero : leadingCoeff p = 0 ↔ p = 0 
goal: p.leadingCoeff = 0 ↔ p = 0

full_name: Polynomial.leadingCoeff_ne_zero
code: theorem leadingCoeff_ne_zero : leadingCoeff p ≠ 0 ↔ p ≠ 0 
goal: p.leadingCoeff ≠ 0 ↔ p ≠ 0

full_name: Polynomial.leadingCoeff_eq_zero_iff_deg_eq_bot
code: theorem leadingCoeff_eq_zero_iff_deg_eq_bot : leadingCoeff p = 0 ↔ degree p = ⊥ 
goal: p.leadingCoeff = 0 ↔ p.degree = ⊥

full_name: Polynomial.natDegree_le_pred
code: lemma natDegree_le_pred (hf : p.natDegree ≤ n) (hn : p.coeff n = 0) : p.natDegree ≤ n - 1 
goal: p.natDegree ≤ n - 1

full_name: Polynomial.natDegree_mem_support_of_nonzero
code: theorem natDegree_mem_support_of_nonzero (H : p ≠ 0) : p.natDegree ∈ p.support 
goal: p.natDegree ∈ p.support

full_name: Polynomial.natDegree_eq_support_max'
code: theorem natDegree_eq_support_max' (h : p ≠ 0) :
    p.natDegree = p.support.max' (nonempty_support_iff.mpr h) 
goal: p.natDegree = p.support.max' ⋯

full_name: Polynomial.natDegree_C_mul_X_pow_le
code: theorem natDegree_C_mul_X_pow_le (a : R) (n : ℕ) : natDegree (C a * X ^ n) ≤ n 
goal: (Polynomial.C a * Polynomial.X ^ n).natDegree ≤ n

full_name: Polynomial.degree_add_eq_left_of_degree_lt
code: theorem degree_add_eq_left_of_degree_lt (h : degree q < degree p) : degree (p + q) = degree p 
goal: (p + q).degree = p.degree

full_name: Polynomial.degree_add_eq_right_of_degree_lt
code: theorem degree_add_eq_right_of_degree_lt (h : degree p < degree q) : degree (p + q) = degree q 
goal: (p + q).degree = q.degree

full_name: Polynomial.natDegree_add_eq_left_of_natDegree_lt
code: theorem natDegree_add_eq_left_of_natDegree_lt (h : natDegree q < natDegree p) :
    natDegree (p + q) = natDegree p 
goal: (p + q).natDegree = p.natDegree

full_name: Polynomial.natDegree_add_eq_right_of_natDegree_lt
code: theorem natDegree_add_eq_right_of_natDegree_lt (h : natDegree p < natDegree q) :
    natDegree (p + q) = natDegree q 
goal: (p + q).natDegree = q.natDegree

full_name: Polynomial.degree_add_C
code: theorem degree_add_C (hp : 0 < degree p) : degree (p + C a) = degree p 
goal: (p + Polynomial.C a).degree = p.degree

full_name: Polynomial.natDegree_add_C
code: @[simp] theorem natDegree_add_C {a : R} : (p + C a).natDegree = p.natDegree 
goal: (p + Polynomial.C a).natDegree = p.natDegree

full_name: Polynomial.natDegree_C_add
code: @[simp] theorem natDegree_C_add {a : R} : (C a + p).natDegree = p.natDegree 
goal: (Polynomial.C a + p).natDegree = p.natDegree

full_name: Polynomial.degree_add_eq_of_leadingCoeff_add_ne_zero
code: theorem degree_add_eq_of_leadingCoeff_add_ne_zero (h : leadingCoeff p + leadingCoeff q ≠ 0) :
    degree (p + q) = max p.degree q.degree 
goal: (p + q).degree = max p.degree q.degree

full_name: Polynomial.natDegree_eq_of_natDegree_add_lt_left
code: lemma natDegree_eq_of_natDegree_add_lt_left (p q : R[X])
    (H : natDegree (p + q) < natDegree p) : natDegree p = natDegree q 
goal: p.natDegree = q.natDegree

full_name: Polynomial.natDegree_eq_of_natDegree_add_lt_right
code: lemma natDegree_eq_of_natDegree_add_lt_right (p q : R[X])
    (H : natDegree (p + q) < natDegree q) : natDegree p = natDegree q 
goal: p.natDegree = q.natDegree

full_name: Polynomial.natDegree_eq_of_natDegree_add_eq_zero
code: lemma natDegree_eq_of_natDegree_add_eq_zero (p q : R[X])
    (H : natDegree (p + q) = 0) : natDegree p = natDegree q 
goal: p.natDegree = q.natDegree

full_name: Polynomial.degree_erase_le
code: theorem degree_erase_le (p : R[X]) (n : ℕ) : degree (p.erase n) ≤ degree p 
goal: (Polynomial.erase n p).degree ≤ p.degree

full_name: Polynomial.degree_erase_lt
code: theorem degree_erase_lt (hp : p ≠ 0) : degree (p.erase (natDegree p)) < degree p 
goal: (Polynomial.erase p.natDegree p).degree < p.degree

full_name: Polynomial.degree_update_le
code: theorem degree_update_le (p : R[X]) (n : ℕ) (a : R) : degree (p.update n a) ≤ max (degree p) n 
goal: (p.update n a).degree ≤ max p.degree ↑n

full_name: Polynomial.degree_sum_le
code: theorem degree_sum_le (s : Finset ι) (f : ι → R[X]) :
    degree (∑ i ∈ s, f i) ≤ s.sup fun b => degree (f b) 
goal: (∑ i ∈ s, f i).degree ≤ s.sup fun b => (f b).degree

full_name: Polynomial.degree_mul_le
code: theorem degree_mul_le (p q : R[X]) : degree (p * q) ≤ degree p + degree q 
goal: (p * q).degree ≤ p.degree + q.degree

full_name: Polynomial.degree_mul_le_of_le
code: theorem degree_mul_le_of_le {a b : WithBot ℕ} (hp : degree p ≤ a) (hq : degree q ≤ b) :
    degree (p * q) ≤ a + b 
goal: (p * q).degree ≤ a + b

full_name: Polynomial.degree_pow_le
code: theorem degree_pow_le (p : R[X]) : ∀ n : ℕ, degree (p ^ n) ≤ n • degree p
  
goal: (p ^ n).degree ≤ n • p.degree

full_name: Polynomial.degree_pow_le_of_le
code: theorem degree_pow_le_of_le {a : WithBot ℕ} (b : ℕ) (hp : degree p ≤ a) :
    degree (p ^ b) ≤ b * a 
goal: (p ^ b).degree ≤ ↑b * a

full_name: Polynomial.leadingCoeff_monomial
code: @[simp]
theorem leadingCoeff_monomial (a : R) (n : ℕ) : leadingCoeff (monomial n a) = a 
goal: ((Polynomial.monomial n) a).leadingCoeff = a

full_name: Polynomial.leadingCoeff_C_mul_X_pow
code: theorem leadingCoeff_C_mul_X_pow (a : R) (n : ℕ) : leadingCoeff (C a * X ^ n) = a 
goal: (Polynomial.C a * Polynomial.X ^ n).leadingCoeff = a

full_name: Polynomial.leadingCoeff_C_mul_X
code: theorem leadingCoeff_C_mul_X (a : R) : leadingCoeff (C a * X) = a 
goal: (Polynomial.C a * Polynomial.X).leadingCoeff = a

full_name: Polynomial.leadingCoeff_C
code: @[simp]
theorem leadingCoeff_C (a : R) : leadingCoeff (C a) = a 
goal: (Polynomial.C a).leadingCoeff = a

full_name: Polynomial.leadingCoeff_X_pow
code: theorem leadingCoeff_X_pow (n : ℕ) : leadingCoeff ((X : R[X]) ^ n) = 1 
goal: (Polynomial.X ^ n).leadingCoeff = 1

full_name: Polynomial.leadingCoeff_X
code: theorem leadingCoeff_X : leadingCoeff (X : R[X]) = 1 
goal: Polynomial.X.leadingCoeff = 1

full_name: Polynomial.monic_X_pow
code: @[simp]
theorem monic_X_pow (n : ℕ) : Monic (X ^ n : R[X]) 
goal: (Polynomial.X ^ n).Monic

full_name: Polynomial.monic_X
code: @[simp]
theorem monic_X : Monic (X : R[X]) 
goal: Polynomial.X.Monic

full_name: Polynomial.leadingCoeff_one
code: theorem leadingCoeff_one : leadingCoeff (1 : R[X]) = 1 
goal: Polynomial.leadingCoeff 1 = 1

full_name: Polynomial.monic_one
code: @[simp]
theorem monic_one : Monic (1 : R[X]) 
goal: Polynomial.Monic 1

full_name: Polynomial.Monic.ne_zero
code: theorem Monic.ne_zero {R : Type*} [Semiring R] [Nontrivial R] {p : R[X]} (hp : p.Monic) :
    p ≠ 0 
goal: p ≠ 0

full_name: Polynomial.Monic.ne_zero_of_ne
code: theorem Monic.ne_zero_of_ne (h : (0 : R) ≠ 1) {p : R[X]} (hp : p.Monic) : p ≠ 0 
goal: p ≠ 0

full_name: Polynomial.monic_of_natDegree_le_of_coeff_eq_one
code: theorem monic_of_natDegree_le_of_coeff_eq_one (n : ℕ) (pn : p.natDegree ≤ n) (p1 : p.coeff n = 1) :
    Monic p 
goal: p.Monic

full_name: Polynomial.monic_of_degree_le_of_coeff_eq_one
code: theorem monic_of_degree_le_of_coeff_eq_one (n : ℕ) (pn : p.degree ≤ n) (p1 : p.coeff n = 1) :
    Monic p 
goal: p.Monic

full_name: Polynomial.Monic.ne_zero_of_polynomial_ne
code: theorem Monic.ne_zero_of_polynomial_ne {r} (hp : Monic p) (hne : q ≠ r) : p ≠ 0 
goal: p ≠ 0

full_name: Polynomial.leadingCoeff_add_of_degree_lt
code: theorem leadingCoeff_add_of_degree_lt (h : degree p < degree q) :
    leadingCoeff (p + q) = leadingCoeff q 
goal: (p + q).leadingCoeff = q.leadingCoeff

full_name: Polynomial.leadingCoeff_add_of_degree_lt'
code: theorem leadingCoeff_add_of_degree_lt' (h : degree q < degree p) :
    leadingCoeff (p + q) = leadingCoeff p 
goal: (p + q).leadingCoeff = p.leadingCoeff

full_name: Polynomial.leadingCoeff_add_of_degree_eq
code: theorem leadingCoeff_add_of_degree_eq (h : degree p = degree q)
    (hlc : leadingCoeff p + leadingCoeff q ≠ 0) :
    leadingCoeff (p + q) = leadingCoeff p + leadingCoeff q 
goal: (p + q).leadingCoeff = p.leadingCoeff + q.leadingCoeff

full_name: Polynomial.coeff_mul_degree_add_degree
code: @[simp]
theorem coeff_mul_degree_add_degree (p q : R[X]) :
    coeff (p * q) (natDegree p + natDegree q) = leadingCoeff p * leadingCoeff q 
goal: (p * q).coeff (p.natDegree + q.natDegree) = p.leadingCoeff * q.leadingCoeff

full_name: Polynomial.degree_mul'
code: theorem degree_mul' (h : leadingCoeff p * leadingCoeff q ≠ 0) :
    degree (p * q) = degree p + degree q 
goal: (p * q).degree = p.degree + q.degree

full_name: Polynomial.Monic.degree_mul
code: theorem Monic.degree_mul (hq : Monic q) : degree (p * q) = degree p + degree q 
goal: (p * q).degree = p.degree + q.degree

full_name: Polynomial.natDegree_mul'
code: theorem natDegree_mul' (h : leadingCoeff p * leadingCoeff q ≠ 0) :
    natDegree (p * q) = natDegree p + natDegree q 
goal: (p * q).natDegree = p.natDegree + q.natDegree

full_name: Polynomial.leadingCoeff_mul'
code: theorem leadingCoeff_mul' (h : leadingCoeff p * leadingCoeff q ≠ 0) :
    leadingCoeff (p * q) = leadingCoeff p * leadingCoeff q 
goal: (p * q).leadingCoeff = p.leadingCoeff * q.leadingCoeff

full_name: Polynomial.monomial_natDegree_leadingCoeff_eq_self
code: theorem monomial_natDegree_leadingCoeff_eq_self (h : p.support.card ≤ 1) :
    monomial p.natDegree p.leadingCoeff = p 
goal: (Polynomial.monomial p.natDegree) p.leadingCoeff = p

full_name: Polynomial.C_mul_X_pow_eq_self
code: theorem C_mul_X_pow_eq_self (h : p.support.card ≤ 1) : C p.leadingCoeff * X ^ p.natDegree = p 
goal: Polynomial.C p.leadingCoeff * Polynomial.X ^ p.natDegree = p

full_name: Polynomial.leadingCoeff_pow'
code: theorem leadingCoeff_pow' : leadingCoeff p ^ n ≠ 0 → leadingCoeff (p ^ n) = leadingCoeff p ^ n 
goal: p.leadingCoeff ^ n ≠ 0 → (p ^ n).leadingCoeff = p.leadingCoeff ^ n

full_name: Polynomial.degree_pow'
code: theorem degree_pow' : ∀ {n : ℕ}, leadingCoeff p ^ n ≠ 0 → degree (p ^ n) = n • degree p
  
goal: p.leadingCoeff ^ n ≠ 0 → (p ^ n).degree = n • p.degree

full_name: Polynomial.natDegree_pow'
code: theorem natDegree_pow' {n : ℕ} (h : leadingCoeff p ^ n ≠ 0) : natDegree (p ^ n) = n * natDegree p 
goal: (p ^ n).natDegree = n * p.natDegree

full_name: Polynomial.leadingCoeff_monic_mul
code: theorem leadingCoeff_monic_mul {p q : R[X]} (hp : Monic p) :
    leadingCoeff (p * q) = leadingCoeff q 
goal: (p * q).leadingCoeff = q.leadingCoeff

full_name: Polynomial.leadingCoeff_mul_monic
code: theorem leadingCoeff_mul_monic {p q : R[X]} (hq : Monic q) :
    leadingCoeff (p * q) = leadingCoeff p 
goal: (p * q).leadingCoeff = p.leadingCoeff

full_name: Polynomial.leadingCoeff_mul_X_pow
code: @[simp]
theorem leadingCoeff_mul_X_pow {p : R[X]} {n : ℕ} : leadingCoeff (p * X ^ n) = leadingCoeff p 
goal: (p * Polynomial.X ^ n).leadingCoeff = p.leadingCoeff

full_name: Polynomial.leadingCoeff_mul_X
code: @[simp]
theorem leadingCoeff_mul_X {p : R[X]} : leadingCoeff (p * X) = leadingCoeff p 
goal: (p * Polynomial.X).leadingCoeff = p.leadingCoeff

full_name: Polynomial.natDegree_mul_le
code: theorem natDegree_mul_le {p q : R[X]} : natDegree (p * q) ≤ natDegree p + natDegree q 
goal: (p * q).natDegree ≤ p.natDegree + q.natDegree

full_name: Polynomial.natDegree_mul_le_of_le
code: theorem natDegree_mul_le_of_le (hp : natDegree p ≤ m) (hg : natDegree q ≤ n) :
    natDegree (p * q) ≤ m + n 
goal: (p * q).natDegree ≤ m + n

full_name: Polynomial.natDegree_pow_le
code: theorem natDegree_pow_le {p : R[X]} {n : ℕ} : (p ^ n).natDegree ≤ n * p.natDegree 
goal: (p ^ n).natDegree ≤ n * p.natDegree

full_name: Polynomial.natDegree_pow_le_of_le
code: theorem natDegree_pow_le_of_le (n : ℕ) (hp : natDegree p ≤ m) :
    natDegree (p ^ n) ≤ n * m 
goal: (p ^ n).natDegree ≤ n * m

full_name: Polynomial.coeff_pow_mul_natDegree
code: @[simp]
theorem coeff_pow_mul_natDegree (p : R[X]) (n : ℕ) :
    (p ^ n).coeff (n * p.natDegree) = p.leadingCoeff ^ n 
goal: (p ^ n).coeff (n * p.natDegree) = p.leadingCoeff ^ n

full_name: Polynomial.coeff_mul_add_eq_of_natDegree_le
code: theorem coeff_mul_add_eq_of_natDegree_le {df dg : ℕ} {f g : R[X]}
    (hdf : natDegree f ≤ df) (hdg : natDegree g ≤ dg) :
    (f * g).coeff (df + dg) = f.coeff df * g.coeff dg 
goal: (f * g).coeff (df + dg) = f.coeff df * g.coeff dg

full_name: Polynomial.zero_le_degree_iff
code: theorem zero_le_degree_iff : 0 ≤ degree p ↔ p ≠ 0 
goal: 0 ≤ p.degree ↔ p ≠ 0

full_name: Polynomial.natDegree_eq_zero_iff_degree_le_zero
code: theorem natDegree_eq_zero_iff_degree_le_zero : p.natDegree = 0 ↔ p.degree ≤ 0 
goal: p.natDegree = 0 ↔ p.degree ≤ 0

full_name: Polynomial.degree_zero_le
code: theorem degree_zero_le : degree (0 : R[X]) ≤ 0 
goal: Polynomial.degree 0 ≤ 0

full_name: Polynomial.degree_le_iff_coeff_zero
code: theorem degree_le_iff_coeff_zero (f : R[X]) (n : WithBot ℕ) :
    degree f ≤ n ↔ ∀ m : ℕ, n < m → coeff f m = 0 
goal: f.degree ≤ n ↔ ∀ (m : ℕ), n < ↑m → f.coeff m = 0

full_name: Polynomial.degree_lt_iff_coeff_zero
code: theorem degree_lt_iff_coeff_zero (f : R[X]) (n : ℕ) :
    degree f < n ↔ ∀ m : ℕ, n ≤ m → coeff f m = 0 
goal: f.degree < ↑n ↔ ∀ (m : ℕ), n ≤ m → f.coeff m = 0

full_name: Polynomial.degree_smul_le
code: theorem degree_smul_le (a : R) (p : R[X]) : degree (a • p) ≤ degree p 
goal: (a • p).degree ≤ p.degree

full_name: Polynomial.natDegree_smul_le
code: theorem natDegree_smul_le (a : R) (p : R[X]) : natDegree (a • p) ≤ natDegree p 
goal: (a • p).natDegree ≤ p.natDegree

full_name: Polynomial.degree_lt_degree_mul_X
code: theorem degree_lt_degree_mul_X (hp : p ≠ 0) : p.degree < (p * X).degree 
goal: p.degree < (p * Polynomial.X).degree

full_name: Polynomial.natDegree_pos_iff_degree_pos
code: theorem natDegree_pos_iff_degree_pos : 0 < natDegree p ↔ 0 < degree p 
goal: 0 < p.natDegree ↔ 0 < p.degree

full_name: Polynomial.eq_C_of_natDegree_le_zero
code: theorem eq_C_of_natDegree_le_zero (h : natDegree p ≤ 0) : p = C (coeff p 0) 
goal: p = Polynomial.C (p.coeff 0)

full_name: Polynomial.eq_C_of_natDegree_eq_zero
code: theorem eq_C_of_natDegree_eq_zero (h : natDegree p = 0) : p = C (coeff p 0) 
goal: p = Polynomial.C (p.coeff 0)

full_name: Polynomial.natDegree_eq_zero
code: lemma natDegree_eq_zero {p : R[X]} : p.natDegree = 0 ↔ ∃ x, C x = p 
goal: p.natDegree = 0 ↔ ∃ x, Polynomial.C x = p

full_name: Polynomial.eq_C_coeff_zero_iff_natDegree_eq_zero
code: theorem eq_C_coeff_zero_iff_natDegree_eq_zero : p = C (p.coeff 0) ↔ p.natDegree = 0 
goal: p = Polynomial.C (p.coeff 0) ↔ p.natDegree = 0

full_name: Polynomial.eq_one_of_monic_natDegree_zero
code: theorem eq_one_of_monic_natDegree_zero (hf : p.Monic) (hfd : p.natDegree = 0) : p = 1 
goal: p = 1

full_name: Polynomial.Monic.natDegree_eq_zero
code: theorem Monic.natDegree_eq_zero (hf : p.Monic) : p.natDegree = 0 ↔ p = 1 
goal: p.natDegree = 0 ↔ p = 1

full_name: Polynomial.ne_zero_of_coe_le_degree
code: theorem ne_zero_of_coe_le_degree (hdeg : ↑n ≤ p.degree) : p ≠ 0 
goal: p ≠ 0

full_name: Polynomial.le_natDegree_of_coe_le_degree
code: theorem le_natDegree_of_coe_le_degree (hdeg : ↑n ≤ p.degree) : n ≤ p.natDegree 
goal: n ≤ p.natDegree

full_name: Polynomial.degree_sum_fin_lt
code: theorem degree_sum_fin_lt {n : ℕ} (f : Fin n → R) :
    degree (∑ i : Fin n, C (f i) * X ^ (i : ℕ)) < n 
goal: (∑ i : Fin n, Polynomial.C (f i) * Polynomial.X ^ ↑i).degree < ↑n

full_name: Polynomial.degree_linear_le
code: theorem degree_linear_le : degree (C a * X + C b) ≤ 1 
goal: (Polynomial.C a * Polynomial.X + Polynomial.C b).degree ≤ 1

full_name: Polynomial.degree_linear_lt
code: theorem degree_linear_lt : degree (C a * X + C b) < 2 
goal: (Polynomial.C a * Polynomial.X + Polynomial.C b).degree < 2

full_name: Polynomial.degree_C_lt_degree_C_mul_X
code: theorem degree_C_lt_degree_C_mul_X (ha : a ≠ 0) : degree (C b) < degree (C a * X) 
goal: (Polynomial.C b).degree < (Polynomial.C a * Polynomial.X).degree

full_name: Polynomial.degree_linear
code: @[simp]
theorem degree_linear (ha : a ≠ 0) : degree (C a * X + C b) = 1 
goal: (Polynomial.C a * Polynomial.X + Polynomial.C b).degree = 1

full_name: Polynomial.natDegree_linear_le
code: theorem natDegree_linear_le : natDegree (C a * X + C b) ≤ 1 
goal: (Polynomial.C a * Polynomial.X + Polynomial.C b).natDegree ≤ 1

full_name: Polynomial.natDegree_linear
code: theorem natDegree_linear (ha : a ≠ 0) : natDegree (C a * X + C b) = 1 
goal: (Polynomial.C a * Polynomial.X + Polynomial.C b).natDegree = 1

full_name: Polynomial.leadingCoeff_linear
code: @[simp]
theorem leadingCoeff_linear (ha : a ≠ 0) : leadingCoeff (C a * X + C b) = a 
goal: (Polynomial.C a * Polynomial.X + Polynomial.C b).leadingCoeff = a

full_name: Polynomial.degree_quadratic_le
code: theorem degree_quadratic_le : degree (C a * X ^ 2 + C b * X + C c) ≤ 2 
goal: (Polynomial.C a * Polynomial.X ^ 2 + Polynomial.C b * Polynomial.X + Polynomial.C c).degree ≤ 2

full_name: Polynomial.degree_quadratic_lt
code: theorem degree_quadratic_lt : degree (C a * X ^ 2 + C b * X + C c) < 3 
goal: (Polynomial.C a * Polynomial.X ^ 2 + Polynomial.C b * Polynomial.X + Polynomial.C c).degree < 3

full_name: Polynomial.degree_linear_lt_degree_C_mul_X_sq
code: theorem degree_linear_lt_degree_C_mul_X_sq (ha : a ≠ 0) :
    degree (C b * X + C c) < degree (C a * X ^ 2) 
goal: (Polynomial.C b * Polynomial.X + Polynomial.C c).degree < (Polynomial.C a * Polynomial.X ^ 2).degree

full_name: Polynomial.degree_quadratic
code: @[simp]
theorem degree_quadratic (ha : a ≠ 0) : degree (C a * X ^ 2 + C b * X + C c) = 2 
goal: (Polynomial.C a * Polynomial.X ^ 2 + Polynomial.C b * Polynomial.X + Polynomial.C c).degree = 2

full_name: Polynomial.natDegree_quadratic_le
code: theorem natDegree_quadratic_le : natDegree (C a * X ^ 2 + C b * X + C c) ≤ 2 
goal: (Polynomial.C a * Polynomial.X ^ 2 + Polynomial.C b * Polynomial.X + Polynomial.C c).natDegree ≤ 2

full_name: Polynomial.natDegree_quadratic
code: theorem natDegree_quadratic (ha : a ≠ 0) : natDegree (C a * X ^ 2 + C b * X + C c) = 2 
goal: (Polynomial.C a * Polynomial.X ^ 2 + Polynomial.C b * Polynomial.X + Polynomial.C c).natDegree = 2

full_name: Polynomial.leadingCoeff_quadratic
code: @[simp]
theorem leadingCoeff_quadratic (ha : a ≠ 0) : leadingCoeff (C a * X ^ 2 + C b * X + C c) = a 
goal: (Polynomial.C a * Polynomial.X ^ 2 + Polynomial.C b * Polynomial.X + Polynomial.C c).leadingCoeff = a

full_name: Polynomial.degree_cubic_le
code: theorem degree_cubic_le : degree (C a * X ^ 3 + C b * X ^ 2 + C c * X + C d) ≤ 3 
goal: (Polynomial.C a * Polynomial.X ^ 3 + Polynomial.C b * Polynomial.X ^ 2 + Polynomial.C c * Polynomial.X +
      Polynomial.C d).degree ≤
  3

full_name: Polynomial.degree_cubic_lt
code: theorem degree_cubic_lt : degree (C a * X ^ 3 + C b * X ^ 2 + C c * X + C d) < 4 
goal: (Polynomial.C a * Polynomial.X ^ 3 + Polynomial.C b * Polynomial.X ^ 2 + Polynomial.C c * Polynomial.X +
      Polynomial.C d).degree <
  4

full_name: Polynomial.degree_quadratic_lt_degree_C_mul_X_cb
code: theorem degree_quadratic_lt_degree_C_mul_X_cb (ha : a ≠ 0) :
    degree (C b * X ^ 2 + C c * X + C d) < degree (C a * X ^ 3) 
goal: (Polynomial.C b * Polynomial.X ^ 2 + Polynomial.C c * Polynomial.X + Polynomial.C d).degree <
  (Polynomial.C a * Polynomial.X ^ 3).degree

full_name: Polynomial.degree_cubic
code: @[simp]
theorem degree_cubic (ha : a ≠ 0) : degree (C a * X ^ 3 + C b * X ^ 2 + C c * X + C d) = 3 
goal: (Polynomial.C a * Polynomial.X ^ 3 + Polynomial.C b * Polynomial.X ^ 2 + Polynomial.C c * Polynomial.X +
      Polynomial.C d).degree =
  3

full_name: Polynomial.natDegree_cubic_le
code: theorem natDegree_cubic_le : natDegree (C a * X ^ 3 + C b * X ^ 2 + C c * X + C d) ≤ 3 
goal: (Polynomial.C a * Polynomial.X ^ 3 + Polynomial.C b * Polynomial.X ^ 2 + Polynomial.C c * Polynomial.X +
      Polynomial.C d).natDegree ≤
  3

full_name: Polynomial.natDegree_cubic
code: theorem natDegree_cubic (ha : a ≠ 0) : natDegree (C a * X ^ 3 + C b * X ^ 2 + C c * X + C d) = 3 
goal: (Polynomial.C a * Polynomial.X ^ 3 + Polynomial.C b * Polynomial.X ^ 2 + Polynomial.C c * Polynomial.X +
      Polynomial.C d).natDegree =
  3

full_name: Polynomial.leadingCoeff_cubic
code: @[simp]
theorem leadingCoeff_cubic (ha : a ≠ 0) :
    leadingCoeff (C a * X ^ 3 + C b * X ^ 2 + C c * X + C d) = a 
goal: (Polynomial.C a * Polynomial.X ^ 3 + Polynomial.C b * Polynomial.X ^ 2 + Polynomial.C c * Polynomial.X +
      Polynomial.C d).leadingCoeff =
  a

full_name: Polynomial.degree_X_pow
code: @[simp]
theorem degree_X_pow : degree ((X : R[X]) ^ n) = n 
goal: (Polynomial.X ^ n).degree = ↑n

full_name: Polynomial.natDegree_X_pow
code: @[simp]
theorem natDegree_X_pow : natDegree ((X : R[X]) ^ n) = n 
goal: (Polynomial.X ^ n).natDegree = n

full_name: Polynomial.natDegree_mul_X
code: @[simp] lemma natDegree_mul_X (hp : p ≠ 0) : natDegree (p * X) = natDegree p + 1 
goal: (p * Polynomial.X).natDegree = p.natDegree + 1

full_name: Polynomial.natDegree_X_mul
code: @[simp] lemma natDegree_X_mul (hp : p ≠ 0) : natDegree (X * p) = natDegree p + 1 
goal: (Polynomial.X * p).natDegree = p.natDegree + 1

full_name: Polynomial.natDegree_mul_X_pow
code: @[simp] lemma natDegree_mul_X_pow (hp : p ≠ 0) : natDegree (p * X ^ n) = natDegree p + n 
goal: (p * Polynomial.X ^ n).natDegree = p.natDegree + n

full_name: Polynomial.natDegree_X_pow_mul
code: @[simp] lemma natDegree_X_pow_mul (hp : p ≠ 0) : natDegree (X ^ n * p) = natDegree p + n 
goal: (Polynomial.X ^ n * p).natDegree = p.natDegree + n

full_name: Polynomial.natDegree_X_pow_le
code: theorem natDegree_X_pow_le {R : Type*} [Semiring R] (n : ℕ) : (X ^ n : R[X]).natDegree ≤ n 
goal: (Polynomial.X ^ n).natDegree ≤ n

full_name: Polynomial.not_isUnit_X
code: theorem not_isUnit_X : ¬IsUnit (X : R[X]) 
goal: ¬IsUnit Polynomial.X

full_name: Polynomial.degree_mul_X
code: @[simp]
theorem degree_mul_X : degree (p * X) = degree p + 1 
goal: (p * Polynomial.X).degree = p.degree + 1

full_name: Polynomial.degree_mul_X_pow
code: @[simp]
theorem degree_mul_X_pow : degree (p * X ^ n) = degree p + n 
goal: (p * Polynomial.X ^ n).degree = p.degree + ↑n

full_name: Polynomial.degree_sub_C
code: theorem degree_sub_C (hp : 0 < degree p) : degree (p - C a) = degree p 
goal: (p - Polynomial.C a).degree = p.degree

full_name: Polynomial.natDegree_sub_C
code: @[simp]
theorem natDegree_sub_C {a : R} : natDegree (p - C a) = natDegree p 
goal: (p - Polynomial.C a).natDegree = p.natDegree

full_name: Polynomial.degree_sub_le
code: theorem degree_sub_le (p q : R[X]) : degree (p - q) ≤ max (degree p) (degree q) 
goal: (p - q).degree ≤ max p.degree q.degree

full_name: Polynomial.degree_sub_le_of_le
code: theorem degree_sub_le_of_le {a b : WithBot ℕ} (hp : degree p ≤ a) (hq : degree q ≤ b) :
    degree (p - q) ≤ max a b 
goal: (p - q).degree ≤ max a b

full_name: Polynomial.leadingCoeff_sub_of_degree_lt
code: theorem leadingCoeff_sub_of_degree_lt (h : Polynomial.degree q < Polynomial.degree p) :
    (p - q).leadingCoeff = p.leadingCoeff 
goal: (p - q).leadingCoeff = p.leadingCoeff

full_name: Polynomial.leadingCoeff_sub_of_degree_lt'
code: theorem leadingCoeff_sub_of_degree_lt' (h : Polynomial.degree p < Polynomial.degree q) :
    (p - q).leadingCoeff = -q.leadingCoeff 
goal: (p - q).leadingCoeff = -q.leadingCoeff

full_name: Polynomial.leadingCoeff_sub_of_degree_eq
code: theorem leadingCoeff_sub_of_degree_eq (h : degree p = degree q)
    (hlc : leadingCoeff p ≠ leadingCoeff q) :
    leadingCoeff (p - q) = leadingCoeff p - leadingCoeff q 
goal: (p - q).leadingCoeff = p.leadingCoeff - q.leadingCoeff

full_name: Polynomial.natDegree_sub_le
code: theorem natDegree_sub_le (p q : R[X]) : natDegree (p - q) ≤ max (natDegree p) (natDegree q) 
goal: (p - q).natDegree ≤ max p.natDegree q.natDegree

full_name: Polynomial.natDegree_sub_le_of_le
code: theorem natDegree_sub_le_of_le (hp : natDegree p ≤ m) (hq : natDegree q ≤ n) :
    natDegree (p - q) ≤ max m n 
goal: (p - q).natDegree ≤ max m n

full_name: Polynomial.degree_sub_lt
code: theorem degree_sub_lt (hd : degree p = degree q) (hp0 : p ≠ 0)
    (hlc : leadingCoeff p = leadingCoeff q) : degree (p - q) < degree p 
goal: (p - q).degree < p.degree

full_name: Polynomial.degree_X_sub_C_le
code: theorem degree_X_sub_C_le (r : R) : (X - C r).degree ≤ 1 
goal: (Polynomial.X - Polynomial.C r).degree ≤ 1

full_name: Polynomial.natDegree_X_sub_C_le
code: theorem natDegree_X_sub_C_le (r : R) : (X - C r).natDegree ≤ 1 
goal: (Polynomial.X - Polynomial.C r).natDegree ≤ 1

full_name: Polynomial.degree_sub_eq_left_of_degree_lt
code: theorem degree_sub_eq_left_of_degree_lt (h : degree q < degree p) : degree (p - q) = degree p 
goal: (p - q).degree = p.degree

full_name: Polynomial.degree_sub_eq_right_of_degree_lt
code: theorem degree_sub_eq_right_of_degree_lt (h : degree p < degree q) : degree (p - q) = degree q 
goal: (p - q).degree = q.degree

full_name: Polynomial.natDegree_sub_eq_left_of_natDegree_lt
code: theorem natDegree_sub_eq_left_of_natDegree_lt (h : natDegree q < natDegree p) :
    natDegree (p - q) = natDegree p 
goal: (p - q).natDegree = p.natDegree

full_name: Polynomial.natDegree_sub_eq_right_of_natDegree_lt
code: theorem natDegree_sub_eq_right_of_natDegree_lt (h : natDegree p < natDegree q) :
    natDegree (p - q) = natDegree q 
goal: (p - q).natDegree = q.natDegree

full_name: Polynomial.degree_X_add_C
code: @[simp]
theorem degree_X_add_C (a : R) : degree (X + C a) = 1 
goal: (Polynomial.X + Polynomial.C a).degree = 1

full_name: Polynomial.natDegree_X_add_C
code: theorem natDegree_X_add_C (x : R) : (X + C x).natDegree = 1 
goal: (Polynomial.X + Polynomial.C x).natDegree = 1

full_name: Polynomial.nextCoeff_X_add_C
code: @[simp]
theorem nextCoeff_X_add_C [Semiring S] (c : S) : nextCoeff (X + C c) = c 
goal: (Polynomial.X + Polynomial.C c).nextCoeff = c

full_name: Polynomial.degree_X_pow_add_C
code: theorem degree_X_pow_add_C {n : ℕ} (hn : 0 < n) (a : R) : degree ((X : R[X]) ^ n + C a) = n 
goal: (Polynomial.X ^ n + Polynomial.C a).degree = ↑n

full_name: Polynomial.X_pow_add_C_ne_zero
code: theorem X_pow_add_C_ne_zero {n : ℕ} (hn : 0 < n) (a : R) : (X : R[X]) ^ n + C a ≠ 0 
goal: Polynomial.X ^ n + Polynomial.C a ≠ 0

full_name: Polynomial.X_add_C_ne_zero
code: theorem X_add_C_ne_zero (r : R) : X + C r ≠ 0 
goal: Polynomial.X + Polynomial.C r ≠ 0

full_name: Polynomial.zero_nmem_multiset_map_X_add_C
code: theorem zero_nmem_multiset_map_X_add_C {α : Type*} (m : Multiset α) (f : α → R) :
    (0 : R[X]) ∉ m.map fun a => X + C (f a) 
goal: 0 ∉ Multiset.map (fun a => Polynomial.X + Polynomial.C (f a)) m

full_name: Polynomial.natDegree_X_pow_add_C
code: theorem natDegree_X_pow_add_C {n : ℕ} {r : R} : (X ^ n + C r).natDegree = n 
goal: (Polynomial.X ^ n + Polynomial.C r).natDegree = n

full_name: Polynomial.X_pow_add_C_ne_one
code: theorem X_pow_add_C_ne_one {n : ℕ} (hn : 0 < n) (a : R) : (X : R[X]) ^ n + C a ≠ 1 
goal: Polynomial.X ^ n + Polynomial.C a ≠ 1

full_name: Polynomial.X_add_C_ne_one
code: theorem X_add_C_ne_one (r : R) : X + C r ≠ 1 
goal: Polynomial.X + Polynomial.C r ≠ 1

full_name: Polynomial.leadingCoeff_X_pow_add_C
code: @[simp]
theorem leadingCoeff_X_pow_add_C {n : ℕ} (hn : 0 < n) {r : R} :
    (X ^ n + C r).leadingCoeff = 1 
goal: (Polynomial.X ^ n + Polynomial.C r).leadingCoeff = 1

full_name: Polynomial.leadingCoeff_X_add_C
code: @[simp]
theorem leadingCoeff_X_add_C [Semiring S] (r : S) : (X + C r).leadingCoeff = 1 
goal: (Polynomial.X + Polynomial.C r).leadingCoeff = 1

full_name: Polynomial.leadingCoeff_X_pow_add_one
code: @[simp]
theorem leadingCoeff_X_pow_add_one {n : ℕ} (hn : 0 < n) : (X ^ n + 1 : R[X]).leadingCoeff = 1 
goal: (Polynomial.X ^ n + 1).leadingCoeff = 1

full_name: Polynomial.leadingCoeff_pow_X_add_C
code: @[simp]
theorem leadingCoeff_pow_X_add_C (r : R) (i : ℕ) : leadingCoeff ((X + C r) ^ i) = 1 
goal: ((Polynomial.X + Polynomial.C r) ^ i).leadingCoeff = 1

full_name: Polynomial.leadingCoeff_X_pow_sub_C
code: @[simp]
theorem leadingCoeff_X_pow_sub_C {n : ℕ} (hn : 0 < n) {r : R} :
    (X ^ n - C r).leadingCoeff = 1 
goal: (Polynomial.X ^ n - Polynomial.C r).leadingCoeff = 1

full_name: Polynomial.leadingCoeff_X_pow_sub_one
code: @[simp]
theorem leadingCoeff_X_pow_sub_one {n : ℕ} (hn : 0 < n) : (X ^ n - 1 : R[X]).leadingCoeff = 1 
goal: (Polynomial.X ^ n - 1).leadingCoeff = 1

full_name: Polynomial.degree_X_sub_C
code: @[simp]
theorem degree_X_sub_C (a : R) : degree (X - C a) = 1 
goal: (Polynomial.X - Polynomial.C a).degree = 1

full_name: Polynomial.natDegree_X_sub_C
code: theorem natDegree_X_sub_C (x : R) : (X - C x).natDegree = 1 
goal: (Polynomial.X - Polynomial.C x).natDegree = 1

full_name: Polynomial.nextCoeff_X_sub_C
code: @[simp]
theorem nextCoeff_X_sub_C [Ring S] (c : S) : nextCoeff (X - C c) = -c 
goal: (Polynomial.X - Polynomial.C c).nextCoeff = -c

full_name: Polynomial.degree_X_pow_sub_C
code: theorem degree_X_pow_sub_C {n : ℕ} (hn : 0 < n) (a : R) : degree ((X : R[X]) ^ n - C a) = n 
goal: (Polynomial.X ^ n - Polynomial.C a).degree = ↑n

full_name: Polynomial.X_pow_sub_C_ne_zero
code: theorem X_pow_sub_C_ne_zero {n : ℕ} (hn : 0 < n) (a : R) : (X : R[X]) ^ n - C a ≠ 0 
goal: Polynomial.X ^ n - Polynomial.C a ≠ 0

full_name: Polynomial.X_sub_C_ne_zero
code: theorem X_sub_C_ne_zero (r : R) : X - C r ≠ 0 
goal: Polynomial.X - Polynomial.C r ≠ 0

full_name: Polynomial.zero_nmem_multiset_map_X_sub_C
code: theorem zero_nmem_multiset_map_X_sub_C {α : Type*} (m : Multiset α) (f : α → R) :
    (0 : R[X]) ∉ m.map fun a => X - C (f a) 
goal: 0 ∉ Multiset.map (fun a => Polynomial.X - Polynomial.C (f a)) m

full_name: Polynomial.natDegree_X_pow_sub_C
code: theorem natDegree_X_pow_sub_C {n : ℕ} {r : R} : (X ^ n - C r).natDegree = n 
goal: (Polynomial.X ^ n - Polynomial.C r).natDegree = n

full_name: Polynomial.leadingCoeff_X_sub_C
code: @[simp]
theorem leadingCoeff_X_sub_C [Ring S] (r : S) : (X - C r).leadingCoeff = 1 
goal: (Polynomial.X - Polynomial.C r).leadingCoeff = 1

full_name: Polynomial.degree_mul
code: @[simp]
theorem degree_mul : degree (p * q) = degree p + degree q 
goal: (p * q).degree = p.degree + q.degree

full_name: Polynomial.degreeMonoidHom
code: /-- `degree` as a monoid homomorphism between `R[X]` and `Multiplicative (WithBot ℕ)`.
  This is useful to prove results about multiplication and degree. -/
def degreeMonoidHom [Nontrivial R] : R[X] →* Multiplicative (WithBot ℕ) 
goal: R[X] →* Multiplicative (WithBot ℕ)

full_name: Polynomial.degree_pow
code: @[simp]
theorem degree_pow [Nontrivial R] (p : R[X]) (n : ℕ) : degree (p ^ n) = n • degree p 
goal: (p ^ n).degree = n • p.degree

full_name: Polynomial.leadingCoeff_mul
code: @[simp]
theorem leadingCoeff_mul (p q : R[X]) : leadingCoeff (p * q) = leadingCoeff p * leadingCoeff q 
goal: (p * q).leadingCoeff = p.leadingCoeff * q.leadingCoeff

full_name: Polynomial.leadingCoeffHom
code: /-- `Polynomial.leadingCoeff` bundled as a `MonoidHom` when `R` has `NoZeroDivisors`, and thus
  `leadingCoeff` is multiplicative -/
def leadingCoeffHom : R[X] →* R 
goal: R[X] →* R

full_name: Polynomial.leadingCoeffHom_apply
code: @[simp]
theorem leadingCoeffHom_apply (p : R[X]) : leadingCoeffHom p = leadingCoeff p 
goal: Polynomial.leadingCoeffHom p = p.leadingCoeff

full_name: Polynomial.leadingCoeff_pow
code: @[simp]
theorem leadingCoeff_pow (p : R[X]) (n : ℕ) : leadingCoeff (p ^ n) = leadingCoeff p ^ n 
goal: (p ^ n).leadingCoeff = p.leadingCoeff ^ n

full_name: Polynomial.leadingCoeff_dvd_leadingCoeff
code: theorem leadingCoeff_dvd_leadingCoeff {a p : R[X]} (hap : a ∣ p) :
    a.leadingCoeff ∣ p.leadingCoeff 
goal: a.leadingCoeff ∣ p.leadingCoeff