Theorem: Polynomial.coeff_mul_natTrailingDegree_add_natTrailingDegree
File: Mathlib/Data/Polynomial/Degree/TrailingDegree.lean

tactic: rw [coeff_mul]
state_before: R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
⊢ coeff (p * q) (natTrailingDegree p + natTrailingDegree q) = trailingCoeff p * trailingCoeff q

tactic: refine'
  Finset.sum_eq_single (p.natTrailingDegree, q.natTrailingDegree) _ fun h =>
    (h (Nat.mem_antidiagonal.mpr rfl)).elim
state_before: R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
⊢ ∑ x in Nat.antidiagonal (natTrailingDegree p + natTrailingDegree q), coeff p x.fst * coeff q x.snd =
    trailingCoeff p * trailingCoeff q

tactic: rintro ⟨i, j⟩ h₁ h₂
state_before: R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
⊢ ∀ (b : ℕ × ℕ),
    b ∈ Nat.antidiagonal (natTrailingDegree p + natTrailingDegree q) →
      b ≠ (natTrailingDegree p, natTrailingDegree q) → coeff p b.fst * coeff q b.snd = 0

tactic: rw [Nat.mem_antidiagonal] at h₁
state_before: case mk
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
i j : ℕ
h₁ : (i, j) ∈ Nat.antidiagonal (natTrailingDegree p + natTrailingDegree q)
h₂ : (i, j) ≠ (natTrailingDegree p, natTrailingDegree q)
⊢ coeff p (i, j).fst * coeff q (i, j).snd = 0

tactic: by_cases hi : i < p.natTrailingDegree
state_before: case mk
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
i j : ℕ
h₁ : (i, j).fst + (i, j).snd = natTrailingDegree p + natTrailingDegree q
h₂ : (i, j) ≠ (natTrailingDegree p, natTrailingDegree q)
⊢ coeff p (i, j).fst * coeff q (i, j).snd = 0

tactic: by_cases hj : j < q.natTrailingDegree
state_before: case neg
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
i j : ℕ
h₁ : (i, j).fst + (i, j).snd = natTrailingDegree p + natTrailingDegree q
h₂ : (i, j) ≠ (natTrailingDegree p, natTrailingDegree q)
hi : ¬i < natTrailingDegree p
⊢ coeff p (i, j).fst * coeff q (i, j).snd = 0

tactic: rw [not_lt] at hi hj
state_before: case neg
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
i j : ℕ
h₁ : (i, j).fst + (i, j).snd = natTrailingDegree p + natTrailingDegree q
h₂ : (i, j) ≠ (natTrailingDegree p, natTrailingDegree q)
hi : ¬i < natTrailingDegree p
hj : ¬j < natTrailingDegree q
⊢ coeff p (i, j).fst * coeff q (i, j).snd = 0

tactic: refine' (h₂ (Prod.ext_iff.mpr _).symm).elim
state_before: case neg
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
i j : ℕ
h₁ : (i, j).fst + (i, j).snd = natTrailingDegree p + natTrailingDegree q
h₂ : (i, j) ≠ (natTrailingDegree p, natTrailingDegree q)
hi : natTrailingDegree p ≤ i
hj : natTrailingDegree q ≤ j
⊢ coeff p (i, j).fst * coeff q (i, j).snd = 0

tactic: exact (add_eq_add_iff_eq_and_eq hi hj).mp h₁.symm
state_before: case neg
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
i j : ℕ
h₁ : (i, j).fst + (i, j).snd = natTrailingDegree p + natTrailingDegree q
h₂ : (i, j) ≠ (natTrailingDegree p, natTrailingDegree q)
hi : natTrailingDegree p ≤ i
hj : natTrailingDegree q ≤ j
⊢ (natTrailingDegree p, natTrailingDegree q).fst = (i, j).fst ∧
    (natTrailingDegree p, natTrailingDegree q).snd = (i, j).snd

tactic: rw [coeff_eq_zero_of_lt_natTrailingDegree hi, zero_mul]
state_before: case pos
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
i j : ℕ
h₁ : (i, j).fst + (i, j).snd = natTrailingDegree p + natTrailingDegree q
h₂ : (i, j) ≠ (natTrailingDegree p, natTrailingDegree q)
hi : i < natTrailingDegree p
⊢ coeff p (i, j).fst * coeff q (i, j).snd = 0

tactic: rw [coeff_eq_zero_of_lt_natTrailingDegree hj, mul_zero]
state_before: case pos
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
i j : ℕ
h₁ : (i, j).fst + (i, j).snd = natTrailingDegree p + natTrailingDegree q
h₂ : (i, j) ≠ (natTrailingDegree p, natTrailingDegree q)
hi : ¬i < natTrailingDegree p
hj : j < natTrailingDegree q
⊢ coeff p (i, j).fst * coeff q (i, j).snd = 0