Step
*
4
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. ¬y ↓∈ bs
12. bag-remove1(eq;bs;y) = (inr ⋅ ) ∈ (bag(T)?)
⊢ bs = case bag-remove1(eq;bs;x) of inl(as) => as | inr(_) => bs ∈ bag(T)
BY
{ ((InstHyp [⌜x⌝;⌜bs⌝] 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)⋅)⋅ }
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. \mneg{}y \mdownarrow{}\mmember{} bs
12. bag-remove1(eq;bs;y) = (inr \mcdot{} )
\mvdash{} bs = case bag-remove1(eq;bs;x) of inl(as) => as | inr($_{}$) => bs
By
Latex:
((InstHyp [\mkleeneopen{}x\mkleeneclose{};\mkleeneopen{}bs\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