-- Mathlib/RingTheory/MvPowerSeries/Basic.lean
theorem coeff_eq_zero_of_constantCoeff_nilpotent
    {f : MvPowerSeries σ R} {m : ℕ} (hf : constantCoeff σ R f ^ m = 0)
    {d : σ →₀ ℕ} {n : ℕ} (hn : m + degree d ≤ n) : coeff R d (f ^ n) = 0

Proof state:
case h
σ : Type u_1
R : Type u_3
inst✝ : CommSemiring R
f : MvPowerSeries σ R
m : ℕ
hf : (constantCoeff σ R) f ^ m = 0
d : σ →₀ ℕ
n : ℕ
hn : m + d.degree ≤ n
k : ℕ →₀ σ →₀ ℕ
hk : (range n).sum ⇑k = d ∧ k.support ⊆ range n
s : Finset ℕ := Finset.filter (fun i => k i = 0) (range n)
hs_def : s = Finset.filter (fun i => k i = 0) (range n)
hs : s ⊆ range n
hs' : ∀ i ∈ s, (coeff R (k i)) f = (constantCoeff σ R) f
hs'' : ∀ i ∈ s, k i = 0
⊢ ∏ i ∈ range n, (coeff R (k i)) f = 0

Tactic:
rw [← prod_sdiff (s₁ := s) (filter_subset _ _)]

Result:
case h
σ : Type u_1
R : Type u_3
inst✝ : CommSemiring R
f : MvPowerSeries σ R
m : ℕ
hf : (constantCoeff σ R) f ^ m = 0
d : σ →₀ ℕ
n : ℕ
hn : m + d.degree ≤ n
k : ℕ →₀ σ →₀ ℕ
hk : (range n).sum ⇑k = d ∧ k.support ⊆ range n
s : Finset ℕ := Finset.filter (fun i => k i = 0) (range n)
hs_def : s = Finset.filter (fun i => k i = 0) (range n)
hs : s ⊆ range n
hs' : ∀ i ∈ s, (coeff R (k i)) f = (constantCoeff σ R) f
hs'' : ∀ i ∈ s, k i = 0
⊢ (∏ x ∈ range n \ s, (coeff R (k x)) f) * ∏ x ∈ s, (coeff R (k x)) f = 0

Proof state:
σ : Type u_1
R : Type u_3
inst✝ : CommSemiring R
f : MvPowerSeries σ R
m : ℕ
hf : (constantCoeff σ R) f ^ m = 0
d : σ →₀ ℕ
n : ℕ
hn : m + d.degree ≤ n
k : ℕ →₀ σ →₀ ℕ
hk : (range n).sum ⇑k = d ∧ k.support ⊆ range n
s : Finset ℕ := Finset.filter (fun i => k i = 0) (range n)
hs_def : s = Finset.filter (fun i => k i = 0) (range n)
hs : s ⊆ range n
hs' : ∀ i ∈ s, (coeff R (k i)) f = (constantCoeff σ R) f
hs'' : ∀ i ∈ s, k i = 0
i : ℕ
hi : i < n
hi' : i < n → ¬k i = 0
⊢ 1 ≤ (k i).degree

Tactic:
rw [← not_lt, Nat.lt_one_iff, degree_eq_zero_iff]

Result:
σ : Type u_1
R : Type u_3
inst✝ : CommSemiring R
f : MvPowerSeries σ R
m : ℕ
hf : (constantCoeff σ R) f ^ m = 0
d : σ →₀ ℕ
n : ℕ
hn : m + d.degree ≤ n
k : ℕ →₀ σ →₀ ℕ
hk : (range n).sum ⇑k = d ∧ k.support ⊆ range n
s : Finset ℕ := Finset.filter (fun i => k i = 0) (range n)
hs_def : s = Finset.filter (fun i => k i = 0) (range n)
hs : s ⊆ range n
hs' : ∀ i ∈ s, (coeff R (k i)) f = (constantCoeff σ R) f
hs'' : ∀ i ∈ s, k i = 0
i : ℕ
hi : i < n
hi' : i < n → ¬k i = 0
⊢ ¬k i = 0

Proof state:
case h
σ : Type u_1
R : Type u_3
inst✝ : CommSemiring R
f : MvPowerSeries σ R
m : ℕ
hf : (constantCoeff σ R) f ^ m = 0
d : σ →₀ ℕ
n : ℕ
hn : m + d.degree ≤ n
k : ℕ →₀ σ →₀ ℕ
hk : (range n).sum ⇑k = d ∧ k.support ⊆ range n
s : Finset ℕ := Finset.filter (fun i => k i = 0) (range n)
hs_def : s = Finset.filter (fun i => k i = 0) (range n)
hs : s ⊆ range n
⊢ ∏ i ∈ range n, (coeff R (k i)) f = 0

Tactic:
have hs' (i : ℕ) (hi : i ∈ s) : coeff R (k i) f = constantCoeff σ R f := by
  simp only [hs_def, mem_filter] at hi
  rw [hi.2, coeff_zero_eq_constantCoeff]

Result:
case h
σ : Type u_1
R : Type u_3
inst✝ : CommSemiring R
f : MvPowerSeries σ R
m : ℕ
hf : (constantCoeff σ R) f ^ m = 0
d : σ →₀ ℕ
n : ℕ
hn : m + d.degree ≤ n
k : ℕ →₀ σ →₀ ℕ
hk : (range n).sum ⇑k = d ∧ k.support ⊆ range n
s : Finset ℕ := Finset.filter (fun i => k i = 0) (range n)
hs_def : s = Finset.filter (fun i => k i = 0) (range n)
hs : s ⊆ range n
hs' : ∀ i ∈ s, (coeff R (k i)) f = (constantCoeff σ R) f
⊢ ∏ i ∈ range n, (coeff R (k i)) f = 0

Proof state:
case h.h
σ : Type u_1
R : Type u_3
inst✝ : CommSemiring R
f : MvPowerSeries σ R
m : ℕ
hf : (constantCoeff σ R) f ^ m = 0
d : σ →₀ ℕ
n : ℕ
hn : m + d.degree ≤ n
k : ℕ →₀ σ →₀ ℕ
hk : (range n).sum ⇑k = d ∧ k.support ⊆ range n
s : Finset ℕ := Finset.filter (fun i => k i = 0) (range n)
hs_def : s = Finset.filter (fun i => k i = 0) (range n)
hs : s ⊆ range n
hs' : ∀ i ∈ s, (coeff R (k i)) f = (constantCoeff σ R) f
hs'' : ∀ i ∈ s, k i = 0
⊢ (constantCoeff σ R) f ^ #s = 0

Tactic:
suffices m ≤ #s by
  obtain ⟨m', hm'⟩ := Nat.exists_eq_add_of_le this
  rw [hm', pow_add, hf, MulZeroClass.zero_mul]

Result:
case h.h
σ : Type u_1
R : Type u_3
inst✝ : CommSemiring R
f : MvPowerSeries σ R
m : ℕ
hf : (constantCoeff σ R) f ^ m = 0
d : σ →₀ ℕ
n : ℕ
hn : m + d.degree ≤ n
k : ℕ →₀ σ →₀ ℕ
hk : (range n).sum ⇑k = d ∧ k.support ⊆ range n
s : Finset ℕ := Finset.filter (fun i => k i = 0) (range n)
hs_def : s = Finset.filter (fun i => k i = 0) (range n)
hs : s ⊆ range n
hs' : ∀ i ∈ s, (coeff R (k i)) f = (constantCoeff σ R) f
hs'' : ∀ i ∈ s, k i = 0
⊢ m ≤ #s

Proof state:
σ : Type u_1
R : Type u_3
inst✝ : CommSemiring R
f : MvPowerSeries σ R
m : ℕ
hf : (constantCoeff σ R) f ^ m = 0
d : σ →₀ ℕ
n : ℕ
hn : m + d.degree ≤ n
k : ℕ →₀ σ →₀ ℕ
hk : (range n).sum ⇑k = d ∧ k.support ⊆ range n
s : Finset ℕ := Finset.filter (fun i => k i = 0) (range n)
hs_def : s = Finset.filter (fun i => k i = 0) (range n)
hs : s ⊆ range n
hs' : ∀ i ∈ s, (coeff R (k i)) f = (constantCoeff σ R) f
i : ℕ
hi : i ∈ range n ∧ k i = 0
⊢ k i = 0

Tactic:
rw [hi.2]

Result:
no goals

Proof state:
case h
σ : Type u_1
R : Type u_3
inst✝ : CommSemiring R
f : MvPowerSeries σ R
m : ℕ
hf : (constantCoeff σ R) f ^ m = 0
d : σ →₀ ℕ
n : ℕ
hn : m + d.degree ≤ n
k : ℕ →₀ σ →₀ ℕ
hk : k ∈ (range n).finsuppAntidiag d
⊢ ∏ i ∈ range n, (coeff R (k i)) f = 0

Tactic:
rw [mem_finsuppAntidiag] at hk

Result:
case h
σ : Type u_1
R : Type u_3
inst✝ : CommSemiring R
f : MvPowerSeries σ R
m : ℕ
hf : (constantCoeff σ R) f ^ m = 0
d : σ →₀ ℕ
n : ℕ
hn : m + d.degree ≤ n
k : ℕ →₀ σ →₀ ℕ
hk : (range n).sum ⇑k = d ∧ k.support ⊆ range n
⊢ ∏ i ∈ range n, (coeff R (k i)) f = 0

Proof state:
case h.h
σ : Type u_1
R : Type u_3
inst✝ : CommSemiring R
f : MvPowerSeries σ R
m : ℕ
hf : (constantCoeff σ R) f ^ m = 0
d : σ →₀ ℕ
n : ℕ
hn : m + d.degree ≤ n
k : ℕ →₀ σ →₀ ℕ
hk : (range n).sum ⇑k = d ∧ k.support ⊆ range n
s : Finset ℕ := Finset.filter (fun i => k i = 0) (range n)
hs_def : s = Finset.filter (fun i => k i = 0) (range n)
hs : s ⊆ range n
hs' : ∀ i ∈ s, (coeff R (k i)) f = (constantCoeff σ R) f
hs'' : ∀ i ∈ s, k i = 0
⊢ m + #(range n \ Finset.filter (fun i => k i = 0) (range n)) ≤ n

Tactic:
apply le_trans _ hn

Result:
σ : Type u_1
R : Type u_3
inst✝ : CommSemiring R
f : MvPowerSeries σ R
m : ℕ
hf : (constantCoeff σ R) f ^ m = 0
d : σ →₀ ℕ
n : ℕ
hn : m + d.degree ≤ n
k : ℕ →₀ σ →₀ ℕ
hk : (range n).sum ⇑k = d ∧ k.support ⊆ range n
s : Finset ℕ := Finset.filter (fun i => k i = 0) (range n)
hs_def : s = Finset.filter (fun i => k i = 0) (range n)
hs : s ⊆ range n
hs' : ∀ i ∈ s, (coeff R (k i)) f = (constantCoeff σ R) f
hs'' : ∀ i ∈ s, k i = 0
⊢ m + #(range n \ Finset.filter (fun i => k i = 0) (range n)) ≤ m + d.degree

Proof state:
σ : Type u_1
R : Type u_3
inst✝ : CommSemiring R
f : MvPowerSeries σ R
m : ℕ
hf : (constantCoeff σ R) f ^ m = 0
d : σ →₀ ℕ
n : ℕ
hn : m + d.degree ≤ n
k : ℕ →₀ σ →₀ ℕ
hk : (range n).sum ⇑k = d ∧ k.support ⊆ range n
s : Finset ℕ := Finset.filter (fun i => k i = 0) (range n)
hs_def : s = Finset.filter (fun i => k i = 0) (range n)
hs : s ⊆ range n
hs' : ∀ i ∈ s, (coeff R (k i)) f = (constantCoeff σ R) f
hs'' : ∀ i ∈ s, k i = 0
⊢ ∀ x < n, (x < n → ¬k x = 0) → 1 ≤ (k x).degree

Tactic:
intro i hi hi'

Result:
σ : Type u_1
R : Type u_3
inst✝ : CommSemiring R
f : MvPowerSeries σ R
m : ℕ
hf : (constantCoeff σ R) f ^ m = 0
d : σ →₀ ℕ
n : ℕ
hn : m + d.degree ≤ n
k : ℕ →₀ σ →₀ ℕ
hk : (range n).sum ⇑k = d ∧ k.support ⊆ range n
s : Finset ℕ := Finset.filter (fun i => k i = 0) (range n)
hs_def : s = Finset.filter (fun i => k i = 0) (range n)
hs : s ⊆ range n
hs' : ∀ i ∈ s, (coeff R (k i)) f = (constantCoeff σ R) f
hs'' : ∀ i ∈ s, k i = 0
i : ℕ
hi : i < n
hi' : i < n → ¬k i = 0
⊢ 1 ≤ (k i).degree