Skip to content
Snippets Groups Projects
Commit a70caa4b authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

All multiset elements are cancelable.

parent 465dd9f4
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,11 @@ Section gmultiset. ...@@ -50,6 +50,11 @@ Section gmultiset.
Proof. split. done. intros X. by rewrite gmultiset_op_union left_id_L. done. Qed. Proof. split. done. intros X. by rewrite gmultiset_op_union left_id_L. done. Qed.
Canonical Structure gmultisetUR := UcmraT (gmultiset K) gmultiset_ucmra_mixin. Canonical Structure gmultisetUR := UcmraT (gmultiset K) gmultiset_ucmra_mixin.
Global Instance gmultiset_cancelable X : Cancelable X.
Proof.
apply: discrete_cancelable=> Y Z _ ?. fold_leibniz. by apply (inj (X )).
Qed.
Lemma gmultiset_opM X mY : X ? mY = X from_option id mY. Lemma gmultiset_opM X mY : X ? mY = X from_option id mY.
Proof. destruct mY; by rewrite /= ?right_id_L. Qed. Proof. destruct mY; by rewrite /= ?right_id_L. Qed.
...@@ -71,7 +76,6 @@ Section gmultiset. ...@@ -71,7 +76,6 @@ Section gmultiset.
repeat (rewrite multiplicity_difference || rewrite multiplicity_union). repeat (rewrite multiplicity_difference || rewrite multiplicity_union).
omega. omega.
Qed. Qed.
End gmultiset. End gmultiset.
Arguments gmultisetC _ {_ _}. Arguments gmultisetC _ {_ _}.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment