Step * of 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 fi ;{};bs) ∈ bag({x:A| ↑p[x]} ))
BY
(Auto THEN BagInd (-1) THEN Auto) }

1
1. Type
2. A ⟶ 𝔹
3. A
4. List
5. [x∈v|p[x]] bag-accum(b,x.if p[x] then x.b else fi ;{};v) ∈ bag({x:A| ↑p[x]} )
⊢ [x∈[u v]|p[x]] bag-accum(b,x.if p[x] then x.b else fi ;{};[u v]) ∈ bag({x:A| ↑p[x]} )

2
1. Type
2. A ⟶ 𝔹
3. List
4. bs bag(A)
5. bs L ∈ bag(A)
6. bag(A)
7. bag({x:A| ↑p[x]} )
8. A
9. A
⊢ if p[x] then x.if p[y] then y.b else fi 
if p[y] then y.b
else b
fi 
if p[y] then y.if p[x] then x.b else fi 
  if p[x] then x.b
  else b
  fi 
∈ bag({x:A| ↑p[x]} )


Latex:


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))


By


Latex:
(Auto  THEN  BagInd  (-1)  THEN  Auto)




Home Index