Theorem: MvPolynomial.sum_weightedHomogeneousComponent
File: Mathlib/RingTheory/MvPolynomial/WeightedHomogeneous.lean

tactic: rw [finsum_eq_sum _ (weightedHomogeneousComponent_finsupp φ)]
state_before: R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
⊢ ∑ᶠ (m : M), (weightedHomogeneousComponent w m) φ = φ
state_after: R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
⊢ ∑ i ∈ ⋯.toFinset, (weightedHomogeneousComponent w i) φ = φ

tactic: ext1 d
state_before: R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
⊢ ∑ i ∈ ⋯.toFinset, (weightedHomogeneousComponent w i) φ = φ
state_after: case a
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ coeff d (∑ i ∈ ⋯.toFinset, (weightedHomogeneousComponent w i) φ) = coeff d φ

tactic: simp only [coeff_sum, coeff_weightedHomogeneousComponent]
state_before: case a
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ coeff d (∑ i ∈ ⋯.toFinset, (weightedHomogeneousComponent w i) φ) = coeff d φ
state_after: case a
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ (∑ x ∈ ⋯.toFinset, if (weightedDegree w) d = x then coeff d φ else 0) = coeff d φ

tactic: rw [Finset.sum_eq_single (weightedDegree w d)]
state_before: case a
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ (∑ x ∈ ⋯.toFinset, if (weightedDegree w) d = x then coeff d φ else 0) = coeff d φ
state_after: case a
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ (if (weightedDegree w) d = (weightedDegree w) d then coeff d φ else 0) = coeff d φ

case a.h₀
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ ∀ b ∈ ⋯.toFinset, b ≠ (weightedDegree w) d → (if (weightedDegree w) d = b then coeff d φ else 0) = 0

case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ (weightedDegree w) d ∉ ⋯.toFinset → (if (weightedDegree w) d = (weightedDegree w) d then coeff d φ else 0) = 0

tactic: rw [if_pos rfl]
state_before: case a
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ (if (weightedDegree w) d = (weightedDegree w) d then coeff d φ else 0) = coeff d φ
state_after: no goals

tactic: intro m _ hm'
state_before: case a.h₀
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ ∀ b ∈ ⋯.toFinset, b ≠ (weightedDegree w) d → (if (weightedDegree w) d = b then coeff d φ else 0) = 0
state_after: case a.h₀
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
m : M
a✝ : m ∈ ⋯.toFinset
hm' : m ≠ (weightedDegree w) d
⊢ (if (weightedDegree w) d = m then coeff d φ else 0) = 0

tactic: rw [if_neg hm'.symm]
state_before: case a.h₀
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
m : M
a✝ : m ∈ ⋯.toFinset
hm' : m ≠ (weightedDegree w) d
⊢ (if (weightedDegree w) d = m then coeff d φ else 0) = 0
state_after: no goals

tactic: intro hm
state_before: case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ (weightedDegree w) d ∉ ⋯.toFinset → (if (weightedDegree w) d = (weightedDegree w) d then coeff d φ else 0) = 0
state_after: case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm : (weightedDegree w) d ∉ ⋯.toFinset
⊢ (if (weightedDegree w) d = (weightedDegree w) d then coeff d φ else 0) = 0

tactic: rw [if_pos rfl]
state_before: case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm : (weightedDegree w) d ∉ ⋯.toFinset
⊢ (if (weightedDegree w) d = (weightedDegree w) d then coeff d φ else 0) = 0
state_after: case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm : (weightedDegree w) d ∉ ⋯.toFinset
⊢ coeff d φ = 0

tactic: simp only [Finite.mem_toFinset, mem_support, Ne, Classical.not_not] at hm
state_before: case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm : (weightedDegree w) d ∉ ⋯.toFinset
⊢ coeff d φ = 0
state_after: case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm : (weightedHomogeneousComponent w ((weightedDegree w) d)) φ = 0
⊢ coeff d φ = 0

tactic: have := coeff_weightedHomogeneousComponent (w := w) (weightedDegree w d) φ d
state_before: case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm : (weightedHomogeneousComponent w ((weightedDegree w) d)) φ = 0
⊢ coeff d φ = 0
state_after: case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm : (weightedHomogeneousComponent w ((weightedDegree w) d)) φ = 0
this :
  coeff d ((weightedHomogeneousComponent w ((weightedDegree w) d)) φ) =
    if (weightedDegree w) d = (weightedDegree w) d then coeff d φ else 0
⊢ coeff d φ = 0

tactic: rw [hm, if_pos rfl, coeff_zero] at this
state_before: case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm : (weightedHomogeneousComponent w ((weightedDegree w) d)) φ = 0
this :
  coeff d ((weightedHomogeneousComponent w ((weightedDegree w) d)) φ) =
    if (weightedDegree w) d = (weightedDegree w) d then coeff d φ else 0
⊢ coeff d φ = 0
state_after: case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm : (weightedHomogeneousComponent w ((weightedDegree w) d)) φ = 0
this : 0 = coeff d φ
⊢ coeff d φ = 0

tactic: exact this.symm
state_before: case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm : (weightedHomogeneousComponent w ((weightedDegree w) d)) φ = 0
this : 0 = coeff d φ
⊢ coeff d φ = 0
state_after: no goals