Nuprl Lemma : bag-summation-filter

[T,R:Type]. ∀[add:R ⟶ R ⟶ R]. ∀[zero:R]. ∀[b:bag(T)]. ∀[p:T ⟶ 𝔹]. ∀[f:T ⟶ R].
  Σ(x∈[x∈b|p[x]]). f[x] = Σ(x∈b). if p[x] then f[x] else zero fi  ∈ 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) ifthenelse: if then else fi  bool: 𝔹 uimplies: supposing a uall: [x:A]. B[x] so_apply: x[s] and: P ∧ Q function: x:A ⟶ B[x] universe: Type equal: t ∈ T monoid_p: IsMonoid(T;op;id)
Definitions unfolded in proof :  uall: [x:A]. B[x] member: t ∈ T uimplies: supposing a and: P ∧ Q prop: squash: T so_apply: x[s] so_lambda: λ2x.t[x] all: x:A. B[x] cand: c∧ B true: True subtype_rel: A ⊆B guard: {T} iff: ⇐⇒ Q rev_implies:  Q implies:  Q infix_ap: y bool: 𝔹 unit: Unit it: btrue: tt ifthenelse: if then else fi  uiff: uiff(P;Q) bfalse: ff bnot: ¬bb not: ¬A false: False exists: x:A. B[x] or: P ∨ Q sq_type: SQType(T) assert: b monoid_p: IsMonoid(T;op;id) ident: Ident(T;op;id)
Lemmas referenced :  bag-summation-split monoid_p_wf comm_wf bool_wf bag_wf equal_wf squash_wf true_wf bag-summation_wf assert_wf bag-filter_wf ifthenelse_wf iff_weakening_equal eqtt_to_assert bag-summation-is-zero bnot_wf assert_elim bfalse_wf and_wf btrue_neq_bfalse eqff_to_assert bool_cases_sqequal subtype_base_sq bool_subtype_base assert-bnot bag-member_wf set_wf assoc_wf not_assert_elim
Rules used in proof :  cut introduction extract_by_obid sqequalSubstitution sqequalTransitivity computationStep sqequalReflexivity isect_memberFormation hypothesis sqequalHypSubstitution isectElimination thin hypothesisEquality productElimination productEquality cumulativity functionExtensionality applyEquality sqequalRule isect_memberEquality axiomEquality because_Cache equalityTransitivity equalitySymmetry functionEquality universeEquality lambdaEquality imageElimination setEquality lambdaFormation setElimination rename independent_isectElimination independent_pairFormation natural_numberEquality imageMemberEquality baseClosed independent_functionElimination unionElimination equalityElimination dependent_functionElimination addLevel levelHypothesis dependent_set_memberEquality applyLambdaEquality voidElimination dependent_pairFormation promote_hyp instantiate

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{}[x\mmember{}b|p[x]]).  f[x]  =  \mSigma{}(x\mmember{}b).  if  p[x]  then  f[x]  else  zero  fi   
    supposing  IsMonoid(R;add;zero)  \mwedge{}  Comm(R;add)



Date html generated: 2017_10_01-AM-09_02_04
Last ObjectModification: 2017_07_26-PM-04_43_22

Theory : bags


Home Index