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
!173
prove NoDup_fmap_2_strong
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
prove NoDup_fmap_2_strong
ralf/no-dup-fmap
into
master
Overview
2
Commits
3
Pipelines
0
Changes
1
All threads resolved!
Show all comments
Merged
Ralf Jung
requested to merge
ralf/no-dup-fmap
into
master
4 years ago
Overview
2
Commits
3
Pipelines
0
Changes
1
All threads resolved!
Show all comments
Expand
Another lemma that I just needed in Perennial.
0
0
Merge request reports
Compare
master
version 2
d96ebd4c
4 years ago
version 1
bfbef8f7
4 years ago
master (base)
and
latest version
latest version
fa2a8606
3 commits,
4 years ago
version 2
d96ebd4c
2 commits,
4 years ago
version 1
bfbef8f7
1 commit,
4 years ago
1 file
+
15
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
theories/list.v
+
15
−
4
Options
@@ -3483,16 +3483,27 @@ Section fmap.
naive_solver
eauto
using
elem_of_list_fmap_1
,
elem_of_list_fmap_2_inj
.
Qed
.
(** A version of [NoDup_fmap_2] that does not require [f] to be injective for
*all* inputs. *)
Lemma
NoDup_fmap_2_strong
l
:
(
∀
x
y
,
x
∈
l
→
y
∈
l
→
f
x
=
f
y
→
x
=
y
)
→
NoDup
l
→
NoDup
(
f
<$>
l
)
.
Proof
.
intros
Hinj
.
induction
1
as
[|
x
l
??
IH
];
simpl
;
constructor
.
-
intros
[
y
[
Hxy
?]]
%
elem_of_list_fmap
.
apply
Hinj
in
Hxy
;
[
by
subst
|
by
constructor
..]
.
-
apply
IH
.
clear
-
Hinj
.
intros
x'
y
Hx'
Hy
.
apply
Hinj
;
by
constructor
.
Qed
.
Lemma
NoDup_fmap_1
l
:
NoDup
(
f
<$>
l
)
→
NoDup
l
.
Proof
.
induction
l
;
simpl
;
inversion_clear
1
;
constructor
;
auto
.
rewrite
elem_of_list_fmap
in
*.
naive_solver
.
Qed
.
Lemma
NoDup_fmap_2
`{
!
Inj
(
=
)
(
=
)
f
}
l
:
NoDup
l
→
NoDup
(
f
<$>
l
)
.
Proof
.
induction
1
;
simpl
;
constructor
;
trivial
.
rewrite
elem_of_list_fmap
.
intros
[
y
[
Hxy
?]]
.
apply
(
inj
f
)
in
Hxy
.
by
subst
.
Qed
.
Proof
.
apply
NoDup_fmap_2_strong
.
intros
??
_
_
.
apply
(
inj
f
)
.
Qed
.
Lemma
NoDup_fmap
`{
!
Inj
(
=
)
(
=
)
f
}
l
:
NoDup
(
f
<$>
l
)
↔
NoDup
l
.
Proof
.
split
;
auto
using
NoDup_fmap_1
,
NoDup_fmap_2
.
Qed
.
Loading