Nuprl Lemma : bag-count-combine

[T1,T2:Type]. ∀[f:T1 ⟶ bag(T2)]. ∀[eq:EqDecider(T2)]. ∀[z:T2]. ∀[bs:bag(T1)].
  ((#z in ⋃x∈bs.f[x]) bag-sum(bs;x.(#z in f[x])))


Proof




Definitions occuring in Statement :  bag-count: (#x in bs) bag-sum: bag-sum(ba;x.f[x]) bag-combine: x∈bs.f[x] bag: bag(T) deq: EqDecider(T) uall: [x:A]. B[x] so_apply: x[s] function: x:A ⟶ B[x] universe: Type sqequal: t
Definitions unfolded in proof :  uall: [x:A]. B[x] member: t ∈ T uimplies: supposing a nat: so_lambda: λ2x.t[x] so_apply: x[s] bag: bag(T) quotient: x,y:A//B[x; y] and: P ∧ Q all: x:A. B[x] implies:  Q so_lambda: λ2y.t[x; y] so_apply: x[s1;s2] prop: subtype_rel: A ⊆B sq_type: SQType(T) guard: {T} bag-sum: bag-sum(ba;x.f[x]) bag-combine: x∈bs.f[x] bag-map: bag-map(f;bs) bag-union: bag-union(bbs) false: False ge: i ≥  satisfiable_int_formula: satisfiable_int_formula(fmla) exists: x:A. B[x] not: ¬A top: Top int_seg: {i..j-} lelt: i ≤ j < k decidable: Dec(P) or: P ∨ Q le: A ≤ B less_than': less_than'(a;b) less_than: a < b squash: T concat: concat(ll) bag-count: (#x in bs) count: count(P;L) reduce: reduce(f;k;as) list_ind: list_ind nil: [] it: cons: [a b] assert: b ifthenelse: if then else fi  bfalse: ff iff: ⇐⇒ Q uiff: uiff(P;Q) rev_implies:  Q int_iseg: {i...j} cand: c∧ B bag-append: as bs
Lemmas referenced :  subtype_base_sq nat_wf set_subtype_base le_wf int_subtype_base list_wf quotient-member-eq permutation_wf permutation-equiv equal_wf bag-count_wf bag-combine_wf bag-sum_wf_nat list-subtype-bag equal-wf-base bag_wf deq_wf nat_properties satisfiable-full-omega-tt intformand_wf intformle_wf itermConstant_wf itermVar_wf intformless_wf int_formula_prop_and_lemma int_formula_prop_le_lemma int_term_value_constant_lemma int_term_value_var_lemma int_formula_prop_less_lemma int_formula_prop_wf ge_wf less_than_wf length_wf int_seg_wf int_seg_properties decidable__le subtract_wf intformnot_wf itermSubtract_wf int_formula_prop_not_lemma int_term_value_subtract_lemma decidable__equal_int int_seg_subtype false_wf intformeq_wf int_formula_prop_eq_lemma non_neg_length decidable__lt lelt_wf decidable__assert null_wf3 subtype_rel_list top_wf list-cases map_nil_lemma list_accum_nil_lemma reduce_nil_lemma product_subtype_list null_cons_lemma last-lemma-sq pos_length iff_transitivity not_wf equal-wf-T-base assert_wf bnot_wf assert_of_null iff_weakening_uiff assert_of_bnot firstn_wf length_firstn itermAdd_wf int_term_value_add_lemma length_wf_nat map_cons_lemma list_accum_cons_lemma concat-single last_wf bag-subtype-list map_append_sq list_accum_append concat_append bag-union_wf bag-map_wf add-commutes bag-count-append bag-append_wf
Rules used in proof :  sqequalSubstitution sqequalTransitivity computationStep sqequalReflexivity isect_memberFormation introduction cut thin instantiate extract_by_obid sqequalHypSubstitution isectElimination cumulativity hypothesis independent_isectElimination sqequalRule intEquality lambdaEquality natural_numberEquality hypothesisEquality pointwiseFunctionalityForEquality pertypeElimination productElimination equalityTransitivity equalitySymmetry lambdaFormation because_Cache rename dependent_functionElimination independent_functionElimination hyp_replacement applyLambdaEquality applyEquality functionExtensionality productEquality sqequalAxiom isect_memberEquality functionEquality universeEquality setElimination intWeakElimination dependent_pairFormation int_eqEquality voidElimination voidEquality independent_pairFormation computeAll axiomEquality unionElimination hypothesis_subsumption dependent_set_memberEquality imageElimination promote_hyp baseClosed impliesFunctionality addEquality

Latex:
\mforall{}[T1,T2:Type].  \mforall{}[f:T1  {}\mrightarrow{}  bag(T2)].  \mforall{}[eq:EqDecider(T2)].  \mforall{}[z:T2].  \mforall{}[bs:bag(T1)].
    ((\#z  in  \mcup{}x\mmember{}bs.f[x])  \msim{}  bag-sum(bs;x.(\#z  in  f[x])))



Date html generated: 2018_05_21-PM-09_46_16
Last ObjectModification: 2017_07_26-PM-06_29_58

Theory : bags_2


Home Index