# Lecture 005

### Undecidable Languages

Facts:

• set of TMs T is countable, implies set of decidable language D countable (by $M \twoheadrightarrow L(M)$ and $|D|\leq|T|$)

• $\mathcal{P}(\Sigma^*)$ is uncountable.

Undecidable:

• $HALTS = \{\langle{M, x} | M \text{ is a TM which halts on input x}\rangle\}$ // Exercise: Diagonalization argument for undecidability, Diagonalizing Primitive Recursive Functions

• $ACCEPTS = \{\langle{M, x} | M \text{ is a TM that accepts the input x}\rangle\}$

• $EMPTY = \{\langle{M} | M \text{ is a TM with } L(M) = \emptyset \rangle\}$

• $EQ = \{\langle{M_1, M_2} | M_1, M_2 \text{ are TMs with }L(M_1) = L(M_2) \rangle\}$

• $EMPTY-HALTS = \{\langle{M} | M \text{ is a TM and } M(\epsilon) \text{ halts} \rangle\}$ // Exercise: Practice with undecidability proofs

• $EMPTY = \{\langle{M} | M \text{ is a TM that accepts finitely many strings}\rangle\}$ // Exercise: Practice with undecidability proofs

Turing reduction: $\leq_{T}$ In order to define it formally, we need to define Turing machines that have access to an oracle. (definition omitted)

// Exercise (Practice with reduction definition) // Exercise (Practice with reduction proofs)

#### Semidecidability and Recursive Enumerability

Semidecidable languages: there is TM (not necessarily a decider) s.t. $L(M) = L \subseteq \Sigma^*$.

• we allow loop if input is not in the semidecidable language

• $L_1, L_2 \text{ semidecidable } \implies L_1 \cup L_2, L_1 \cap L_2 \text{ semidecidable}$ // Exercise (Semidecidability is closed under intersection and union)

Co-semidecidable languages: if $\bar{L}$ is semidecidable

• $\text{semidecidable} \land \text{co-semidecidable} \iff \text{decidable}$ // TODO: look at proof

// Exercise (HALTS is semidecidable)

Enumerator: a TM that when started with a blank input tape, outputs a list of strings, possibly with repetition, on a second output tape. An enumerator may run forever if it outputs an unbounded number of strings.

Recursively enumerable: exists enumerator $E$ only outputs strings in $L$ and eventually outputs every string in $L$.

• Semidecidable iff recursively enumerable

// TODO: Check Your Understanding // TODO: High Order Bits

## Sutner's Lecture

### Decidable and Undecidable

Universal TM ($\mu$): simulate turning machines

• if input not a TM (not in language), assume $\mu$ will not halt

• polynomial slowdown

• small UTM: only 2 state, 5 symbol

### Decidable Problems

#### Friedman's Self-Avoiding Words

Subsequence: $A$ is subsequence of $B$ if you can erase some of $A$ to get $B$. [abc] is a subsequence of [cbabbabcac] but [ccb] is not.

$x[i] = x_ix_{i+1}...x_{2i}$

Self-avoiding: if for all $a \leq i < j \leq |x|/2$, block $x[i]$ is not a subsequence of block $x[j]$

• for alphabet of any finite size, there are only finitely many self-avoiding words.

• $\alpha(k) = \max(|x| | x\in \Sigma^*_k, x \text{ self-avoiding})$

• $\alpha$ is computable, strictly increasing, really fast

• $\begin{cases} B_1(x) = 2x\\ B_{k+1}(x) = B_k^x(1)\\ \end{cases}$

• $B_k^x(1)$: iterate $B_k$ $x-\text{times}$ on $1$. (doubling)
• $B_2$: exponentiation
• $B_3$: super exponentiation
• $\alpha(3) > B_{7198}(158386)$

### Undecidable Problems

#### Hilbert's 10th problem (Solutions of Diophantine Equations)

Diophantine Equations: $P(x_1, x_2, ... x_n) = 0$

• whether $P$ has integral solution

Theorem: wether integer solutions of Diophantine equation exists is undecidable

• $x^2 + y^2 - z^2 = 0$ is easy

• $x^k + y^k - z^k = 0$ is hard, solutions only exist for $k=1, 2$

#### Tiling Problem

Theorem: Tailing Problem is undecidable

#### Riemann Hypothesis

$\zeta(s) = \sum_{n\geq 1}n^{-s} = 1/1^s + 1/2^s + 1/3^s +...$ where $Re(s)>1$

Riemann Hypothesis: all non-real roots $s$ of this function have $Re(s) = 1/2$

Claim: $M$ halts iff RH is false.

### Computability Hierarchy

Halting: Does $M_e$ halt on input $e$? (where $e$ is TM index) Full Halting: Does $M_e$ halt on input $x\in \mathbb{N}$? (where $e$ is TM index) Pure Halting: Does $M_e$ halt on empty tape? (where $e$ is TM index)

#### Oracle Machine

Oracle Machine: can solve any math problem and decide whether element $x$ is in $A \subseteq \mathbb{N}$ for all $A$.

Oracle Process: a normal TM write a number on tape, and enter $q_{query}$ give it to oracle machine. Oracle machine look at the tape and force normal TM to enter either $q_N$ or $q_Y$.

Oracle Turing Machine (o-machine): normal TM who can access to oracle machine.

• define $A$-computable, $A$-decidable, $A$-semidecidable where $A$ is a variable

• when $A = \emptyset, \mathbb{N}, \text{Prime}$ (any any other decidable sets), then the machine is the same as TM.

• when $A = K$ where $K$ is the set of all halting TM, then $(\forall W \in \mathbb{N}) (W \text{ is semidecidable } \implies W \leq_T K)$. Every semidecidable set $W$ is $K-decidable$

Turing Reducibility: $B \leq_{t} A$ (B can be reduced to A)

• it is preorder (reflexive, transitive)

Hardness and Completeness:

• $A \text{ is } \mathcal{C}\text{-hard} \iff \forall (B \in C)(B \leq_T A)$ (A is the hardest problem in C, or harder than every C)

• $A \text{ is } \mathcal{C}\text{-complete} \iff \forall (B \in C)(B \leq_T A \land A \in C)$ (A is the hardest problem in C)

• Note: Halt is Semidecidable-Complete (R.E.-complete).

• Flaw: we want $A \leq_T B \land B \in C \implies A \in C$, but $\bar{A} \leq_T A$, and complement of HALT is not Semidecidable. So definition does not work for $C = \text{ semidecidable}$

Many-one reducible: $A \leq_m B \iff (\exists \text{ computable } f:\mathbb{N} \rightarrow \mathbb{N})(x\in A \iff f(x) \in B)$ ($A$ is many-one reducible to $B$ if when asking $A$ if $x$ belongs to a set, $A$ manipulate $x$ using $f$ and return $B(f(x))$)

• $A \leq_m B \implies A \leq_t B$

• $A \leq_m B \land B \text{ decidable } \implies A \text{ decidable}$

• $A \leq_m B \land B \text{ semidecidable } \implies A \text{ semidecidable}$

• Note: halting is many-one complete for the class of semidecidable sets

### Models of Computation

• Church: "Effectively calculable (intuitively computable)" iff $\lambda$-definable

• Church: "Effectively calculable (intuitively computable)" iff general recursive ($\mu$-recursive)

• (Godel rejected proposals by Church)

Similarity in Models:

• a space $\mathcal{C}$ of possible configurations (finite length snapshots)

• a "one-step" relation, that can be captured by P.R.

• one unbounded search on P.R. steps

• input / output convention, where output is only defined on halt

#### $\mu$-Recursive Functions

$\mu$-Recursive Functions: primitive recursive with unbounded search. Given P.R. $g : \mathbb{N}^{n+1} \rightarrow \mathbb{N}$, $f : \mathbb{N}^n \nrightarrow \mathbb{N}$ with $f(x) = \text{min}(\{z \in \mathbb{N} | g(z, x) = 0\})$ is $\mu$-recursive

• try $z = 0, 1, 2, 3...$ until there is a $z$ that $g(z, x)= 0$ works.

• where $g : \mathbb{N}^{n+1} \rightarrow \mathbb{N}$ is primitive recursion

Prove TM decidable implies $\mu$-recursive

1. $C\xrightarrow[M]{t}C'$ is primitive recursive for fixed $t$
2. find $t$ such that $C = C^{init}_x$ and $C'$ is final configuration. (unbounded search for t)
3. $\text{TM decidable } \implies \mu\text{-recursive} \land \lnot \text{TM decidable } \implies \lnot \mu\text{-recursive}$

Prove $\mu$-recursive implies TM decidable: simulate $\mu$-recursion on TM

1. All P.R. is TM decidable
2. to simulate $f(x) = \text{min}(\{z \in \mathbb{N} | g(z, x) = 0\})$, we keep two tapes. One tape keep counter of $z$ from 0 while the other does the P.R. calculation.

Unbounded Search: Let $L \subseteq \Sigma^*$ be a language. Then $K = \{y \in \Sigma^* | (\exists x \in \Sigma^*)(\langle{x, y}\rangle \in L)\}$ is unbounded search language of $L$

• decidable: $L = \{\langle{t, M, x}\rangle | M(x) \text{ halts in fewer than } t \text{ steps}\}$

• undecidable: $L = \{\langle{M, x}\rangle | (\exists t \in \mathbb{N})(M(x) \text{ halts})\}$

### Hierarchy

• PRIME (decidable)

• HALT (semidecidable)

• DE (semidecidable): reduced to HALT

• DIV ($\Sigma_2$-complete): checking $(\exists x \in \mathbb{N})(f(x)\downarrow)$ is semidecidable, checking $(\exists x \in \mathbb{N})(f(x)\uparrow)$ is beyond semidecidable. With oracle, it becomes semidecidable by unbounded search asking whether $f(0)\downarrow, f(1)\downarrow, ...$

• PDE ($\Sigma_3$-complete)

• UTM ($\Pi_4$-complete)

$\Delta_1$: all decidable sets $\Sigma_1 = \{K \subseteq \Sigma^* | K \text{ is unbounded search of decidable language}\}$: all semidecidable sets $\Pi_1 = \{K \subseteq \Sigma^* | (\Sigma^* - K) \in \Sigma_1\}$: all co-semidecidable sets $\Delta_k = \Sigma_{k} \cap \Pi_{k}$ $\Sigma_{k+1}$: all sets obtained from $\Pi_k$ by unbounded search $\Pi_{k+1}$: all complements of sets in $\Sigma_k$ $\emptyset^{(n)} = K^{(n-1)} = \Sigma_n\text{-complete}$ (with many-one reduction) $\emptyset^{(\omega)} = \{\langle{e, n}\rangle | e \in \emptyset^{(n)}\}$ (any set in arithmetical hierarchy is reducible to $\emptyset^{(\omega)}$, which captures all arithmetic truth), but you can also apply jump to $\emptyset^{(\omega)}$...

Note: all higher level language includes lower level languages

• Example: $\{z \in \Sigma^* | \exists y P(y, z)\} \in \Sigma_1$ is the same as $\{z \in \Sigma^* | \exists y \forall x P(y, z)\} \in \Sigma_2$ is the same as $\{z \in \Sigma^* | \forall x \exists y P(y, z)\} \in \Sigma_2 \in \Pi_2$ since $x$ is not defined.

Generally:

• $\Sigma_k$: $\{z | \exists x_1 \forall x_2 ... (\forall / \exists) x_k P(x_1, ..., x_k, z)\}$

• $\Pi_k$: $\{z | \forall x_1 \exists x_2 ... (\forall / \exists) x_k P(x_1, ..., x_k, z)\}$

• All the inclusions $\Delta_k \subseteq \Sigma_k, \Pi_k \subseteq \Delta_{k+1}$ are proper, $k \geq 1$

• Let $P_k \in \Sigma_k - \Delta_k$, then $P_1, P_2, P_3, ...$ gets strictly more difficult

Halting Set of OTM: a set in which all OTM halt.

jump: the jump $A'$ of $A \subseteq \mathbb{N}$ is the Halting Set for OTMs with oracle A: $A' = \{e \in \mathbb{N} | \{e\}^A(e) \downarrow\}$

• $A'$ is $A$-semidecidable (but not $A$-decidable)

• for $A = \emptyset$, $A' = K$ (ordinary HALT)

Table of Content