Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Marianna Rapoport
iris-coq
Commits
4ecb139a
Commit
4ecb139a
authored
Nov 17, 2016
by
Robbert Krebbers
Browse files
Show that gmultiset is a simple collection.
This way we can use set_solver to solve goals involving ∈.
parent
c218e1ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
prelude/gmultiset.v
View file @
4ecb139a
...
...
@@ -106,7 +106,21 @@ Proof.
destruct
(
X
!!
_
),
(
Y
!!
_
)
;
simplify_option_eq
;
omega
.
Qed
.
Lemma
elem_of_multiplicity
x
X
:
x
∈
X
↔
0
<
multiplicity
x
X
.
Proof
.
done
.
Qed
.
(* Algebraic laws *)
Global
Instance
gmultiset_simple_collection
:
SimpleCollection
A
(
gmultiset
A
).
Proof
.
split
.
-
intros
x
.
rewrite
elem_of_multiplicity
,
multiplicity_empty
.
omega
.
-
intros
x
y
.
destruct
(
decide
(
x
=
y
))
as
[->|].
+
rewrite
elem_of_multiplicity
,
multiplicity_singleton
.
split
;
auto
with
lia
.
+
rewrite
elem_of_multiplicity
,
multiplicity_singleton_ne
by
done
.
by
split
;
auto
with
lia
.
-
intros
X
Y
x
.
rewrite
!
elem_of_multiplicity
,
multiplicity_union
.
omega
.
Qed
.
Global
Instance
gmultiset_comm
:
Comm
(@
eq
(
gmultiset
A
))
(
∪
).
Proof
.
intros
X
Y
.
apply
gmultiset_eq
;
intros
x
.
rewrite
!
multiplicity_union
;
omega
.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment