Theorem: Polynomial.coeff_comp_degree_mul_degree
File: Mathlib/Algebra/Polynomial/Eval.lean

tactic: rw [comp, eval₂_def, coeff_sum]
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ (p.comp q).coeff (p.natDegree * q.natDegree) = p.leadingCoeff * q.leadingCoeff ^ p.natDegree
state_after: R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ (p.sum fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) = p.leadingCoeff * q.leadingCoeff ^ p.natDegree

tactic: refine Eq.trans (Finset.sum_eq_single p.natDegree ?h₀ ?h₁) ?h₂
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ (p.sum fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) = p.leadingCoeff * q.leadingCoeff ^ p.natDegree
state_after: case h₀
R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ ∀ b ∈ p.support, b ≠ p.natDegree → (fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) b (p.coeff b) = 0

case h₁
R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ p.natDegree ∉ p.support →
    (fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) p.natDegree (p.coeff p.natDegree) = 0

case h₂
R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ (fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) p.natDegree (p.coeff p.natDegree) =
    p.leadingCoeff * q.leadingCoeff ^ p.natDegree

tactic: case h₂ =>
  simp only [coeff_natDegree, coeff_C_mul, coeff_pow_mul_natDegree]
state_before: case h₀
R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ ∀ b ∈ p.support, b ≠ p.natDegree → (fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) b (p.coeff b) = 0

case h₁
R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ p.natDegree ∉ p.support →
    (fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) p.natDegree (p.coeff p.natDegree) = 0

case h₂
R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ (fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) p.natDegree (p.coeff p.natDegree) =
    p.leadingCoeff * q.leadingCoeff ^ p.natDegree
state_after: case h₀
R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ ∀ b ∈ p.support, b ≠ p.natDegree → (fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) b (p.coeff b) = 0

case h₁
R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ p.natDegree ∉ p.support →
    (fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) p.natDegree (p.coeff p.natDegree) = 0

tactic: case h₀ =>
  intro b hbs hbp
  refine coeff_eq_zero_of_natDegree_lt (natDegree_mul_le.trans_lt ?_)
  rw [natDegree_C, zero_add]
  refine natDegree_pow_le.trans_lt ((mul_lt_mul_right (pos_iff_ne_zero.mpr hqd0)).mpr ?_)
  exact lt_of_le_of_ne (le_natDegree_of_mem_supp _ hbs) hbp
state_before: case h₀
R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ ∀ b ∈ p.support, b ≠ p.natDegree → (fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) b (p.coeff b) = 0

case h₁
R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ p.natDegree ∉ p.support →
    (fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) p.natDegree (p.coeff p.natDegree) = 0
state_after: case h₁
R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ p.natDegree ∉ p.support →
    (fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) p.natDegree (p.coeff p.natDegree) = 0

tactic: case h₁ =>
  simp (config := { contextual := true })
state_before: case h₁
R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ p.natDegree ∉ p.support →
    (fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) p.natDegree (p.coeff p.natDegree) = 0
state_after: no goals

tactic: simp only [coeff_natDegree, coeff_C_mul, coeff_pow_mul_natDegree]
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ (fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) p.natDegree (p.coeff p.natDegree) =
    p.leadingCoeff * q.leadingCoeff ^ p.natDegree
state_after: no goals

tactic: intro b hbs hbp
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ ∀ b ∈ p.support, b ≠ p.natDegree → (fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) b (p.coeff b) = 0
state_after: R : Type u
S : Type v
T : Type w
ι : Type y
a b✝ : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
b : ℕ
hbs : b ∈ p.support
hbp : b ≠ p.natDegree
⊢ (fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) b (p.coeff b) = 0

tactic: refine coeff_eq_zero_of_natDegree_lt (natDegree_mul_le.trans_lt ?_)
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
a b✝ : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
b : ℕ
hbs : b ∈ p.support
hbp : b ≠ p.natDegree
⊢ (fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) b (p.coeff b) = 0
state_after: R : Type u
S : Type v
T : Type w
ι : Type y
a b✝ : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
b : ℕ
hbs : b ∈ p.support
hbp : b ≠ p.natDegree
⊢ (C (p.coeff b)).natDegree + (q ^ b).natDegree < p.natDegree * q.natDegree

tactic: rw [natDegree_C, zero_add]
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
a b✝ : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
b : ℕ
hbs : b ∈ p.support
hbp : b ≠ p.natDegree
⊢ (C (p.coeff b)).natDegree + (q ^ b).natDegree < p.natDegree * q.natDegree
state_after: R : Type u
S : Type v
T : Type w
ι : Type y
a b✝ : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
b : ℕ
hbs : b ∈ p.support
hbp : b ≠ p.natDegree
⊢ (q ^ b).natDegree < p.natDegree * q.natDegree

tactic: refine natDegree_pow_le.trans_lt ((mul_lt_mul_right (pos_iff_ne_zero.mpr hqd0)).mpr ?_)
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
a b✝ : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
b : ℕ
hbs : b ∈ p.support
hbp : b ≠ p.natDegree
⊢ (q ^ b).natDegree < p.natDegree * q.natDegree
state_after: R : Type u
S : Type v
T : Type w
ι : Type y
a b✝ : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
b : ℕ
hbs : b ∈ p.support
hbp : b ≠ p.natDegree
⊢ b < p.natDegree

tactic: exact lt_of_le_of_ne (le_natDegree_of_mem_supp _ hbs) hbp
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
a b✝ : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
b : ℕ
hbs : b ∈ p.support
hbp : b ≠ p.natDegree
⊢ b < p.natDegree
state_after: no goals

tactic: simp (config := { contextual := true })
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
hqd0 : q.natDegree ≠ 0
⊢ p.natDegree ∉ p.support →
    (fun a b => (C b * q ^ a).coeff (p.natDegree * q.natDegree)) p.natDegree (p.coeff p.natDegree) = 0
state_after: no goals