2

Background

There’s an excellent question on MathOverflow that talks about the following: imagine that $M$ is a TM that searches over all ZFC proofs and halts if and only if it finds a proof that it halts. The answer is yes because it’s possible to adapt the logic behind Löb’s theorem to Turing machines.

At that question is a remarkable answer by Akiva Weinberger that spells out an explicit argument, based on the proof of Löb’s theorem, showing why this machine $M$ halts:

Build a second machine $N$. $N$ searches for a proof in ZFC of, "if $N$ halts then $M$ halts". If it finds one, it halts.

ZFC can argue as follows. "Suppose $N$ halts. Then it found a proof that if $N$ halts then $M$ halts. This, combined with the trace of $N$ halting, would be a ZFC proof that $M$ halts. Thus $M$ finds this and halts."

That paragraph is a ZFC proof that if $N$ halts then $M$ halts… which $N$ finds, so $N$ halts. Thus, by the same logic as above, there is a proof that $M$ halts, which it will find and then halt on.

Löb’s theorem is closely related to Curry’s paradox. Briefly, Curry’s paradox envisions a statement $P$ that says “if $P$ is true, then $\phi$ is true,” where $\phi$ is some arbitrary statement. The paradox is that this seems to imply that $\phi$ is true regardless of what $\phi$ is.

My Question

Pick any statement $\phi$. I’m going to argue that ZFC proves $\phi$. (Clearly it doesn’t, so there has to be a flaw in the following reasoning. However, I’m not sure what it is!) This is essentially a minimally-modified version of Akiva Weinberger’s MO answer but applied to Curry’s paradox rather than Löb’s theorem. To make it easier to see the changes, I’ve bolded all parts that differ from the original.

Consider a TM $M$ that searches over all ZFC proofs and halts if and only if it finds a proof of the statement “if $M$ halts, then $\phi$ is true.

Build a second machine $N$. $N$ searches for a proof in ZFC of, "if $N$ halts, then if $M$ halts, then $\phi$ is true.” If it finds one, it halts.

ZFC can argue as follows. "Suppose $N$ halts. Then it found a proof that if $N$ halts, then if $M$ halts, then $\phi$ is true. This, combined with the trace of $N$ halting, would be a ZFC proof that if $M$ halts, then $\phi$ is true. Thus $M$ finds this and halts. This, combined with a trace of $M$ halting, would be a ZFC proof of $\phi$.

That paragraph is a ZFC proof that if $N$ halts, then if $M$ halts, then $\phi$ is true… which $N$ finds, so $N$ halts. Thus, by the same logic as above, there is a proof that $M$ halts, which it will find and then halt on. And since $M$ halts, a trace of $M$ halting, plus the preceding argument, gives a ZFC proof of $\phi$.

There has to be something wrong with the above argument, but I confess I’m not seeing what it is. Can someone point out where I’m telling lies? :-)

  • How can a Turing machine contain a description of itself in its state machine to decide if some string is a halting run of itself? The machine is not complete until you encode the string describing it into its state machine. – Chad K Jan 28 '24 at 17:22
  • 1
    This is possible due to Kleene’s second recursion theorem. It’s analogous to the idea of a program that prints its own source code (a Quine), which is possible despite the fact that it seems like the program wouldn’t be “complete” without containing a copy of its source code. (See Chapter 6 of Sipser’s Introduction to the Theory of Computation for a good explanation.) – templatetypedef Jan 28 '24 at 17:36
  • I don't see how that answers my question. The reference talks about taking a complete $M$ and creating another machine $N$ that has $M$ embedded in it. You're talking about a machine that has itself embedded in it. Just because there are some programs that print their own code doesn't mean all programs can be embedded in themselves. They can be embedded in another program. – Chad K Jan 28 '24 at 17:48
  • 1
    The second recursion theorem I linked in my comment states, essentially, that TMs can compute arbitrary functions of their own encodings. See these lecture slides for more details and an concrete example of a program that computes a nontrivial property of itself. – templatetypedef Jan 28 '24 at 17:54
  • Does a Turing machine $M$ that does nothing - just halts on its starting step satisfy the definition of $M$ in the first paragraph? If $M$ is a fixed point for something, what is it a fixed point for? Can you write the program $M$ in any programming language of your choice? If $M$ is a fixed point, can you write the program $N$ that $M$ is a fixed point for in any programming language? What does the program take as input? What do you mean by 'halts'? A specific input or all inputs? If you mean all inputs, what's a proof in ZFC that a program halts on all inputs? Is that computable? – Chad K Jan 28 '24 at 18:49
  • 1
    An always-halting TM would not meet the requirements because were specifically interested in a TM that loops over all proofs and checks for a proof that it itself halts. You could imagine writing a TM $X$ that takes in a TM $Y$ as input, searches for a proof that $Y$ halts, then halts if and only if it finds one. Applying Kleene’s theorem to that TM then produces $M$. This could be done in any Turing-complete language. As for which inputs - let’s relax our model of TMs a bit and imagine that, like Turing’s original conception, a TM starts with a blank tape and runs from there. – templatetypedef Jan 28 '24 at 19:34
  • good question. I literally wrote up almost your exact argument after reading that MO answer, and then found your post. Do you happen to have an answer you're satisfied with? Perhaps if you understand it better now, you could write a "self answer" to your post!

    My argument replaced the original "M halts" with "P" (for arbitrary P), so I instead deal with just 1 machine, N which halts iff N finds a PA/ZFC proof that [N halts -> P], a proof which it then prints out. This simplifies the argument somewhat.

    – D.R. Dec 06 '24 at 06:52

3 Answers3

2

I don't see a contradiction anywhere. Let $\varphi$ be a statement in the language of $\mathsf{ZFC}$. Let $\ulcorner\varphi\urcorner$ be a string encoding $\varphi$. Let $\text{prov}(\ulcorner\varphi\urcorner)$ be the formula that says there exists a string encoding a proof of $\varphi$ from the axioms of $\mathsf{ZFC}$.

For a Turing machine $M$ and a string $\ulcorner M\urcorner$ encoding $M$, let $\text{halt}(\ulcorner M\urcorner)$ be the formula that says there exists a string encoding a run of $M$ halting on the empty input.

What you showed is that there is a Turing machine $M_\varphi$, encoded by a string $\ulcorner M_\varphi\urcorner$ such that $$\mathsf{ZFC}\vdash\text{halt}(\ulcorner M_\varphi\urcorner)\rightarrow\text{prov}(\ulcorner\varphi\urcorner)$$

and also that there is a Turing machine $N_\varphi$ encoded by $\ulcorner N_\varphi\urcorner$ such that $$\mathsf{ZFC}\vdash(\text{halt}(\ulcorner N_\varphi\urcorner)\land\text{halt}(\ulcorner M_\varphi\urcorner))\rightarrow\text{prov}(\ulcorner\varphi\urcorner)$$

but unless $\mathsf{ZFC}\vdash(\text{halt}(\ulcorner N_\varphi\urcorner)\land\text{halt}(\ulcorner M_\varphi\urcorner))$ or $\mathsf{ZFC}\vdash\text{halt}(\ulcorner M_\varphi\urcorner)$ you cannot conclude from this that $\mathsf{ZFC}\vdash\text{prov}(\ulcorner\varphi\urcorner)$.

It's difficult to understand why you need either $M$ or $N$. You can build a machine $M$ that searches the space of strings for proofs of $\varphi$ in $\mathsf{ZFC}$ directly. Why do you need a machine $M$ to search for proofs that 'If $M$ halts on the empty input then $\varphi$ is provable in $\mathsf{ZFC}$'? A machine that searches for proofs of $\varphi$ will halt on the empty input if and only if $\varphi$ is provable in $\mathsf{ZFC}$.

Chad K
  • 5,058
  • Thanks for the answer. I think I’d get a better sense for why my argument doesn’t work if I could see the original (correct) argument about Löb’s theorem recast using your notation. Would it be possible to see why the original argument is correct but why my modified one fails? – templatetypedef Feb 21 '24 at 19:20
  • 1
    @templatetypedef: Your argument doesn't fail. You proved that the provability predicate of $\mathsf{ZFC}$ is reducible to the halting problem. That's not a contradiction in $\mathsf{ZFC}$. It's long known and doesn't need any fixed point theorems. There's a direct reduction from $\text{prov}$ to $\text{halt}$. – Chad K Feb 24 '24 at 17:41
1

The problem is this part:

That paragraph is a ZFC proof that if N halts, then if M halts, then ϕ is true

The relevant paragraph only talks about proofs of $\phi,$ not $\phi$ itself. So all you can say at that point is:

That paragraph is a ZFC proof that if N halts, then if M halts, then ZFC proves ϕ

which isn't as useful.


A good way to find the mistake is to take $\phi=\bot$ (i.e. any contradiction). Then using the 2nd incompleteness theorem it's easy to see that these are equivalent in a weak metatheory:

  • $M$ halts
  • $N$ halts
  • ZFC is inconsistent

In particular we (and ZFC) can prove "if $M$ and $N$ halt then $\mathsf{ZFC}\vdash \phi$". But ZFC cannot prove "if $M$ and $N$ halt then $\phi$", unless it's inconsistent.

  • Gotcha, thanks. So to clarify, the issue is that the relevant bit is a ZFC proof of “if N halts, then if M halts, then ZFC proves phi” rather than “if N halts, then if M halts, then phi,” so in the next paragraph where we talk about N finding the proof, it doesn’t necessarily find a proof of the statement it’s searching for? And that differs from the original (correct) proof because… help me finish that sentence? – templatetypedef Mar 02 '24 at 15:30
0

I think I have an answer. The slogan is: the subtle assumption we're making is precisely the "Löb hypothesis", and so being careful about this assumption, we get directly a proof of Löb's theorem using these funny Turing machine.

Let me analyze a simpler variant, that makes the point just as well. Let $P$ denote some proposition (like $P$ is "$0=1$", or "$\forall x \forall y (x+y=y+x)$").

Consider the Turing machine/program $N$ that halts iff it finds a (PA/ZFC/whatever) proof that [$N$ halts $\to P$] (a proof which it then prints out).

Side notes: this means a proof that can use "$N$ halts" (encoded in PA/ZFC/whatever; indeed PA and ZFC are sufficiently powerful languages that they can encode this) as a black box wherever/whenever it wants in a proof tree that concludes with "$P$".

From now on, let me just say "PA" instead of "PA/ZFC/whatever".

Also one can construct this $N$ by: defining $N_1$ to be a 1-input program that takes in the code $\texttt{B}$ for a 1-input program $B$ and runs through PA proofs until it finds a PA proof that [$B$ halts $\to P$]; and then define $N$ to be $N_1(\texttt{N}_1)$.

Back to the argument at hand:

Let us assume that $N$ halts (like truly halts, in the true real world).

Because halting is something that can be "finitely witnessed", we know that PA can prove [$N$ halts].

Then by construction of $N$, it prints out a PA proof that [$N$ halts $\to$ P].

Putting these together, we can conclude that [PA proves $P$]. (this is all under the initial assumption at the start of this textblock)

The above argument can be formalized in PA (I think), so $(\star)$: we now have a PA proof that [$N$ halts $\to$ [PA proves $P$]].

Assuming the Löb hypothesis (!!!), i.e. PA proves [$\operatorname{Prov}_{\text{PA}}(P)\to P$], only then can we chain implications together to simplify $(\star)$ to just: we have a PA proof that [$N$ halts $\to P$].

This leads to $N$ halting (truly, in the true real world), which again PA can see/prove, and so applying modus ponens one last time we arrive at [PA proves $P$].

(I agree with the MO post --- this must be funniest proof I've ever seen. The necessary "double lap", i.e. doing essentially the same argument twice, is absolutely hilarious.)


One thing I think is super super subtle about the Löb hypothesis is that it's actually saying $\{\text{PA}, \operatorname{Prov}_{\text{PA}}(P)\} \vdash P$, where can only use $\operatorname{Prov}_{\text{PA}}(P)$ as a black box in the proof tree.

Whereas if we assume PA is consistent/honest (which most people believe), then in our minds we read $\operatorname{Prov}_{\text{PA}}(P)=:$ [PA $\vdash P$] as a kind of white box, that actually communicates the (true, genuine in the real world) existence of/"contains" a PA proof that concludes with $P$.

Like the subtle mistake is that people might interpret the Löb hypothesis [$\text{PA} \vdash (\operatorname{Prov}_{\text{PA}}(P) \to P)$] as: ([PA $\vdash \operatorname{Prov}_{\text{PA}}(P)$] $\implies$ [PA $\vdash P$]), i.e. "if PA says it proves $P$, then it does actually prove $P$". But this is implication in the "outer/meta" world, hence denoted by the "$\implies$" symbol! Only in the "outer/meta" world can we think of the precondition [PA $\vdash$ [PA $\vdash P$]] as a white box that actually has some meaning (semantics), as opposed to in the "inner" world where it's just a black box that is pure syntax.


So the conclusion is that the funny Turing machine $N$ "wraps" $P$ in an extra "Prov" predicate, and we need the Löb hypothesis to "unwrap", to complete the full "double lap". And this gives us a proof of Löb's theorem: [PA $\vdash (\operatorname{Prov}_{\text{PA}}(P) \to P)$] $\implies$ [PA $\vdash P$].

(An "outer/meta" world implication "$\implies$". I'm not sure if is also an "inner" world implication "$\to$". If someone could clarify further in the comments, I would be grateful.)

(PLEASE please note I am just an amateur; I could be completely and utterly wrong about everything in this answer)

D.R.
  • 10,556