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
Package Registry
Model registry
Operate
Terraform modules
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
Adam
stdpp
Commits
66c1acb6
Commit
66c1acb6
authored
3 years ago
by
Glen Mével
Browse files
Options
Downloads
Patches
Plain Diff
comment about `dec_pred_finite_alt` and prove related lemmas
Also, rename `dec_pred_finite{,_set}` to `dec_pred_finite{,_set}_alt`.
parent
79830523
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/fin_sets.v
+2
-2
2 additions, 2 deletions
theories/fin_sets.v
theories/sets.v
+24
-3
24 additions, 3 deletions
theories/sets.v
with
26 additions
and
5 deletions
theories/fin_sets.v
+
2
−
2
View file @
66c1acb6
...
...
@@ -475,10 +475,10 @@ Proof.
-
intros
[
X
Hfin
]
.
exists
(
elements
X
)
.
set_solver
.
Qed
.
Lemma
dec_pred_finite_set
(
P
:
A
→
Prop
)
`{
!∀
x
:
A
,
Decision
(
P
x
)}
:
Lemma
dec_pred_finite_set
_alt
(
P
:
A
→
Prop
)
`{
!∀
x
:
A
,
Decision
(
P
x
)}
:
pred_finite
P
↔
(
∃
X
:
C
,
∀
x
,
P
x
↔
x
∈
X
)
.
Proof
.
rewrite
dec_pred_finite
;
[|
done
]
.
split
.
rewrite
dec_pred_finite
_alt
;
[|
done
]
.
split
.
-
intros
[
xs
Hfin
]
.
exists
(
list_to_set
xs
)
.
set_solver
.
-
intros
[
X
Hfin
]
.
exists
(
elements
X
)
.
set_solver
.
Qed
.
...
...
This diff is collapsed.
Click to expand it.
theories/sets.v
+
24
−
3
View file @
66c1acb6
...
...
@@ -1169,11 +1169,32 @@ Proof.
intros
xs
.
exists
(
fresh
xs
)
.
split
;
[
set_solver
|]
.
apply
infinite_is_fresh
.
Qed
.
Lemma
dec_pred_finite
{
A
}
(
P
:
A
→
Prop
)
`{
!∀
x
,
Decision
(
P
x
)}
:
(** For decidable predicates, we have an alternative formulation for [pred_finite]. *)
Lemma
dec_pred_finite_alt
{
A
}
(
P
:
A
→
Prop
)
`{
!∀
x
,
Decision
(
P
x
)}
:
pred_finite
P
↔
∃
xs
:
list
A
,
∀
x
,
P
x
↔
x
∈
xs
.
Proof
.
split
;
intros
[
xs
Hxs
];
[|
exists
xs
;
set_solver
]
.
exists
(
filter
P
xs
)
.
intros
x
.
rewrite
elem_of_list_filter
.
naive_solver
.
split
;
intros
[
xs
?]
.
-
exists
(
filter
P
xs
)
.
intros
x
.
rewrite
elem_of_list_filter
.
naive_solver
.
-
exists
xs
.
naive_solver
.
Qed
.
(** Conversely (if equality is decidable), the alternative formulation makes the
predicate decidable; so it is stronger than [pred_finite] (there are finite
which are undecidable, for instance [λ (), Q] where [Q] is undecidable). *)
Lemma
pred_finite_alt_dec
{
A
}
`{
!
EqDecision
A
}
(
P
:
A
→
Prop
)
:
{
xs
:
list
A
|
∀
x
,
P
x
↔
x
∈
xs
}
→
pred_finite
P
*
(
∀
x
,
Decision
(
P
x
))
.
Proof
.
intros
[
xs
?]
.
split
.
-
exists
xs
.
naive_solver
.
-
intros
x
.
destruct
(
decide
(
x
∈
xs
));
[
left
|
right
];
naive_solver
.
Qed
.
Lemma
finite_sig_pred_finite_alt
{
A
}
(
P
:
A
→
Prop
)
`{
Finite
(
sig
P
)}
:
{
xs
:
list
A
|
∀
x
,
P
x
↔
x
∈
xs
}
.
Proof
.
exists
(
proj1_sig
<$>
enum
_)
.
intros
x
.
split
.
-
intros
px
.
apply
elem_of_list_fmap_1_alt
with
(
x
↾
px
);
[
apply
elem_of_enum
|];
done
.
-
intros
Hx
.
apply
elem_of_list_fmap
in
Hx
as
[[
x'
px'
]
[
->
_]]
.
done
.
Qed
.
Lemma
finite_sig_pred_finite
{
A
}
(
P
:
A
→
Prop
)
`{
Finite
(
sig
P
)}
:
...
...
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