-- 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 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) ∈ antidiagonal (m + n)
hne : (i, j) ≠ (m, n)
hj : ¬j < n
hi : ¬i < m
⊢ (coeff R (i, j).1) φ * (coeff R (i, j).2) ψ = 0

Tactic:
rw [mem_antidiagonal] at hij

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
i j : ℕ
hij : (i, j).1 + (i, j).2 = m + n
hne : (i, j) ≠ (m, n)
hj : ¬j < n
hi : ¬i < m
⊢ (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
⊢ ψ = 0

Tactic:
have ex : ∃ m, coeff R m φ ≠ 0 := by
  contrapose! H
  exact ext H

Result:
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
h : φ * ψ = 0
H : ¬φ = 0
ex : ∃ m, (coeff R m) φ ≠ 0
⊢ ψ = 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
this : m + n < i + j
⊢ (coeff R (i, j).1) φ * (coeff R (i, j).2) ψ = 0

Tactic:
exfalso

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
⊢ False

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
hne : (i, j) ≠ (m, n)
hi : m ≤ i
hj : n ≤ j
⊢ (coeff R (i, j).1) φ * (coeff R (i, j).2) ψ = 0

Tactic:
suffices m < i by
  have : m + n < i + j := add_lt_add_of_lt_of_le this hj
  exfalso
  exact ne_of_lt this hij.symm

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
i j : ℕ
hij : (i, j).1 + (i, j).2 = m + n
hne : (i, j) ≠ (m, n)
hi : m ≤ i
hj : n ≤ j
⊢ m < i

Proof state:
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : R⟦X⟧
h : φ * ψ = 0
H : ∀ (m : ℕ), (coeff R m) φ = 0
⊢ φ = 0

Tactic:
exact ext H

Result:
no goals

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
j : ℕ
hj : n ≤ j
hij : (m, j).1 + (m, j).2 = m + n
hi hne : m ≤ m
⊢ (m, j) = (m, n)

Tactic:
simpa [Ne, Prod.mk.inj_iff] using (add_right_inj m).mp hij

Result:
no goals

Proof state:
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

Tactic:
rw [(coeff R n).map_zero]

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) ψ = 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
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) ∈ antidiagonal (m + n)
hne : (i, j) ≠ (m, n)
hj : j < n
⊢ (coeff R (i, j).1) φ * (coeff R (i, j).2) ψ = 0

Tactic:
rw [ih j hj, mul_zero]

Result:
no goals

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
⊢ ψ = 0

Tactic:
have hm₂ : ∀ k < m, ¬coeff R k φ ≠ 0 := fun k => Nat.find_min ex

Result:
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

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) ∈ antidiagonal (m + n)
hne : (i, j) ≠ (m, n)
hj : ¬j < n
⊢ (coeff R (i, j).1) φ * (coeff R (i, j).2) ψ = 0

Tactic:
by_cases hi : i < m

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
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) ∈ antidiagonal (m + n)
hne : (i, j) ≠ (m, n)
hj : ¬j < n
hi : i < m
⊢ (coeff R (i, j).1) φ * (coeff R (i, j).2) ψ = 0

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) ∈ antidiagonal (m + n)
hne : (i, j) ≠ (m, n)
hj : ¬j < n
hi : ¬i < m
⊢ (coeff R (i, j).1) φ * (coeff R (i, j).2) ψ = 0

Proof state:
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) ψ = 0

Tactic:
induction' n using Nat.strong_induction_on with n ih

Result:
case h.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 : ℕ
ih : ∀ m < n, (coeff R m) ψ = 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
this : m + n < i + j
⊢ False

Tactic:
exact ne_of_lt this hij.symm

Result:
no goals