39

I am not very well-versed in the world of theorem proving, much less automated theorem proving, so please correct me if anything I say or assume in my question is wrong.

Basically, my question is: are automated theorem provers themselves ever formally proven to work with another theorem prover, or is there just an underlying assumption that any theorem prover was just implemented really really well, extensively tested & reviewed, etc. and so it "must work"?

If so, does there always remain some underlying doubt in any proof proven by a formally verified automated theorem prover, as the formal verification of that theorem prover still lies on assuming that the non-formally verified theorem prover was correct in its verification of the former theorem prover, even if it might technically be wrong - as it was not formally verified itself? (That is a mouthful of a question, apologies.)

I am thinking of this question in much the same vein as bootstrapping compilers.

Jason Gross
  • 137
  • 7
J. Auon
  • 503
  • 4
  • 7
  • 2
    This is indeed interesting and important - I'm not nearly knowledgeable to give an answer here, but you might find J. C. Davis' Ph.D. thesis interesting. – Noah Schweber Jan 21 '20 at 16:39
  • 4
    If a theorem prover can prove its own consistency, doesn't that mean it is inconsistent? – yters Jan 22 '20 at 18:30
  • 1
    @yters I'd guess it can at least prove its own relative consistency. – senderle Jan 23 '20 at 02:29
  • 1
    @yters: That's why the question isn't really well-defined. After all, there is no way to formalize the correctness of a theorem prover build in the real world since the most we can do is to express that notion in some syntactic form that intuitively seems to correspond to what we want it to mean. And then of course under mild assumptions, no reasonable theorem prover can prove its own consistency, much less arithmetical soundness (which is one precisely specifiable aspect of correctness), unless it proves $0=1$. I'm not sure why none of the existing answers touched on this aspect. – user21820 Jan 24 '20 at 08:10
  • 1
    You cannot prove a proof language's strong normalization ("every program terminates with a unique result") property in itself unless it is in fact inconsistent. Or unless the proof language is so weak that it does not even allow you to encode Peano arithmetic... – xuq01 Jan 24 '20 at 17:35

5 Answers5

46

I recommend reading Pollack's How to believe a machine-checked proof. It explains how proof assistants are designed to minimize the amount of critical code.

There are many levels of formal verification (that's the phrase you're looking for in place of "proven") of a proof assistant:

  1. Verify that the algorithms used by the proof assistant are correct.
  2. Verify that the implementation of (the critical core of) the proof assistant is correct.
  3. Verify that the compiler for the language in which the proof assistant is implemented is correctly designed and implemented.
  4. Verify that the hardware on which the proof assistant runs is correctly designed and built.
  5. Compute the probability that a cosmic ray passes through the CPU and tricks your proof assistant every time you run it.
  6. Estimate the likelihood that you are insane.

People put serious effort into these (well, at least the first four). For example, steps 1 and 2 are addressed in Coq Coq Correct!, and steps 3 and 4 in the amazing award-winning CompCert project.

Andrej Bauer
  • 30,396
  • 1
  • 70
  • 117
  • 10
  • Estimate the likelihood that you are part of a simulation by very powerful beings that are living in a finite world but are simulating us in an apparently infinite world, and so there is no real model of PA but we cannot ever figure that out because the simulation tricks us.
  • – user21820 Jan 22 '20 at 10:16
  • 3
    "Coq Coq Correct!" is the greatest title I've seen in a long while. – Édouard Jan 22 '20 at 12:23
  • @user21820: I worry about your personal value of point 6 above. – Andrej Bauer Jan 22 '20 at 12:42
  • 2
    I do feel that swapping 5 and 6 probably leads to a more sane approach to proving proof systems =) – Cort Ammon Jan 22 '20 at 15:15
  • @AndrejBauer: Heh. I was joking in my comment. But more seriously, we don't have any evidence that there is a real-world model of PA, due to the impossibility of performing 100% accurate computations involving arbitrary-length strings. Assuming PA sure works well in terms of producing theorems that appear to be true at human-testable scales, but 'unsoundness' of PA at untestable scales is far more likely than cosmic ray trickery and my insanity. =) – user21820 Jan 22 '20 at 16:57
  • 1
    The Intro to Isabelle slides (pdf), discuss "If I Prove It on the Computer, It Is Correct, Right?" Which is more about validity of a proof rather than the theorem prover, but I think probably still worth mentioning the two points "logic could be inconsistent" and "theorem could mean something else" (page 17). – BurnsBA Jan 22 '20 at 17:42
  • @user21820: you have a strange notion of "real-world model of PA". Are you imagining an infinite string of beads somewhere, that somehow we can comprehend all at once to consitute a model of PA? – Andrej Bauer Jan 22 '20 at 22:12
  • @AndrejBauer: No I am not. Having a real-world model of PA means that we have a conceptual type whose members are potentially constructible entities in the real world, that is closed under operations addition and multiplication, such that it (with those operations) satisfies the axioms of PA. Equivalently, we need a conceptual type of strings that is closed under concatenation and satisfies TC. No such thing is known to exist. We can imagine binary strings stored in extendible electronic memory, but it would fail at extremely large string lengths. – user21820 Jan 23 '20 at 02:49
  • We're deeply off topic here. – Andrej Bauer Jan 23 '20 at 07:13
  • No it's not off-topic; it's directly relevant to your point (1). I don't think it is fair to give much weight to point (5) if one cannot even have comparable confidence of soundness of the underlying formal system. – user21820 Jan 23 '20 at 17:47
  • Nobody is discussing whether we can verify every theorem, but rather how to trust a proof assistant when it confirms that a specific given proof is valid. If the proof assisant runs out of resources, it crashes. Therefore, we will always detect the fact that our idelized mathematical model (which presupposes unlimited resources) is is out of sync with reality. In other words, we do not need to know whether there "really is a model of $\mathbb{N}$ in our universe" in order to trust the outputs of a proof assistant. – Andrej Bauer Jan 23 '20 at 18:10
  • And in any case, if you're going to worry about something, you could start with worrying about the computational complexity of the algorithms that run inside a proof assistant, as those will present an actual bottle neck. Philosophical worries about storing infinitely many beads into the universe are far down on the list of things that worry people who actually implement proof assistants, rather than just philosophise about them. – Andrej Bauer Jan 23 '20 at 18:14
  • It occurred to me that @user21820 may have misunderstood my point 1. I did not meant by that that we need to show soundness of PA or other foundational theories, but rather that the underlying algorithms (for example, normalization procedures) for the type theory implemented in the proof assistant are correct. – Andrej Bauer Jan 24 '20 at 06:59
  • 1
    @AndrejBauer: Based on your last comment, yes... you should edit your post to clarify, because for most logicians "underlying formal theory" would mean "underlying foundational system"... And of course I agree that the algorithmic issues far outweigh potential unsoundness in the foundational system. (Though it would be nice if you don't keep misconstruing my point as being about "infinitely many beads".) Thanks! – user21820 Jan 24 '20 at 08:03
  • Ok, I fixed it. I hope that clarifies things a bit. Regarding infinitiely many beads, I honestly never understood what people meant when they wanted a "real-world model of PA". It just seems such a misguided idea that I might as well imagine an infinite stream of beads. – Andrej Bauer Jan 24 '20 at 13:25