Step
*
1
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. as : bag(T)
10. bs = ({x} + as) ∈ bag(T)
11. bag-remove1(eq;bs;x) = (inl as) ∈ (bag(T)?)
12. a1 : bag(T)
13. bs = ({y} + a1) ∈ bag(T)
14. bag-remove1(eq;bs;y) = (inl a1) ∈ (bag(T)?)
⊢ case bag-remove1(eq;as;y) of inl(as) => as | inr(_) => as
= case bag-remove1(eq;a1;x) of inl(as) => as | inr(_) => a1
∈ bag(T)
BY
{ TACTIC:(((InstHyp [⌜y⌝;⌜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)⋅)
          THEN ((InstHyp [⌜x⌝;⌜a1⌝] 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. as : bag(T)
10. bs = ({x} + as) ∈ bag(T)
11. bag-remove1(eq;bs;x) = (inl as) ∈ (bag(T)?)
12. a1 : bag(T)
13. bs = ({y} + a1) ∈ bag(T)
14. bag-remove1(eq;bs;y) = (inl a1) ∈ (bag(T)?)
15. as@0 : bag(T)
16. as = ({y} + as@0) ∈ bag(T)
17. bag-remove1(eq;as;y) = (inl as@0) ∈ (bag(T)?)
18. a2 : bag(T)
19. a1 = ({x} + a2) ∈ bag(T)
20. bag-remove1(eq;a1;x) = (inl a2) ∈ (bag(T)?)
⊢ as@0 = a2 ∈ bag(T)
2
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. as : bag(T)
10. bs = ({x} + as) ∈ bag(T)
11. bag-remove1(eq;bs;x) = (inl as) ∈ (bag(T)?)
12. a1 : bag(T)
13. bs = ({y} + a1) ∈ bag(T)
14. bag-remove1(eq;bs;y) = (inl a1) ∈ (bag(T)?)
15. as@0 : bag(T)
16. as = ({y} + as@0) ∈ bag(T)
17. bag-remove1(eq;as;y) = (inl as@0) ∈ (bag(T)?)
18. ¬x ↓∈ a1
19. bag-remove1(eq;a1;x) = (inr ⋅ ) ∈ (bag(T)?)
⊢ as@0 = a1 ∈ bag(T)
3
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. as : bag(T)
10. bs = ({x} + as) ∈ bag(T)
11. bag-remove1(eq;bs;x) = (inl as) ∈ (bag(T)?)
12. a1 : bag(T)
13. bs = ({y} + a1) ∈ bag(T)
14. bag-remove1(eq;bs;y) = (inl a1) ∈ (bag(T)?)
15. ¬y ↓∈ as
16. bag-remove1(eq;as;y) = (inr ⋅ ) ∈ (bag(T)?)
17. a2 : bag(T)
18. a1 = ({x} + a2) ∈ bag(T)
19. bag-remove1(eq;a1;x) = (inl a2) ∈ (bag(T)?)
⊢ as = a2 ∈ bag(T)
4
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. as : bag(T)
10. bs = ({x} + as) ∈ bag(T)
11. bag-remove1(eq;bs;x) = (inl as) ∈ (bag(T)?)
12. a1 : bag(T)
13. bs = ({y} + a1) ∈ bag(T)
14. bag-remove1(eq;bs;y) = (inl a1) ∈ (bag(T)?)
15. ¬y ↓∈ as
16. bag-remove1(eq;as;y) = (inr ⋅ ) ∈ (bag(T)?)
17. ¬x ↓∈ a1
18. bag-remove1(eq;a1;x) = (inr ⋅ ) ∈ (bag(T)?)
⊢ as = a1 ∈ 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.  as  :  bag(T)
10.  bs  =  (\{x\}  +  as)
11.  bag-remove1(eq;bs;x)  =  (inl  as)
12.  a1  :  bag(T)
13.  bs  =  (\{y\}  +  a1)
14.  bag-remove1(eq;bs;y)  =  (inl  a1)
\mvdash{}  case  bag-remove1(eq;as;y)  of  inl(as)  =>  as  |  inr($_{}$)  =>  as
=  case  bag-remove1(eq;a1;x)  of  inl(as)  =>  as  |  inr($_{}$)  =>  a1
By
Latex:
TACTIC:(((InstHyp  [\mkleeneopen{}y\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{})
                THEN  ((InstHyp  [\mkleeneopen{}x\mkleeneclose{};\mkleeneopen{}a1\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{}
                )\mcdot{}
Home
Index