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
Rodolphe Lepigre
Iris
Commits
f079e680
Commit
f079e680
authored
Dec 15, 2015
by
Robbert Krebbers
Browse files
Extensionality of map on agreement.
parent
5f13409c
Changes
1
Hide whitespace changes
Inline
Side-by-side
iris/agree.v
View file @
f079e680
...
...
@@ -124,15 +124,21 @@ Proof.
Qed
.
End
agree
.
Program
Definition
agree_map
`
{
Dist
A
,
Dist
B
}
(
f
:
A
→
B
)
(
x
:
agree
A
)
:
agree
B
:
=
{|
agree_car
n
:
=
f
(
x
n
)
;
agree_is_valid
:
=
agree_is_valid
x
|}.
Solve
Obligations
with
auto
using
agree_valid_0
,
agree_valid_S
.
Section
agree_map
.
Context
`
{
Cofe
A
,
Cofe
B
}
(
f
:
A
→
B
)
`
{
Hf
:
∀
n
,
Proper
(
dist
n
==>
dist
n
)
f
}.
Program
Definition
agree_map
(
x
:
agree
A
)
:
agree
B
:
=
{|
agree_car
n
:
=
f
(
x
n
)
;
agree_is_valid
:
=
agree_is_valid
x
|}.
Solve
Obligations
with
auto
using
agree_valid_0
,
agree_valid_S
.
Global
Instance
agree_map_ne
n
:
Proper
(
dist
n
==>
dist
n
)
agree_map
.
Context
`
{
Cofe
A
,
Cofe
B
}
(
f
:
A
→
B
)
`
{
Hf
:
∀
n
,
Proper
(
dist
n
==>
dist
n
)
f
}.
Global
Instance
agree_map_ne
n
:
Proper
(
dist
n
==>
dist
n
)
(
agree_map
f
).
Proof
.
by
intros
x1
x2
Hx
;
split
;
simpl
;
intros
;
[
apply
Hx
|
apply
Hf
,
Hx
].
Qed
.
Global
Instance
agree_map_proper
:
Proper
((
≡
)==>(
≡
))
agree_map
:
=
ne_proper
_
.
Global
Instance
agree_map_monotone
:
CMRAMonotone
agree_map
.
Global
Instance
agree_map_proper
:
Proper
((
≡
)
==>
(
≡
))
(
agree_map
f
)
:
=
ne_proper
_
.
Lemma
agree_map_ext
(
g
:
A
→
B
)
x
:
(
∀
x
,
f
x
≡
g
x
)
→
agree_map
f
x
≡
agree_map
g
x
.
Proof
.
by
intros
Hfg
;
split
;
simpl
;
intros
;
rewrite
?Hfg
.
Qed
.
Global
Instance
agree_map_monotone
:
CMRAMonotone
(
agree_map
f
).
Proof
.
split
;
[|
by
intros
n
x
[?
Hx
]
;
split
;
simpl
;
[|
by
intros
n'
?
;
rewrite
Hx
]].
intros
x
y
n
;
rewrite
!
agree_includedN
;
intros
Hy
;
rewrite
Hy
.
...
...
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