Lecture 4 - Undecidability

Still in preparation. Please check the references at the end of the document.

In the previous lecture, we have learned about and proved the Recursion Theorem, which in essence states that any computable function can be computed by a Turing machine which can obtain its own description and then compute with it. Today, we will use the Recursion Theorem to prove that certain problems are undecidable, meaning that there is no algorithm that can solve them.

Undecidability

As we have seen in lecture 2, a language L is decidable if there exists a Turing machine M that halts on all inputs and accepts all strings in L and rejects all strings not in L.

A language L is undecidable if there is no Turing machine that decides L.

Let us now state our first undecidability result.


Theorem 1: The language ATM={MxM is a Turing machine that accepts input x} is undecidable.


Proof: Suppose, for the sake of contradiction, that ATM is decidable. Then there exists a Turing machine T that decides ATM. Now, consider the following Turing machine M:

On input x:

  1. Obtain its own description M using the recursion theorem.

  2. Run T on input Mx.

  3. If T accepts, then reject. If T rejects, then accept.

By construction, M accepts x if and only if T rejects Mx. This contradicts the assumption that T decides ATM.

Therefore, ATM is undecidable.


The above theorem can also be proved using a diagonalization argument, which we now show.


Alternative Proof of Theorem 1: Suppose, for the sake of contradiction, that ATM is decidable. Then there exists a Turing machine T that decides ATM. Since the set of all Turing machines is countable, we can list them as M1,M2,M3, Let D be the following Turing machine:

On input M:

  1. Run T on input M.

  2. If T accepts, then reject. If T rejects, then accept.

On all other inputs (i.e. which are not encodings of any Turing machine), reject.

Since D is a Turing machine, it must correspond to some Mk in our list. Now, consider the input of ATM given by MkMk. Then, by definition of Mk, we have that Mk accepts Mk if and only if T rejects MkMk. This contradicts the assumption that T decides ATM.


The two proofs are quite similar in spirit, but the first one is quite shorter.

Also, one of the reasons which makes the language ATM undecidable is that this language tries to predict the behavior of any Turing machine on any input. As we will now see, this is a fundamental limitation of Turing machines. We state this as a principle:

Turing machines cannot predict what other Turing machines will do without simulating them.

Let us now see this principle at work in other undecidability results.


Theorem 2: The language HALTTM={MxM is a Turing machine that halts on input x} is undecidable.


Proof: Suppose, for the sake of contradiction, that HALTTM is decidable. Then there exists a Turing machine T that decides HALTTM.

Now, consider the following Turing machine M:

On input x:

  1. Obtain its own description M using the recursion theorem.

  2. Run T on input MM.

  3. If T accepts, then accept. If T rejects, then go on an infinite loop.

By construction, M halts on input x if and only if T accepts MM. This contradicts the assumption that T decides HALTTM.


Another undecidability result is the following:


Theorem 3: The language EmptyTM={MLM=} is undecidable.


Proof: Suppose, for the sake of contradiction, that EmptyTM is decidable. Then there exists a Turing machine T that decides EmptyTM.

Now, consider the following Turing machine M:

On input x:

  1. Obtain its own description M using the recursion theorem.

  2. Run T on input M.

  3. If T accepts, then accept. If T rejects, then reject.

By construction, LM= if and only if T rejects M (note that LM={0,1} if T accepts M). This contradicts the assumption that T decides EmptyTM.


After seeing such results, one may wonder if we can prove a more general result along the lines of the principle we stated earlier. The answer is yes, and given by Rice’s Theorem.


Theorem 4 (Rice’s Theorem): Let P be a subset of all languages such that

  1. There is a Turing machine M such that LMP.
  2. There is a Turing machine N such that LNP.

Then the language

LP={MLMP} is undecidable.


Proof: Suppose, for the sake of contradiction, that LP is decidable. Then there exists a Turing machine T that decides LP.

Now, consider the following Turing machine R:

On input x:

  1. Obtain its own description R using the recursion theorem.
  2. Run T on input R.
  3. If T accepts, then simulate N on x. If T rejects, then simulate M1 on x.

By the above construction, LR=LN if T accepts R and LR=LM if T rejects R. This contradicts the assumption that T decides LP.


Acknowledgements & References

This lecture was based on these resources:

Previous
Next