Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
Iris
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rodolphe Lepigre
Iris
Commits
f31e57b6
Commit
f31e57b6
authored
Nov 22, 2016
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More set_Forall and set_Exists stuff for finite sets.
parent
f072ab70
Changes
1
Hide whitespace changes
Inline
Sidebyside
Showing
1 changed file
with
28 additions
and
8 deletions
+28
8
prelude/fin_collections.v
prelude/fin_collections.v
+28
8
No files found.
prelude/fin_collections.v
View file @
f31e57b6
...
@@ 249,18 +249,38 @@ Section filter.
...
@@ 249,18 +249,38 @@ Section filter.
End
filter
.
End
filter
.
(** * Decision procedures *)
(** * Decision procedures *)
Global
Instance
set_Forall_dec
`
(
P
:
A
→
Prop
)
Lemma
set_Forall_elements
P
X
:
set_Forall
P
X
↔
Forall
P
(
elements
X
).
`
{
∀
x
,
Decision
(
P
x
)}
X
:
Decision
(
set_Forall
P
X
)

100
.
Proof
.
rewrite
Forall_forall
.
by
setoid_rewrite
elem_of_elements
.
Qed
.
Lemma
set_Exists_elements
P
X
:
set_Exists
P
X
↔
Exists
P
(
elements
X
).
Proof
.
rewrite
Exists_exists
.
by
setoid_rewrite
elem_of_elements
.
Qed
.
Lemma
set_Forall_Exists_dec
{
P
Q
:
A
→
Prop
}
(
dec
:
∀
x
,
{
P
x
}
+
{
Q
x
})
X
:
{
set_Forall
P
X
}
+
{
set_Exists
Q
X
}.
Proof
.
refine
(
cast_if
(
Forall_Exists_dec
dec
(
elements
X
)))
;
[
by
apply
set_Forall_elements

by
apply
set_Exists_elements
].
Defined
.
Lemma
not_set_Forall_Exists
P
`
{
dec
:
∀
x
,
Decision
(
P
x
)}
X
:
¬
set_Forall
P
X
→
set_Exists
(
not
∘
P
)
X
.
Proof
.
intro
.
by
destruct
(
set_Forall_Exists_dec
dec
X
).
Qed
.
Lemma
not_set_Exists_Forall
P
`
{
dec
:
∀
x
,
Decision
(
P
x
)}
X
:
¬
set_Exists
P
X
→
set_Forall
(
not
∘
P
)
X
.
Proof
.
by
destruct
(@
set_Forall_Exists_dec
(
not
∘
P
)
_
(
λ
x
,
swap_if
(
decide
(
P
x
)))
X
).
Qed
.
Global
Instance
set_Forall_dec
(
P
:
A
→
Prop
)
`
{
∀
x
,
Decision
(
P
x
)}
X
:
Decision
(
set_Forall
P
X
)

100
.
Proof
.
Proof
.
refine
(
cast_if
(
decide
(
Forall
P
(
elements
X
))))
;
refine
(
cast_if
(
decide
(
Forall
P
(
elements
X
))))
;
abstract
(
unfold
set_Forall
;
setoid_rewrite
<
elem_of_elements
;
by
rewrite
set_Forall_elements
.
by
rewrite
<
Forall_forall
).
Defined
.
Defined
.
Global
Instance
set_Exists_dec
`
(
P
:
A
→
Prop
)
`
{
∀
x
,
Decision
(
P
x
)}
X
:
Global
Instance
set_Exists_dec
`
(
P
:
A
→
Prop
)
`
{
∀
x
,
Decision
(
P
x
)}
X
:
Decision
(
set_Exists
P
X
)

100
.
Decision
(
set_Exists
P
X
)

100
.
Proof
.
Proof
.
refine
(
cast_if
(
decide
(
Exists
P
(
elements
X
))))
;
refine
(
cast_if
(
decide
(
Exists
P
(
elements
X
))))
;
abstract
(
unfold
set_Exists
;
setoid_rewrite
<
elem_of_elements
;
by
rewrite
set_Exists_elements
.
by
rewrite
<
Exists_exists
).
Defined
.
Defined
.
End
fin_collection
.
End
fin_collection
.
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