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
Merge requests
!65
gmultiset lemmas
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
gmultiset lemmas
dfrumin/coq-stdpp:gmultiset_lemmas
into
master
Overview
27
Commits
7
Pipelines
0
Changes
1
Merged
Dan Frumin
requested to merge
dfrumin/coq-stdpp:gmultiset_lemmas
into
master
6 years ago
Overview
27
Commits
7
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
master
version 5
765e544c
6 years ago
version 4
87c732fc
6 years ago
version 3
90c03053
6 years ago
version 2
a41a00fd
6 years ago
version 1
c21663f9
6 years ago
master (base)
and
version 2
latest version
3521f39b
7 commits,
6 years ago
version 5
765e544c
7 commits,
6 years ago
version 4
87c732fc
6 commits,
6 years ago
version 3
90c03053
5 commits,
6 years ago
version 2
a41a00fd
4 commits,
6 years ago
version 1
c21663f9
3 commits,
6 years ago
1 file
+
34
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
theories/gmultiset.v
+
34
−
4
Options
@@ -330,7 +330,27 @@ Proof.
destruct
(
X
!!
x
);
naive_solver
lia
.
Qed
.
(* Properties of the size operation *)
(** Properties of the set_fold operation *)
Lemma
gmultiset_set_fold_empty
{
B
}
(
f
:
A
→
B
→
B
)
(
b
:
B
)
:
set_fold
f
b
(
∅
:
gmultiset
A
)
=
b
.
Proof
.
by
unfold
set_fold
;
simpl
;
rewrite
gmultiset_elements_empty
.
Qed
.
Lemma
gmultiset_set_fold_singleton
{
B
}
(
f
:
A
→
B
→
B
)
(
b
:
B
)
(
a
:
A
)
:
set_fold
f
b
({[
a
]}
:
gmultiset
A
)
=
f
a
b
.
Proof
.
by
unfold
set_fold
;
simpl
;
rewrite
gmultiset_elements_singleton
.
Qed
.
Lemma
gmultiset_set_fold_disj_union
(
f
:
A
→
A
→
A
)
(
b
:
A
)
X
Y
:
Comm
(
=
)
f
→
Assoc
(
=
)
f
→
set_fold
f
b
(
X
⊎
Y
)
=
set_fold
f
(
set_fold
f
b
X
)
Y
.
Proof
.
intros
Hcomm
Hassoc
.
unfold
set_fold
;
simpl
.
assert
(
Proper
((
≡
ₚ
)
==>
(
=
))
(
foldr
f
b
))
as
Hproper
.
{
apply
foldr_permutation_proper
;
try
apply
_
.
intros
a1
a2
b1
.
by
rewrite
!
Hassoc
,
(
Hcomm
a1
a2
)
.
}
rewrite
gmultiset_elements_disj_union
,
<-
foldr_app
.
apply
Hproper
,
Permutation_app_comm
.
Qed
.
(** Properties of the size operation *)
Lemma
gmultiset_size_empty
:
size
(
∅
:
gmultiset
A
)
=
0
.
Proof
.
done
.
Qed
.
Lemma
gmultiset_size_empty_inv
X
:
size
X
=
0
→
X
=
∅.
@@ -370,7 +390,7 @@ Proof.
by
rewrite
gmultiset_elements_disj_union
,
app_length
.
Qed
.
(* Order stuff *)
(*
*
Order stuff *)
Global
Instance
gmultiset_po
:
PartialOrder
(
⊆@
{
gmultiset
A
})
.
Proof
.
split
;
[
split
|]
.
@@ -464,6 +484,13 @@ Proof.
rewrite
HX
at
2
;
rewrite
gmultiset_size_disj_union
.
lia
.
Qed
.
Lemma
gmultiset_empty_difference
X
Y
:
Y
⊆
X
→
Y
∖
X
=
∅.
Proof
.
intros
HYX
.
unfold_leibniz
.
intros
x
.
rewrite
multiplicity_difference
,
multiplicity_empty
.
specialize
(
HYX
x
)
.
lia
.
Qed
.
Lemma
gmultiset_non_empty_difference
X
Y
:
X
⊂
Y
→
Y
∖
X
≠
∅.
Proof
.
intros
[_
HXY2
]
Hdiff
;
destruct
HXY2
;
intros
x
.
@@ -471,13 +498,16 @@ Proof.
rewrite
multiplicity_difference
,
multiplicity_empty
;
lia
.
Qed
.
Lemma
gmultiset_difference_diag
X
:
X
∖
X
=
∅.
Proof
.
by
apply
gmultiset_empty_difference
.
Qed
.
Lemma
gmultiset_difference_subset
X
Y
:
X
≠
∅
→
X
⊆
Y
→
Y
∖
X
⊂
Y
.
Proof
.
intros
.
eapply
strict_transitive_l
;
[
by
apply
gmultiset_union_subset_r
|]
.
by
rewrite
<-
(
gmultiset_disj_union_difference
X
Y
)
.
Qed
.
(* Mononicity *)
(*
*
Mononicity *)
Lemma
gmultiset_elements_submseteq
X
Y
:
X
⊆
Y
→
elements
X
⊆+
elements
Y
.
Proof
.
intros
->%
gmultiset_disj_union_difference
.
rewrite
gmultiset_elements_disj_union
.
@@ -495,7 +525,7 @@ Proof.
gmultiset_size_disj_union
by
auto
.
lia
.
Qed
.
(* Well-foundedness *)
(*
*
Well-foundedness *)
Lemma
gmultiset_wf
:
wf
(
⊂@
{
gmultiset
A
})
.
Proof
.
apply
(
wf_projected
(
<
)
size
);
auto
using
gmultiset_subset_size
,
lt_wf
.
Loading