Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Tej Chajed
iris
Commits
19aae59a
Commit
19aae59a
authored
Nov 01, 2018
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prove that `fmap` on `option` and `gmap` is monotone.
parent
19e85810
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
theories/algebra/cmra.v
theories/algebra/cmra.v
+8
-0
theories/algebra/gmap.v
theories/algebra/gmap.v
+8
-0
No files found.
theories/algebra/cmra.v
View file @
19aae59a
...
...
@@ -1430,6 +1430,14 @@ Section option_prod.
Proof
.
intros
?%
Some_pair_included
.
by
rewrite
-(
Some_included_total
b1
).
Qed
.
End
option_prod
.
Lemma
option_fmap_mono
{
A
B
:
cmraT
}
(
f
:
A
→
B
)
ma
mb
:
Proper
((
≡
)
==>
(
≡
))
f
→
(
∀
a
b
,
a
≼
b
→
f
a
≼
f
b
)
→
ma
≼
mb
→
f
<$>
ma
≼
f
<$>
mb
.
Proof
.
intros
??.
rewrite
!
option_included
;
intros
[->|(
a
&
b
&->&->&?)]
;
naive_solver
.
Qed
.
Instance
option_fmap_cmra_morphism
{
A
B
:
cmraT
}
(
f
:
A
→
B
)
`
{!
CmraMorphism
f
}
:
CmraMorphism
(
fmap
f
:
option
A
→
option
B
).
Proof
.
...
...
theories/algebra/gmap.v
View file @
19aae59a
...
...
@@ -474,6 +474,14 @@ Proof.
apply
(
delete_local_update_cancelable
m
_
i
(
Some
x
))
;
[
done
|
by
rewrite
lookup_singleton
].
Qed
.
Lemma
gmap_fmap_mono
{
B
:
ucmraT
}
(
f
:
A
→
B
)
m1
m2
:
Proper
((
≡
)
==>
(
≡
))
f
→
(
∀
x
y
,
x
≼
y
→
f
x
≼
f
y
)
→
m1
≼
m2
→
fmap
f
m1
≼
fmap
f
m2
.
Proof
.
intros
??.
rewrite
!
lookup_included
=>
Hm
i
.
rewrite
!
lookup_fmap
.
by
apply
option_fmap_mono
.
Qed
.
End
properties
.
Section
unital_properties
.
...
...
Write
Preview
Markdown
is supported
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