Nuprl Lemma : bag-double-summation
∀[R:Type]. ∀[add:R ⟶ R ⟶ R]. ∀[zero:R].
  ∀[T,A,B:Type]. ∀[f:T ⟶ bag(A)]. ∀[g:T ⟶ B]. ∀[h:B ⟶ A ⟶ R]. ∀[b:bag(T)].
    (Σ(x∈b). Σ(y∈f[x]). h[g[x];y] = Σ(p∈⋃x∈b.bag-map(λy.<g[x], y>f[x])). h[fst(p);snd(p)] ∈ R) 
  supposing IsMonoid(R;add;zero) ∧ Comm(R;add)
Proof
Definitions occuring in Statement : 
bag-summation: Σ(x∈b). f[x]
, 
bag-combine: ⋃x∈bs.f[x]
, 
bag-map: bag-map(f;bs)
, 
bag: bag(T)
, 
comm: Comm(T;op)
, 
uimplies: b supposing a
, 
uall: ∀[x:A]. B[x]
, 
so_apply: x[s1;s2]
, 
so_apply: x[s]
, 
pi1: fst(t)
, 
pi2: snd(t)
, 
and: P ∧ Q
, 
lambda: λx.A[x]
, 
function: x:A ⟶ B[x]
, 
pair: <a, b>
, 
universe: Type
, 
equal: s = t ∈ T
, 
monoid_p: IsMonoid(T;op;id)
Definitions unfolded in proof : 
uall: ∀[x:A]. B[x]
, 
member: t ∈ T
, 
uimplies: b supposing a
, 
and: P ∧ Q
, 
bag: bag(T)
, 
quotient: x,y:A//B[x; y]
, 
all: ∀x:A. B[x]
, 
implies: P 
⇒ Q
, 
so_lambda: λ2x y.t[x; y]
, 
so_apply: x[s1;s2]
, 
nat: ℕ
, 
false: False
, 
ge: i ≥ j 
, 
not: ¬A
, 
satisfiable_int_formula: satisfiable_int_formula(fmla)
, 
exists: ∃x:A. B[x]
, 
top: Top
, 
prop: ℙ
, 
guard: {T}
, 
int_seg: {i..j-}
, 
lelt: i ≤ j < k
, 
le: A ≤ B
, 
decidable: Dec(P)
, 
or: P ∨ Q
, 
subtype_rel: A ⊆r B
, 
so_lambda: λ2x.t[x]
, 
so_apply: x[s]
, 
sq_type: SQType(T)
, 
less_than: a < b
, 
squash: ↓T
, 
empty-bag: {}
, 
cons: [a / b]
, 
assert: ↑b
, 
ifthenelse: if b then t else f fi 
, 
bfalse: ff
, 
iff: P 
⇐⇒ Q
, 
rev_implies: P 
⇐ Q
, 
uiff: uiff(P;Q)
, 
int_iseg: {i...j}
, 
cand: A c∧ B
, 
single-bag: {x}
, 
bag-append: as + bs
, 
pi1: fst(t)
, 
pi2: snd(t)
, 
true: True
, 
infix_ap: x f y
, 
monoid_p: IsMonoid(T;op;id)
Lemmas referenced : 
quotient-member-eq, 
list_wf, 
permutation_wf, 
permutation-equiv, 
nat_properties, 
full-omega-unsat, 
intformand_wf, 
intformle_wf, 
itermConstant_wf, 
itermVar_wf, 
intformless_wf, 
istype-int, 
int_formula_prop_and_lemma, 
istype-void, 
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, 
istype-less_than, 
int_seg_properties, 
int_seg_wf, 
subtract-1-ge-0, 
decidable__equal_int, 
subtract_wf, 
subtype_base_sq, 
set_subtype_base, 
lelt_wf, 
int_subtype_base, 
intformnot_wf, 
intformeq_wf, 
itermSubtract_wf, 
int_formula_prop_not_lemma, 
int_formula_prop_eq_lemma, 
int_term_value_subtract_lemma, 
decidable__le, 
decidable__lt, 
istype-le, 
subtype_rel_self, 
non_neg_length, 
length_wf, 
decidable__assert, 
null_wf, 
list-cases, 
product_subtype_list, 
null_cons_lemma, 
last-lemma-sq, 
pos_length, 
iff_transitivity, 
not_wf, 
equal-wf-T-base, 
assert_wf, 
bnot_wf, 
iff_weakening_uiff, 
assert_of_null, 
istype-assert, 
nil_wf, 
length_of_nil_lemma, 
assert_of_bnot, 
firstn_wf, 
length_firstn, 
itermAdd_wf, 
int_term_value_add_lemma, 
istype-nat, 
length_wf_nat, 
equal_wf, 
bag-summation_wf, 
bag-combine_wf, 
list-subtype-bag, 
bag-map_wf, 
bag_wf, 
monoid_p_wf, 
comm_wf, 
bag-append_wf, 
single-bag_wf, 
last_wf, 
pi1_wf, 
pi2_wf, 
infix_ap_wf, 
bag-summation-empty, 
bag-combine-empty-left, 
squash_wf, 
true_wf, 
bag-combine-append-left, 
iff_weakening_equal, 
bag-summation-append, 
bag-subtype-list, 
bag-summation-map, 
istype-universe, 
bag-summation-single, 
bag-combine-single-left
Rules used in proof : 
sqequalSubstitution, 
sqequalTransitivity, 
computationStep, 
sqequalReflexivity, 
isect_memberFormation_alt, 
introduction, 
cut, 
sqequalHypSubstitution, 
productElimination, 
thin, 
pointwiseFunctionalityForEquality, 
hypothesisEquality, 
hypothesis, 
sqequalRule, 
pertypeElimination, 
promote_hyp, 
equalityTransitivity, 
equalitySymmetry, 
inhabitedIsType, 
lambdaFormation_alt, 
rename, 
extract_by_obid, 
isectElimination, 
lambdaEquality_alt, 
independent_isectElimination, 
dependent_functionElimination, 
independent_functionElimination, 
setElimination, 
intWeakElimination, 
natural_numberEquality, 
approximateComputation, 
dependent_pairFormation_alt, 
int_eqEquality, 
isect_memberEquality_alt, 
voidElimination, 
independent_pairFormation, 
universeIsType, 
axiomEquality, 
functionIsTypeImplies, 
unionElimination, 
applyEquality, 
instantiate, 
cumulativity, 
intEquality, 
applyLambdaEquality, 
dependent_set_memberEquality_alt, 
because_Cache, 
productIsType, 
hypothesis_subsumption, 
imageElimination, 
baseClosed, 
functionIsType, 
equalityIstype, 
addEquality, 
hyp_replacement, 
productEquality, 
independent_pairEquality, 
sqequalBase, 
isectIsTypeImplies, 
closedConclusion, 
imageMemberEquality, 
universeEquality
Latex:
\mforall{}[R:Type].  \mforall{}[add:R  {}\mrightarrow{}  R  {}\mrightarrow{}  R].  \mforall{}[zero:R].
    \mforall{}[T,A,B:Type].  \mforall{}[f:T  {}\mrightarrow{}  bag(A)].  \mforall{}[g:T  {}\mrightarrow{}  B].  \mforall{}[h:B  {}\mrightarrow{}  A  {}\mrightarrow{}  R].  \mforall{}[b:bag(T)].
        (\mSigma{}(x\mmember{}b).  \mSigma{}(y\mmember{}f[x]).  h[g[x];y]  =  \mSigma{}(p\mmember{}\mcup{}x\mmember{}b.bag-map(\mlambda{}y.<g[x],  y>f[x])).  h[fst(p);snd(p)]) 
    supposing  IsMonoid(R;add;zero)  \mwedge{}  Comm(R;add)
Date html generated:
2019_10_15-AM-11_00_57
Last ObjectModification:
2019_08_08-PM-06_16_03
Theory : bags
Home
Index