Theorem: Polynomial.degree_derivative_eq
File: Mathlib/Data/Polynomial/Derivative.lean

tactic: apply le_antisymm
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : Semiring R
inst✝ : NoZeroSMulDivisors ℕ R
p : R[X]
hp : 0 < natDegree p
⊢ degree (↑derivative p) = ↑(natDegree p - 1)

tactic: rw [derivative_apply]
state_before: case a
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : Semiring R
inst✝ : NoZeroSMulDivisors ℕ R
p : R[X]
hp : 0 < natDegree p
⊢ degree (↑derivative p) ≤ ↑(natDegree p - 1)

tactic: apply le_trans (degree_sum_le _ _) (Finset.sup_le _)
state_before: case a
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : Semiring R
inst✝ : NoZeroSMulDivisors ℕ R
p : R[X]
hp : 0 < natDegree p
⊢ degree (sum p fun n a => ↑C (a * ↑n) * X ^ (n - 1)) ≤ ↑(natDegree p - 1)

tactic: intro n hn
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : Semiring R
inst✝ : NoZeroSMulDivisors ℕ R
p : R[X]
hp : 0 < natDegree p
⊢ ∀ (b : ℕ), b ∈ support p → degree ((fun n a => ↑C (a * ↑n) * X ^ (n - 1)) b (coeff p b)) ≤ ↑(natDegree p - 1)

tactic: simp only [Nat.cast_withBot]
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n✝ : ℕ
inst✝¹ : Semiring R
inst✝ : NoZeroSMulDivisors ℕ R
p : R[X]
hp : 0 < natDegree p
n : ℕ
hn : n ∈ support p
⊢ degree ((fun n a => ↑C (a * ↑n) * X ^ (n - 1)) n (coeff p n)) ≤ ↑(natDegree p - 1)

tactic: apply le_trans (degree_C_mul_X_pow_le _ _) (WithBot.coe_le_coe.2 (tsub_le_tsub_right _ _))
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n✝ : ℕ
inst✝¹ : Semiring R
inst✝ : NoZeroSMulDivisors ℕ R
p : R[X]
hp : 0 < natDegree p
n : ℕ
hn : n ∈ support p
⊢ degree (↑C (coeff p n * ↑n) * X ^ (n - 1)) ≤ ↑(natDegree p - 1)

tactic: apply le_natDegree_of_mem_supp _ hn
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n✝ : ℕ
inst✝¹ : Semiring R
inst✝ : NoZeroSMulDivisors ℕ R
p : R[X]
hp : 0 < natDegree p
n : ℕ
hn : n ∈ support p
⊢ n ≤ natDegree p

tactic: refine' le_sup _
state_before: case a
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : Semiring R
inst✝ : NoZeroSMulDivisors ℕ R
p : R[X]
hp : 0 < natDegree p
⊢ ↑(natDegree p - 1) ≤ degree (↑derivative p)

tactic: rw [mem_support_derivative, tsub_add_cancel_of_le, mem_support_iff]
state_before: case a
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : Semiring R
inst✝ : NoZeroSMulDivisors ℕ R
p : R[X]
hp : 0 < natDegree p
⊢ natDegree p - 1 ∈ support (↑derivative p)

tactic: exact hp
state_before: case a
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : Semiring R
inst✝ : NoZeroSMulDivisors ℕ R
p : R[X]
hp : 0 < natDegree p
⊢ 1 ≤ natDegree p

tactic: show ¬leadingCoeff p = 0
state_before: case a
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : Semiring R
inst✝ : NoZeroSMulDivisors ℕ R
p : R[X]
hp : 0 < natDegree p
⊢ coeff p (natDegree p) ≠ 0

tactic: rw [leadingCoeff_eq_zero]
state_before: case a
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : Semiring R
inst✝ : NoZeroSMulDivisors ℕ R
p : R[X]
hp : 0 < natDegree p
⊢ ¬leadingCoeff p = 0

tactic: intro h
state_before: case a
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : Semiring R
inst✝ : NoZeroSMulDivisors ℕ R
p : R[X]
hp : 0 < natDegree p
⊢ ¬p = 0

tactic: rw [h, natDegree_zero] at hp
state_before: case a
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : Semiring R
inst✝ : NoZeroSMulDivisors ℕ R
p : R[X]
hp : 0 < natDegree p
h : p = 0
⊢ False

tactic: exact lt_irrefl 0 (lt_of_le_of_lt (zero_le _) hp)
state_before: case a
R : Type u
S : Type v
T : Type w
ι : Type y
A : Type z
a b : R
n : ℕ
inst✝¹ : Semiring R
inst✝ : NoZeroSMulDivisors ℕ R
p : R[X]
hp : 0 < 0
h : p = 0
⊢ False