Documentation

Mathlib.Algebra.Polynomial.Degree.Defs

Degree of univariate polynomials #

Main definitions #

Main results #

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 = ⊥.

Equations
Instances For

    natDegree p forces degree p to ℕ, by defining natDegree 0 = 0.

    Equations
    Instances For
      def Polynomial.leadingCoeff {R : Type u} [Semiring R] (p : Polynomial R) :
      R

      leadingCoeff p gives the coefficient of the highest power of X in p.

      Equations
      Instances For
        def Polynomial.Monic {R : Type u} [Semiring R] (p : Polynomial R) :

        a polynomial is Monic if its leading coefficient is 1

        Equations
        Instances For
          @[simp]
          theorem Polynomial.Monic.leadingCoeff {R : Type u} [Semiring R] {p : Polynomial R} (hp : p.Monic) :
          @[simp]
          @[simp]
          @[simp]
          theorem Polynomial.degree_eq_bot {R : Type u} [Semiring R] {p : Polynomial R} :
          p.degree = ⊥ ↔ p = 0
          theorem Polynomial.degree_eq_natDegree {R : Type u} [Semiring R] {p : Polynomial R} (hp : p ≠ 0) :
          theorem Polynomial.degree_eq_iff_natDegree_eq {R : Type u} [Semiring R] {p : Polynomial R} {n : ℕ} (hp : p ≠ 0) :
          p.degree = ↑n ↔ p.natDegree = n
          theorem Polynomial.degree_eq_iff_natDegree_eq_of_pos {R : Type u} [Semiring R] {p : Polynomial R} {n : ℕ} (hn : 0 < n) :
          p.degree = ↑n ↔ p.natDegree = n
          theorem Polynomial.natDegree_eq_of_degree_eq_some {R : Type u} [Semiring R] {p : Polynomial R} {n : ℕ} (h : p.degree = ↑n) :
          theorem Polynomial.le_degree_of_ne_zero {R : Type u} {n : ℕ} [Semiring R] {p : Polynomial R} (h : p.coeff n ≠ 0) :
          ↑n ≤ p.degree
          theorem Polynomial.degree_mono {R : Type u} {S : Type v} [Semiring R] [Semiring S] {f : Polynomial R} {g : Polynomial S} (h : f.support ⊆ g.support) :
          theorem Polynomial.natDegree_lt_iff_degree_lt {R : Type u} {n : ℕ} [Semiring R] {p : Polynomial R} (hp : p ≠ 0) :
          p.natDegree < n ↔ p.degree < ↑n
          theorem Polynomial.natDegree_le_of_degree_le {R : Type u} [Semiring R] {p : Polynomial R} {n : ℕ} :
          p.degree ≤ ↑n → p.natDegree ≤ n

          Alias of the reverse direction of Polynomial.natDegree_le_iff_degree_le.

          theorem Polynomial.degree_le_of_natDegree_le {R : Type u} [Semiring R] {p : Polynomial R} {n : ℕ} :
          p.natDegree ≤ n → p.degree ≤ ↑n

          Alias of the forward direction of Polynomial.natDegree_le_iff_degree_le.

          @[simp]
          theorem Polynomial.degree_C {R : Type u} {a : R} [Semiring R] (ha : a ≠ 0) :
          (C a).degree = 0
          theorem Polynomial.degree_C_le {R : Type u} {a : R} [Semiring R] :
          (C a).degree ≤ 0
          theorem Polynomial.degree_C_lt {R : Type u} {a : R} [Semiring R] :
          (C a).degree < 1
          @[simp]
          theorem Polynomial.natDegree_C {R : Type u} [Semiring R] (a : R) :
          (C a).natDegree = 0
          @[simp]
          @[simp]
          theorem Polynomial.natDegree_natCast {R : Type u} [Semiring R] (n : ℕ) :
          (↑n).natDegree = 0
          @[simp]
          theorem Polynomial.degree_natCast_le {R : Type u} [Semiring R] (n : ℕ) :
          (↑n).degree ≤ 0
          @[simp]
          theorem Polynomial.degree_monomial {R : Type u} {a : R} [Semiring R] (n : ℕ) (ha : a ≠ 0) :
          ((monomial n) a).degree = ↑n
          @[simp]
          theorem Polynomial.degree_C_mul_X_pow {R : Type u} {a : R} [Semiring R] (n : ℕ) (ha : a ≠ 0) :
          (C a * X ^ n).degree = ↑n
          theorem Polynomial.degree_C_mul_X {R : Type u} {a : R} [Semiring R] (ha : a ≠ 0) :
          (C a * X).degree = 1
          theorem Polynomial.degree_monomial_le {R : Type u} [Semiring R] (n : ℕ) (a : R) :
          ((monomial n) a).degree ≤ ↑n
          theorem Polynomial.degree_C_mul_X_pow_le {R : Type u} [Semiring R] (n : ℕ) (a : R) :
          (C a * X ^ n).degree ≤ ↑n
          theorem Polynomial.degree_C_mul_X_le {R : Type u} [Semiring R] (a : R) :
          (C a * X).degree ≤ 1
          @[simp]
          theorem Polynomial.natDegree_C_mul_X_pow {R : Type u} [Semiring R] (n : ℕ) (a : R) (ha : a ≠ 0) :
          (C a * X ^ n).natDegree = n
          @[simp]
          theorem Polynomial.natDegree_C_mul_X {R : Type u} [Semiring R] (a : R) (ha : a ≠ 0) :
          (C a * X).natDegree = 1
          @[simp]
          theorem Polynomial.natDegree_monomial {R : Type u} [Semiring R] [DecidableEq R] (i : ℕ) (r : R) :
          ((monomial i) r).natDegree = if r = 0 then 0 else i
          theorem Polynomial.natDegree_monomial_le {R : Type u} [Semiring R] (a : R) {m : ℕ} :
          theorem Polynomial.natDegree_monomial_eq {R : Type u} [Semiring R] (i : ℕ) {r : R} (r0 : r ≠ 0) :
          ((monomial i) r).natDegree = i
          theorem Polynomial.coeff_ne_zero_of_eq_degree {R : Type u} {n : ℕ} [Semiring R] {p : Polynomial R} (hn : p.degree = ↑n) :
          p.coeff n ≠ 0
          theorem Polynomial.degree_X_pow_le {R : Type u} [Semiring R] (n : ℕ) :
          (X ^ n).degree ≤ ↑n
          @[simp]
          theorem Polynomial.degree_one {R : Type u} [Semiring R] [Nontrivial R] :
          degree 1 = 0
          @[simp]
          theorem Polynomial.degree_X {R : Type u} [Semiring R] [Nontrivial R] :
          @[simp]
          @[simp]
          theorem Polynomial.degree_neg {R : Type u} [Ring R] (p : Polynomial R) :
          theorem Polynomial.degree_neg_le_of_le {R : Type u} [Ring R] {a : WithBot ℕ} {p : Polynomial R} (hp : p.degree ≤ a) :
          (-p).degree ≤ a
          @[simp]
          theorem Polynomial.natDegree_neg_le_of_le {R : Type u} {m : ℕ} [Ring R] {p : Polynomial R} (hp : p.natDegree ≤ m) :
          @[simp]
          theorem Polynomial.natDegree_intCast {R : Type u} [Ring R] (n : ℤ) :
          (↑n).natDegree = 0
          theorem Polynomial.degree_intCast_le {R : Type u} [Ring R] (n : ℤ) :
          (↑n).degree ≤ 0
          def Polynomial.nextCoeff {R : Type u} [Semiring R] (p : Polynomial R) :
          R

          The second-highest coefficient, or 0 for constants

          Equations
          Instances For
            @[simp]
            theorem Polynomial.nextCoeff_C_eq_zero {R : Type u} [Semiring R] (c : R) :
            (C c).nextCoeff = 0
            theorem Polynomial.degree_add_le_of_degree_le {R : Type u} [Semiring R] {p q : Polynomial R} {n : ℕ} (hp : p.degree ≤ ↑n) (hq : q.degree ≤ ↑n) :
            (p + q).degree ≤ ↑n
            theorem Polynomial.degree_add_le_of_le {R : Type u} [Semiring R] {p q : Polynomial R} {a b : WithBot ℕ} (hp : p.degree ≤ a) (hq : q.degree ≤ b) :
            (p + q).degree ≤ max a b
            theorem Polynomial.natDegree_add_le_of_degree_le {R : Type u} [Semiring R] {p q : Polynomial R} {n : ℕ} (hp : p.natDegree ≤ n) (hq : q.natDegree ≤ n) :
            (p + q).natDegree ≤ n
            theorem Polynomial.natDegree_add_le_of_le {R : Type u} {n m : ℕ} [Semiring R] {p q : Polynomial R} (hp : p.natDegree ≤ m) (hq : q.natDegree ≤ n) :
            (p + q).natDegree ≤ max m n
            @[simp]
            theorem Polynomial.natDegree_C_mul_X_pow_le {R : Type u} [Semiring R] (a : R) (n : ℕ) :
            (C a * X ^ n).natDegree ≤ n
            theorem Polynomial.degree_erase_lt {R : Type u} [Semiring R] {p : Polynomial R} (hp : p ≠ 0) :
            theorem Polynomial.degree_update_le {R : Type u} [Semiring R] (p : Polynomial R) (n : ℕ) (a : R) :
            (p.update n a).degree ≤ max p.degree ↑n
            theorem Polynomial.degree_sum_le {R : Type u} [Semiring R] {ι : Type u_1} (s : Finset ι) (f : ι → Polynomial R) :
            (∑ i ∈ s, f i).degree ≤ s.sup fun (b : ι) => (f b).degree
            theorem Polynomial.degree_mul_le {R : Type u} [Semiring R] (p q : Polynomial R) :
            theorem Polynomial.degree_mul_le_of_le {R : Type u} [Semiring R] {p q : Polynomial R} {a b : WithBot ℕ} (hp : p.degree ≤ a) (hq : q.degree ≤ b) :
            (p * q).degree ≤ a + b
            theorem Polynomial.degree_pow_le {R : Type u} [Semiring R] (p : Polynomial R) (n : ℕ) :
            (p ^ n).degree ≤ n • p.degree
            theorem Polynomial.degree_pow_le_of_le {R : Type u} [Semiring R] {p : Polynomial R} {a : WithBot ℕ} (b : ℕ) (hp : p.degree ≤ a) :
            (p ^ b).degree ≤ ↑b * a
            @[simp]
            theorem Polynomial.leadingCoeff_monomial {R : Type u} [Semiring R] (a : R) (n : ℕ) :
            theorem Polynomial.leadingCoeff_C_mul_X_pow {R : Type u} [Semiring R] (a : R) (n : ℕ) :
            (C a * X ^ n).leadingCoeff = a
            @[simp]
            theorem Polynomial.leadingCoeff_C {R : Type u} [Semiring R] (a : R) :
            @[simp]
            theorem Polynomial.monic_X_pow {R : Type u} [Semiring R] (n : ℕ) :
            (X ^ n).Monic
            @[simp]
            theorem Polynomial.monic_X {R : Type u} [Semiring R] :
            @[simp]
            theorem Polynomial.monic_one {R : Type u} [Semiring R] :
            theorem Polynomial.Monic.ne_zero {R : Type u} [Semiring R] [Nontrivial R] {p : Polynomial R} (hp : p.Monic) :
            p ≠ 0
            theorem Polynomial.Monic.ne_zero_of_ne {R : Type u} [Semiring R] (h : 0 ≠ 1) {p : Polynomial R} (hp : p.Monic) :
            p ≠ 0
            theorem Polynomial.Monic.ne_zero_of_C {R : Type u} [Semiring R] [Nontrivial R] {c : R} (hc : (C c).Monic) :
            c ≠ 0
            theorem Polynomial.Monic.ne_zero_of_polynomial_ne {R : Type u} [Semiring R] {p q r : Polynomial R} (hp : p.Monic) (hne : q ≠ r) :
            p ≠ 0
            theorem Polynomial.natDegree_mul_le_of_le {R : Type u} {n m : ℕ} [Semiring R] {p q : Polynomial R} (hp : p.natDegree ≤ m) (hg : q.natDegree ≤ n) :
            (p * q).natDegree ≤ m + n
            theorem Polynomial.natDegree_pow_le {R : Type u} [Semiring R] {p : Polynomial R} {n : ℕ} :
            theorem Polynomial.natDegree_pow_le_of_le {R : Type u} {m : ℕ} [Semiring R] {p : Polynomial R} (n : ℕ) (hp : p.natDegree ≤ m) :
            (p ^ n).natDegree ≤ n * m
            theorem Polynomial.degree_le_iff_coeff_zero {R : Type u} [Semiring R] (f : Polynomial R) (n : WithBot ℕ) :
            f.degree ≤ n ↔ ∀ (m : ℕ), n < ↑m → f.coeff m = 0
            theorem Polynomial.degree_lt_iff_coeff_zero {R : Type u} [Semiring R] (f : Polynomial R) (n : ℕ) :
            f.degree < ↑n ↔ ∀ (m : ℕ), n ≤ m → f.coeff m = 0
            @[simp]
            theorem Polynomial.degree_X_pow {R : Type u} [Semiring R] [Nontrivial R] (n : ℕ) :
            (X ^ n).degree = ↑n
            @[simp]
            theorem Polynomial.natDegree_X_pow {R : Type u} [Semiring R] [Nontrivial R] (n : ℕ) :
            (X ^ n).natDegree = n
            theorem Polynomial.degree_sub_le {R : Type u} [Ring R] (p q : Polynomial R) :
            theorem Polynomial.degree_sub_le_of_le {R : Type u} [Ring R] {p q : Polynomial R} {a b : WithBot ℕ} (hp : p.degree ≤ a) (hq : q.degree ≤ b) :
            (p - q).degree ≤ max a b
            theorem Polynomial.natDegree_sub_le_of_le {R : Type u} {n m : ℕ} [Ring R] {p q : Polynomial R} (hp : p.natDegree ≤ m) (hq : q.natDegree ≤ n) :
            (p - q).natDegree ≤ max m n
            theorem Polynomial.degree_sub_lt {R : Type u} [Ring R] {p q : Polynomial R} (hd : p.degree = q.degree) (hp0 : p ≠ 0) (hlc : p.leadingCoeff = q.leadingCoeff) :
            (p - q).degree < p.degree
            theorem Polynomial.degree_X_sub_C_le {R : Type u} [Ring R] (r : R) :
            (X - C r).degree ≤ 1
            theorem Polynomial.natDegree_X_sub_C_le {R : Type u} [Ring R] (r : R) :
            (X - C r).natDegree ≤ 1