12

Suppose we have some subset $S$ of Turing machines with the property that, for every partial recursive function, at least one machine in $S$ computes that function.

Question: for any such subset $S$, can we prove it is impossible to build a halting oracle that correctly analyzes everything in $S$?

I would guess that the answer to this question is "yes," but I have found this surprisingly difficult to prove.

For instance, the usual proof of the halting problem does not work here: the usual diagonalization method only shows that any such halting oracle cannot be in $S$. Is there some way from there to show it also cannot be any Turing machine, no matter what $S$ is?

Is there some way to prove this rigorously?

Mike Battaglia
  • 1,071
  • 6
  • 19

2 Answers2

9

There is no way to prove this, because it's false: there are "dense" subsets of the set of Turing machines for which we can decide halting on the empty input, but this is not very meaningful.

(Let us call a set $S$ of Turing machines dense if every partial computable function is computed by a machine in $S$, and computably dense if there is a Turing machine that takes a Turing machine as input and outputs an equivalent machine in $S$. I don't know if there are more standard terms for this.)

To see this, fix a recursive subset $P$ of the set of Turing machines such that every partial recursive function is computed by a machine in $P$ and by a machine in $\overline{P}$ (think of a syntactic property of a program, like having an even number of semicolons or containing the string "this machine halts"; it's tedious but routine to show that such properties exist for Turing machines). Take $S$ to be the set of Turing machines $M$ such that $M \in P$ if and only if $M$ halts on the empty input. Then $S$ is dense, so a machine that computes $P$ satisfies your assumptions.

Note that such a set $S$ cannot be computably dense; if it were, you could decide whether $M$ halts by replacing $M$ with an equivalent machine $M' \in S$ and asking the oracle whether it halts, as I suggested in my comments.


EDIT: This naturally leads to a question I don't have an answer to: is it possible for such a set $S$ to be recursive? Or is every recursive dense set computably dense?


EDIT: I asked this question on Bluesky and got an answer from Gro-Tsen. Let me paraphrase it here in a slightly less formal way:

Yes, there is a recursive dense set $S$ for which halting on the empty input is decidable. The idea is that $S$ is the set of programs that contain a correct statement of the form "if this program halts on the empty input, then it does so in at most $n$ steps" (which I'll abbreviate as $H(n)$).

  • $S$ is decidable, because one can check whether a program contains such a statement, and if it does, whether the statement is correct by running the program for $n$ steps on the empty input.
  • $S$ is dense, because to any program one can add the statement $H(n)$, where $n$ is either the runtime of the program on the empty input if it halts, or an arbitrary number otherwise.
  • Finally, the halting problem on the empty input is decidable for programs in $S$: if a program contains the statement $H(n)$, simply run it for $n$ steps; if it didn't halt, then it never will.

EDIT: as pointed out by Jean Abou Samra on Bluesky, one can also consider the set $S$ of programs of the form

  • "if the input is empty then return $k$ else..." for a fixed $k$, or
  • "if the input is empty then loop forever else...".
7

There is no set $S$ of Turing machine programs such that every computable function is computed by a program in $S$ and all instances of halting $\varphi_e(n)\downarrow$ are decidable for programs $e\in S$ and arbitrary input $n$.

To see this, consider the universal computable function $f(e,n)=\varphi_e(n)$. We can make this a unary function using a pairing function, so there is some program $p$ such that $\varphi_p(\langle e,n\rangle)=f(e,n)=\varphi_e(n)$. By assumption, we can find such a program $p$ in $S$, so without loss, $p\in S$. By assumption, we can decide halting for $p$ on any input. So we can decide whether $p$ halts on $\langle e,n\rangle$ for any $e$ and $n$, and so we can decide the full halting problem.

JDH
  • 186
  • 2