Step
*
1
1
1
2
1
1
of Lemma
bag-bind-assoc
1. A : Type
2. B : Type
3. C : Type
4. f : A ⟶ bag(B)
5. g : B ⟶ bag(C)
6. u : A@i
7. v : A List@i
8. bag-union(bag-map(g;bag-union(bag-map(f;v)))) = bag-union(bag-map(λa.bag-union(bag-map(g;f a));v)) ∈ bag(C)
⊢ bag-union(map(g;f u) @ map(g;bag-union(map(f;v))))
= (bag-union(map(g;f u)) @ bag-union(map(λa.bag-union(map(g;f a));v)))
∈ bag(C)
BY
{ (Fold `bag-map` 0 THEN Fold `bag-append` 0) }
1
1. A : Type
2. B : Type
3. C : Type
4. f : A ⟶ bag(B)
5. g : B ⟶ bag(C)
6. u : A@i
7. v : A List@i
8. bag-union(bag-map(g;bag-union(bag-map(f;v)))) = bag-union(bag-map(λa.bag-union(bag-map(g;f a));v)) ∈ bag(C)
⊢ bag-union(bag-map(g;f u) + bag-map(g;bag-union(bag-map(f;v))))
= (bag-union(bag-map(g;f u)) + bag-union(bag-map(λa.bag-union(bag-map(g;f a));v)))
∈ bag(C)
Latex:
Latex:
1.  A  :  Type
2.  B  :  Type
3.  C  :  Type
4.  f  :  A  {}\mrightarrow{}  bag(B)
5.  g  :  B  {}\mrightarrow{}  bag(C)
6.  u  :  A@i
7.  v  :  A  List@i
8.  bag-union(bag-map(g;bag-union(bag-map(f;v))))
=  bag-union(bag-map(\mlambda{}a.bag-union(bag-map(g;f  a));v))
\mvdash{}  bag-union(map(g;f  u)  @  map(g;bag-union(map(f;v))))
=  (bag-union(map(g;f  u))  @  bag-union(map(\mlambda{}a.bag-union(map(g;f  a));v)))
By
Latex:
(Fold  `bag-map`  0  THEN  Fold  `bag-append`  0)
Home
Index