### Nuprl Lemma : bag-filter-as-accum

`∀[A:Type]. ∀[p:A ⟶ 𝔹]. ∀[bs:bag(A)].`
`  ([x∈bs|p[x]] = bag-accum(b,x.if p[x] then x.b else b fi ;{};bs) ∈ bag({x:A| ↑p[x]} ))`

Proof

Definitions occuring in Statement :  bag-accum: `bag-accum(v,x.f[v; x];init;bs)` bag-filter: `[x∈b|p[x]]` cons-bag: `x.b` empty-bag: `{}` bag: `bag(T)` assert: `↑b` ifthenelse: `if b then t else f fi ` bool: `𝔹` uall: `∀[x:A]. B[x]` so_apply: `x[s]` set: `{x:A| B[x]} ` function: `x:A ⟶ B[x]` universe: `Type` equal: `s = t ∈ T`
Definitions unfolded in proof :  uall: `∀[x:A]. B[x]` member: `t ∈ T` squash: `↓T` exists: `∃x:A. B[x]` all: `∀x:A. B[x]` nat: `ℕ` implies: `P `` Q` false: `False` ge: `i ≥ j ` uimplies: `b supposing a` satisfiable_int_formula: `satisfiable_int_formula(fmla)` not: `¬A` top: `Top` and: `P ∧ Q` prop: `ℙ` subtype_rel: `A ⊆r B` guard: `{T}` or: `P ∨ Q` bag-accum: `bag-accum(v,x.f[v; x];init;bs)` list_accum: list_accum nil: `[]` it: `⋅` empty-bag: `{}` bag-filter: `[x∈b|p[x]]` filter: `filter(P;l)` reduce: `reduce(f;k;as)` list_ind: list_ind so_lambda: `λ2x.t[x]` so_apply: `x[s]` cons: `[a / b]` colength: `colength(L)` so_lambda: `λ2x y.t[x; y]` so_apply: `x[s1;s2]` decidable: `Dec(P)` sq_type: `SQType(T)` less_than: `a < b` less_than': `less_than'(a;b)` bool: `𝔹` unit: `Unit` btrue: `tt` ifthenelse: `if b then t else f fi ` uiff: `uiff(P;Q)` bfalse: `ff` cons-bag: `x.b` true: `True` iff: `P `⇐⇒` Q` rev_implies: `P `` Q` bnot: `¬bb` assert: `↑b` bag-append: `as + bs`
Lemmas referenced :  bag_to_squash_list 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 equal-wf-T-base nat_wf colength_wf_list less_than_transitivity1 less_than_irreflexivity list_wf list-cases bag-filter_wf nil_wf list-subtype-bag product_subtype_list spread_cons_lemma intformeq_wf itermAdd_wf int_formula_prop_eq_lemma int_term_value_add_lemma decidable__le intformnot_wf int_formula_prop_not_lemma le_wf equal_wf subtract_wf itermSubtract_wf int_term_value_subtract_lemma subtype_base_sq set_subtype_base int_subtype_base decidable__equal_int bag-accum_wf bool_wf eqtt_to_assert cons-bag_wf assert_wf bag_wf filter_cons_lemma uiff_transitivity bnot_wf not_wf eqff_to_assert assert_of_bnot empty-bag_wf cons-bag-as-append iff_weakening_equal set_wf bag-append_wf squash_wf true_wf bag-append-comm single-bag_wf bag-append-assoc-comm bool_cases_sqequal bool_subtype_base assert-bnot list_accum_append subtype_rel_list top_wf bag-accum-single bag-append-assoc all_wf
Rules used in proof :  sqequalSubstitution sqequalTransitivity computationStep sqequalReflexivity isect_memberFormation introduction cut extract_by_obid sqequalHypSubstitution isectElimination thin because_Cache hypothesisEquality imageElimination productElimination promote_hyp hypothesis rename lambdaFormation setElimination intWeakElimination natural_numberEquality independent_isectElimination dependent_pairFormation lambdaEquality int_eqEquality intEquality dependent_functionElimination isect_memberEquality voidElimination voidEquality sqequalRule independent_pairFormation computeAll independent_functionElimination axiomEquality cumulativity applyEquality unionElimination functionExtensionality hypothesis_subsumption equalityTransitivity equalitySymmetry applyLambdaEquality dependent_set_memberEquality addEquality baseClosed instantiate hyp_replacement equalityElimination setEquality functionEquality universeEquality imageMemberEquality

Latex:
\mforall{}[A:Type].  \mforall{}[p:A  {}\mrightarrow{}  \mBbbB{}].  \mforall{}[bs:bag(A)].
([x\mmember{}bs|p[x]]  =  bag-accum(b,x.if  p[x]  then  x.b  else  b  fi  ;\{\};bs))

Date html generated: 2017_10_01-AM-08_48_21
Last ObjectModification: 2017_07_26-PM-04_32_30

Theory : bags

Home Index