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
10d52cfd
Commit
10d52cfd
authored
3 years ago
by
Robbert Krebbers
Committed by
Glen Mével
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
shorten the proof of `dec_pred_finite`
parent
5ce93607
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/sets.v
+3
-15
3 additions, 15 deletions
theories/sets.v
with
3 additions
and
15 deletions
theories/sets.v
+
3
−
15
View file @
10d52cfd
...
...
@@ -1169,23 +1169,11 @@ Proof.
intros
xs
.
exists
(
fresh
xs
)
.
split
;
[
set_solver
|]
.
apply
infinite_is_fresh
.
Qed
.
Lemma
dec_pred_finite
{
A
}
(
P
:
A
→
Prop
)
{
Hdec
:
∀
x
,
Decision
(
P
x
)}
:
pred_finite
P
↔
∃
(
xs
:
list
A
)
,
∀
x
,
P
x
↔
x
∈
xs
.
Lemma
dec_pred_finite
{
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
]
.
cut
(
∀
n
,
∃
ys
,
(
∀
x
,
P
x
→
x
∈
ys
++
drop
n
xs
)
∧
(
∀
x
,
x
∈
ys
→
P
x
))
.
{
intros
H
.
specialize
(
H
(
length
xs
))
as
(
ys
&
H1
&
H2
)
.
rewrite
drop_all
,
app_nil_r
in
H1
.
exists
ys
.
set_solver
.
}
intros
n
.
induction
n
as
[
|
n
(
ys
&
IH1
&
IH2
)]
.
{
exists
[]
.
rewrite
drop_0
.
set_solver
.
}
destruct
(
decide
(
n
<
length
xs
))
as
[[
y
Hn
]
%
lookup_lt_is_Some
|
?]
.
{
destruct
(
decide
(
P
y
))
as
[
Hy
|
Hy
]
.
{
exists
(
ys
++
[
y
])
.
pose
proof
(
assoc
app
)
as
<-.
cbn
.
rewrite
<-
drop_S
;
set_solver
.
}
{
exists
ys
.
split
;
[|
done
]
.
intros
x
Hx
.
specialize
(
IH1
x
Hx
)
as
[?
|
Hx_elem_of
]
%
elem_of_app
;
[
set_solver
|]
.
erewrite
drop_S
in
Hx_elem_of
;
set_solver
.
}
}
{
exists
ys
.
revert
IH1
.
rewrite
!
drop_ge
,
app_nil_r
;
[
done
|
lia
..]
.
}
exists
(
filter
P
xs
)
.
intros
x
.
rewrite
elem_of_list_filter
.
naive_solver
.
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