Theorem: Polynomial.eq_zero_of_mul_eq_zero_of_smul
File: Mathlib/Algebra/Polynomial/RingDivision.lean

Proof steps:
state_before: R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
⊢ ∀ (Q : R[X]), P * Q = 0 → Q = 0
state_after: R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
⊢ Q = 0
tactic: intro Q hQ
state_before: R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
⊢ ∀ (i : ℕ), P.coeff i • Q = 0
state_after: case base
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
⊢ ∃ n, ∀ m > n, P.coeff m • Q = 0

case step
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
⊢ ∀ (n : ℕ), (∀ m > n, P.coeff m • Q = 0) → P.coeff n • Q = 0
tactic: apply Nat.strong_decreasing_induction
state_before: case step
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
⊢ ∀ (n : ℕ), (∀ m > n, P.coeff m • Q = 0) → P.coeff n • Q = 0
state_after: case step
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
⊢ P.coeff l • Q = 0
tactic: intro l IH
state_before: case step
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
⊢ P.coeff l • Q = 0
state_after: case step.inl
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
h✝ : (P.coeff l • Q).natDegree < Q.natDegree
⊢ P.coeff l • Q = 0

case step.inr
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
⊢ P.coeff l • Q = 0
tactic: obtain _|hl := (natDegree_smul_le (P.coeff l) Q).lt_or_eq
state_before: case step.inr
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
⊢ P.coeff l • Q = 0
state_after: case step.inr
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
⊢ P.coeff l * Q.leadingCoeff = 0
tactic: suffices P.coeff l * Q.leadingCoeff = 0 by
    rwa [← leadingCoeff_eq_zero, ← coeff_natDegree, coeff_smul, hl, coeff_natDegree, smul_eq_mul]
state_before: case step.inr
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
⊢ P.coeff l * Q.leadingCoeff = 0
state_after: case step.inr
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
m : ℕ := Q.natDegree
⊢ P.coeff l * Q.leadingCoeff = 0
tactic: let m := Q.natDegree
state_before: case step.inr
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
m : ℕ := Q.natDegree
⊢ P.coeff l * Q.leadingCoeff = 0
state_after: case step.inr
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
m : ℕ := Q.natDegree
⊢ (P * Q).coeff (l + m) = P.coeff l * Q.leadingCoeff
tactic: suffices (P * Q).coeff (l + m) = P.coeff l * Q.leadingCoeff by rw [← this, hQ, coeff_zero]
state_before: case step.inr
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
m : ℕ := Q.natDegree
⊢ (P * Q).coeff (l + m) = P.coeff l * Q.leadingCoeff
state_after: case step.inr
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
m : ℕ := Q.natDegree
⊢ ∑ x ∈ antidiagonal (l + m), P.coeff x.1 * Q.coeff x.2 = P.coeff l * Q.leadingCoeff
tactic: rw [coeff_mul]
state_before: case step.inr
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
m : ℕ := Q.natDegree
⊢ ∑ x ∈ antidiagonal (l + m), P.coeff x.1 * Q.coeff x.2 = P.coeff l * Q.leadingCoeff
state_after: R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
m : ℕ := Q.natDegree
⊢ ∀ b ∈ antidiagonal (l + m), b ≠ (l, m) → P.coeff b.1 * Q.coeff b.2 = 0
tactic: apply Finset.sum_eq_single (l, m) _ (by simp)
state_before: R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
m : ℕ := Q.natDegree
⊢ ∀ b ∈ antidiagonal (l + m), b ≠ (l, m) → P.coeff b.1 * Q.coeff b.2 = 0
state_after: R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
m : ℕ := Q.natDegree
⊢ ∀ (a b : ℕ), a + b = l + m → (a = l → ¬b = m) → P.coeff a * Q.coeff b = 0
tactic: simp only [Finset.mem_antidiagonal, ne_eq, Prod.forall, Prod.mk.injEq, not_and]
state_before: R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
m : ℕ := Q.natDegree
⊢ ∀ (a b : ℕ), a + b = l + m → (a = l → ¬b = m) → P.coeff a * Q.coeff b = 0
state_after: R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
m : ℕ := Q.natDegree
i j : ℕ
hij : i + j = l + m
H : i = l → ¬j = m
⊢ P.coeff i * Q.coeff j = 0
tactic: intro i j hij H
state_before: R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
m : ℕ := Q.natDegree
i j : ℕ
hij : i + j = l + m
H : i = l → ¬j = m
⊢ P.coeff i * Q.coeff j = 0
state_after: case inl
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
m : ℕ := Q.natDegree
i j : ℕ
hij : i + j = l + m
H : i = l → ¬j = m
hi : i < l
⊢ P.coeff i * Q.coeff j = 0

case inr.inl
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
m : ℕ := Q.natDegree
i j : ℕ
IH : ∀ m > i, P.coeff m • Q = 0
hl : (P.coeff i • Q).natDegree = Q.natDegree
hij : i + j = i + m
H : i = i → ¬j = m
⊢ P.coeff i * Q.coeff j = 0

case inr.inr
R : Type u
S : Type v
T : Type w
a✝ b : R
n : ℕ
inst✝ : CommSemiring R
a p P : R[X]
h : ∀ (r : R), r • P = 0 → r = 0
Q : R[X]
hQ : P * Q = 0
l : ℕ
IH : ∀ m > l, P.coeff m • Q = 0
hl : (P.coeff l • Q).natDegree = Q.natDegree
m : ℕ := Q.natDegree
i j : ℕ
hij : i + j = l + m
H : i = l → ¬j = m
hi : l < i
⊢ P.coeff i * Q.coeff j = 0
tactic: obtain hi|rfl|hi := lt_trichotomy i l