Step
*
3
of Lemma
bag-drop-commutes
1. T : Type
2. eq : EqDecider(T)
3. bs : bag(T)
4. x : T
5. y : T
6. ∀x,y:T.  Dec(x = y ∈ T)
7. ¬(x = y ∈ T)
8. ∀x:T. ∀bs:bag(T).
     ((∃as:bag(T). ((bs = ({x} + as) ∈ bag(T)) ∧ (bag-remove1(eq;bs;x) = (inl as) ∈ (bag(T)?))))
     ∨ ((¬x ↓∈ bs) ∧ (bag-remove1(eq;bs;x) = (inr ⋅ ) ∈ (bag(T)?))))
9. ¬x ↓∈ bs
10. bag-remove1(eq;bs;x) = (inr ⋅ ) ∈ (bag(T)?)
11. as : bag(T)
12. bs = ({y} + as) ∈ bag(T)
13. bag-remove1(eq;bs;y) = (inl as) ∈ (bag(T)?)
⊢ as = case bag-remove1(eq;as;x) of inl(as) => as | inr(_) => as ∈ bag(T)
BY
{ ((InstHyp [⌜x⌝;⌜as⌝] 8⋅ THENA Auto)
   THEN D -1
   THEN ExRepD
   THEN ((HypSubst (-1) 0 THENA (D (-1) THEN Reduce 0 THEN Auto)) THEN Reduce 0 THEN Auto)⋅)⋅ }
1
1. T : Type
2. eq : EqDecider(T)
3. bs : bag(T)
4. x : T
5. y : T
6. ∀x,y:T.  Dec(x = y ∈ T)
7. ¬(x = y ∈ T)
8. ∀x:T. ∀bs:bag(T).
     ((∃as:bag(T). ((bs = ({x} + as) ∈ bag(T)) ∧ (bag-remove1(eq;bs;x) = (inl as) ∈ (bag(T)?))))
     ∨ ((¬x ↓∈ bs) ∧ (bag-remove1(eq;bs;x) = (inr ⋅ ) ∈ (bag(T)?))))
9. ¬x ↓∈ bs
10. bag-remove1(eq;bs;x) = (inr ⋅ ) ∈ (bag(T)?)
11. as : bag(T)
12. bs = ({y} + as) ∈ bag(T)
13. bag-remove1(eq;bs;y) = (inl as) ∈ (bag(T)?)
14. as@0 : bag(T)
15. as = ({x} + as@0) ∈ bag(T)
16. bag-remove1(eq;as;x) = (inl as@0) ∈ (bag(T)?)
⊢ as = as@0 ∈ bag(T)
Latex:
Latex:
1.  T  :  Type
2.  eq  :  EqDecider(T)
3.  bs  :  bag(T)
4.  x  :  T
5.  y  :  T
6.  \mforall{}x,y:T.    Dec(x  =  y)
7.  \mneg{}(x  =  y)
8.  \mforall{}x:T.  \mforall{}bs:bag(T).
          ((\mexists{}as:bag(T).  ((bs  =  (\{x\}  +  as))  \mwedge{}  (bag-remove1(eq;bs;x)  =  (inl  as))))
          \mvee{}  ((\mneg{}x  \mdownarrow{}\mmember{}  bs)  \mwedge{}  (bag-remove1(eq;bs;x)  =  (inr  \mcdot{}  ))))
9.  \mneg{}x  \mdownarrow{}\mmember{}  bs
10.  bag-remove1(eq;bs;x)  =  (inr  \mcdot{}  )
11.  as  :  bag(T)
12.  bs  =  (\{y\}  +  as)
13.  bag-remove1(eq;bs;y)  =  (inl  as)
\mvdash{}  as  =  case  bag-remove1(eq;as;x)  of  inl(as)  =>  as  |  inr($_{}$)  =>  as
By
Latex:
((InstHyp  [\mkleeneopen{}x\mkleeneclose{};\mkleeneopen{}as\mkleeneclose{}]  8\mcdot{}  THENA  Auto)
  THEN  D  -1
  THEN  ExRepD
  THEN  ((HypSubst  (-1)  0  THENA  (D  (-1)  THEN  Reduce  0  THEN  Auto))  THEN  Reduce  0  THEN  Auto)\mcdot{})\mcdot{}
Home
Index