Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tej Chajed
iris
Commits
ba30e046
Commit
ba30e046
authored
Feb 15, 2016
by
Ralf Jung
Browse files
show that monadic set operations respect the partial order
parent
8c22bd60
Changes
2
Hide whitespace changes
Inline
Side-by-side
prelude/collections.v
View file @
ba30e046
...
...
@@ -531,12 +531,21 @@ End fresh.
Section
collection_monad
.
Context
`
{
CollectionMonad
M
}.
Global
Instance
collection_fmap_mono
{
A
B
}
:
Proper
(
pointwise_relation
_
(=)
==>
(
⊆
)
==>
(
⊆
))
(@
fmap
M
_
A
B
).
Proof
.
intros
f
g
?
X
Y
?
;
solve_elem_of
.
Qed
.
Global
Instance
collection_fmap_proper
{
A
B
}
:
Proper
(
pointwise_relation
_
(=)
==>
(
≡
)
==>
(
≡
))
(@
fmap
M
_
A
B
).
Proof
.
intros
f
g
?
X
Y
[??]
;
split
;
solve_elem_of
.
Qed
.
Global
Instance
collection_bind_mono
{
A
B
}
:
Proper
(((=)
==>
(
⊆
))
==>
(
⊆
)
==>
(
⊆
))
(@
mbind
M
_
A
B
).
Proof
.
unfold
respectful
;
intros
f
g
Hfg
X
Y
?
;
solve_elem_of
.
Qed
.
Global
Instance
collection_bind_proper
{
A
B
}
:
Proper
(((=)
==>
(
≡
))
==>
(
≡
)
==>
(
≡
))
(@
mbind
M
_
A
B
).
Proof
.
unfold
respectful
;
intros
f
g
Hfg
X
Y
[??]
;
split
;
solve_elem_of
.
Qed
.
Global
Instance
collection_join_mono
{
A
}
:
Proper
((
⊆
)
==>
(
⊆
))
(@
mjoin
M
_
A
).
Proof
.
intros
X
Y
?
;
solve_elem_of
.
Qed
.
Global
Instance
collection_join_proper
{
A
}
:
Proper
((
≡
)
==>
(
≡
))
(@
mjoin
M
_
A
).
Proof
.
intros
X
Y
[??]
;
split
;
solve_elem_of
.
Qed
.
...
...
prelude/sets.v
View file @
ba30e046
...
...
@@ -28,4 +28,4 @@ Instance set_join : MJoin set := λ A (XX : set (set A)),
Instance
set_collection_monad
:
CollectionMonad
set
.
Proof
.
by
split
;
try
apply
_
.
Qed
.
Global
Opaque
set_union
set_intersection
.
Global
Opaque
set_union
set_intersection
set_difference
.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment