Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Numerical Analysis in Coq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Micaela Mayero
Numerical Analysis in Coq
Commits
0f829fa7
Commit
0f829fa7
authored
3 years ago
by
François Clément
Browse files
Options
Downloads
Patches
Plain Diff
WIP: select True values in nat predicate.
parent
126e62bb
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
Lebesgue/nat_compl.v
+16
-8
16 additions, 8 deletions
Lebesgue/nat_compl.v
with
16 additions
and
8 deletions
Lebesgue/nat_compl.v
+
16
−
8
View file @
0f829fa7
...
...
@@ -41,7 +41,7 @@ Proof.
intros
;
lia
.
Qed
.
Fixpoint
max_n
(
f
:
nat
->
nat
)
n
:=
Fixpoint
max_n
(
f
:
nat
->
nat
)
(
n
:
nat
)
:
nat
:=
match
n
with
|
0
=>
f
0
%
nat
|
S
n
=>
max
(
f
(
S
n
))
(
max_n
f
n
)
...
...
@@ -83,6 +83,20 @@ Section Select_in_predicate.
Variable
P
:
nat
->
Prop
.
(
*
Predicate
on
natural
numbers
.
*
)
(
*
Lemma
classic_P
:
forall
P
(
n
:
nat
),
P
n
\
/
~
P
n
.
Proof
.
intros
;
apply
classic
.
Qed
.
Fixpoint
select
(
P
:
nat
->
Prop
)
(
n
:
nat
)
:
nat
:=
match
(
LPO
P
(
classic_P
P
))
with
|
inleft
H
=>
let
N
:=
proj1_sig
H
in
N
|
inright
H
=>
0
end
.
*
)
Definition
useful_finite
:
(
nat
->
nat
)
->
nat
->
Prop
:=
fun
phi
N
=>
(
forall
n
,
n
<
S
N
->
P
(
phi
n
))
/
\
...
...
@@ -93,9 +107,9 @@ Definition useful_seq : (nat -> nat) -> Prop :=
(
forall
n
,
P
(
phi
n
))
/
\
(
forall
p
,
P
p
->
exists
n
,
p
=
phi
n
).
(
*
When
we
don
'
t
need
an
injecive
function
fhi
*
)
Lemma
keep_useful
:
exists
(
phi
:
nat
->
nat
)
(
optN
:
option
nat
),
(
*
(
forall
n1
n2
,
n1
<
n2
->
phi
n1
<
phi
n2
)
/
\
(
*
phi
injective
would
be
fine
too
.
*
)
*
)
match
optN
with
|
Some
N
=>
useful_finite
phi
N
|
None
=>
useful_seq
phi
...
...
@@ -105,12 +119,6 @@ destruct (LPO (fun N => forall n, N < n -> ~ P n)) as [[N HN] | H].
intros
;
apply
classic
.
(
*
*
)
Admitted
.
Definition
get_useful
:
...
...
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