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
9d0f527a
Commit
9d0f527a
authored
9 months ago
by
Robbert Krebbers
Browse files
Options
Downloads
Plain Diff
Merge branch 'robbert/sorted_unique' into 'master'
Stronger sorted unique lemmas See merge request
!567
parents
1844a78e
1d6ec7e6
No related branches found
No related tags found
1 merge request
!567
Stronger sorted unique lemmas
Pipeline
#106657
passed
9 months ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+2
-0
2 additions, 0 deletions
CHANGELOG.md
stdpp/sorting.v
+17
-4
17 additions, 4 deletions
stdpp/sorting.v
with
19 additions
and
4 deletions
CHANGELOG.md
+
2
−
0
View file @
9d0f527a
...
...
@@ -45,6 +45,8 @@ API-breaking change is listed.
the folded function itself.
-
Add string literal notation "my string" to
`std_scope`
, and no longer globally
open
`string_scope`
.
-
Add lemmas
`Sorted_unique_strong`
and
`StronglySorted_unique_strong`
that only
require anti-symmetry for the elements that are in the list.
The following
`sed`
script should perform most of the renaming
(on macOS, replace
`sed`
by
`gsed`
, installed via e.g.
`brew install gnu-sed`
).
...
...
This diff is collapsed.
Click to expand it.
stdpp/sorting.v
+
17
−
4
View file @
9d0f527a
...
...
@@ -71,10 +71,13 @@ Section sorted.
Lemma
Sorted_StronglySorted
`{
!
Transitive
R
}
l
:
Sorted
R
l
→
StronglySorted
R
l
.
Proof
.
by
apply
Sorted
.
Sorted_StronglySorted
.
Qed
.
Lemma
StronglySorted_unique
`{
!
AntiSymm
(
=
)
R
}
l1
l2
:
Lemma
StronglySorted_unique_strong
l1
l2
:
(
∀
x1
x2
,
x1
∈
l1
→
x2
∈
l2
→
R
x1
x2
→
R
x2
x1
→
x1
=
x2
)
→
StronglySorted
R
l1
→
StronglySorted
R
l2
→
l1
≡
ₚ
l2
→
l1
=
l2
.
Proof
.
intros
Hl1
;
revert
l2
.
induction
Hl1
as
[|
x1
l1
?
IH
Hx1
];
intros
l2
Hl2
E
.
intros
Hasym
Hl1
.
revert
l2
Hasym
.
induction
Hl1
as
[|
x1
l1
?
IH
Hx1
];
intros
l2
Hasym
Hl2
E
.
{
symmetry
.
by
apply
Permutation_nil
.
}
destruct
Hl2
as
[|
x2
l2
?
Hx2
]
.
{
by
apply
Permutation_nil_r
in
E
.
}
...
...
@@ -82,9 +85,19 @@ Section sorted.
{
rewrite
Forall_forall
in
Hx1
,
Hx2
.
assert
(
x2
∈
x1
::
l1
)
as
Hx2'
by
(
by
rewrite
E
;
left
)
.
assert
(
x1
∈
x2
::
l2
)
as
Hx1'
by
(
by
rewrite
<-
E
;
left
)
.
inv
Hx1'
;
inv
Hx2'
;
simplify_eq
;
auto
.
}
f_equal
.
by
apply
IH
,
(
inj
(
x2
::.))
.
inv
Hx1'
;
inv
Hx2'
;
simplify_eq
;
[
eauto
..|]
.
apply
Hasym
;
[
by
constructor
..|
|];
by
eauto
.
}
f_equal
.
apply
IH
,
(
inj
(
x2
::.));
[|
done
..]
.
intros
????
.
apply
Hasym
;
by
constructor
.
Qed
.
Lemma
StronglySorted_unique
`{
!
AntiSymm
(
=
)
R
}
l1
l2
:
StronglySorted
R
l1
→
StronglySorted
R
l2
→
l1
≡
ₚ
l2
→
l1
=
l2
.
Proof
.
apply
StronglySorted_unique_strong
;
eauto
.
Qed
.
Lemma
Sorted_unique_strong
`{
!
Transitive
R
}
l1
l2
:
(
∀
x1
x2
,
x1
∈
l1
→
x2
∈
l2
→
R
x1
x2
→
R
x2
x1
→
x1
=
x2
)
→
Sorted
R
l1
→
Sorted
R
l2
→
l1
≡
ₚ
l2
→
l1
=
l2
.
Proof
.
auto
using
StronglySorted_unique_strong
,
Sorted_StronglySorted
.
Qed
.
Lemma
Sorted_unique
`{
!
Transitive
R
,
!
AntiSymm
(
=
)
R
}
l1
l2
:
Sorted
R
l1
→
Sorted
R
l2
→
l1
≡
ₚ
l2
→
l1
=
l2
.
Proof
.
auto
using
StronglySorted_unique
,
Sorted_StronglySorted
.
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