Step
*
2
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. ¬y ↓∈ bs
13. bag-remove1(eq;bs;y) = (inr ⋅ ) ∈ (bag(T)?)
⊢ case bag-remove1(eq;as;y) of inl(as) => as | inr(_) => as = as ∈ bag(T)
BY
{ ((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)⋅)⋅ }
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. ¬y ↓∈ bs
13. bag-remove1(eq;bs;y) = (inr ⋅ ) ∈ (bag(T)?)
14. as@0 : bag(T)
15. as = ({y} + as@0) ∈ bag(T)
16. bag-remove1(eq;as;y) = (inl as@0) ∈ (bag(T)?)
⊢ as@0 = as ∈ 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. \mneg{}y \mdownarrow{}\mmember{} bs
13. bag-remove1(eq;bs;y) = (inr \mcdot{} )
\mvdash{} case bag-remove1(eq;as;y) of inl(as) => as | inr($_{}$) => as = as
By
Latex:
((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{})\mcdot{}
Home
Index