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
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Arthur Azevedo de Amorim
stdpp
Commits
556a5992
Commit
556a5992
authored
5 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/fin_maps' into 'master'
Lemmas for fin_maps See merge request
!91
parents
75435486
2ffa9271
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/fin_maps.v
+34
-0
34 additions, 0 deletions
theories/fin_maps.v
with
34 additions
and
0 deletions
theories/fin_maps.v
+
34
−
0
View file @
556a5992
...
...
@@ -1190,6 +1190,9 @@ Proof.
Qed
.
Lemma
map_Forall_delete
m
i
:
map_Forall
P
m
→
map_Forall
P
(
delete
i
m
)
.
Proof
.
intros
Hm
j
x
;
rewrite
lookup_delete_Some
.
naive_solver
.
Qed
.
Lemma
map_Forall_foldr_delete
m
is
:
map_Forall
P
m
→
map_Forall
P
(
foldr
delete
m
is
)
.
Proof
.
induction
is
;
eauto
using
map_Forall_delete
.
Qed
.
Lemma
map_Forall_ind
(
Q
:
M
A
→
Prop
)
:
Q
∅
→
(
∀
m
i
x
,
m
!!
i
=
None
→
P
i
x
→
map_Forall
P
m
→
Q
m
→
Q
(
<
[
i
:=
x
]
>
m
))
→
...
...
@@ -1604,6 +1607,9 @@ Proof. intros A ?. by apply union_with_idemp. Qed.
Lemma
lookup_union
{
A
}
(
m1
m2
:
M
A
)
i
:
(
m1
∪
m2
)
!!
i
=
union_with
(
λ
x
_,
Some
x
)
(
m1
!!
i
)
(
m2
!!
i
)
.
Proof
.
apply
lookup_union_with
.
Qed
.
Lemma
lookup_union_r
{
A
}
(
m1
m2
:
M
A
)
i
:
m1
!!
i
=
None
→
(
m1
∪
m2
)
!!
i
=
m2
!!
i
.
Proof
.
intros
Hi
.
by
rewrite
lookup_union
,
Hi
,
(
left_id_L
_
_)
.
Qed
.
Lemma
lookup_union_Some_raw
{
A
}
(
m1
m2
:
M
A
)
i
x
:
(
m1
∪
m2
)
!!
i
=
Some
x
↔
m1
!!
i
=
Some
x
∨
(
m1
!!
i
=
None
∧
m2
!!
i
=
Some
x
)
.
...
...
@@ -1761,6 +1767,22 @@ Qed.
Lemma
delete_union
{
A
}
(
m1
m2
:
M
A
)
i
:
delete
i
(
m1
∪
m2
)
=
delete
i
m1
∪
delete
i
m2
.
Proof
.
apply
delete_union_with
.
Qed
.
Lemma
map_Forall_union_11
{
A
}
(
m1
m2
:
M
A
)
P
:
map_Forall
P
(
m1
∪
m2
)
→
map_Forall
P
m1
.
Proof
.
intros
HP
i
x
?
.
apply
HP
,
lookup_union_Some_raw
;
auto
.
Qed
.
Lemma
map_Forall_union_12
{
A
}
(
m1
m2
:
M
A
)
P
:
m1
##
ₘ
m2
→
map_Forall
P
(
m1
∪
m2
)
→
map_Forall
P
m2
.
Proof
.
intros
?
HP
i
x
?
.
apply
HP
,
lookup_union_Some
;
auto
.
Qed
.
Lemma
map_Forall_union_2
{
A
}
(
m1
m2
:
M
A
)
P
:
map_Forall
P
m1
→
map_Forall
P
m2
→
map_Forall
P
(
m1
∪
m2
)
.
Proof
.
intros
????
[|[]]
%
lookup_union_Some_raw
;
eauto
.
Qed
.
Lemma
map_Forall_union
{
A
}
(
m1
m2
:
M
A
)
P
:
m1
##
ₘ
m2
→
map_Forall
P
(
m1
∪
m2
)
↔
map_Forall
P
m1
∧
map_Forall
P
m2
.
Proof
.
naive_solver
eauto
using
map_Forall_union_11
,
map_Forall_union_12
,
map_Forall_union_2
.
Qed
.
(** ** Properties of the [union_list] operation *)
Lemma
map_disjoint_union_list_l
{
A
}
(
ms
:
list
(
M
A
))
(
m
:
M
A
)
:
...
...
@@ -1795,9 +1817,21 @@ Proof.
induction
is
;
simpl
;
[
done
|]
.
rewrite
elem_of_cons
;
intros
.
rewrite
lookup_delete_ne
;
intuition
.
Qed
.
Lemma
lookup_foldr_delete_Some
{
A
}
(
m
:
M
A
)
is
j
y
:
foldr
delete
m
is
!!
j
=
Some
y
↔
j
∉
is
∧
m
!!
j
=
Some
y
.
Proof
.
induction
is
;
simpl
;
rewrite
?lookup_delete_Some
;
set_solver
.
Qed
.
Lemma
foldr_delete_notin
{
A
}
(
m
:
M
A
)
is
:
Forall
(
λ
i
,
m
!!
i
=
None
)
is
→
foldr
delete
m
is
=
m
.
Proof
.
induction
1
;
simpl
;
[
done
|]
.
rewrite
delete_notin
;
congruence
.
Qed
.
Lemma
foldr_delete_commute
{
A
}
(
m
:
M
A
)
is
j
:
delete
j
(
foldr
delete
m
is
)
=
foldr
delete
(
delete
j
m
)
is
.
Proof
.
induction
is
as
[|??
IH
];
[
done
|
]
.
simpl
.
by
rewrite
delete_commute
,
IH
.
Qed
.
Lemma
foldr_delete_insert
{
A
}
(
m
:
M
A
)
is
j
x
:
j
∈
is
→
foldr
delete
(
<
[
j
:=
x
]
>
m
)
is
=
foldr
delete
m
is
.
Proof
.
induction
1
as
[
i
is
|
j
i
is
?
IH
];
simpl
;
[|
by
rewrite
IH
]
.
by
rewrite
!
foldr_delete_commute
,
delete_insert_delete
.
Qed
.
Lemma
foldr_delete_insert_ne
{
A
}
(
m
:
M
A
)
is
j
x
:
j
∉
is
→
foldr
delete
(
<
[
j
:=
x
]
>
m
)
is
=
<
[
j
:=
x
]
>
(
foldr
delete
m
is
)
.
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