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
Model registry
Operate
Environments
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
Gregory Malecha
stdpp
Commits
f9ad00e2
Commit
f9ad00e2
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Generalize insert_delete lemma.
parent
d52ee289
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
+4
-9
4 additions, 9 deletions
theories/fin_maps.v
with
4 additions
and
9 deletions
theories/fin_maps.v
+
4
−
9
View file @
f9ad00e2
...
...
@@ -366,13 +366,8 @@ Qed.
Lemma
delete_insert
{
A
}
(
m
:
M
A
)
i
x
:
m
!!
i
=
None
→
delete
i
(
<
[
i
:=
x
]
>
m
)
=
m
.
Proof
.
apply
delete_partial_alter
.
Qed
.
Lemma
insert_delete
{
A
}
(
m
:
M
A
)
i
x
:
m
!!
i
=
Some
x
→
<
[
i
:=
x
]
>
(
delete
i
m
)
=
m
.
Proof
.
intros
Hmi
.
unfold
delete
,
map_delete
,
insert
,
map_insert
.
rewrite
<-
partial_alter_compose
.
unfold
compose
.
rewrite
<-
Hmi
.
by
apply
partial_alter_self_alt
.
Qed
.
Lemma
insert_delete
{
A
}
(
m
:
M
A
)
i
x
:
<
[
i
:=
x
]
>
(
delete
i
m
)
=
<
[
i
:=
x
]
>
m
.
Proof
.
symmetry
;
apply
(
partial_alter_compose
(
λ
_,
Some
x
))
.
Qed
.
Lemma
delete_subseteq
{
A
}
(
m
:
M
A
)
i
:
delete
i
m
⊆
m
.
Proof
.
rewrite
!
map_subseteq_spec
.
intros
j
x
.
rewrite
lookup_delete_Some
.
tauto
.
...
...
@@ -473,8 +468,8 @@ Lemma insert_subset_inv {A} (m1 m2 : M A) i x :
∃
m2'
,
m2
=
<
[
i
:=
x
]
>
m2'
∧
m1
⊂
m2'
∧
m2'
!!
i
=
None
.
Proof
.
intros
Hi
Hm1m2
.
exists
(
delete
i
m2
)
.
split_and
?
.
-
rewrite
insert_delete
.
done
.
eapply
lookup_weaken
,
strict_include
;
eauto
.
by
rewrite
lookup_insert
.
-
rewrite
insert_delete
,
insert_id
.
done
.
eapply
lookup_weaken
,
strict_include
;
eauto
.
by
rewrite
lookup_insert
.
-
eauto
using
insert_delete_subset
.
-
by
rewrite
lookup_delete
.
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