Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joshua Yanovski
iris-coq
Commits
fdc22ecc
Commit
fdc22ecc
authored
Feb 09, 2016
by
Robbert Krebbers
Browse files
Stronger version of map_insert_op.
parent
87957de9
Changes
1
Hide whitespace changes
Inline
Side-by-side
algebra/fin_maps.v
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
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment