Documentation

Mathlib.Algebra.Polynomial.Degree.Operations

Lemmas for calculating the degree of univariate polynomials #

Main results #

theorem Polynomial.le_natDegree_of_ne_zero {R : Type u} {n : } [Semiring R] {p : Polynomial R} (h : p.coeff n 0) :
theorem Polynomial.degree_eq_of_le_of_coeff_ne_zero {R : Type u} {n : } [Semiring R] {p : Polynomial R} (pn : p.degree n) (p1 : p.coeff n 0) :
p.degree = n
theorem Polynomial.natDegree_eq_of_le_of_coeff_ne_zero {R : Type u} {n : } [Semiring R] {p : Polynomial R} (pn : p.natDegree n) (p1 : p.coeff n 0) :
theorem Polynomial.natDegree_lt_natDegree {R : Type u} {S : Type v} [Semiring R] [Semiring S] {p : Polynomial R} {q : Polynomial S} (hp : p 0) (hpq : p.degree < q.degree) :
theorem Polynomial.natDegree_eq_natDegree {R : Type u} {S : Type v} [Semiring R] [Semiring S] {p : Polynomial R} {q : Polynomial S} (hpq : p.degree = q.degree) :
theorem Polynomial.coeff_eq_zero_of_degree_lt {R : Type u} {n : } [Semiring R] {p : Polynomial R} (h : p.degree < n) :
p.coeff n = 0
theorem Polynomial.coeff_eq_zero_of_natDegree_lt {R : Type u} [Semiring R] {p : Polynomial R} {n : } (h : p.natDegree < n) :
p.coeff n = 0
theorem Polynomial.ext_iff_natDegree_le {R : Type u} [Semiring R] {p q : Polynomial R} {n : } (hp : p.natDegree n) (hq : q.natDegree n) :
p = q in, p.coeff i = q.coeff i
theorem Polynomial.ext_iff_degree_le {R : Type u} [Semiring R] {p q : Polynomial R} {n : } (hp : p.degree n) (hq : q.degree n) :
p = q in, p.coeff i = q.coeff i
theorem Polynomial.ite_le_natDegree_coeff {R : Type u} [Semiring R] (p : Polynomial R) (n : ) (I : Decidable (n < 1 + p.natDegree)) :
(if n < 1 + p.natDegree then p.coeff n else 0) = p.coeff n
theorem Polynomial.coeff_mul_X_sub_C {R : Type u} [Ring R] {p : Polynomial R} {r : R} {a : } :
(p * (X - C r)).coeff (a + 1) = p.coeff a - p.coeff (a + 1) * r
theorem Polynomial.ne_zero_of_degree_gt {R : Type u} [Semiring R] {p : Polynomial R} {n : WithBot } (h : n < p.degree) :
p 0
theorem Polynomial.ne_zero_of_degree_ge_degree {R : Type u} [Semiring R] {p q : Polynomial R} (hpq : p.degree q.degree) (hp : p 0) :
q 0
theorem Polynomial.ne_zero_of_natDegree_gt {R : Type u} [Semiring R] {p : Polynomial R} {n : } (h : n < p.natDegree) :
p 0
theorem Polynomial.eq_C_of_degree_le_zero {R : Type u} [Semiring R] {p : Polynomial R} (h : p.degree 0) :
p = C (p.coeff 0)
theorem Polynomial.eq_C_of_degree_eq_zero {R : Type u} [Semiring R] {p : Polynomial R} (h : p.degree = 0) :
p = C (p.coeff 0)
theorem Polynomial.degree_add_C {R : Type u} {a : R} [Semiring R] {p : Polynomial R} (hp : 0 < p.degree) :
(p + C a).degree = p.degree
@[simp]
theorem Polynomial.natDegree_add_C {R : Type u} [Semiring R] {p : Polynomial R} {a : R} :
@[simp]
theorem Polynomial.natDegree_C_add {R : Type u} [Semiring R] {p : Polynomial R} {a : R} :
theorem Polynomial.monic_of_natDegree_le_of_coeff_eq_one {R : Type u} [Semiring R] {p : Polynomial R} (n : ) (pn : p.natDegree n) (p1 : p.coeff n = 1) :
theorem Polynomial.monic_of_degree_le_of_coeff_eq_one {R : Type u} [Semiring R] {p : Polynomial R} (n : ) (pn : p.degree n) (p1 : p.coeff n = 1) :
theorem Polynomial.degree_mul' {R : Type u} [Semiring R] {p q : Polynomial R} (h : p.leadingCoeff * q.leadingCoeff 0) :
(p * q).degree = p.degree + q.degree
theorem Polynomial.Monic.degree_mul {R : Type u} [Semiring R] {p q : Polynomial R} (hq : q.Monic) :
(p * q).degree = p.degree + q.degree
theorem Polynomial.degree_pow' {R : Type u} [Semiring R] {p : Polynomial R} {n : } :
p.leadingCoeff ^ n 0(p ^ n).degree = n p.degree
theorem Polynomial.natDegree_pow' {R : Type u} [Semiring R] {p : Polynomial R} {n : } (h : p.leadingCoeff ^ n 0) :
(p ^ n).natDegree = n * p.natDegree
theorem Polynomial.degree_C_mul_of_isUnit {R : Type u} {a : R} [Semiring R] (ha : IsUnit a) (p : Polynomial R) :
(C a * p).degree = p.degree
theorem Polynomial.degree_mul_C_of_isUnit {R : Type u} {a : R} [Semiring R] (ha : IsUnit a) (p : Polynomial R) :
(p * C a).degree = p.degree
theorem Polynomial.natDegree_C_mul_of_isUnit {R : Type u} {a : R} [Semiring R] (ha : IsUnit a) (p : Polynomial R) :
theorem Polynomial.natDegree_mul_C_of_isUnit {R : Type u} {a : R} [Semiring R] (ha : IsUnit a) (p : Polynomial R) :
@[simp]
theorem Polynomial.coeff_pow_mul_natDegree {R : Type u} [Semiring R] (p : Polynomial R) (n : ) :
(p ^ n).coeff (n * p.natDegree) = p.leadingCoeff ^ n
theorem Polynomial.coeff_mul_add_eq_of_natDegree_le {R : Type u} [Semiring R] {df dg : } {f g : Polynomial R} (hdf : f.natDegree df) (hdg : g.natDegree dg) :
(f * g).coeff (df + dg) = f.coeff df * g.coeff dg
theorem Polynomial.degree_smul_le {R : Type u} [Semiring R] (a : R) (p : Polynomial R) :
theorem Polynomial.degree_lt_degree_mul_X {R : Type u} [Semiring R] {p : Polynomial R} (hp : p 0) :
p.degree < (p * X).degree
theorem Polynomial.eq_C_of_natDegree_eq_zero {R : Type u} [Semiring R] {p : Polynomial R} (h : p.natDegree = 0) :
p = C (p.coeff 0)
theorem Polynomial.natDegree_eq_zero {R : Type u} [Semiring R] {p : Polynomial R} :
p.natDegree = 0 ∃ (x : R), C x = p
theorem Polynomial.eq_one_of_monic_natDegree_zero {R : Type u} [Semiring R] {p : Polynomial R} (hf : p.Monic) (hfd : p.natDegree = 0) :
p = 1
theorem Polynomial.Monic.natDegree_eq_zero {R : Type u} [Semiring R] {p : Polynomial R} (hf : p.Monic) :
p.natDegree = 0 p = 1
theorem Polynomial.degree_sum_fin_lt {R : Type u} [Semiring R] {n : } (f : Fin nR) :
(∑ i : Fin n, C (f i) * X ^ i).degree < n
theorem Polynomial.degree_C_lt_degree_C_mul_X {R : Type u} {a b : R} [Semiring R] (ha : a 0) :
(C b).degree < (C a * X).degree
@[simp]
theorem Polynomial.natDegree_mul_X {R : Type u} [Semiring R] [Nontrivial R] {p : Polynomial R} (hp : p 0) :
@[simp]
theorem Polynomial.natDegree_X_mul {R : Type u} [Semiring R] [Nontrivial R] {p : Polynomial R} (hp : p 0) :
@[simp]
theorem Polynomial.natDegree_mul_X_pow {R : Type u} [Semiring R] [Nontrivial R] {p : Polynomial R} (n : ) (hp : p 0) :
(p * X ^ n).natDegree = p.natDegree + n
@[simp]
theorem Polynomial.natDegree_X_pow_mul {R : Type u} [Semiring R] [Nontrivial R] {p : Polynomial R} (n : ) (hp : p 0) :
(X ^ n * p).natDegree = p.natDegree + n
@[simp]
theorem Polynomial.degree_mul_X {R : Type u} [Semiring R] [Nontrivial R] {p : Polynomial R} :
(p * X).degree = p.degree + 1
@[simp]
theorem Polynomial.degree_mul_X_pow {R : Type u} [Semiring R] [Nontrivial R] {p : Polynomial R} (n : ) :
(p * X ^ n).degree = p.degree + n
theorem Polynomial.degree_sub_C {R : Type u} {a : R} [Ring R] {p : Polynomial R} (hp : 0 < p.degree) :
(p - C a).degree = p.degree
@[simp]
theorem Polynomial.natDegree_sub_C {R : Type u} [Ring R] {p : Polynomial R} {a : R} :
@[simp]
theorem Polynomial.degree_X_add_C {R : Type u} [Nontrivial R] [Semiring R] (a : R) :
(X + C a).degree = 1
theorem Polynomial.natDegree_X_add_C {R : Type u} [Nontrivial R] [Semiring R] (x : R) :
(X + C x).natDegree = 1
@[simp]
theorem Polynomial.nextCoeff_X_add_C {S : Type v} [Semiring S] (c : S) :
(X + C c).nextCoeff = c
theorem Polynomial.degree_X_pow_add_C {R : Type u} [Nontrivial R] [Semiring R] {n : } (hn : 0 < n) (a : R) :
(X ^ n + C a).degree = n
theorem Polynomial.X_pow_add_C_ne_zero {R : Type u} [Nontrivial R] [Semiring R] {n : } (hn : 0 < n) (a : R) :
X ^ n + C a 0
theorem Polynomial.X_add_C_ne_zero {R : Type u} [Nontrivial R] [Semiring R] (r : R) :
X + C r 0
theorem Polynomial.zero_nmem_multiset_map_X_add_C {R : Type u} [Nontrivial R] [Semiring R] {α : Type u_1} (m : Multiset α) (f : αR) :
0Multiset.map (fun (a : α) => X + C (f a)) m
theorem Polynomial.natDegree_X_pow_add_C {R : Type u} [Nontrivial R] [Semiring R] {n : } {r : R} :
(X ^ n + C r).natDegree = n
theorem Polynomial.X_pow_add_C_ne_one {R : Type u} [Nontrivial R] [Semiring R] {n : } (hn : 0 < n) (a : R) :
X ^ n + C a 1
theorem Polynomial.X_add_C_ne_one {R : Type u} [Nontrivial R] [Semiring R] (r : R) :
X + C r 1
@[simp]
theorem Polynomial.leadingCoeff_X_pow_add_C {R : Type u} [Semiring R] {n : } (hn : 0 < n) {r : R} :
(X ^ n + C r).leadingCoeff = 1
@[simp]
theorem Polynomial.leadingCoeff_X_add_C {S : Type v} [Semiring S] (r : S) :
@[simp]
theorem Polynomial.leadingCoeff_X_pow_add_one {R : Type u} [Semiring R] {n : } (hn : 0 < n) :
(X ^ n + 1).leadingCoeff = 1
@[simp]
theorem Polynomial.leadingCoeff_pow_X_add_C {R : Type u} [Semiring R] (r : R) (i : ) :
((X + C r) ^ i).leadingCoeff = 1
@[simp]
theorem Polynomial.degree_mul {R : Type u} [Semiring R] [NoZeroDivisors R] {p q : Polynomial R} :
(p * q).degree = p.degree + q.degree

degree as a monoid homomorphism between R[X] and Multiplicative (WithBot ℕ). This is useful to prove results about multiplication and degree.

Equations
Instances For
    @[simp]
    theorem Polynomial.degree_pow {R : Type u} [Semiring R] [NoZeroDivisors R] [Nontrivial R] (p : Polynomial R) (n : ) :
    (p ^ n).degree = n p.degree

    Polynomial.leadingCoeff bundled as a MonoidHom when R has NoZeroDivisors, and thus leadingCoeff is multiplicative

    Equations
    Instances For
      @[simp]
      theorem Polynomial.degree_le_mul_left {R : Type u} [Semiring R] [NoZeroDivisors R] {q : Polynomial R} (p : Polynomial R) (hq : q 0) :
      p.degree (p * q).degree
      theorem Polynomial.Monic.degree_pos {R : Type u} [CommSemiring R] {p : Polynomial R} (hp : p.Monic) :
      0 < p.degree p 1
      @[simp]
      theorem Polynomial.leadingCoeff_X_pow_sub_C {R : Type u} [Ring R] {n : } (hn : 0 < n) {r : R} :
      (X ^ n - C r).leadingCoeff = 1
      @[simp]
      theorem Polynomial.leadingCoeff_X_pow_sub_one {R : Type u} [Ring R] {n : } (hn : 0 < n) :
      (X ^ n - 1).leadingCoeff = 1
      @[simp]
      theorem Polynomial.degree_X_sub_C {R : Type u} [Ring R] [Nontrivial R] (a : R) :
      (X - C a).degree = 1
      theorem Polynomial.natDegree_X_sub_C {R : Type u} [Ring R] [Nontrivial R] (x : R) :
      (X - C x).natDegree = 1
      @[simp]
      theorem Polynomial.nextCoeff_X_sub_C {S : Type v} [Ring S] (c : S) :
      (X - C c).nextCoeff = -c
      theorem Polynomial.degree_X_pow_sub_C {R : Type u} [Ring R] [Nontrivial R] {n : } (hn : 0 < n) (a : R) :
      (X ^ n - C a).degree = n
      theorem Polynomial.X_pow_sub_C_ne_zero {R : Type u} [Ring R] [Nontrivial R] {n : } (hn : 0 < n) (a : R) :
      X ^ n - C a 0
      theorem Polynomial.X_sub_C_ne_zero {R : Type u} [Ring R] [Nontrivial R] (r : R) :
      X - C r 0
      theorem Polynomial.zero_nmem_multiset_map_X_sub_C {R : Type u} [Ring R] [Nontrivial R] {α : Type u_1} (m : Multiset α) (f : αR) :
      0Multiset.map (fun (a : α) => X - C (f a)) m
      theorem Polynomial.natDegree_X_pow_sub_C {R : Type u} [Ring R] [Nontrivial R] {n : } {r : R} :
      (X ^ n - C r).natDegree = n
      @[simp]
      theorem Polynomial.leadingCoeff_X_sub_C {S : Type v} [Ring S] (r : S) :