Hierarchy Theorems, co-r.e. sets, Reductions




CS154

Chris Pollett

Apr. 29, 2020

Outline

Hierarchy Theorems

When Can We Recognize `A_f`?

Lemma. `A_{f} \in \mbox{TIME}((f(n))^3 )`.

Proof. We will use a variation on our universal Turing machine from Monday to prove this. Our machine, `U_f`, will have `4` tapes. Let `n= | langle M,x rangle|`. First, `U_f` uses `M_f` to write an "alarm clock" amount of time `I^{f(n)}` on the fourth tape. The fourth head is then rewound. Using the input `langle M, x rangle`, the second tape is initialized to encode the start state `s` of `M`, `langle M rangle` is copied to the third tape and converted into a 1-tape machine using our earlier simulation (this machine executes one step of the original machine in at most `O(f(n))` steps and we could linear speed this up to `f(n)` ). The first tape is set up with just `x` on it. Doing all this, takes `O(f(n))` time. The modified `M` is then simulated step by step. This involves:

  1. Comparing the current state, and current head position of tape `1` against the transition function of `M` on tape `3` until a match its found,
  2. applying the appropriate change to the first tape and updating the current state on the second tape, and
  3. advancing the alarm clock tape.
Simulating one step of the modified `M` take `O(f(n))` steps on `U_f`. So simulating one step of the original takes `O(f(n)^2)` steps on `U_f`. We simulate exactly `f(n)` steps of `M` by using our clock and determine if we have accepted by then. So the total time is `O(f(n)^3)`, which gives `A_f` in `\mbox{TIME}((f(n))^3 )` as desired.

When Can't We Recognize `A_f`?

Lemma. `A_{f} !in \mbox{TIME}( f( lfloor n/2 rfloor ))`.

Proof. Suppose `M_{A_f}` decides `A_f` in time `f(lfloor n/2 rfloor)`. Let `D_f` be the diagonalizing machine that computes:
`D_{f}( langle M rangle)`: if `M_{A_f}( langle M, M rangle)` accepts then "reject" else "accept".
This machine on input `langle M rangle` runs in the same time as `M_{A_f}` on input `langle M, M rangle` (which is twice as long `+ 1` as `langle M rangle`). That is, it runs in time `f(lfloor (2n+1)/2 rfloor) = f(n)`. Does `D_f` accept its own description? Suppose `D_{f} ( langle D_f rangle)` accepts. By our definition of `D_f` this is done in at most `f(n)` steps. This means `M_{A_f}( langle D_f, D_f rangle)` rejects, which means `\langle D_f, D_f rangle !in A_f`. This means `D_f` on input `D_f` did not accept in `f(n)` steps, contradicting our starting assumption. Starting with `D_{f}(langle D_f rangle)` rejecting, we can follow a similar chain of reasoning to get a contradiction as well.

Hierarchy Theorems

Hierarchy Theorem Implications and Open Problems

In-Class Exercise

A Specific Nonrecursively Enumerable Language I

A Specific Non-Recursively Enumerable Language II

Corollary. `\bar{A}_{TM}` is not r.e.

Proof. We proved in an earlier lecture `A_{TM}` is recursively enumerable. So if `\bar A_{TM}` were r.e., then `A_{TM}` would be decidable giving a contradiction with our result that `A_{TM}` is undecidable.

Reducibility

Example

Let `\mbox{HALT}_{TM} = { langle M, w rangle | \mbox{M is a TM and M halts on input w}}`.

Theorem. `\mbox{HALT}_{TM}` is undecidable.

Proof. Suppose `H` decides `\mbox{HALT}_{TM}` . From `H` we can construct a machine `S` which decides `A_{TM}` as follows:

`S =`" On input `langle M, w rangle` an encoding of a TM `M` and a string `w`:

  1. We build a new string `langle M',w rangle` where `M'` is a machine which simulates `M` until `M` halts (if it does) and if `M` accepts `M'` accepts. Otherwise, if `M` rejects than `M'` moves right forever, one square at a time. The map `langle M,w rangle -> langle M', w rangle` is well-defined enough that it can be computed by a TM. This is our reduction.
  2. We then ask our decider for `H` if `langle M', w rangle` is in `H`? If `H` accepts we accept and if `H` rejects we reject."

Since the only way `M'` on input `w` halts is if `M` accepts `w`, we know `langle M,w rangle` is in `A_{TM}` iff `langle M', w rangle` is in `\mbox{HALT}_{TM}`. So if `H` was a decision procedure for `\mbox{HALT}_{TM}`, then `S` would be a decision procedure for `A_{TM}`. As we know there is no decision procedure for `A_{TM}` we know that the supposed `H` can't exist.

Complete Problems

Complete r.e. and NP problems

Theorem.

  1. `A_{TM}` is Turing-complete for r.e.
  2. `A_{\mbox{clocked TM}} := {\langle M, w, 1^t rangle | \mbox{M is a nondeterministic machine that accepts w in at most t steps} }` is Karp-complete for NP.

Proof. For (1), we already have show that `A_{TM}` is in r.e. (the set of recursively enumerable languages). Suppose `L` in r.e. is recognized by a machine `M`. The function `w -> langle M, w rangle` is Turing computable and `w in L` iff `langle M, w rangle in A_{TM}`. Therefore, `A_{TM}` is Turing-complete. For (2), we first show `A_{\mbox{clocked TM}}` is in NP. An nondeterministic algorithm to recognize this language is as follows: On input `\langle M, w, 1^t rangle`, nondeterministically guess a string `v` of length `t^2`, then verify that `v` codes a sequence of configurations of `M` of length `t`, the first being the start configuration of `M` on `w` and such that the `i+1`st configuration follows from the `i`th. If it does, and `M` accepts `w` then accept, else reject. Now suppose `L` is in NP. Then it can be decided by some nondeterministic machine `M` in time `p(n)` for some polynomial `p`. The function `w -> langle M, w, 1^{p(|w|)} rangle` is polynomial time computable and gives a reduction from `L` to `A_{\mbox{clocked TM}}`.