∀ {ι : Type u_1} {M : Type u_3} {γ : Type u_5} {s : Finset ι} [inst : AddCommMonoid M] {p : ι → Prop}
  [inst_1 : DecidablePred p] [inst_2 : DecidablePred fun x => ¬p x] (f : (x : ι) → p x → γ) (g : (x : ι) → ¬p x → γ)
  (h : γ → M), ∑ x ∈ s, h (if hx : p x then f x hx else g x hx) = ∑ x, h (f ↑x ⋯) + ∑ x, h (g ↑x ⋯)