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
0666a61f
Commit
0666a61f
authored
3 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Add lemmas `map_singleton_equiv_inj` and `map_fmap_equiv_inj`.
parent
ac4dbb94
No related branches found
No related tags found
1 merge request
!276
Misc setoids lemmas and tweaks for maps and option
Pipeline
#48334
passed
3 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/fin_maps.v
+14
-0
14 additions, 0 deletions
theories/fin_maps.v
with
14 additions
and
0 deletions
theories/fin_maps.v
+
14
−
0
View file @
0666a61f
...
@@ -677,6 +677,14 @@ Proof.
...
@@ -677,6 +677,14 @@ Proof.
-
rewrite
lookup_singleton
in
Heq
.
naive_solver
.
-
rewrite
lookup_singleton
in
Heq
.
naive_solver
.
-
rewrite
lookup_singleton_ne
in
Heq
by
done
.
naive_solver
.
-
rewrite
lookup_singleton_ne
in
Heq
by
done
.
naive_solver
.
Qed
.
Qed
.
Global
Instance
map_singleton_equiv_inj
`{
Equiv
A
}
:
Inj2
(
=
)
(
≡
)
(
≡
)
(
singletonM
(
M
:=
M
A
))
.
Proof
.
intros
i1
x1
i2
x2
Heq
.
specialize
(
Heq
i1
)
.
rewrite
lookup_singleton
in
Heq
.
destruct
(
decide
(
i1
=
i2
))
as
[
->
|]
.
-
rewrite
lookup_singleton
in
Heq
.
apply
(
inj
_)
in
Heq
.
naive_solver
.
-
rewrite
lookup_singleton_ne
in
Heq
by
done
.
inversion
Heq
.
Qed
.
Lemma
map_non_empty_singleton
{
A
}
i
(
x
:
A
)
:
{[
i
:=
x
]}
≠
(
∅
:
M
A
)
.
Lemma
map_non_empty_singleton
{
A
}
i
(
x
:
A
)
:
{[
i
:=
x
]}
≠
(
∅
:
M
A
)
.
Proof
.
Proof
.
...
@@ -716,6 +724,12 @@ Proof.
...
@@ -716,6 +724,12 @@ Proof.
intros
?
m1
m2
Hm
.
apply
map_eq
;
intros
i
.
intros
?
m1
m2
Hm
.
apply
map_eq
;
intros
i
.
apply
(
inj
(
fmap
(
M
:=
option
)
f
))
.
by
rewrite
<-!
lookup_fmap
,
Hm
.
apply
(
inj
(
fmap
(
M
:=
option
)
f
))
.
by
rewrite
<-!
lookup_fmap
,
Hm
.
Qed
.
Qed
.
Global
Instance
map_fmap_equiv_inj
`{
Equiv
A
,
Equiv
B
}
(
f
:
A
→
B
)
:
Inj
(
≡
)
(
≡
)
f
→
Inj
(
≡@
{
M
A
})
(
≡@
{
M
B
})
(
fmap
f
)
.
Proof
.
intros
?
m1
m2
Hm
i
.
apply
(
inj
(
fmap
(
M
:=
option
)
f
))
.
rewrite
<-!
lookup_fmap
.
by
apply
lookup_proper
.
Qed
.
Lemma
lookup_fmap_Some
{
A
B
}
(
f
:
A
→
B
)
(
m
:
M
A
)
i
y
:
Lemma
lookup_fmap_Some
{
A
B
}
(
f
:
A
→
B
)
(
m
:
M
A
)
i
y
:
(
f
<$>
m
)
!!
i
=
Some
y
↔
∃
x
,
f
x
=
y
∧
m
!!
i
=
Some
x
.
(
f
<$>
m
)
!!
i
=
Some
y
↔
∃
x
,
f
x
=
y
∧
m
!!
i
=
Some
x
.
...
...
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