While reading some articles on formal proofs (see also my previous question on cstheory about the length of ZFC proofs versus human written proofs), I came up with this apparent paradox.
Let $M_{const}$ be a program that given Turing machine $M$ checks if there is a short ZFC proof $\Gamma$ of length $|\Gamma| \leq |M|^2$ that $M$ runs in constant time.
Program M_const( M )
enumerate all strings S of length <= |M|^2
verify if S is a proof of "M in O(1)"
if it is a valid proof the halt and accept
if no valid proof is found halt and reject
Now, we can build $M_{paradox}$ that knows its own code (by the recursion theorem) and on input $x$ first simulate $M_{const}( M_{paradox} )$; if it accepts then loop from $1$ to $|x|$ (so it falls in $O(n)$), otherwise halts (so it falls in $O(1)$).
Program M_paradox( x )
String M = self_code() // ok by the recursion theorem
simulate M_const( M ) // simulate M_const on M_paradox
if it accepts then for i = 1 to |x| do nothing // -> O(n)
otherwise halts // -> O(1)
some dummy unused code here // see below
It is clear (and hopefully provable in ZFC) that:
- $M_{const}$ always halts and is correct;
- if $M_{const}( M_{paradox} ) = Yes$ then $M_{const} \notin O(1)$ by construction; so we have a contradiction;
- so $M_{const}(M_{paradox}) = No $; and we can have:
- (a) $M_{paradox} \notin O(1)$ OR
- (b) $M_{paradox} \in O(1)$ AND there is not a short proof of it;
but case $(a)$ cannot hold by construction; so ...
- $M_{paradox} \in O(1)$
- AND there is not a short proof of it;
But steps 1--4 can be formalized in ZFC and (unless I'm missing something, its length depends only linearly on $|M_{paraox}|$) so we can add some dummy code to $M_{paradox}$ until such ZFC proof is shorter than $| M_{paradox}|^2$ (we can use the fact that the runtime of a Turing machine doesn't change if we add unused states, it only affects the self representation); so we get a contradiction with point 5 which says that there is not a short proof of $M_{paradox} \in O(1)$ ???
Q1. What is the output of $M_{const}( M_{paradox} )$ ?
Update: There were another question Q2 here, but it I decided to post it as a new "Part II" question to avoid confusion.
O(1)
in ZFC but can be shown to be in a stronger system. Just likecheck if n is a proof that con(ZFC); increment and loop if not else halt
cannot be shown to terminate in ZFC if it's consistent.. $\endgroup$