Degree of univariate polynomials #
Main definitions #
Polynomial.degree: the degree of a polynomial, where0has degree⊥Polynomial.natDegree: the degree of a polynomial, where0has degree0Polynomial.leadingCoeff: the leading coefficient of a polynomialPolynomial.Monic: a polynomial is monic if its leading coefficient is 0Polynomial.nextCoeff: the next coefficient after the leading coefficient
Main results #
Polynomial.degree_eq_natDegree: the degree and natDegree coincide for nonzero polynomials
leadingCoeff p gives the coefficient of the highest power of X in p.
Instances For
a polynomial is Monic if its leading coefficient is 1
Instances For
theorem
Polynomial.Monic.def
{R : Type u}
[Semiring R]
{p : Polynomial R}
:
p.Monic ↔ p.leadingCoeff = 1
@[implicit_reducible]
instance
Polynomial.Monic.decidable
{R : Type u}
[Semiring R]
{p : Polynomial R}
[DecidableEq R]
:
Decidable p.Monic
@[simp]
theorem
Polynomial.Monic.leadingCoeff
{R : Type u}
[Semiring R]
{p : Polynomial R}
(hp : p.Monic)
:
p.leadingCoeff = 1
theorem
Polynomial.Monic.coeff_natDegree
{R : Type u}
[Semiring R]
{p : Polynomial R}
(hp : p.Monic)
:
@[simp]
@[simp]
theorem
Polynomial.coeff_natDegree
{R : Type u}
[Semiring R]
{p : Polynomial R}
:
p.coeff p.natDegree = p.leadingCoeff
@[simp]
theorem
Polynomial.degree_eq_iff_natDegree_eq
{R : Type u}
[Semiring R]
{p : Polynomial R}
{n : ℕ}
(hp : p ≠ 0)
:
theorem
Polynomial.degree_eq_iff_natDegree_eq_of_pos
{R : Type u}
[Semiring R]
{p : Polynomial R}
{n : ℕ}
(hn : 0 < n)
:
theorem
Polynomial.natDegree_eq_of_degree_eq_some
{R : Type u}
[Semiring R]
{p : Polynomial R}
{n : ℕ}
(h : p.degree = ↑n)
:
p.natDegree = n
@[simp]
theorem
Polynomial.natDegree_eq_of_degree_eq
{R : Type u}
{S : Type v}
[Semiring R]
{p : Polynomial R}
[Semiring S]
{q : Polynomial S}
(h : p.degree = q.degree)
:
theorem
Polynomial.le_degree_of_ne_zero
{R : Type u}
{n : ℕ}
[Semiring R]
{p : Polynomial R}
(h : p.coeff n ≠ 0)
:
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.degree_le_degree
{R : Type u}
[Semiring R]
{p q : Polynomial R}
(h : q.coeff p.natDegree ≠ 0)
:
theorem
Polynomial.natDegree_le_iff_degree_le
{R : Type u}
[Semiring R]
{p : Polynomial R}
{n : ℕ}
:
theorem
Polynomial.natDegree_lt_iff_degree_lt
{R : Type u}
{n : ℕ}
[Semiring R]
{p : Polynomial R}
(hp : p ≠ 0)
:
Alias of the reverse direction of Polynomial.natDegree_le_iff_degree_le.
Alias of the forward direction of Polynomial.natDegree_le_iff_degree_le.
theorem
Polynomial.natDegree_le_natDegree
{R : Type u}
{S : Type v}
[Semiring R]
{p : Polynomial R}
[Semiring S]
{q : Polynomial S}
(hpq : p.degree ≤ q.degree)
:
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Polynomial.natDegree_ofNat
{R : Type u}
[Semiring R]
(n : ℕ)
[n.AtLeastTwo]
:
(OfNat.ofNat n).natDegree = 0
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
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.withBotSucc_degree_eq_natDegree_add_one
{R : Type u}
[Semiring R]
{p : Polynomial R}
(h : p ≠ 0)
:
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Polynomial.degree_neg_le_of_le
{R : Type u}
[Ring R]
{a : WithBot ℕ}
{p : Polynomial R}
(hp : 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]
@[simp]
theorem
Polynomial.leadingCoeff_neg
{R : Type u}
[Ring R]
(p : Polynomial R)
:
(-p).leadingCoeff = -p.leadingCoeff
The second-highest coefficient, or 0 for constants
Instances For
@[simp]
theorem
Polynomial.nextCoeff_of_natDegree_pos
{R : Type u}
[Semiring R]
{p : Polynomial R}
(hp : 0 < p.natDegree)
:
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)
:
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)
:
@[simp]
@[simp]
theorem
Polynomial.leadingCoeff_eq_zero
{R : Type u}
[Semiring R]
{p : Polynomial R}
:
p.leadingCoeff = 0 ↔ p = 0
theorem
Polynomial.leadingCoeff_ne_zero
{R : Type u}
[Semiring R]
{p : Polynomial R}
:
p.leadingCoeff ≠ 0 ↔ p ≠ 0
theorem
Polynomial.leadingCoeff_eq_zero_iff_deg_eq_bot
{R : Type u}
[Semiring R]
{p : Polynomial R}
:
p.leadingCoeff = 0 ↔ p.degree = ⊥
theorem
Polynomial.degree_sum_le
{R : Type u}
[Semiring R]
{ι : Type u_1}
(s : Finset ι)
(f : ι → Polynomial R)
:
theorem
Polynomial.degree_pow_le_of_le
{R : Type u}
[Semiring R]
{p : Polynomial R}
{a : WithBot ℕ}
(b : ℕ)
(hp : p.degree ≤ a)
:
@[simp]
theorem
Polynomial.leadingCoeff_monomial
{R : Type u}
[Semiring R]
(a : R)
(n : ℕ)
:
((monomial n) a).leadingCoeff = a
theorem
Polynomial.leadingCoeff_C_mul_X_pow
{R : Type u}
[Semiring R]
(a : R)
(n : ℕ)
:
(C a * X ^ n).leadingCoeff = a
theorem
Polynomial.leadingCoeff_C_mul_X
{R : Type u}
[Semiring R]
(a : R)
:
(C a * X).leadingCoeff = a
@[simp]
@[simp]
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)
:
theorem
Polynomial.natDegree_pow_le_of_le
{R : Type u}
{m : ℕ}
[Semiring R]
{p : Polynomial R}
(n : ℕ)
(hp : p.natDegree ≤ m)
:
theorem
Polynomial.natDegree_eq_zero_iff_degree_le_zero
{R : Type u}
[Semiring R]
{p : Polynomial R}
:
theorem
Polynomial.degree_le_iff_coeff_zero
{R : Type u}
[Semiring R]
(f : Polynomial R)
(n : WithBot ℕ)
:
@[simp]
@[simp]
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)
: