Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
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
Package Registry
Model registry
Operate
Terraform modules
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
Yixuan Chen
Iris
Commits
fdc22ecc
Commit
fdc22ecc
authored
9 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Stronger version of map_insert_op.
parent
87957de9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
algebra/fin_maps.v
+16
-2
16 additions, 2 deletions
algebra/fin_maps.v
with
16 additions
and
2 deletions
algebra/fin_maps.v
+
16
−
2
View file @
fdc22ecc
...
...
@@ -176,9 +176,23 @@ Proof.
by
move
=>
/
(_
i
);
simplify_map_equality
.
Qed
.
Lemma
map_insert_op
m1
m2
i
x
:
Lemma
map_insert_op
_None
m1
m2
i
x
:
m2
!!
i
=
None
→
<
[
i
:=
x
]
>
(
m1
⋅
m2
)
=
<
[
i
:=
x
]
>
m1
⋅
m2
.
Proof
.
by
intros
Hi
;
apply
(
insert_merge_l
_
m1
m2
);
rewrite
Hi
.
Qed
.
Lemma
map_insert_op_unit
m1
m2
i
x
:
m2
!!
i
≡
Some
(
unit
x
)
→
<
[
i
:=
x
]
>
(
m1
⋅
m2
)
≡
<
[
i
:=
x
]
>
m1
⋅
m2
.
Proof
.
intros
Hu
j
;
destruct
(
decide
(
i
=
j
))
as
[
->
|]
.
*
by
rewrite
lookup_insert
lookup_op
lookup_insert
Hu
cmra_unit_r
.
*
by
rewrite
lookup_insert_ne
//
!
lookup_op
lookup_insert_ne
.
Qed
.
Lemma
map_insert_op
m1
m2
i
x
:
m2
!!
i
=
None
∨
m2
!!
i
≡
Some
(
unit
x
)
→
<
[
i
:=
x
]
>
(
m1
⋅
m2
)
≡
<
[
i
:=
x
]
>
m1
⋅
m2
.
Proof
.
by
intros
[?|?];
[
rewrite
map_insert_op_None
|
rewrite
map_insert_op_unit
]
.
Qed
.
Lemma
map_unit_singleton
(
i
:
K
)
(
x
:
A
)
:
unit
({[
i
↦
x
]}
:
gmap
K
A
)
=
{[
i
↦
unit
x
]}
.
Proof
.
apply
map_fmap_singleton
.
Qed
.
...
...
@@ -261,7 +275,7 @@ Proof.
assert
(
i
∉
dom
(
gset
K
)
m
∧
i
∉
dom
(
gset
K
)
mf
)
as
[??]
.
{
rewrite
-
not_elem_of_union
-
map_dom_op
;
apply
is_fresh
.
}
exists
(
<
[
i
:=
x
]
>
m
);
split
;
first
by
apply
HQ
,
not_elem_of_dom
.
rewrite
-
map_insert_op
;
last
by
apply
not_elem_of_dom
.
rewrite
-
map_insert_op
_None
;
last
by
apply
not_elem_of_dom
.
by
apply
map_insert_validN
;
[
apply
cmra_valid_validN
|]
.
Qed
.
Lemma
map_updateP_alloc'
m
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