2 Turing Machine

A Turing Machine \(M\) is \((Q, \Sigma , \delta , q_0)\)

\(Q (\ni q_i), h \notin Q\)

Set of states, \(h\) halting state

\(\Sigma (\ni \sigma , \sigma ', \hdots )\)

Set of symbols

\(q_0 \in Q\)

Initial state

\(\delta \subseteq (Q \times \Sigma ) \times (Q \cup \{ h\} \times \Sigma \times \{ L,R,-\} )\)

is the transition function

if \((q, \triangleright , q', \sigma , D) \in \delta \)

then \(\sigma = \triangleright , D = R\)

\(\Sigma ^*\) is the free monoid generated from \(\Sigma \). \("\cdot "\) is the associative string concatenation operator. \(\epsilon \) is the empty string and identity element.

2.1 Configuration

A configuration \(C\) of a TM \(M\) is a quadruple: \((q,u,\sigma ,v) \in (Q \cup \{ h\} ) \times \Sigma ^* \times \Sigma \times \Sigma ^F)\) where \(\Sigma ^F = \Sigma ^* \cdot (\Sigma \backslash \{ \# \} ) \cup \{ \epsilon \} \).

\(\sigma \) is the currently selected symbol under the head of the machine. Short notation is \((q, u \underline{\sigma }v)\) or \((q, w)\) when position is not needed.

2.2 Computations

A computation is a finite succession of computation steps

\((q, w) \to (q', w')\)

Computation step

\((q_0, w) \to ^* (q', w') \)

Reflexive and transitive closure of comp. steps.

\((q_0, w) \to ^n_M (q', w') \)

Machine \(M\) computes \(w'\) in \(n\) steps.

\(\downarrow , \uparrow \)

Converges and diverges

2.3 T(uring)-Computability

Let \(\Sigma , \Sigma _0, \Sigma _1\) be alphabets, let \(\# , \triangleright \notin \Sigma _0 \cup \Sigma _1\) and \(\Sigma _0 \cup \Sigma _1 \subset \Sigma \).

Let \(f\) be a function \(f: \Sigma ^*_0 \to \Sigma ^*_1\).

\(f\) is turing computable by a machine \(M\) \(\Leftrightarrow \) \(\forall w \in \Sigma ^*_0 \ : f(w) = z \Leftrightarrow (q_0, \underline{\triangleright }w) \to ^*_M (h, \triangleright z\underline{\# })\)

sectionProblems and Functions

2.4 Poly reduction

\(L_1\le _P L_2 \) Then exsit \(f\in O(n)\mapsto |f(w)|=n^k \) for some k

2.5 Total Function

\(f : A \to B\), subset of \(A \times B\) is total \(\Leftrightarrow \)

\(\forall a \in A \ \exists b \in B \ : (a,b) \in f \)

\(f\) is defined everywhere

\((a,b),(a,c) \in f \Rightarrow b = c\)

uniqueness

2.6 Partial Function

\(f : A \to B\), subset of \(A \times B\) is a partial function \(\Leftrightarrow \)

\((a,b),(a,c) \in f \Rightarrow b = c\)

uniqueness

\(\exists \) at least a \(b \in B \ : \ f(a) = b\)

not required to be defined everywhere

Theorem

Computable functions are \(\# (\mathbb {N})\). Total computable functions are \(\# (\mathbb {N})\). There exists functions that are not computable.

Proof

Computable functions can be given a Gödel numbering. Therefore there exists a 1-1 mapping with natural numbers. All the possible total functions \(\{ f: \mathbb {N}\to \mathbb {N}\} \) are \(2^{\# (\mathbb {N})}\).

Theorem

Padding Lemma: every computable function \(\varphi _i\) has \(\# (\mathbb {N})\) indexes. \(\forall i . \exists A_i \) infinite set of indexes such that \(\forall y \in A_i. \varphi _y = \varphi _i\)

Proof

If a program \(P_j\) in WHILE computes \(\varphi _i\), one can build \(\# (\mathbb {N})\) other programs that compute the same thing, semantically equal to \(\varphi _i\) by just adding a skip command at the end of the program. The new program’s index will change because an effective numbering depends only on the syntactic description of the program.

Theorem

The class of Primitive Recursive functions (and extensions) does not contain all the effectively computable functions:

Proof

reductio ad absurdum

1: Encode and enumerate p.r. functions

\(f_0, \hdots , f_n \). There are \(\mathbb {N}\)

2: Define diagonal func. \(g(x) = f_x(x)+1\)

Intuitively computable

3: \(\forall n . g(n) \neq f_n(n) \Rightarrow \forall n . g \neq f_n \)

\(g\) doesn’t appear in list

Implies there is no formalism for expressing only and all total functions.

Recursion Axiom

Let \(h\) be a p.r. func. in \(k+1\) variables, \(g\) be a p.r. func in \(k-1\) variables. The function \(f\) in \(k\) variables defined as follow is then p.r.

\(f = \left\lbrace \begin{matrix} f(0,x_2,\hdots ,x_k) & = & g(x_2, \hdots , x_k) & \text{final step} \\ f(x_1 + 1, \hdots , x_k) & = & h(x_1, f(x_1, \hdots , x_k), x_2, \hdots , x_k) & \text{iteration} \end{matrix} \right.\)

This represents a FOR loop. \(x_1\), the first variable of \(f\) is the decrementing counter. \(g\) is the final step. \(h\) represents loop steps. This is guaranteed to terminate. One can define basic maths primitives with p.r. functions.

Theorem

Enumeration: \(\exists z . \forall i,x .\ \varphi _z(i,x) = \varphi _i(x)\)

Proof

Guarantees that a formalism that expresses all computable function has an universal algorithm. Therefore there exists an Universal Turing Machine. \(\varphi _z(i,x) = U(\mu y. T(i, x, y)) = \varphi _i(x)\)