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
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Arthur Azevedo de Amorim
stdpp
Commits
37762bb8
Commit
37762bb8
authored
6 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Bit of refactoring for multiset singleton.
parent
34a3138e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/gmultiset.v
+12
-7
12 additions, 7 deletions
theories/gmultiset.v
with
12 additions
and
7 deletions
theories/gmultiset.v
+
12
−
7
View file @
37762bb8
...
...
@@ -83,6 +83,13 @@ Lemma multiplicity_singleton x : multiplicity x {[ x ]} = 1.
Proof
.
unfold
multiplicity
;
simpl
.
by
rewrite
lookup_singleton
.
Qed
.
Lemma
multiplicity_singleton_ne
x
y
:
x
≠
y
→
multiplicity
x
{[
y
]}
=
0
.
Proof
.
intros
.
unfold
multiplicity
;
simpl
.
by
rewrite
lookup_singleton_ne
.
Qed
.
Lemma
multiplicity_singleton'
x
y
:
multiplicity
x
{[
y
]}
=
if
decide
(
x
=
y
)
then
1
else
0
.
Proof
.
destruct
(
decide
_)
as
[
->
|]
.
-
by
rewrite
multiplicity_singleton
.
-
by
rewrite
multiplicity_singleton_ne
.
Qed
.
Lemma
multiplicity_union
X
Y
x
:
multiplicity
x
(
X
∪
Y
)
=
multiplicity
x
X
`
max
`
multiplicity
x
Y
.
Proof
.
...
...
@@ -117,10 +124,9 @@ Global Instance gmultiset_simple_set : SemiSet A (gmultiset A).
Proof
.
split
.
-
intros
x
.
rewrite
elem_of_multiplicity
,
multiplicity_empty
.
lia
.
-
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
.
rewrite
elem_of_multiplicity
,
multiplicity_singleton'
.
destruct
(
decide
(
x
=
y
));
intuition
lia
.
-
intros
X
Y
x
.
rewrite
!
elem_of_multiplicity
,
multiplicity_union
.
lia
.
Qed
.
Global
Instance
gmultiset_elem_of_dec
:
RelDecision
(
∈@
{
gmultiset
A
})
.
...
...
@@ -411,9 +417,8 @@ Proof. rewrite (comm_L (⊎)). apply gmultiset_disj_union_subset_l. Qed.
Lemma
gmultiset_elem_of_singleton_subseteq
x
X
:
x
∈
X
↔
{[
x
]}
⊆
X
.
Proof
.
rewrite
elem_of_multiplicity
.
split
.
-
intros
Hx
y
;
destruct
(
decide
(
x
=
y
))
as
[
->
|]
.
+
rewrite
multiplicity_singleton
;
lia
.
+
rewrite
multiplicity_singleton_ne
by
done
;
lia
.
-
intros
Hx
y
.
rewrite
multiplicity_singleton'
.
destruct
(
decide
(
y
=
x
));
naive_solver
lia
.
-
intros
Hx
.
generalize
(
Hx
x
)
.
rewrite
multiplicity_singleton
.
lia
.
Qed
.
...
...
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