Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stdpp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
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
Iris
stdpp
Commits
5db505ac
Commit
5db505ac
authored
2 weeks ago
by
Marijn van Wezel
Browse files
Options
Downloads
Patches
Plain Diff
Add `SetUnfoldElemOf` instance of `dom` on `gmultiset`
parent
d2e8771d
No related branches found
Branches containing commit
No related tags found
1 merge request
!591
Add `SetUnfoldElemOf` instance of `dom` on `gmultiset`
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
stdpp/gmultiset.v
+10
-6
10 additions, 6 deletions
stdpp/gmultiset.v
with
10 additions
and
6 deletions
stdpp/gmultiset.v
+
10
−
6
View file @
5db505ac
...
...
@@ -159,6 +159,13 @@ Section basic_lemmas.
Global
Instance
gmultiset_elem_of_dec
:
RelDecision
(
∈@
{
gmultiset
A
})
.
Proof
.
refine
(
λ
x
X
,
cast_if
(
decide
(
0
<
multiplicity
x
X
)));
done
.
Defined
.
Lemma
gmultiset_elem_of_dom
x
X
:
x
∈
dom
X
↔
x
∈
X
.
Proof
.
unfold
dom
,
gmultiset_dom
,
elem_of
at
2
,
gmultiset_elem_of
,
multiplicity
.
destruct
X
as
[
X
];
simpl
;
rewrite
elem_of_dom
,
<-
not_eq_None_Some
.
destruct
(
X
!!
x
);
naive_solver
lia
.
Qed
.
End
basic_lemmas
.
(** * A solver for multisets *)
...
...
@@ -299,6 +306,9 @@ Section multiset_unfold.
intros
??;
constructor
.
rewrite
gmultiset_elem_of_intersection
.
by
rewrite
(
set_unfold_elem_of
x
X
P
),
(
set_unfold_elem_of
x
Y
Q
)
.
Qed
.
Global
Instance
set_unfold_gmultiset_dom
x
X
:
SetUnfoldElemOf
x
(
dom
X
)
(
x
∈
X
)
.
Proof
.
constructor
.
apply
gmultiset_elem_of_dom
.
Qed
.
End
multiset_unfold
.
(** Step 3: instantiate hypotheses *)
...
...
@@ -554,12 +564,6 @@ Section more_lemmas.
exists
(
x
,
n
);
split
;
[|
by
apply
elem_of_map_to_list
]
.
apply
elem_of_replicate
;
auto
with
lia
.
Qed
.
Lemma
gmultiset_elem_of_dom
x
X
:
x
∈
dom
X
↔
x
∈
X
.
Proof
.
unfold
dom
,
gmultiset_dom
,
elem_of
at
2
,
gmultiset_elem_of
,
multiplicity
.
destruct
X
as
[
X
];
simpl
;
rewrite
elem_of_dom
,
<-
not_eq_None_Some
.
destruct
(
X
!!
x
);
naive_solver
lia
.
Qed
.
(** Properties of the set_fold operation *)
Lemma
gmultiset_set_fold_empty
{
B
}
(
f
:
A
→
B
→
B
)
(
b
:
B
)
:
...
...
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