-
Notifications
You must be signed in to change notification settings - Fork 640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prove the completeness of real numbers from logical axiom sig_not_dec #10632
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a rather superficial review but this is interesting and it looks good.
I vaguely wonder whether sig_not_dec
and its use over a formula quantified over sequences is reducible to LPO?
Maybe worth to have the move of lemmas over Q
in a separate commit if not too complicated to do.
-> {n | ~P n} + {forall n, P n}. | ||
|
||
Definition sig_not_dec_T : Type := forall P : Prop, {not (not P)} + {not P}. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a longer term, I would be tempted to move sig_forall_dec_T
and sig_not_dec_T
in a more generic part of the library (e.g. in Decidable.v
) but this would require some effort of consistent naming to do at the same time, so this shall be for a later step.
Another remark in passing about the terminology "decidable" made a long time ago in the standard library: The standard definition of "decidable" from computability theory is the existence of a provably total deciding recursive function. This happens to coincide with {A}+{~A}
in the context of constructive mathematics where a model of recursive functions is intended but it starts to be disputable in the presence of axioms invalidating the model of recursive functions. So, I believe that another terminology should eventually be found. However, I don't have a good solution. Maybe using the expression "semantically decidable" (but it is a bit long).
…tion by Cauchy reals
The last commit of However, proofs in So what do you think is the best sort for |
I'd be inclined to go for CRlt in Type, as it is a Sigma01 statement. |
@spitters I now wonder if the real numbers interface is a good idea at all. Do you remember what was the motivation for it in C-CoRN ? Consider the heart of real number computation, function This algorithm is ridiculously slow. For each If we want good performance, we'd take your "faster" implementation of C-CoRN, make it the exposed definition of real numbers, and code every computation bulldog-style to it. So : no abstractions, no type classes, no records, no nothing. The downside of this is if one day we find an even faster implementation than "faster", we'll have to rewrite everything. A middle ground would be to add redundant performance functions in the interface. Typically |
Not that I enjoy playing Cassandra, but I distinctly remember warning you against this tension between abstraction and performance for real computations at TYPES... |
@ppedrot So what is your recommendation in this case? Abstraction or speed? Anyway I'm almost certain we do not want to expose my ConstructiveCauchyReals. They are a good proof that constructive reals are consistent, but they do not compute with decent speed. So we must hide them behind some sort of abstraction for the moment. |
@VincentSe I am not a specialist, but the impression I had was that it is not realistic to hope for a generic, efficient implementation of reals. In particular believing that constructing a real in proof mode will lead to something that computes in practice is but wishful thinking. It seems you almost always prefer some floating-point implementation where the precision is quantified once over the whole library, and that uses clever approximating algorithms for the functions you're interested in. Which means that, for the case at hand, abstraction is the only viable alternative. |
@ppedrot Yes, that is my opinion too. Anyway I don't have anything fast enough to offer at the moment, so we keep the interface. Next question, in the interface, do we put |
The motivation of the corn reals was not computation. |
Hi @herbelin, I don't think there will be more reviews about these changes. All comments and suggestions are integrated, can you merge now ? Again, this PR is not the last one about real numbers... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I added a few more comments. Also, if I want to work with constructive reals only, is the recommended way to Require Import ConstructiveRIneq
?
I'm proposing to merge in the middle of next week, assuming that it'll be enough time for people like @silene to comment if they want, even if in vacation. I'm assigning in the meantime. |
These are Dedekind reals with extra structure. They've been studied by Auke
Booij.
Using countable choice the dedekind sand Cauchy numbers are equivalent.
from my phone
…On Fri, Aug 16, 2019, 11:24 Vincent Semeria ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In theories/Reals/ConstructiveReals.v
<#10632 (comment)>:
> @@ -0,0 +1,119 @@
+(************************************************************************)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
+(************************************************************************)
+(************************************************************************)
+
+(* An interface for constructive and computable real numbers.
+ All of its elements are isomorphic, for example it contains
Sumbool-based Dedekind reals (replace the or by a sumbool in the located
hypothesis). They're computable and isomorphic to the Cauchy reals.
I proposed them to Andrej, but he said he wanted to keep the possibly non
computable Dedekind reals. I think he wants to study abstract Stone
duality, which is a way to "compute" those Prop-based numbers. I don't
exactly know what this means though.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10632?email_source=notifications&email_token=AABTNTVU7YEB2TZBNNEHQE3QE3BCPA5CNFSM4IJYKHMKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCBZ2NDI#discussion_r314770031>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABTNTWRMGFKPIVJMOPMVBLQE3BCPANCNFSM4IJYKHMA>
.
|
Sorry for the delay. I'm going to merge it soon. |
…axiom sig_not_dec Reviewed-by: herbelin
Thanks Hugo |
Kind: feature.
Prove the completeness of real numbers from logical axiom sig_not_dec. Now the classical real numbers only have logical axioms and quotient axioms.
Move some lemmas about rational numbers into the QArith part of the stdlib.
Also add an interface for constructive real numbers, as well as its opaque implementation by Cauchy reals. The classical reals are now a quotient of this opaque term.