Theorem: Polynomial.coeff_mul_degree_add_degree
File: Mathlib/Algebra/Polynomial/Degree/Definitions.lean

tactic: refine Finset.sum_eq_single (natDegree p, natDegree q) ?_ ?_
state_before: R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
⊢ ∑ x ∈ antidiagonal (p.natDegree + q.natDegree), p.coeff x.1 * q.coeff x.2 = p.coeff p.natDegree * q.coeff q.natDegree
state_after: case refine_1
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
⊢ ∀ b ∈ antidiagonal (p.natDegree + q.natDegree), b ≠ (p.natDegree, q.natDegree) → p.coeff b.1 * q.coeff b.2 = 0

case refine_2
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
⊢ (p.natDegree, q.natDegree) ∉ antidiagonal (p.natDegree + q.natDegree) →
    p.coeff (p.natDegree, q.natDegree).1 * q.coeff (p.natDegree, q.natDegree).2 = 0

tactic: rintro ⟨i, j⟩ h₁ h₂
state_before: case refine_1
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
⊢ ∀ b ∈ antidiagonal (p.natDegree + q.natDegree), b ≠ (p.natDegree, q.natDegree) → p.coeff b.1 * q.coeff b.2 = 0
state_after: case refine_1.mk
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j) ∈ antidiagonal (p.natDegree + q.natDegree)
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
⊢ p.coeff (i, j).1 * q.coeff (i, j).2 = 0

tactic: rw [mem_antidiagonal] at h₁
state_before: case refine_1.mk
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j) ∈ antidiagonal (p.natDegree + q.natDegree)
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
⊢ p.coeff (i, j).1 * q.coeff (i, j).2 = 0
state_after: case refine_1.mk
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j).1 + (i, j).2 = p.natDegree + q.natDegree
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
⊢ p.coeff (i, j).1 * q.coeff (i, j).2 = 0

tactic: by_cases H : natDegree p < i
state_before: case refine_1.mk
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j).1 + (i, j).2 = p.natDegree + q.natDegree
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
⊢ p.coeff (i, j).1 * q.coeff (i, j).2 = 0
state_after: case pos
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j).1 + (i, j).2 = p.natDegree + q.natDegree
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
H : p.natDegree < i
⊢ p.coeff (i, j).1 * q.coeff (i, j).2 = 0

case neg
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j).1 + (i, j).2 = p.natDegree + q.natDegree
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
H : ¬p.natDegree < i
⊢ p.coeff (i, j).1 * q.coeff (i, j).2 = 0

tactic: rw [coeff_eq_zero_of_degree_lt
    (lt_of_le_of_lt degree_le_natDegree (WithBot.coe_lt_coe.2 H)),
  zero_mul]
state_before: case pos
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j).1 + (i, j).2 = p.natDegree + q.natDegree
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
H : p.natDegree < i
⊢ p.coeff (i, j).1 * q.coeff (i, j).2 = 0
state_after: no goals

tactic: rw [not_lt_iff_eq_or_lt] at H
state_before: case neg
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j).1 + (i, j).2 = p.natDegree + q.natDegree
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
H : ¬p.natDegree < i
⊢ p.coeff (i, j).1 * q.coeff (i, j).2 = 0
state_after: case neg
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j).1 + (i, j).2 = p.natDegree + q.natDegree
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
H : p.natDegree = i ∨ i < p.natDegree
⊢ p.coeff (i, j).1 * q.coeff (i, j).2 = 0

tactic: cases' H with H H
state_before: case neg
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j).1 + (i, j).2 = p.natDegree + q.natDegree
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
H : p.natDegree = i ∨ i < p.natDegree
⊢ p.coeff (i, j).1 * q.coeff (i, j).2 = 0
state_after: case neg.inl
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j).1 + (i, j).2 = p.natDegree + q.natDegree
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
H : p.natDegree = i
⊢ p.coeff (i, j).1 * q.coeff (i, j).2 = 0

case neg.inr
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j).1 + (i, j).2 = p.natDegree + q.natDegree
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
H : i < p.natDegree
⊢ p.coeff (i, j).1 * q.coeff (i, j).2 = 0

tactic: subst H
state_before: case neg.inl
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j).1 + (i, j).2 = p.natDegree + q.natDegree
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
H : p.natDegree = i
⊢ p.coeff (i, j).1 * q.coeff (i, j).2 = 0
state_after: case neg.inl
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
j : ℕ
h₁ : (p.natDegree, j).1 + (p.natDegree, j).2 = p.natDegree + q.natDegree
h₂ : (p.natDegree, j) ≠ (p.natDegree, q.natDegree)
⊢ p.coeff (p.natDegree, j).1 * q.coeff (p.natDegree, j).2 = 0

tactic: rw [add_left_cancel_iff] at h₁
state_before: case neg.inl
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
j : ℕ
h₁ : (p.natDegree, j).1 + (p.natDegree, j).2 = p.natDegree + q.natDegree
h₂ : (p.natDegree, j) ≠ (p.natDegree, q.natDegree)
⊢ p.coeff (p.natDegree, j).1 * q.coeff (p.natDegree, j).2 = 0
state_after: case neg.inl
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
j : ℕ
h₁ : (p.natDegree, j).2 = q.natDegree
h₂ : (p.natDegree, j) ≠ (p.natDegree, q.natDegree)
⊢ p.coeff (p.natDegree, j).1 * q.coeff (p.natDegree, j).2 = 0

tactic: dsimp at h₁
state_before: case neg.inl
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
j : ℕ
h₁ : (p.natDegree, j).2 = q.natDegree
h₂ : (p.natDegree, j) ≠ (p.natDegree, q.natDegree)
⊢ p.coeff (p.natDegree, j).1 * q.coeff (p.natDegree, j).2 = 0
state_after: case neg.inl
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
j : ℕ
h₁ : j = q.natDegree
h₂ : (p.natDegree, j) ≠ (p.natDegree, q.natDegree)
⊢ p.coeff (p.natDegree, j).1 * q.coeff (p.natDegree, j).2 = 0

tactic: subst h₁
state_before: case neg.inl
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
j : ℕ
h₁ : j = q.natDegree
h₂ : (p.natDegree, j) ≠ (p.natDegree, q.natDegree)
⊢ p.coeff (p.natDegree, j).1 * q.coeff (p.natDegree, j).2 = 0
state_after: case neg.inl
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
h₂ : (p.natDegree, q.natDegree) ≠ (p.natDegree, q.natDegree)
⊢ p.coeff (p.natDegree, q.natDegree).1 * q.coeff (p.natDegree, q.natDegree).2 = 0

tactic: exact (h₂ rfl).elim
state_before: case neg.inl
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
h₂ : (p.natDegree, q.natDegree) ≠ (p.natDegree, q.natDegree)
⊢ p.coeff (p.natDegree, q.natDegree).1 * q.coeff (p.natDegree, q.natDegree).2 = 0
state_after: no goals

tactic: suffices natDegree q < j by
  rw [coeff_eq_zero_of_degree_lt
      (lt_of_le_of_lt degree_le_natDegree (WithBot.coe_lt_coe.2 this)),
    mul_zero]
state_before: case neg.inr
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j).1 + (i, j).2 = p.natDegree + q.natDegree
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
H : i < p.natDegree
⊢ p.coeff (i, j).1 * q.coeff (i, j).2 = 0
state_after: case neg.inr
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j).1 + (i, j).2 = p.natDegree + q.natDegree
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
H : i < p.natDegree
⊢ q.natDegree < j

tactic: by_contra! H'
state_before: case neg.inr
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j).1 + (i, j).2 = p.natDegree + q.natDegree
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
H : i < p.natDegree
⊢ q.natDegree < j
state_after: case neg.inr
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j).1 + (i, j).2 = p.natDegree + q.natDegree
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
H : i < p.natDegree
H' : j ≤ q.natDegree
⊢ False

tactic: exact
  ne_of_lt (Nat.lt_of_lt_of_le (Nat.add_lt_add_right H j) (Nat.add_le_add_left H' _))
    h₁
state_before: case neg.inr
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j).1 + (i, j).2 = p.natDegree + q.natDegree
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
H : i < p.natDegree
H' : j ≤ q.natDegree
⊢ False
state_after: no goals

tactic: rw [coeff_eq_zero_of_degree_lt
    (lt_of_le_of_lt degree_le_natDegree (WithBot.coe_lt_coe.2 this)),
  mul_zero]
state_before: R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
i j : ℕ
h₁ : (i, j).1 + (i, j).2 = p.natDegree + q.natDegree
h₂ : (i, j) ≠ (p.natDegree, q.natDegree)
H : i < p.natDegree
this : q.natDegree < j
⊢ p.coeff (i, j).1 * q.coeff (i, j).2 = 0
state_after: no goals

tactic: intro H
state_before: case refine_2
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
⊢ (p.natDegree, q.natDegree) ∉ antidiagonal (p.natDegree + q.natDegree) →
    p.coeff (p.natDegree, q.natDegree).1 * q.coeff (p.natDegree, q.natDegree).2 = 0
state_after: case refine_2
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
H : (p.natDegree, q.natDegree) ∉ antidiagonal (p.natDegree + q.natDegree)
⊢ p.coeff (p.natDegree, q.natDegree).1 * q.coeff (p.natDegree, q.natDegree).2 = 0

tactic: exfalso
state_before: case refine_2
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
H : (p.natDegree, q.natDegree) ∉ antidiagonal (p.natDegree + q.natDegree)
⊢ p.coeff (p.natDegree, q.natDegree).1 * q.coeff (p.natDegree, q.natDegree).2 = 0
state_after: case refine_2
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
H : (p.natDegree, q.natDegree) ∉ antidiagonal (p.natDegree + q.natDegree)
⊢ False

tactic: apply H
state_before: case refine_2
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
H : (p.natDegree, q.natDegree) ∉ antidiagonal (p.natDegree + q.natDegree)
⊢ False
state_after: case refine_2
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
H : (p.natDegree, q.natDegree) ∉ antidiagonal (p.natDegree + q.natDegree)
⊢ (p.natDegree, q.natDegree) ∈ antidiagonal (p.natDegree + q.natDegree)

tactic: rw [mem_antidiagonal]
state_before: case refine_2
R : Type u
S : Type v
a b c d : R
n m : ℕ
inst✝ : Semiring R
p✝¹ p✝ q✝ : R[X]
ι : Type u_1
p q : R[X]
H : (p.natDegree, q.natDegree) ∉ antidiagonal (p.natDegree + q.natDegree)
⊢ (p.natDegree, q.natDegree) ∈ antidiagonal (p.natDegree + q.natDegree)
state_after: no goals