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₂
inst✝³ : DecidableEq ι
inst✝² : (i : ι) → AddZeroClass (β i)
inst✝¹ : (i : ι) → (x : β i) → Decidable (x ≠ 0)
inst✝ : AddCommMonoid γ
φ : (i : ι) → β i →+ γ
f : Π₀ (i : ι), β i
⊢ (sumAddHom φ) f = f.sum fun x => ⇑(φ x)
state_after: case mk'.mk.mk
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
inst✝³ : 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 ⟨s, hf⟩ } =
    { toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ }.sum fun x => ⇑(φ x)

tactic: change (∑ i ∈ _, _) = ∑ i ∈ Finset.filter _ _, _
state_before: case mk'.mk.mk
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
inst✝³ : 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 ⟨s, hf⟩ } =
    { toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ }.sum fun x => ⇑(φ x)
state_after: case mk'.mk.mk
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
inst✝³ : 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 ∈ (↑⟨s, hf⟩).toFinset, (φ i) ({ toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } i) =
    ∑ i ∈ Finset.filter (fun i => { toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } i ≠ 0) (↑⟨s, hf⟩).toFinset,
      (fun x => ⇑(φ x)) i ({ toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } i)

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₂
inst✝³ : 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 ∈ (↑⟨s, hf⟩).toFinset, (φ i) ({ toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } i) =
    ∑ i ∈ Finset.filter (fun i => { toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } i ≠ 0) (↑⟨s, hf⟩).toFinset,
      (fun x => ⇑(φ x)) i ({ toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } i)
state_after: case mk'.mk.mk
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
inst✝³ : 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 ∈ (↑⟨s, hf⟩).toFinset,
    (φ x) ({ toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } x) =
      if { toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } x ≠ 0 then
        (fun x => ⇑(φ x)) x ({ toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } x)
      else 0

tactic: intro i _
state_before: case mk'.mk.mk
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
inst✝³ : 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 ∈ (↑⟨s, hf⟩).toFinset,
    (φ x) ({ toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } x) =
      if { toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } x ≠ 0 then
        (fun x => ⇑(φ x)) x ({ toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } x)
      else 0
state_after: case mk'.mk.mk
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
inst✝³ : 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 ∈ (↑⟨s, hf⟩).toFinset
⊢ (φ i) ({ toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } i) =
    if { toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } i ≠ 0 then
      (fun x => ⇑(φ x)) i ({ toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } i)
    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₂
inst✝³ : 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 ∈ (↑⟨s, hf⟩).toFinset
⊢ (φ i) ({ toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } i) =
    if { toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } i ≠ 0 then
      (fun x => ⇑(φ x)) i ({ toFun := f, support' := Quot.mk Setoid.r ⟨s, hf⟩ } i)
    else 0
state_after: case mk'.mk.mk
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
inst✝³ : 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 ∈ s.toFinset
⊢ (φ i) (f i) = if f i ≠ 0 then (φ i) (f i) else 0

tactic: split_ifs with h
state_before: case mk'.mk.mk
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
inst✝³ : 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 ∈ s.toFinset
⊢ (φ i) (f i) = if f i ≠ 0 then (φ i) (f i) else 0
state_after: case pos
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
inst✝³ : 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 ∈ s.toFinset
h : f i ≠ 0
⊢ (φ i) (f i) = (φ i) (f i)

case neg
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
inst✝³ : 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 ∈ s.toFinset
h : ¬f i ≠ 0
⊢ (φ i) (f i) = 0

tactic: rfl
state_before: case pos
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
inst✝³ : 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 ∈ s.toFinset
h : f i ≠ 0
⊢ (φ i) (f i) = (φ i) (f i)
state_after: no goals

tactic: rw [not_not.mp h, AddMonoidHom.map_zero]
state_before: case neg
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
inst✝³ : 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 ∈ s.toFinset
h : ¬f i ≠ 0
⊢ (φ i) (f i) = 0
state_after: no goals