1

The resources I found pretty much all end with this "obvious" statement, which I can't figure out how.

In plain language how to do this exactly?

Edit: sources I have found:

Background: I am not in the research field of logic, hence my asking about a plain language explanation. I can understand the core of the proof of the halting problem itself in "plain language". I just couldn't find a way to equate it to entscheidungsproblem.

Bram28
  • 100,612
  • 6
  • 70
  • 118
Alex
  • 326
  • 1
  • 8
  • 4
    If you have problems with resources, it is vital to tell us what those resources are. I would be surprised if anyone wrote that this reduction was obvious without giving enough background information to show the reader the way. – Rob Arthan Jan 14 '24 at 21:22
  • 1
    Please see edits. – Alex Jan 15 '24 at 12:37

2 Answers2

5

The basic idea is to use first-order logic to describe any turing-machine and its input, and to show that those sentences logically imply the 'halting sentence' "This machine with this input will halt" if and only if that machine with that input will indeed halt.

So given that, you can solve the halting problem if you can decide first-order logic consequence, i.e. the Entscheidungsproblem: when presented with any machine and input, you describe it using first-order logic, and decide whether or not the halting sentence is a logical consequence: if the halting sentence is a logical consequence, then the machine will halt, and if the halting sentence i not a logical consequence, then the machine will not halt.

To provide a bit more detail as what that first-order description looks like:

First, let's assume the turing-machine only uses a binary alphabet: $0$'s and $1$'s (or: blanks and marks). So, if we use integers to index the cells of the tape, we can use a predicate Mark(t,x) to say that "At time t, square x has a $1$" (by 'time t' we mean: after t steps of operation).

So, assuming the input tape consists of finitely many $1$'s, we can fully describe that input tape by a first-order logic sentence. For example, assuming that the input tape has $1$s in cells $0$, $1$, and $2$, we can say $$\forall x (Mark(0,x) \leftrightarrow (x = 0 \lor x = 1 \lor x=2))$$.

Indexing the internal states of the machine, we'll also have a predicate $State(t,y)$ that expresses that "After t steps, the machine is in state $y$". Thus, for example, if state $1$ is the starting state, then we use $$State(0,1)$$.

Another predicate we use is $Cell(t,x)$ that says "After t steps of operation, the read-white head of the machine is at cell $x$". So, assuming the machine starts at cell $0$ we can say $$Cell(0,0)$$

The above three statements provide us with the machine-tape configuration at time $0$: it describes what the tape looks like, what state the machine is in, and what cell it is looking at the very start.

Of course, we'll also need to describe how the Turing-machine works. For example, suppose that whenever the machine is in state $1$, and is looking at a $1$, then it will change that $1$ into a $0$, move right, and stay in state $1$. For that, we can use the following expression:

$$\forall t \forall x ((State(t,1) \land Cell(t,x) \land Mark(t,x)) \to (State(t+1,1) \land Cell(t+1,x+1) \land \neg Mark(t+1,x) \land \forall z(z \neq x \to (Mark(t,z) \leftrightarrow Mark(t+1,z)))$$

(see how that works?)

OK, so we add a sentence like that for every transition/instruction that defines the working of the machine.

Now we have all our premises: the machine-tape starting configuration, and how the machine works. OK, so now can show that the machine-tape configuration for any time step after that is a logical consequence of those premises. Following our example, notice that after $2$ steps of operation, the machine will have changed the first two $1$'s into a $0$, is still in state $1$, and is now looking at the third $1$, while the rest of the tape is all blank. This machine-tape configuration can be described as:

$$State(2,1) \land Cell(2,2) \land \forall x (Mark(2,x) \leftrightarrow x = 2)$$

Now, you can easily verify that this statement is a logical consequence of the premises. And, given a complete proof system, it is therefore also provable.

Fun exercise for you to do: use a proof system to derive this statement from the previous ones ... and when you do so, you'll find that you'll need some further axioms like $1+1=2$ or, better yet, use some general axiomatization of the integers ... these are details that I won't provide since that'll detract from the basic proof idea here.

Another thing I won't prove, but simply tell you, is that you can show that any such machine-tape configuration sentence is a logical consequence of the initial premises if and only if that machine and tape are indeed in the very configuration after that many steps as described by the sentence.

Or, in terms of provability: if you have a sound and complete proof system for First-order logic, then a statement like $state(7,4)$ is provable from the premises if and only if the machine as described by the premises, when starting on the input tape as described by the premises, will in fact be in state $4$ after $7$ steps of operation.

OK, so now let's assume that state $0$ is the halting state of the Turing machine. Then we can define a halting sentence as follows:

$$\exists t \ State(t,0)$$

Given the above, this halting sentence is a logical consequence of the premises if and only if the machine-input pair as described by the premises does halt at some point.

So again: if the Entscheidungsproblem is solvable, then we can decide first-order logical consequence. So that means that we can decide whether or not the halting sentence is a logical consequence of the premises, and thereby we can decide, for any machine-input pair, whether or not the machine halts on that input, i.e. we can solve the halting problem.

(note that in the end, we are really not interested in provability: when it comes to the entscheidungsproblem and the halting problem, we are really just interested in decidability of logical consequence and decidability of halting-ness.)

But of course, we can't solve the halting problem. Hence, we can't solve the Entscheidungsproblem either. And this is what Turing showed in his famous 1936 paper: he laid out the notion of (what we now call) Turing-machines to try and give a mathematical definition of 'computation', he used this to show that there are things that are not computable (the halting problem!), and used that to show that the Entscheidingsproblem is not solvable either. As some have said: it's as if he laid down the foundations of all modern computer science almost as a by-product of his proof that the Entscheidungsproblem for logic is unsolvable!

Bram28
  • 100,612
  • 6
  • 70
  • 118
  • An algorithm for the entscheidungsproblem would then tell us if that statement is provable or not provable. But not provable doesn't mean it is false. In other words, the output of the entscheidungsproblem is not whether an statement is true or false, just that is is approvable or not approvable. – Alex Jan 15 '24 at 00:35
  • 1
    @Alex Right, but the key is that the halting sentence is provable if and only if the turing machine halts. So, if you find it is not provable, then you know machine will not halt. – Bram28 Jan 15 '24 at 02:11
  • So is the Halting sentence in plain language "at some point in time the machine $M$ on input $x$ has reached a halting state", or "at some point in time $M$ on input $x$ will halt", or "at this particular time $t$ the machine $M$ on $x$ will halt"? – Alex Jan 15 '24 at 03:39
  • Let's say the "halting sentence" is "The machine $M$ taking input $x$ will halt at some point." Now, an algorithm to entscheidungsproblem could say this sentence is not provable. Now this sentence may still be true, just not approvable, or it maybe false. So we still don't know if it will halt. – Alex Jan 15 '24 at 11:07
  • @Alex I added a lot more detail to my post. Hopefully that'll make things more clear! – Bram28 Jan 15 '24 at 16:04
  • Thank you, @Bram28. Can you add your definition of Entscheidungsproblem? It is almost there in "if the Entscheidungsproblem is solvable, then we can decide first-order logical consequence." To me, Entscheidungsproblem is to tell if any statement is provable, not if any statement is true or false. "Being a logical consequence of a cause or not" is "true or false". – Alex Jan 16 '24 at 01:05
  • @alex The Entscheidungsproblem is to decide whether a sentence is a first-order logical consequence of a set of other sentences or not. This is equivalent to deciding whether a sentence is by itself s logical necessity or not. And while that turns out to be equivalent to whether or not a sentence is provable or not, that is only because first-order logic turns out to be complete. If first-order logic was not complete, then the entscheidungsproblem would still be about logical consequence, but it would no longer be about provability. So that’s why I insist you phrase it in terms of consequence. – Bram28 Jan 16 '24 at 03:23
  • "Not being a logical consequence" doesn't mean it is incorrect, just that we can't prove (for lack of a better word) it is correct. Am I right? – Alex Jan 18 '24 at 12:13
  • @Alex Pretty much. Logic doesn't show whether some individual claim is 'true' or 'correct' ... it is about showing that some claim would be true if we assume some other claims to be true. If I assume that $x+1=3$ for any number $x$, then I can prove that $1+1=3$ ... but all I am showing is that $1+1=3$ is a logical consequence of $x+1=3$. So, just because something is a consequence of something else doesn't mean it is correct. And yes: showing that something is not a consequence also does not mean it is incorrect. $1+1=2$ is not a consequence of 'Snow is white', but it is still true. – Bram28 Jan 18 '24 at 13:12
  • In other words, given a set of Axiom, an algorithm to Entscheidungsproblem wouldn't be able to tell if an arbitrary statement is true (in case it is a logical consequence of the axioms) but not false (not being a logical consequence of the axioms doesn't mean it is false). Hence not violating Godel's incompleteness. – Alex Jan 18 '24 at 14:15
  • 1
    @Alex Right. Hilbert's dream was that we would be able to settle any mathematical question by having 1) a set of axioms so that any mathematical truth/theorem would be a logical consequence of that set, and 2) a decision procedure that, for any math claim, can actually tell us whether or not it is a consequence of those axioms. So, if we use a formal logic system like FOL to try and achieve those goals, part 2) ends up being the Entscheidungsproblem: the general problem of deciding whether some FOL sentence is a logical consequence of a bunch of other FOL sentences. (continued ...) – Bram28 Jan 18 '24 at 14:56
  • 1
    @Alex Now, at first we had a very nice result that seemed to get us part of the way: Godel showed in 1929 that if a FOL statement is a logical consequence of a set of FOL statements, then there exists a formal proof for that, i.e. the statement is provable from those other sentences. This is called Godel's Completeness Theorem: FOL logic is complete. In fact, it is also easy to show that if there is a proof, you can systematically find such a proof, i.e. there is an algorithm for finding such a proof, i.e.: if a statement is a logical consequence, then we can tell that it is. (Continued..) – Bram28 Jan 18 '24 at 15:06
  • 1
    @Alex But this did not give us decidability: If a statement is not a logical consequence, then there is no proof for it (given a sound proof system) ... but of course we don't have a formal proof for that very fact. So, how can we tell that a statement is not a consequence? That was still an open question. So at this point we knew that FOL consequence was semi-decidable (there is an algorithm that tells us that something is a logical consequence) but we still did not know whether it was fully decidable (is there an algorithm that tells us either way, i.e. decide consequence?) – Bram28 Jan 18 '24 at 15:12
  • 1
    @Alex Then, in 1931, Godel showed that part 1) of the project cannot be done: that there is no (recursive) set of axioms (expressed in some FOL language) from which all mathematical truths (expressible in that same language) are logical consequences (or what is the same thing, given Godel's 1929 result) from which all truths can be provable. This is Godel Incompleteness result which we can roughly put as: mathematics is incomplete. OK, so this shot down Hilbert's project: We cannot do part 1)! OK, but what about part 2) ... the Entscheidingsproblem? That was still an open question. – Bram28 Jan 18 '24 at 15:18
  • 1
    @Alex Well, in 1936 Turing comes along and shows that the Entscheidungsproblem is not solvable. In other words, part 2) of Hilbert's project also cannot be done! In fact, it's even worse: we know that Hilbert's dream cannot be achieved using FOL. OK, but maybe there is some other way to decide mathematical truth? Maybe there is some other notational system to obtain an effective symbol-manipulation method of deciding whether some math claim is true or not? Well, Turing's work shows that that is extremely unlikely, as his notion of computation seems to over any such method in general. – Bram28 Jan 18 '24 at 15:24
  • 1
    All makes sense now. Thanks. I was defining "true" as being a logical consequence of axioms. – Alex Jan 19 '24 at 10:31
1

I am trying to answer this myself, taking what I learned from @Bram28's answer. The key thing I am still confused about in @Bram28's answer is what the halting sentence to be input to the algorithm to entscheidungsproblem should be.

Let's try a "halting sentence" that

"It is provable that the machine $M$ will halt on the input $x$." 

An algorithm to entscheidungsproblem would tell us if this statement is provable.

  • If it is provable, then the machine must halt, cause otherwise it can't be provable that the machine halts.
  • If it is not provable, it must be that the machine will never halt, because otherwise we can just let it run till it halts, which is the easiest way to prove it halts.

This seems to work but I am not sure if it correct. (It can't be this simple?)

Alex
  • 326
  • 1
  • 8
  • The halting statement effectively says "the machine will halt" ... that's all. It is not a meta-statement that says anything about the provability of it halting – Bram28 Jan 15 '24 at 20:00
  • An algorithm to Entscheidungsproblem will not tell us if "the machine will halt" is true (logical consequence) or not, right? By Godel there already can't be an algorithm to tell if an arbitrary statement is true or false, because there are statements that can't be proved. – Alex Jan 16 '24 at 01:13
  • If the Entscheidungsproblem is solvable, i.e. if there would be an algorithm that can decide whether or not some FOL statement logically follows from some other FOL statements, then there would also be an algorithm that can decide, for any machine and input, whether or not that machine will halt on that input. So, if the Entschedungsproblem would be solvable, the halting problem would be as well. The Godel results do not change that link. – Bram28 Jan 16 '24 at 12:02
  • So, while the Entscheidungsproblem isn’t directly about halting, but is about logical consequence, you could nevertheless exploit any solution to the Entscheidungsproblem to obtain a solution to the halting problem. This is what I show in my answer … and what I thought you asked about: “If we had an algorithm for entscheidungsproblem, how do we exactly construct an algorithm for the halting problem?” – Bram28 Jan 16 '24 at 12:10