Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rice Wine
Iris
Commits
4ecb139a
Commit
4ecb139a
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Show that gmultiset is a simple collection.
This way we can use set_solver to solve goals involving ∈.
parent
c218e1ab
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
prelude/gmultiset.v
+14
-0
14 additions, 0 deletions
prelude/gmultiset.v
with
14 additions
and
0 deletions
prelude/gmultiset.v
+
14
−
0
View file @
4ecb139a
...
@@ -106,7 +106,21 @@ Proof.
...
@@ -106,7 +106,21 @@ Proof.
destruct
(
X
!!
_),
(
Y
!!
_);
simplify_option_eq
;
omega
.
destruct
(
X
!!
_),
(
Y
!!
_);
simplify_option_eq
;
omega
.
Qed
.
Qed
.
Lemma
elem_of_multiplicity
x
X
:
x
∈
X
↔
0
<
multiplicity
x
X
.
Proof
.
done
.
Qed
.
(* Algebraic laws *)
(* 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
))
(
∪
)
.
Global
Instance
gmultiset_comm
:
Comm
(
@
eq
(
gmultiset
A
))
(
∪
)
.
Proof
.
Proof
.
intros
X
Y
.
apply
gmultiset_eq
;
intros
x
.
rewrite
!
multiplicity_union
;
omega
.
intros
X
Y
.
apply
gmultiset_eq
;
intros
x
.
rewrite
!
multiplicity_union
;
omega
.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment