### Nuprl Lemma : bag-summation-split

`∀[T,R:Type]. ∀[add:R ⟶ R ⟶ R]. ∀[zero:R]. ∀[b:bag(T)]. ∀[p:T ⟶ 𝔹]. ∀[f:T ⟶ R].`
`  Σ(x∈b). f[x] = (Σ(x∈[x∈b|p[x]]). f[x] add Σ(x∈[x∈b|¬bp[x]]). f[x]) ∈ R supposing IsMonoid(R;add;zero) ∧ Comm(R;add)`

Proof

Definitions occuring in Statement :  bag-summation: `Σ(x∈b). f[x]` bag-filter: `[x∈b|p[x]]` bag: `bag(T)` comm: `Comm(T;op)` bnot: `¬bb` bool: `𝔹` uimplies: `b supposing a` uall: `∀[x:A]. B[x]` infix_ap: `x f y` so_apply: `x[s]` and: `P ∧ Q` function: `x:A ⟶ B[x]` universe: `Type` equal: `s = t ∈ T` monoid_p: `IsMonoid(T;op;id)`
Definitions unfolded in proof :  uall: `∀[x:A]. B[x]` member: `t ∈ T` and: `P ∧ Q` so_apply: `x[s]` cand: `A c∧ B` prop: `ℙ` so_lambda: `λ2x.t[x]` all: `∀x:A. B[x]` uimplies: `b supposing a` true: `True` subtype_rel: `A ⊆r B` squash: `↓T` guard: `{T}` iff: `P `⇐⇒` Q` rev_implies: `P `` Q` implies: `P `` Q` monoid_p: `IsMonoid(T;op;id)`
Lemmas referenced :  bag-filter-split infix_ap_wf bag-summation_wf assert_wf bag-filter_wf bnot_wf bag-summation-append subtype_rel_bag monoid_p_wf comm_wf bool_wf bag_wf equal_wf squash_wf true_wf assoc_wf iff_weakening_equal
Rules used in proof :  cut introduction extract_by_obid sqequalHypSubstitution sqequalSubstitution sqequalTransitivity computationStep sqequalReflexivity isectElimination thin hypothesisEquality because_Cache productElimination applyEquality functionExtensionality independent_pairFormation hypothesis cumulativity setEquality sqequalRule lambdaEquality lambdaFormation setElimination rename equalityTransitivity equalitySymmetry independent_isectElimination natural_numberEquality productEquality functionEquality universeEquality isect_memberFormation isect_memberEquality axiomEquality imageElimination imageMemberEquality baseClosed independent_functionElimination

Latex:
\mforall{}[T,R:Type].  \mforall{}[add:R  {}\mrightarrow{}  R  {}\mrightarrow{}  R].  \mforall{}[zero:R].  \mforall{}[b:bag(T)].  \mforall{}[p:T  {}\mrightarrow{}  \mBbbB{}].  \mforall{}[f:T  {}\mrightarrow{}  R].
\mSigma{}(x\mmember{}b).  f[x]  =  (\mSigma{}(x\mmember{}[x\mmember{}b|p[x]]).  f[x]  add  \mSigma{}(x\mmember{}[x\mmember{}b|\mneg{}\msubb{}p[x]]).  f[x])