-- Mathlib/RingTheory/PowerSeries/Basic.lean
theorem eq_zero_or_eq_zero_of_mul_eq_zero [NoZeroDivisors R] (φ ψ : R⟦X⟧) (h : φ * ψ = 0) :
    φ = 0 ∨ ψ = 0

Proof state:
case h.h.h₁
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
hm₂ : ∀ k < m, ¬(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ m < n, (coeff R m) ψ = 0
h : ∑ p ∈ antidiagonal (m + n), (coeff R p.1) φ * (coeff R p.2) ψ = 0
⊢ (m, n) ∉ antidiagonal (m + n) → (coeff R (m, n).1) φ * (coeff R (m, n).2) ψ = 0

Tactic:
contrapose!

Result:
case h.h.h₁
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
hm₂ : ∀ k < m, ¬(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ m < n, (coeff R m) ψ = 0
h : ∑ p ∈ antidiagonal (m + n), (coeff R p.1) φ * (coeff R p.2) ψ = 0
⊢ (coeff R (m, n).1) φ * (coeff R (m, n).2) ψ ≠ 0 → (m, n) ∈ antidiagonal (m + n)

Proof state:
case h.h
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
hm₂ : ∀ k < m, ¬(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ m < n, (coeff R m) ψ = 0
h : (coeff R (m + n)) (φ * ψ) = (coeff R (m + n)) 0
⊢ (coeff R n) ψ = 0

Tactic:
rw [LinearMap.map_zero, coeff_mul, Finset.sum_eq_single (m, n)] at h

Result:
case h.h
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
hm₂ : ∀ k < m, ¬(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ m < n, (coeff R m) ψ = 0
h : (coeff R (m, n).1) φ * (coeff R (m, n).2) ψ = 0
⊢ (coeff R n) ψ = 0

case h.h.h₀
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
hm₂ : ∀ k < m, ¬(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ m < n, (coeff R m) ψ = 0
h : ∑ p ∈ antidiagonal (m + n), (coeff R p.1) φ * (coeff R p.2) ψ = 0
⊢ ∀ b ∈ antidiagonal (m + n), b ≠ (m, n) → (coeff R b.1) φ * (coeff R b.2) ψ = 0

case h.h.h₁
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
hm₂ : ∀ k < m, ¬(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ m < n, (coeff R m) ψ = 0
h : ∑ p ∈ antidiagonal (m + n), (coeff R p.1) φ * (coeff R p.2) ψ = 0
⊢ (m, n) ∉ antidiagonal (m + n) → (coeff R (m, n).1) φ * (coeff R (m, n).2) ψ = 0

Proof state:
case h.h
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
hm₂ : ∀ k < m, ¬(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ m < n, (coeff R m) ψ = 0
h : (coeff R (m, n).1) φ = 0 ∨ (coeff R (m, n).2) ψ = 0
⊢ (coeff R n) ψ = 0

Tactic:
rw [or_iff_not_imp_left] at h

Result:
case h.h
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
hm₂ : ∀ k < m, ¬(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ m < n, (coeff R m) ψ = 0
h : ¬(coeff R (m, n).1) φ = 0 → (coeff R (m, n).2) ψ = 0
⊢ (coeff R n) ψ = 0

Proof state:
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
hm₂ : ∀ k < m, ¬(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ m < n, (coeff R m) ψ = 0
h : ∑ p ∈ antidiagonal (m + n), (coeff R p.1) φ * (coeff R p.2) ψ = 0
i j : ℕ
hij : (i, j).1 + (i, j).2 = m + n
hne : (i, j) ≠ (m, n)
hi : m ≤ i
hj : n ≤ j
this : m < i
⊢ (coeff R (i, j).1) φ * (coeff R (i, j).2) ψ = 0

Tactic:
have : m + n < i + j := add_lt_add_of_lt_of_le this hj

Result:
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
hm₂ : ∀ k < m, ¬(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ m < n, (coeff R m) ψ = 0
h : ∑ p ∈ antidiagonal (m + n), (coeff R p.1) φ * (coeff R p.2) ψ = 0
i j : ℕ
hij : (i, j).1 + (i, j).2 = m + n
hne : (i, j) ≠ (m, n)
hi : m ≤ i
hj : n ≤ j
this✝ : m < i
this : m + n < i + j
⊢ (coeff R (i, j).1) φ * (coeff R (i, j).2) ψ = 0

Proof state:
case h.h
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
hm₂ : ∀ k < m, ¬(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ m < n, (coeff R m) ψ = 0
h : (coeff R (m, n).1) φ * (coeff R (m, n).2) ψ = 0
⊢ (coeff R n) ψ = 0

Tactic:
replace h := NoZeroDivisors.eq_zero_or_eq_zero_of_mul_eq_zero h

Result:
case h.h
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
hm₂ : ∀ k < m, ¬(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ m < n, (coeff R m) ψ = 0
h : (coeff R (m, n).1) φ = 0 ∨ (coeff R (m, n).2) ψ = 0
⊢ (coeff R n) ψ = 0

Proof state:
case pos
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
n : ℕ
ih : ∀ m < n, (coeff R m) ψ = 0
h : ∑ p ∈ antidiagonal (m + n), (coeff R p.1) φ * (coeff R p.2) ψ = 0
i j : ℕ
hij : (i, j) ∈ antidiagonal (m + n)
hne : (i, j) ≠ (m, n)
hj : ¬j < n
hi : i < m
hm₂ : ¬(coeff R i) φ ≠ 0
⊢ (coeff R (i, j).1) φ * (coeff R (i, j).2) ψ = 0

Tactic:
push_neg at hm₂

Result:
case pos
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
n : ℕ
ih : ∀ m < n, (coeff R m) ψ = 0
h : ∑ p ∈ antidiagonal (m + n), (coeff R p.1) φ * (coeff R p.2) ψ = 0
i j : ℕ
hij : (i, j) ∈ antidiagonal (m + n)
hne : (i, j) ≠ (m, n)
hj : ¬j < n
hi : i < m
hm₂ : (coeff R i) φ = 0
⊢ (coeff R (i, j).1) φ * (coeff R (i, j).2) ψ = 0

Proof state:
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
h : φ * ψ = 0
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
hm₂ : ∀ k < m, ¬(coeff R k) φ ≠ 0
⊢ ψ = 0

Tactic:
ext n

Result:
case h
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
h : φ * ψ = 0
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
hm₂ : ∀ k < m, ¬(coeff R k) φ ≠ 0
n : ℕ
⊢ (coeff R n) ψ = (coeff R n) 0

Proof state:
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
h : φ * ψ = 0
⊢ ¬φ = 0 → ψ = 0

Tactic:
intro H

Result:
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
h : φ * ψ = 0
H : ¬φ = 0
⊢ ψ = 0

Proof state:
case neg
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
hm₂ : ∀ k < m, ¬(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ m < n, (coeff R m) ψ = 0
h : ∑ p ∈ antidiagonal (m + n), (coeff R p.1) φ * (coeff R p.2) ψ = 0
i j : ℕ
hij : (i, j).1 + (i, j).2 = m + n
hi : m ≤ i
hj : n ≤ j
hne : i ≤ m
⊢ (i, j) = (m, n)

Tactic:
obtain rfl := le_antisymm hi hne

Result:
case neg
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : (coeff R m) φ ≠ 0
hm₂ : ∀ k < m, ¬(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ m < n, (coeff R m) ψ = 0
h : ∑ p ∈ antidiagonal (m + n), (coeff R p.1) φ * (coeff R p.2) ψ = 0
j : ℕ
hj : n ≤ j
hij : (m, j).1 + (m, j).2 = m + n
hi hne : m ≤ m
⊢ (m, j) = (m, n)