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
1b9b1ef7
Commit
1b9b1ef7
authored
4 years ago
by
Simon Friis Vindum
Browse files
Options
Downloads
Patches
Plain Diff
Add lemmas about list_to_map
parent
1b559061
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!199
Add lemmas about `list_to_map`
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/fin_map_dom.v
+10
-0
10 additions, 0 deletions
theories/fin_map_dom.v
theories/fin_maps.v
+9
-0
9 additions, 0 deletions
theories/fin_maps.v
with
19 additions
and
0 deletions
theories/fin_map_dom.v
+
10
−
0
View file @
1b9b1ef7
...
@@ -156,6 +156,13 @@ Proof.
...
@@ -156,6 +156,13 @@ Proof.
intros
m1
m2
EQm
.
apply
elem_of_equiv
.
intros
i
.
intros
m1
m2
EQm
.
apply
elem_of_equiv
.
intros
i
.
rewrite
!
elem_of_dom
,
EQm
.
done
.
rewrite
!
elem_of_dom
,
EQm
.
done
.
Qed
.
Qed
.
Lemma
dom_list_to_map
{
A
:
Type
}
(
l
:
list
(
K
*
A
))
:
dom
D
(
list_to_map
l
:
M
A
)
≡
list_to_set
l
.
*
1
.
Proof
.
induction
l
as
[|??
IH
]
.
-
by
rewrite
dom_empty
.
-
simpl
.
by
rewrite
dom_insert
,
IH
.
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. *)
...
@@ -197,6 +204,9 @@ Section leibniz.
...
@@ -197,6 +204,9 @@ Section leibniz.
(
∀
i
,
i
∈
X
↔
∃
x
,
m
!!
i
=
Some
x
∧
is_Some
(
f
i
x
))
→
(
∀
i
,
i
∈
X
↔
∃
x
,
m
!!
i
=
Some
x
∧
is_Some
(
f
i
x
))
→
dom
D
(
map_imap
f
m
)
=
X
.
dom
D
(
map_imap
f
m
)
=
X
.
Proof
.
unfold_leibniz
;
apply
dom_imap
.
Qed
.
Proof
.
unfold_leibniz
;
apply
dom_imap
.
Qed
.
Lemma
dom_list_to_map_L
{
A
:
Type
}
(
l
:
list
(
K
*
A
))
:
dom
D
(
list_to_map
l
:
M
A
)
=
list_to_set
l
.
*
1
.
Proof
.
unfold_leibniz
.
apply
dom_list_to_map
.
Qed
.
End
leibniz
.
End
leibniz
.
(** * Set solver instances *)
(** * Set solver instances *)
...
...
This diff is collapsed.
Click to expand it.
theories/fin_maps.v
+
9
−
0
View file @
1b9b1ef7
...
@@ -838,6 +838,15 @@ Proof. done. Qed.
...
@@ -838,6 +838,15 @@ Proof. done. Qed.
Lemma
list_to_map_cons
{
A
}
(
l
:
list
(
K
*
A
))
i
x
:
Lemma
list_to_map_cons
{
A
}
(
l
:
list
(
K
*
A
))
i
x
:
list_to_map
((
i
,
x
)
::
l
)
=
<
[
i
:=
x
]
>
(
list_to_map
l
:
M
A
)
.
list_to_map
((
i
,
x
)
::
l
)
=
<
[
i
:=
x
]
>
(
list_to_map
l
:
M
A
)
.
Proof
.
done
.
Qed
.
Proof
.
done
.
Qed
.
Lemma
list_to_map_snoc
{
A
}
(
l
:
list
(
K
*
A
))
i
x
:
i
∉
l
.
*
1
→
list_to_map
(
l
++
[(
i
,
x
)])
=
<
[
i
:=
x
]
>
(
list_to_map
l
:
M
A
)
.
Proof
.
induction
l
as
[|[
k
y
]
l
IH
];
[
done
|]
.
intros
[
Hneq
Hni
]
%
not_elem_of_cons
.
simpl
.
rewrite
(
IH
Hni
)
.
rewrite
insert_commute
;
[
done
|]
.
rewrite
comm
;
[
apply
Hneq
|
apply
_]
.
Qed
.
Lemma
list_to_map_fmap
{
A
B
}
(
f
:
A
→
B
)
l
:
Lemma
list_to_map_fmap
{
A
B
}
(
f
:
A
→
B
)
l
:
list_to_map
(
prod_map
id
f
<$>
l
)
=
f
<$>
(
list_to_map
l
:
M
A
)
.
list_to_map
(
prod_map
id
f
<$>
l
)
=
f
<$>
(
list_to_map
l
:
M
A
)
.
Proof
.
Proof
.
...
...
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