Theorem: Dfinsupp.sumAddHom_apply
File: Mathlib/Data/Dfinsupp/Basic.lean

tactic: rcases f with ⟨f, s, hf⟩
state_before: ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝² : (i : ι) → AddZeroClass (β i)
inst✝¹ : (i : ι) → (x : β i) → Decidable (x ≠ 0)
inst✝ : AddCommMonoid γ
φ : (i : ι) → β i →+ γ
f : Π₀ (i : ι), β i
⊢ ↑(sumAddHom φ) f = sum f fun x => ↑(φ x)

tactic: change (∑ i in _, _) = ∑ i in Finset.filter _ _, _
state_before: case mk'.mk.mk
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝² : (i : ι) → AddZeroClass (β i)
inst✝¹ : (i : ι) → (x : β i) → Decidable (x ≠ 0)
inst✝ : AddCommMonoid γ
φ : (i : ι) → β i →+ γ
f : (i : ι) → β i
support'✝ : Trunc { s // ∀ (i : ι), i ∈ s ∨ f i = 0 }
s : Multiset ι
hf : ∀ (i : ι), i ∈ s ∨ f i = 0
⊢ ↑(sumAddHom φ) { toFun := f, support' := Quot.mk Setoid.r { val := s, property := hf } } =
    sum { toFun := f, support' := Quot.mk Setoid.r { val := s, property := hf } } fun x => ↑(φ x)

tactic: rw [Finset.sum_filter, Finset.sum_congr rfl]
state_before: case mk'.mk.mk
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝² : (i : ι) → AddZeroClass (β i)
inst✝¹ : (i : ι) → (x : β i) → Decidable (x ≠ 0)
inst✝ : AddCommMonoid γ
φ : (i : ι) → β i →+ γ
f : (i : ι) → β i
support'✝ : Trunc { s // ∀ (i : ι), i ∈ s ∨ f i = 0 }
s : Multiset ι
hf : ∀ (i : ι), i ∈ s ∨ f i = 0
⊢ ∑ i in Multiset.toFinset ↑{ val := s, property := hf },
      ↑(φ i) (↑{ toFun := f, support' := Quot.mk Setoid.r { val := s, property := hf } } i) =
    ∑ i in
      Finset.filter (fun i => ↑{ toFun := f, support' := Quot.mk Setoid.r { val := s, property := hf } } i ≠ 0)
        (Multiset.toFinset ↑{ val := s, property := hf }),
      (fun x => ↑(φ x)) i (↑{ toFun := f, support' := Quot.mk Setoid.r { val := s, property := hf } } i)

tactic: intro i _
state_before: case mk'.mk.mk
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝² : (i : ι) → AddZeroClass (β i)
inst✝¹ : (i : ι) → (x : β i) → Decidable (x ≠ 0)
inst✝ : AddCommMonoid γ
φ : (i : ι) → β i →+ γ
f : (i : ι) → β i
support'✝ : Trunc { s // ∀ (i : ι), i ∈ s ∨ f i = 0 }
s : Multiset ι
hf : ∀ (i : ι), i ∈ s ∨ f i = 0
⊢ ∀ (x : ι),
    x ∈ Multiset.toFinset ↑{ val := s, property := hf } →
      ↑(φ x) (↑{ toFun := f, support' := Quot.mk Setoid.r { val := s, property := hf } } x) =
        if ↑{ toFun := f, support' := Quot.mk Setoid.r { val := s, property := hf } } x ≠ 0 then
          (fun x => ↑(φ x)) x (↑{ toFun := f, support' := Quot.mk Setoid.r { val := s, property := hf } } x)
        else 0

tactic: dsimp only [coe_mk', Subtype.coe_mk] at *
state_before: case mk'.mk.mk
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝² : (i : ι) → AddZeroClass (β i)
inst✝¹ : (i : ι) → (x : β i) → Decidable (x ≠ 0)
inst✝ : AddCommMonoid γ
φ : (i : ι) → β i →+ γ
f : (i : ι) → β i
support'✝ : Trunc { s // ∀ (i : ι), i ∈ s ∨ f i = 0 }
s : Multiset ι
hf : ∀ (i : ι), i ∈ s ∨ f i = 0
i : ι
a✝ : i ∈ Multiset.toFinset ↑{ val := s, property := hf }
⊢ ↑(φ i) (↑{ toFun := f, support' := Quot.mk Setoid.r { val := s, property := hf } } i) =
    if ↑{ toFun := f, support' := Quot.mk Setoid.r { val := s, property := hf } } i ≠ 0 then
      (fun x => ↑(φ x)) i (↑{ toFun := f, support' := Quot.mk Setoid.r { val := s, property := hf } } i)
    else 0

tactic: split_ifs with h
state_before: case mk'.mk.mk
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝² : (i : ι) → AddZeroClass (β i)
inst✝¹ : (i : ι) → (x : β i) → Decidable (x ≠ 0)
inst✝ : AddCommMonoid γ
φ : (i : ι) → β i →+ γ
f : (i : ι) → β i
support'✝ : Trunc { s // ∀ (i : ι), i ∈ s ∨ f i = 0 }
s : Multiset ι
hf : ∀ (i : ι), i ∈ s ∨ f i = 0
i : ι
a✝ : i ∈ Multiset.toFinset s
⊢ ↑(φ i) (f i) = if f i ≠ 0 then ↑(φ i) (f i) else 0

tactic: rfl
state_before: case mk'.mk.mk.inl
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝² : (i : ι) → AddZeroClass (β i)
inst✝¹ : (i : ι) → (x : β i) → Decidable (x ≠ 0)
inst✝ : AddCommMonoid γ
φ : (i : ι) → β i →+ γ
f : (i : ι) → β i
support'✝ : Trunc { s // ∀ (i : ι), i ∈ s ∨ f i = 0 }
s : Multiset ι
hf : ∀ (i : ι), i ∈ s ∨ f i = 0
i : ι
a✝ : i ∈ Multiset.toFinset s
h : f i ≠ 0
⊢ ↑(φ i) (f i) = ↑(φ i) (f i)

case mk'.mk.mk.inr
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝² : (i : ι) → AddZeroClass (β i)
inst✝¹ : (i : ι) → (x : β i) → Decidable (x ≠ 0)
inst✝ : AddCommMonoid γ
φ : (i : ι) → β i →+ γ
f : (i : ι) → β i
support'✝ : Trunc { s // ∀ (i : ι), i ∈ s ∨ f i = 0 }
s : Multiset ι
hf : ∀ (i : ι), i ∈ s ∨ f i = 0
i : ι
a✝ : i ∈ Multiset.toFinset s
h : ¬f i ≠ 0
⊢ ↑(φ i) (f i) = 0

tactic: rw [not_not.mp h, AddMonoidHom.map_zero]
state_before: case mk'.mk.mk.inr
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝² : (i : ι) → AddZeroClass (β i)
inst✝¹ : (i : ι) → (x : β i) → Decidable (x ≠ 0)
inst✝ : AddCommMonoid γ
φ : (i : ι) → β i →+ γ
f : (i : ι) → β i
support'✝ : Trunc { s // ∀ (i : ι), i ∈ s ∨ f i = 0 }
s : Multiset ι
hf : ∀ (i : ι), i ∈ s ∨ f i = 0
i : ι
a✝ : i ∈ Multiset.toFinset s
h : ¬f i ≠ 0
⊢ ↑(φ i) (f i) = 0