-- 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:
σ : 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 : ℕ
hi : i ∈ range n ∧ k i = 0
⊢ (coeff R (k i)) f = (constantCoeff σ R) f

Tactic:
rw [hi.2, coeff_zero_eq_constantCoeff]

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
⊢ ∀ x ∈ (range n).finsuppAntidiag d, ∏ i ∈ range n, (coeff R (x i)) f = 0

Tactic:
intro k 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 : k ∈ (range n).finsuppAntidiag d
⊢ ∏ i ∈ range n, (coeff R (k i)) f = 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)
⊢ ∏ i ∈ range n, (coeff R (k i)) f = 0

Tactic:
have hs : s ⊆ range n := 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
⊢ ∏ i ∈ range n, (coeff R (k i)) f = 0

Proof state:
case intro
σ : 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
this : m ≤ #s
m' : ℕ
hm' : #s = m + m'
⊢ (constantCoeff σ R) f ^ #s = 0

Tactic:
rw [hm', pow_add, hf, MulZeroClass.zero_mul]

Result:
no goals

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
⊢ #(range n \ Finset.filter (fun i => k i = 0) (range n)) ≤ (∑ x ∈ range n \ s, k x).degree

Tactic:
rw [← hs_def]

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
⊢ #(range n \ s) ≤ (∑ x ∈ range n \ s, k x).degree

Proof state:
case h.e'_4
σ : 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, k x).degree = ∑ x ∈ range n \ s, (k x).degree

Tactic:
simp only [degree_eq_weight_one, map_sum]

Result:
no goals

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 ∈ s
⊢ k i = 0

Tactic:
simp only [hs_def, mem_filter] at 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
i : ℕ
hi : i ∈ range n ∧ k i = 0
⊢ k i = 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
⊢ (coeff R d) (f ^ n) = 0

Tactic:
rw [coeff_pow]

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
⊢ ∑ l ∈ (range n).finsuppAntidiag d, ∏ i ∈ range n, (coeff R (l i)) 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
i : ℕ
hi : i ∈ s
⊢ (coeff R (k i)) f = (constantCoeff σ R) f

Tactic:
simp only [hs_def, mem_filter] at 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
i : ℕ
hi : i ∈ range n ∧ k i = 0
⊢ (coeff R (k i)) f = (constantCoeff σ R) f

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
⊢ ∏ i ∈ range n, (coeff R (k i)) f = 0

Tactic:
have hs'' (i : ℕ) (hi : i ∈ s) : k i = 0 := by
  simp only [hs_def, mem_filter] at hi
  rw [hi.2]

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
⊢ ∏ i ∈ range n, (coeff R (k i)) f = 0