Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Iris
stdpp
Commits
37762bb8
Commit
37762bb8
authored
Feb 23, 2019
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bit of refactoring for multiset singleton.
parent
34a3138e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
theories/gmultiset.v
theories/gmultiset.v
+12
-7
No files found.
theories/gmultiset.v
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
.
...
...
Write
Preview
Markdown
is supported
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