Opening the book…
\(\def\Atom#1#2{ { \mathord{#1}(#2) } }\)
\(\def\Bin{ {\mathbb{B}} }\)
\(\def\cardeq#1#2{ { #1 \approx #2 } }\)
\(\def\cardle#1#2{ { #1 \preceq #2 } }\)
\(\def\cardless#1#2{ { #1 \prec #2 } }\)
\(\def\cardneq#1#2{ { #1 \not\approx #2 } }\)
\(\def\comp#1#2{ { #2 \circ #1 } }\)
\(\def\concat{ { \;\frown\; } }\)
\(\def\Cut{ { \text{Cut} } }\)
\(\def\Discharge#1#2{ { [#1]^#2 } }\)
\(\def\DischargeRule#1#2{ { \RightLabel{#1}\LeftLabel{\scriptsize{#2} } } }\)
\(\def\dom#1{ {\operatorname{dom}(#1)} }\)
\(\def\Domain#1{ {\left| \Struct{#1} \right|} }\)
\(\def\Elim#1{ { {#1}\mathrm{Elim} } }\)
\(\newcommand{\Entails}{\vDash}\)
\(\newcommand{\EntailsN}{\nvDash}\)
\(\def\eq[#1][#2]{ { #1 = #2 } }\)
\(\def\eqN[#1][#2]{ { #1 \neq #2 } }\)
\(\def\equivclass#1#2{ { #1/_{#2} } }\)
\(\def\equivrep#1#2{ { [#1]_{#2} } }\)
\(\def\Exchange{ { \text{X} } }\)
\(\def\False{ { \mathbb{F} } }\)
\(\def\FalseCl{ { \lfalse_C } }\)
\(\def\FalseInt{ { \lfalse_I } }\)
\(\def\fCenter{ { \,\Sequent\, } }\)
\(\def\fdefined{ { \;\downarrow } }\)
\(\def\fn#1{ { \operatorname{#1} } }\)
\(\def\Frm[#1]{ {\operatorname{Frm}(\Lang #1)} }\)
\(\def\fundefined{ { \;\uparrow } }\)
\(\def\funimage#1#2{ { #1[#2] } }\)
\(\def\funrestrictionto#1#2{ { #1 \restriction_{#2} } }\)
\(\newcommand{\ident}{\equiv}\)
\(\newcommand{\indcase}[2]{#1 \ident #2\text{:}}\)
\(\newcommand{\indcaseA}[2]{#1 \text{ is atomic:}}\)
\(\def\indfrm{ { A } }\)
\(\def\indfrmp{ { A } }\)
\(\def\joinrel{\mathrel{\mkern-3mu}}\)
\(\def\lambd[#1][#2]{\lambda #1 . #2}\)
\(\def\Lang#1{ { \mathcal{#1} } }\)
\(\def\LeftR#1{ { {#1}\mathrm{L} } }\)
\(\def\len#1{ {\operatorname{len}(#1)} }\)
\(\def\lexists#1#2{ { \exists #1\, #2 } }\)
\(\def\lfalse{ {\bot} }\)
\(\def\lforall#1#2{ { \forall#1\, #2 } }\)
\(\newcommand{\lif}{\rightarrow}\)
\(\newcommand{\liff}{\leftrightarrow}\)
\(\def\Log#1{ { \mathbf{#1} } }\)
\(\def\ltrue{ {\top} }\)
\(\def\Id#1{ {\operatorname{Id}_#1} }\)
\(\def\Int{ {\mathbb{Z}} }\)
\(\def\Intro#1{ { {#1}\mathrm{Intro} } }\)
\(\def\mModel#1{ { \mathfrak{#1} } }\)
\(\newcommand{\mSat}[3][{}]{\mModel{#2}{#1}\Vdash{#3}}\)
\(\newcommand{\mSatN}[3][{}]{\mModel{#2}{#1}\nVdash{#3}}\)
\(\def\Nat{ {\mathbb{N}} }\)
\(\def\nicefrac#1#2{ {{}^#1/_#2} }\)
\(\def\num#1{ { \overline{#1} } }\)
\(\newcommand{\Obj}[1]{\mathsf{#1}}\)
\(\def\Rat{ {\mathbb{Q}} }\)
\(\def\Real{ {\mathbb{R}} }\)
\(\def\RightR#1{ { {#1}\mathrm{R} } }\)
\(\def\Part#1#2{ { \Atom{\Obj P}{#1, #2} } }\)
\(\def\pto{ { \hspace{0.1 cm}\to\hspace{-0.44 cm}\vcenter{\tiny{\hbox{|}}}\hspace{0.35 cm} } }\)
\(\def\PosInt{ {\mathbb{Z}^+} }\)
\(\def\Pow#1{ {\wp(#1)} }\)
\(\newcommand{\Proves}{\vdash}\)
\(\newcommand{\ProvesN}{\nvdash}\)
\(\def\Relbar{\mathrel{=}}\)
\(\newcommand{\Sat}[3][{}]{\Struct{#2}{#1}\vDash{#3}}\)
\(\newcommand{\SatN}[3][{}]{\Struct{#2}{#1}\nvDash{#3}}\)
\(\newcommand{\Sequent}{\Rightarrow}\)
\(\def\Setabs#1#2{ { \{#1:#2\} } }\)
\(\newcommand{\sFmla}[2]{#1\,#2}\)
\(\def\Struct#1{ {#1} }\)
\(\def\subst#1#2{ { #1/#2 } }\)
\(\def\Subst#1#2#3{ { #1[\subst{#2}{#3}] } }\)
\(\def\TMblank{ { 0 } }\)
\(\newcommand{\TMendtape}{\triangleright}\)
\(\def\TMleft{ { L } }\)
\(\def\TMright{ { R } }\)
\(\def\TMstay{ { N } }\)
\(\def\TMstroke{ { 1 } }\)
\(\def\TMtrans#1#2#3{ { #1,#2,#3 } }\)
\(\def\Trm[#1]{ {\operatorname{Trm}(\Lang #1)} }\)
\(\def\True{ { \mathbb{T} } }\)
\(\newcommand{\TRule}[2]{#2#1}\)
\(\def\tuple#1{ {\langle #1 \rangle} }\)
\(\newcommand{\Value}[3][\,]{\mathrm{Val}_{#1}^{#3}(#2)}\)
\(\def\Var{ { \mathrm{Var} } }\)
\(\newcommand{\varAssign}[3]{#1 \sim_{#3} #2}\)
\(\def\Weakening{ { \text{W} } }\)
Assume we have fixed some finite descriptions of Turing machines. Using these, we can enumerate Turing machines via their descriptions, say, ordered by the lexicographic ordering. Each Turing machine thus receives an index: its place in the enumeration \(M_1\), \(M_2\), \(M_3\), …of Turing machine descriptions.
We know that there must be non-Turing-computable functions: the set of Turing machine descriptions—and hence the set of Turing machines—is enumerable, but the set of all functions from \(\Nat\) to \(\Nat\) is not. But we can find specific examples of non-computable function as well. One such function is the halting function.
The halting function \(h\) is defined as \[h(e,n) = \begin{cases} \text{0} & \text{if machine $M_e$ does not halt for input $n$} \\ \text{1} & \text{if machine $M_e$ halts for input $n$} \end{cases}\nonumber\]
The Halting Problem is the problem of determining (for any \(e\), \(n\)) whether the Turing machine \(M_e\) halts for an input of \(n\) strokes.
We show that \(h\) is not Turing-computable by showing that a related function, \(s\), is not Turing-computable. This proof relies on the fact that anything that can be computed by a Turing machine can be computed using just two symbols: \(\TMblank\) and \(\TMstroke\), and the fact that two Turing machines can be hooked together to create a single machine.
The function \(s\) is defined as \[s(e) = \begin{cases} \text{0} & \text{if machine $M_e$ does not halt for input $e$} \\ \text{1} & \text{if machine $M_e$ halts for input $e$} \end{cases}\nonumber\]
The function \(s\) is not Turing computable.
Proof. We suppose, for contradiction, that the function \(s\) is Turing computable. Then there would be a Turing machine \(S\) that computes \(s\). We may assume, without loss of generality, that when \(S\) halts, it does so while scanning the first square. This machine can be “hooked up” to another machine \(J\), which halts if it is started on a blank tape (i.e., if it reads \(\TMblank\) in the initial state while scanning the square to the right of the end-of-tape symbol), and otherwise wanders off to the right, never halting. \(S \concat J\), the machine created by hooking \(S\) to \(J\), is a Turing machine, so it is \(M_e\) for some \(e\) (i.e., it appears somewhere in the enumeration). Start \(M_e\) on an input of \(e\) \(\TMstroke\)s. There are two possibilities: either \(M_e\) halts or it does not halt.
- Suppose \(M_e\) halts for an input of \(e\) \(\TMstroke\)s. Then \(s(e) = 1\). So \(S\), when started on \(e\), halts with a single \(\TMstroke\) as output on the tape. Then \(J\) starts with a \(\TMstroke\) on the tape. In that case \(J\) does not halt. But \(M_e\) is the machine \(S \concat J\), so it should do exactly what \(S\) followed by \(J\) would do. So \(M_e\) cannot halt for an input of \(e\) \(\TMstroke\)’s.
- Now suppose \(M_e\) does not halt for an input of \(e\) \(\TMstroke\)s. Then \(s(e) = 0\), and \(S\), when started on input \(e\), halts with a blank tape. \(J\), when started on a blank tape, immediately halts. Again, \(M_e\) does what \(S\) followed by \(J\) would do, so \(M_e\) must halt for an input of \(e\) \(\TMstroke\)’s.
This shows there cannot be a Turing machine \(S\): \(s\) is not Turing computable. ◻
The halting problem is unsolvable, i.e., the function \(h\) is not Turing computable.
Proof. Suppose \(h\) were Turing computable, say, by a Turing machine \(H\). We could use \(H\) to build a Turing machine that computes \(s\): First, make a copy of the input (separated by a blank). Then move back to the beginning, and run \(H\). We can clearly make a machine that does the former, and if \(H\) existed, we would be able to “hook it up” to such a modified doubling machine to get a new machine which would determine if \(M_e\) halts on input \(e\), i.e., computes \(s\). But we’ve already shown that no such machine can exist. Hence, \(h\) is also not Turing computable. ◻
The Three Halting (3-Halt) problem is the problem of giving a decision procedure to determine whether or not an arbitrarily chosen Turing Machine halts for an input of three strokes on an otherwise blank tape. Prove that the 3-Halt problem is unsolvable.
Show that if the halting problem is solvable for Turing machine and input pairs \(M_e\) and \(n\) where \(e \neq n\), then it is also solvable for the cases where \(e = n\).
We proved that the halting problem is unsolvable if the input is a number \(e\), which identifies a Turing machine \(M_e\) via an enumaration of all Turing machines. What if we allow the description of Turing machines from section 13.2 directly as input? (This would require a larger alphabet of course.) Can there be a Turing machine which decides the halting problem but takes as input descriptions of Turing machines rather than indices? Explain why or why not.
This page titled 3.2.3: The Halting Problem was last modified on Fri, 08 Mar 2024 05:56:07 GMT and is shared under a CC BY license and was authored, remixed, and/or curated by Richard Zach et al. (Open Logic Project) .
The book could not be loaded just now.