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
249891cd
Commit
249891cd
authored
3 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Add lemma `dom_map_kmap`.
parent
e18f9a7d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!265
Add function `map_kmap` that transforms the keys of a finite map.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/fin_map_dom.v
+14
-0
14 additions, 0 deletions
theories/fin_map_dom.v
with
14 additions
and
0 deletions
theories/fin_map_dom.v
+
14
−
0
View file @
249891cd
...
@@ -198,6 +198,15 @@ Proof.
...
@@ -198,6 +198,15 @@ Proof.
naive_solver
.
naive_solver
.
Qed
.
Qed
.
Lemma
dom_map_kmap
`{
!
Elements
K
D
,
!
FinSet
K
D
,
FinMapDom
K2
M2
D2
}
{
A
}
(
f
:
K
→
K2
)
`{
!
Inj
(
=
)
(
=
)
f
}
(
m
:
M
A
)
:
dom
D2
(
map_kmap
(
M2
:=
M2
)
f
m
)
≡
set_map
f
(
dom
D
m
)
.
Proof
.
apply
set_equiv
.
intros
i
.
rewrite
!
elem_of_dom
,
(
lookup_map_kmap_is_Some
_),
elem_of_map
.
by
setoid_rewrite
elem_of_dom
.
Qed
.
(** If [D] has Leibniz equality, we can show an even stronger result. This is a
(** If [D] has Leibniz equality, we can show an even stronger result. This is a
common case e.g. when having a [gmap K A] where the key [K] has Leibniz equality
common case e.g. when having a [gmap K A] where the key [K] has Leibniz equality
(and thus also [gset K], the usual domain) but the value type [A] does not. *)
(and thus also [gset K], the usual domain) but the value type [A] does not. *)
...
@@ -252,6 +261,11 @@ Section leibniz.
...
@@ -252,6 +261,11 @@ Section leibniz.
Proof
.
unfold_leibniz
.
apply
dom_union_inv
.
Qed
.
Proof
.
unfold_leibniz
.
apply
dom_union_inv
.
Qed
.
End
leibniz
.
End
leibniz
.
Lemma
dom_map_kmap_L
`{
!
Elements
K
D
,
!
FinSet
K
D
,
FinMapDom
K2
M2
D2
}
`{
!
LeibnizEquiv
D2
}
{
A
}
(
f
:
K
→
K2
)
`{
!
Inj
(
=
)
(
=
)
f
}
(
m
:
M
A
)
:
dom
D2
(
map_kmap
(
M2
:=
M2
)
f
m
)
=
set_map
f
(
dom
D
m
)
.
Proof
.
unfold_leibniz
.
by
apply
dom_map_kmap
.
Qed
.
(** * Set solver instances *)
(** * Set solver instances *)
Global
Instance
set_unfold_dom_empty
{
A
}
i
:
SetUnfoldElemOf
i
(
dom
D
(
∅:
M
A
))
False
.
Global
Instance
set_unfold_dom_empty
{
A
}
i
:
SetUnfoldElemOf
i
(
dom
D
(
∅:
M
A
))
False
.
Proof
.
constructor
.
by
rewrite
dom_empty
,
elem_of_empty
.
Qed
.
Proof
.
constructor
.
by
rewrite
dom_empty
,
elem_of_empty
.
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