Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stdpp
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
Model registry
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
Iris
stdpp
Commits
f4072243
Verified
Commit
f4072243
authored
2 years ago
by
Dan Frumin
Committed by
Paolo G. Giarrusso
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Introduce `set_bind` and associated lemmas.
parent
f844da54
No related branches found
No related tags found
1 merge request
!406
Introduce `set_bind` and associated lemmas + set_bind theory: revise setoid rewriting
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/fin_sets.v
+54
-0
54 additions, 0 deletions
theories/fin_sets.v
with
54 additions
and
0 deletions
theories/fin_sets.v
+
54
−
0
View file @
f4072243
...
...
@@ -27,6 +27,11 @@ Definition set_map `{Elements A C, Singleton B D, Empty D, Union D}
Typeclasses
Opaque
set_map
.
Global
Instance
:
Params
(
@
set_map
)
8
:=
{}
.
Definition
set_bind
`{
Elements
A
SA
,
Empty
SB
,
Union
SB
}
(
f
:
A
→
SB
)
(
X
:
SA
)
:
SB
:=
⋃
(
f
<$>
elements
X
)
.
Typeclasses
Opaque
set_bind
.
Global
Instance
set_fresh
`{
Elements
A
C
,
Fresh
A
(
list
A
)}
:
Fresh
A
C
:=
fresh
∘
elements
.
Typeclasses
Opaque
set_fresh
.
...
...
@@ -436,6 +441,55 @@ Section map.
Proof
.
unfold_leibniz
.
apply
set_map_singleton
.
Qed
.
End
map
.
(** * Bind *)
Section
set_bind
.
Context
`{
FinSet
A
SA
,
FinSet
B
SB
}
.
Local
Notation
set_bind
:=
(
set_bind
(
A
:=
A
)
(
SA
:=
SA
)
(
SB
:=
SB
))
.
Lemma
set_bind_ext
(
f
g
:
A
→
SB
)
(
X
Y
:
SA
)
:
(
∀
x
,
f
x
≡
g
x
)
→
X
≡
Y
→
set_bind
f
X
≡
set_bind
g
Y
.
Proof
.
intros
Hfg
HXY
b
.
unfold
set_bind
.
rewrite
!
elem_of_union_list
.
set_unfold
.
setoid_rewrite
elem_of_elements
.
naive_solver
.
Qed
.
Global
Instance
set_bind_proper
:
Proper
(
pointwise_relation
_
(
≡
)
==>
(
≡
)
==>
(
≡
))
set_bind
.
Proof
.
intros
f1
f2
Hf
X1
X2
HX
.
by
apply
set_bind_ext
.
Qed
.
Lemma
elem_of_set_bind
(
f
:
A
→
SB
)
(
X
:
SA
)
y
:
y
∈
set_bind
f
X
↔
∃
x
,
x
∈
X
∧
y
∈
f
x
.
Proof
.
unfold
set_bind
.
rewrite
!
elem_of_union_list
.
set_unfold
.
setoid_rewrite
elem_of_elements
.
naive_solver
.
Qed
.
Global
Instance
set_unfold_set_bind
(
f
:
A
→
SB
)
(
X
:
SA
)
y
(
P
:
A
→
B
→
Prop
)
(
Q
:
A
→
Prop
)
:
(
∀
x
y
,
SetUnfoldElemOf
y
(
f
x
)
(
P
x
y
))
→
(
∀
x
,
SetUnfoldElemOf
x
X
(
Q
x
))
→
SetUnfoldElemOf
y
(
set_bind
f
X
)
(
∃
x
,
Q
x
∧
P
x
y
)
.
Proof
.
intros
HSU1
HSU2
.
constructor
.
rewrite
elem_of_set_bind
.
set_solver
.
Qed
.
Global
Instance
set_bind_subset
f
:
Proper
((
⊆
)
==>
(
⊆
))
(
set_bind
f
)
.
Proof
.
intros
X
Y
HXY
.
set_solver
.
Qed
.
Lemma
set_bind_singleton
f
x
:
set_bind
f
{[
x
]}
≡
f
x
.
Proof
.
set_solver
.
Qed
.
Lemma
set_bind_singleton_L
`{
!
LeibnizEquiv
SB
}
f
x
:
set_bind
f
{[
x
]}
=
f
x
.
Proof
.
unfold_leibniz
.
apply
set_bind_singleton
.
Qed
.
Lemma
set_bind_disj_union
f
(
X
Y
:
SA
)
:
X
##
Y
→
set_bind
f
(
X
∪
Y
)
≡
set_bind
f
X
∪
set_bind
f
Y
.
Proof
.
set_solver
.
Qed
.
Lemma
set_bind_disj_union_L
`{
!
LeibnizEquiv
SB
}
f
(
X
Y
:
SA
)
:
X
##
Y
→
set_bind
f
(
X
∪
Y
)
=
set_bind
f
X
∪
set_bind
f
Y
.
Proof
.
unfold_leibniz
.
apply
set_bind_disj_union
.
Qed
.
End
set_bind
.
(** * Decision procedures *)
Lemma
set_Forall_elements
P
X
:
set_Forall
P
X
↔
Forall
P
(
elements
X
)
.
Proof
.
rewrite
Forall_forall
.
by
setoid_rewrite
elem_of_elements
.
Qed
.
...
...
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