From dd04c466c2a9e6c0a08f02dab2564ea15ef78877 Mon Sep 17 00:00:00 2001 From: KokunoYumeto <208192274+KokunoYumeto@users.noreply.github.com> Date: Mon, 30 Nov 2026 22:30:29 +0100 Subject: [PATCH 1/4] computability/computability-theory: corrections (30 places) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit application-fixed-point.tex: - l. 35: Theorem about partial computable f; proof starts from a computable f. Partial f, case f(e) undefined included. - l. 65: If f is the constant function whose value is an index η of the nowhere defined function, then the fixed-point W_e is empty but φ_η(0) gives no answer at all: not every failure is a wrong answer. ce-closed-cup-cap.tex: - l. 54: Tricker should be trickier; earlier for looking should be by looking. coding-computations.tex: - l. 21: Two machines at the same state with identical tape contents can make different next transitions when their heads occupy different cells. complement-ce.tex: - l. 39: A is the domain of phi_d, so x in A iff T(d,x,h(x)), not T(e,...); explanation uses other letters. d, e as in the proof. - l. 47: The explanation uses the letters of the proof, d and e. complete-ce-sets.tex: - l. 44: The final proof direction does not establish K completeness; it must transfer K0 completeness by reducing K0 to K. - l. 48: A c.e. set is shown complete by reducing the complete set K_0 to it, so the exercise needs the reduction of K_0 to K. - l. 56: c.e. sets neither computable nor many-one complete: Post 1944 (simple sets); Friedberg-Muchnik is about Turing reducibility. Both stated. computability-theory.tex: - l. 11: The driver imports no-universal-function.tex, prop-reduce.tex and complete-ce-sets.tex, all of which contain actual prob environments in the current tree. Thus its no-exercises sentence is stale. def-functions-self-reference.tex: - l. 32: phi_e(y) = g(e,y) between possibly undefined values (the fixed-point lemma uses \simeq). \simeq. equiv-ce-defs.tex: - l. 58: The normal-form identity concerns a possibly undefined function at arbitrary x; the book’s pointwise convention requires Kleene equality. - l. 69: The numerical definition evaluates the first two decoded entries of every z, not only exact length-two canonical sequence codes. The machine gloss must not add a canonical-pair-code test. - l. 80: x is unbound here; the quantified z supplies the argument (z)_0. fixed-point-thm.tex: - l. 81, 89: Both equivalence-proof chains use = for arbitrary potentially undefined pointwise values, despite the lemma’s Kleene convention. - l. 187: The displayed program has a physical newline after the semicolon, but its quoted template produces one space there; it does not print exactly its own displayed text. - l. 214: For arbitrary lambda termg, λx.g(xx) captures free occurrences ofx in g unlessx is chosen fresh. k-1.tex: - l. 78: g(w) = s(e,(w)_0,(w)_1) can send non-codes (not in K_0) into K_1. Non-codes go to an index of the nowhere defined function. - l. 80: Numbers that code no pair are not in K_0 and must not be sent into K_1; they go to an index of the nowhere defined function. no-universal-function.tex: - l. 12: 'total for the partial computable functions'. 'universal for'. non-comp-set.tex: - l. 25: len(z) = 2 does not mean z codes a pair (7 times a pair code), so K_0 is not dom f. z = <(z)_0, (z)_1>. prop-reduce.tex: - l. 46: The word "computable" was missing: the domains of partial computable functions are meant. - l. 69: A many-one reduction is a total computable map on the natural numbers, as explicitly defined in reducibility.tex. Restricting its declared domain to A omits the nonmembership inputs needed for the displayed characteristic-function identity. reducibility.tex: - l. 42: K_0 = { : x in W_e}: pair order reversed. . Also two typos at 31, 37 (noticed). rice-theorem.tex: - l. 94: C is a collection of unary partial computable functions, so its member is h_x rather than the displayed equality or a pointwise value. Explicitly introduce h_x by its defining equation before testing its membership. - l. 100: phi_{s(e,x)}(y) = h_x(y) between possibly undefined values. \simeq. s-m-n.tex: - l. 34: The explanation substitutes the unintroduced program variable x for the fixed program e. - l. 34: The conditional sentence begins with the mistyped It instead of If. It is independent of the program-variable referent 0022. total.tex: - l. 44: The pointwise s-m-n identity is asserted for allx,y and has an undefined branch; it requires Kleene equality under the chapter convention. universal-part-function.tex: - l. 39: g is a unary partial recursive function. 'partial' added. Co-Authored-By: Claude Opus 5.5 --- .../application-fixed-point.tex | 9 +++++---- .../computability-theory/ce-closed-cup-cap.tex | 2 +- .../computability-theory/coding-computations.tex | 2 +- .../computability-theory/complement-ce.tex | 6 +++--- .../computability-theory/complete-ce-sets.tex | 11 +++++++---- .../computability-theory/computability-theory.tex | 3 +-- .../def-functions-self-reference.tex | 2 +- .../computability-theory/equiv-ce-defs.tex | 7 +++---- .../computability-theory/fixed-point-thm.tex | 14 +++++++------- content/computability/computability-theory/k-1.tex | 10 ++++++++-- .../computability-theory/no-universal-function.tex | 2 +- .../computability-theory/non-comp-set.tex | 2 +- .../computability-theory/prop-reduce.tex | 4 ++-- .../computability-theory/reducibility.tex | 2 +- .../computability-theory/rice-theorem.tex | 4 ++-- .../computability/computability-theory/s-m-n.tex | 4 ++-- .../computability/computability-theory/total.tex | 2 +- .../universal-part-function.tex | 2 +- 18 files changed, 48 insertions(+), 40 deletions(-) diff --git a/content/computability/computability-theory/application-fixed-point.tex b/content/computability/computability-theory/application-fixed-point.tex index 1ec7622d5..98d79e019 100644 --- a/content/computability/computability-theory/application-fixed-point.tex +++ b/content/computability/computability-theory/application-fixed-point.tex @@ -32,7 +32,7 @@ \end{thm} \begin{proof} -Let $f$ be any computable function; we will construct an $e$ +Let $f$ be any partial computable function; we will construct an $e$ such that $W_e$ is computable, but $\cfind{f(e)}$ is not its characteristic function. Using the fixed point theorem, we can find an index $e$ such that @@ -62,9 +62,10 @@ But now notice that if $\cfind{f(e)}(0)$ is defined and equal to $0$, then $\cfind{e}(y)$ is defined exactly when $y$ is equal to $0$, so $W_e = \{ 0 \}$. If $\cfind{f(e)}(0)$ is not defined, or is defined but not -equal to $0$, then $W_e = \emptyset$. Either way, $\cfind{f(e)}$ is not -the characteristic function of~$W_e$, since it gives the wrong answer -on input $0$. +equal to $0$, then $W_e = \emptyset$. Either way, $W_e$ is computable, +but $f(e)$ is undefined or $\cfind{f(e)}$ is not +the characteristic function of~$W_e$, since it gives no answer or +the wrong answer on input $0$. \end{proof} \end{document} diff --git a/content/computability/computability-theory/ce-closed-cup-cap.tex b/content/computability/computability-theory/ce-closed-cup-cap.tex index 7f8f4a18c..3bab95a56 100644 --- a/content/computability/computability-theory/ce-closed-cup-cap.tex +++ b/content/computability/computability-theory/ce-closed-cup-cap.tex @@ -51,7 +51,7 @@ \] Then $k$ enumerates $A \cup B$; the idea is that $k$ just alternates between the enumerations offered by $f$ and~$g$. Enumerating $A \cap -B$ is tricker. If $A \cap B$ is empty, it is trivially computably +B$ is trickier. If $A \cap B$ is empty, it is trivially computably enumerable. Otherwise, let $c$ be any element of $A \cap B$, and define $l$ by \[ diff --git a/content/computability/computability-theory/coding-computations.tex b/content/computability/computability-theory/coding-computations.tex index 6d936cacc..6e042bafe 100644 --- a/content/computability/computability-theory/coding-computations.tex +++ b/content/computability/computability-theory/coding-computations.tex @@ -18,7 +18,7 @@ \item Describe the complete record of the computation of a function given by some definition for a given input. For instance, a Turing machine computation can be described by the sequence of - configurations (state of the machine, contents of the tape) for each + configurations (state of the machine, contents of the tape, and head position) for each step of computation. \item Test whether a putative record of a computation is in fact the record of how a computable function with a given definition would be diff --git a/content/computability/computability-theory/complement-ce.tex b/content/computability/computability-theory/complement-ce.tex index aa29ad2f8..035e214b7 100644 --- a/content/computability/computability-theory/complement-ce.tex +++ b/content/computability/computability-theory/complement-ce.tex @@ -36,15 +36,15 @@ Now, if $x \in A$, it will succeed in the first case, and if $x \in \Complement{A}$, it will succeed in the second case. So, $h$~is a total computable function. But now we have that for every~$x$, $x \in -A$ if and only if $T(e, x, h(x))$, i.e., if $\cfind{e}$ is the one -that is defined. Since $T(e, x, h(x))$ is a computable relation, +A$ if and only if $T(d, x, h(x))$, i.e., if $\cfind{d}$ is the one +that is defined. Since $T(d, x, h(x))$ is a computable relation, $A$~is computable. \end{proof} \begin{explain} It is easier to understand what is going on in informal computational terms: to decide $A$, on input $x$ search for halting computations of -$\cfind{e}$ and $\cfind{f}$. One of them is bound to halt; if it is $\cfind{e}$, +$\cfind{d}$ and $\cfind{e}$. One of them is bound to halt; if it is $\cfind{d}$, then $x$ is in~$A$, and otherwise, $x$ is in~$\Complement{A}$. \end{explain} diff --git a/content/computability/computability-theory/complete-ce-sets.tex b/content/computability/computability-theory/complete-ce-sets.tex index f203cbff1..059b4d93b 100644 --- a/content/computability/computability-theory/complete-ce-sets.tex +++ b/content/computability/computability-theory/complete-ce-sets.tex @@ -41,11 +41,12 @@ \olref[ppr]{prop:trans-red}, any computably enumerable set can be reduced to~$K_1$ as well. -$K$ can be reduced to $K_0$ in much the same way. +And $K_0$ can be reduced to~$K$ in much the same way as it was +reduced to~$K_1$, so $K$ is complete as well. \end{proof} \begin{prob} -Give a reduction of $K$ to $K_0$. +Give a reduction of $K_0$ to~$K$. \end{prob} \begin{digress} @@ -53,8 +54,10 @@ that we have considered so far are either computable, or complete. This should seem strange!{} Are there any examples of computably enumerable sets that are neither computable nor complete? The answer -is yes, but it wasn't until the middle of the 1950s that this was -established by Friedberg and Muchnik, independently. +is yes: Post showed this in 1944. If completeness is defined using the +more liberal Turing reducibility instead of many-one reducibility, it +wasn't until the middle of the 1950s that this was established, by +Friedberg and Muchnik, independently. \end{digress} \end{document} diff --git a/content/computability/computability-theory/computability-theory.tex b/content/computability/computability-theory/computability-theory.tex index ae27dd2fb..fb51e2155 100644 --- a/content/computability/computability-theory/computability-theory.tex +++ b/content/computability/computability-theory/computability-theory.tex @@ -8,8 +8,7 @@ \olchapter{cmp}{thy}{Computability Theory} \begin{editorial} - Material in this chapter should be reviewed and expanded. In - particular, there are no exercises yet. + Material in this chapter should be reviewed and expanded. \end{editorial} \olimport{introduction} diff --git a/content/computability/computability-theory/def-functions-self-reference.tex b/content/computability/computability-theory/def-functions-self-reference.tex index 8878ca35d..26ac6e7e1 100644 --- a/content/computability/computability-theory/def-functions-self-reference.tex +++ b/content/computability/computability-theory/def-functions-self-reference.tex @@ -29,7 +29,7 @@ \end{cases} \] and then using the fixed-point lemma to find an index~$e$ such that -$\cfind{e}(y) = g(e,y)$. +$\cfind{e}(y) \simeq g(e,y)$. For a concrete example, the ``greatest common divisor'' function $\fn{gcd}(u,v)$ can be defined by diff --git a/content/computability/computability-theory/equiv-ce-defs.tex b/content/computability/computability-theory/equiv-ce-defs.tex index 23bf64035..1426444f7 100644 --- a/content/computability/computability-theory/equiv-ce-defs.tex +++ b/content/computability/computability-theory/equiv-ce-defs.tex @@ -55,7 +55,7 @@ $\cfind{e}$. If $S$ is empty, we are done. Otherwise, let $a$ be any element of~$S$. By Kleene's normal form theorem, we can write \[ -\cfind{e}(x) = U(\umin{s}{T(e, x, s)}). +\cfind{e}(x) \simeq U(\umin{s}{T(e, x, s)}). \] In particular, $\cfind{e}(x) \fdefined$ and $= y$ if and only if there is an $s$ such that $T(e, x, s)$ and $U(s) = y$. Define $f(z)$ by @@ -66,8 +66,7 @@ \end{cases} \] Then $f$ is primitive recursive, because $T$ and $U$ -are. \iftag{TMs}{Expressed in terms of Turing machines, if $z$ codes a - pair $\tuple{(z)_0, (z)_1}$ such that $(z)_1$ is a halting +are. \iftag{TMs}{Expressed in terms of Turing machines, if $(z)_1$ is a halting computation of machine~$M_e$ on input $(z)_0$, then $f$ returns the output of the computation; otherwise, it returns~$a$.} @@ -77,7 +76,7 @@ $\cfind{e}$, so for some $x$ and~$s$, $T(e,x,s)$ holds and $U(s) = y$. But then $y = f(\tuple{x,s})$. Conversely, suppose $y$ is in the range of~$f$. Then either $y = a$, or for some~$z$, $T(e,(z)_0,(z)_1)$ and -$U((z)_1) = y$. Since, in the latter case, $\cfind{e}(x) \fdefined = +$U((z)_1) = y$. Since, in the latter case, $\cfind{e}((z)_0) \fdefined = y$, either way, $y$ is in~$S$. (The notation $\cfind{e}(x) \fdefined = y$ means ``$\cfind{e}(x)$ is diff --git a/content/computability/computability-theory/fixed-point-thm.tex b/content/computability/computability-theory/fixed-point-thm.tex index 84fa36661..1ea5a1c14 100644 --- a/content/computability/computability-theory/fixed-point-thm.tex +++ b/content/computability/computability-theory/fixed-point-thm.tex @@ -78,16 +78,16 @@ $(1) \Rightarrow (2)$: Given $f$, define $g$ by $g(x,y) \simeq \fn{Un}(f(x),y)$. Use (1) to get an index~$e$ such that for every~$y$, \begin{align*} -\cfind{e}(y) & = \fn{Un}(f(e),y) \\ -& = \cfind{f(e)}(y). +\cfind{e}(y) & \simeq \fn{Un}(f(e),y) \\ +& \simeq \cfind{f(e)}(y). \end{align*} $(2) \Rightarrow (1)$: Given $g$, use the $s$-$m$-$n$ theorem to get $f$ such that for every $x$ and~$y$, $\cfind{f(x)}(y) \simeq g(x,y)$. Use (2) to get an index~$e$ such that \begin{align*} -\cfind{e}(y) & = \cfind{f(e)}(y) \\ -& = g(e,y). +\cfind{e}(y) & \simeq \cfind{f(e)}(y) \\ +& \simeq g(e,y). \end{align*} This concludes the proof. \end{proof} @@ -184,8 +184,7 @@ string $x$ repeatedly, $y$ times. Then the ``program'' \begin{quote} \begin{verbatim} -getinput(y); -print(diag('getinput(y); print(diag(x), y)'), y) +getinput(y); print(diag('getinput(y); print(diag(x), y)'), y) \end{verbatim} \end{quote} prints itself out $y$ times, on input $y$. Replacing the @@ -211,7 +210,8 @@ \begin{digress} The same idea can be used to get a ``fixed point'' combinator. Suppose you have a lambda term $g$, and you want another term $k$ with the -property that $k$ is $\beta$-equivalent to $gk$. Define terms +property that $k$ is $\beta$-equivalent to $gk$. Choose $x$ not free in +$g$, and define terms \[ \fn{diag}(x) = xx \] diff --git a/content/computability/computability-theory/k-1.tex b/content/computability/computability-theory/k-1.tex index fe8e27fa6..8817697e6 100644 --- a/content/computability/computability-theory/k-1.tex +++ b/content/computability/computability-theory/k-1.tex @@ -75,9 +75,15 @@ In other words, $\tuple{x, y} \in K_0$ if and only if $s(e,x,y) \in K_1$. So the function $g$ defined by \[ -g(w) = s(e,(w)_0,(w)_1) +g(w) = +\begin{cases} +s(e,(w)_0,(w)_1) & \text{if $w = \tuple{(w)_0, (w)_1}$}\\ +a & \text{otherwise,} +\end{cases} \] -is a reduction of $K_0$ to~$K_1$. +where $a$ is an index of the nowhere defined function, is a reduction +of $K_0$ to~$K_1$. (If $w$ does not code a pair, then $w \notin K_0$ and +$g(w) = a \notin K_1$.) \end{proof} \end{document} diff --git a/content/computability/computability-theory/no-universal-function.tex b/content/computability/computability-theory/no-universal-function.tex index 4671b8b89..62ad597da 100644 --- a/content/computability/computability-theory/no-universal-function.tex +++ b/content/computability/computability-theory/no-universal-function.tex @@ -9,7 +9,7 @@ \olfileid{cmp}{thy}{nou} \olsection{No Universal Computable Function} -Although there is a partial computable function that is total for the +Although there is a partial computable function that is universal for the partial computable functions, there is no total computable function that is universal for the total computable functions. diff --git a/content/computability/computability-theory/non-comp-set.tex b/content/computability/computability-theory/non-comp-set.tex index 7b99b737a..8c684d08b 100644 --- a/content/computability/computability-theory/non-comp-set.tex +++ b/content/computability/computability-theory/non-comp-set.tex @@ -22,7 +22,7 @@ To see that $K_0$ is computably enumerable, note that it is the domain of the function~$f$ defined by \[ -f(z) = \umin{y}{(\len{z} = 2 \land T((z)_0, (z)_1, y))}. +f(z) = \umin{y}{(z = \tuple{(z)_0, (z)_1} \land T((z)_0, (z)_1, y))}. \] For, if $\cfind{e}(x)$ is defined, $f(\tuple{e, x})$ finds a halting computation sequence; if $\cfind{e}(x)$ is undefined, so is diff --git a/content/computability/computability-theory/prop-reduce.tex b/content/computability/computability-theory/prop-reduce.tex index 5767a56e8..0505f03fd 100644 --- a/content/computability/computability-theory/prop-reduce.tex +++ b/content/computability/computability-theory/prop-reduce.tex @@ -43,7 +43,7 @@ \begin{proof} Let $f$ be a many-one reduction from $A$ to~$B$. For the first -claim, just check that if $B$ is the domain of a partial function~$g$, +claim, just check that if $B$ is the domain of a partial computable function~$g$, then $A$ is the domain of~$\comp{f}{g}$: \begin{align*} x \in A & \text{ iff } f(x) \in B \\ @@ -66,7 +66,7 @@ \end{prob} \begin{prob} -Show that if $f\colon A \to B$ is a many-one reduction, then $\Char{A} +Show that if $f$ is a many-one reduction of $A$ to~$B$, then $\Char{A} = \comp{f}{\Char{B}}$. \end{prob} diff --git a/content/computability/computability-theory/reducibility.tex b/content/computability/computability-theory/reducibility.tex index 92aeef87e..f385bb4ec 100644 --- a/content/computability/computability-theory/reducibility.tex +++ b/content/computability/computability-theory/reducibility.tex @@ -39,7 +39,7 @@ \[ K_0 = \Setabs{\tuple{e, x}}{\cfind{e}(x) \fdefined }, \] -i.e., $K_0 = \Setabs{\tuple{x,e}}{x \in W_e}$. It is easy to extend +i.e., $K_0 = \Setabs{\tuple{e,x}}{x \in W_e}$. It is easy to extend any proof of the uncomputability of~$K$ to the uncomputability of~$K_0$: if $K_0$ were computable, we could decide whether or not !!a{element}~$x$ is in $K$ simply by asking whether or not the pair diff --git a/content/computability/computability-theory/rice-theorem.tex b/content/computability/computability-theory/rice-theorem.tex index 929c193f2..da9f453f4 100644 --- a/content/computability/computability-theory/rice-theorem.tex +++ b/content/computability/computability-theory/rice-theorem.tex @@ -91,13 +91,13 @@ $h(x,y)$ acts just like $f$ or it acts just like $g$, and deciding whether or not $\cfind{x}(x)$ is defined amounts to deciding which of these two cases holds. But this amounts to deciding whether or not -$h_x(y) \simeq h(x,y)$ is in~$C$ or not, and if $A$ were computable, +the function $h_x$, defined by $h_x(y) \simeq h(x,y)$, is in~$C$, and if $A$ were computable, we could do just that. More formally, since $h$~is partial computable, it is equal to the function $\cfind{e}$ for some index~$e$. By the $s$-$m$-$n$ theorem there is a primitive recursive function~$s$ such that for each~$x$, -$\cfind{s(e,x)}(y) = h_x(y)$. Now we have that for each $x$, if +$\cfind{s(e,x)}(y) \simeq h_x(y)$. Now we have that for each $x$, if $\cfind{x}(x) \fdefined$, then $\cfind{s(e,x)}$ is the same function as~$g$, and so $s(e,x)$ is in $A$. On the other hand, if $\cfind{x}(x) \uparrow$, then $\cfind{s(e,x)}$ is the same function as~$f$, and so diff --git a/content/computability/computability-theory/s-m-n.tex b/content/computability/computability-theory/s-m-n.tex index f61a7321b..4d43b40aa 100644 --- a/content/computability/computability-theory/s-m-n.tex +++ b/content/computability/computability-theory/s-m-n.tex @@ -31,8 +31,8 @@ It is helpful to think of $s^m_n$ as acting on \emph{programs}. That is, $s^m_n$ takes a program~$e$ for an $(m+n)$-ary function, as well as fixed inputs $a_0$, \dots, $a_{m-1}$; and it returns a program -$s^m_n(x, a_0, \dots, a_{m-1})$ for the $n$-ary function of the -remaining arguments. \iftag{TMs}{It you think of $x$ as the description of a +$s^m_n(e, a_0, \dots, a_{m-1})$ for the $n$-ary function of the +remaining arguments. \iftag{TMs}{If you think of $e$ as the description of a Turing machine, then $s^m_n(e, a_0, \dots, a_{m-1})$ is the Turing machine that, on input $y_0$, \dots,~$y_{n-1}$, prepends $a_0$, \dots,~$a_{m-1}$ to the input string, and runs~$e$. Each $s^m_n$ diff --git a/content/computability/computability-theory/total.tex b/content/computability/computability-theory/total.tex index 78d72dcf4..9a1aa855a 100644 --- a/content/computability/computability-theory/total.tex +++ b/content/computability/computability-theory/total.tex @@ -41,7 +41,7 @@ Using the $s$-$m$-$n$ theorem, there is a primitive recursive function~$k(x)$ such that for every $x$ and~$y$, \[ -\cfind{k(x)}(y) = +\cfind{k(x)}(y) \simeq \begin{cases} 0 & \text{if $x \in K$} \\ \fundefined & \text{otherwise} diff --git a/content/computability/computability-theory/universal-part-function.tex b/content/computability/computability-theory/universal-part-function.tex index 04fede7cf..7f5275603 100644 --- a/content/computability/computability-theory/universal-part-function.tex +++ b/content/computability/computability-theory/universal-part-function.tex @@ -36,7 +36,7 @@ sequences of numbers we can easily generalize this to more arguments. For example, note that if $f(x,y,z)$ is a $3$-place partial recursive function, then the function $g(x) \simeq f((x)_0, (x)_1, (x)_2)$ is a -unary recursive function. +unary partial recursive function. \end{explain} \end{document} From 6ff82eac922b064e549005d4b99295ad998222f6 Mon Sep 17 00:00:00 2001 From: KokunoYumeto <208192274+KokunoYumeto@users.noreply.github.com> Date: Mon, 30 Nov 2026 22:30:30 +0100 Subject: [PATCH 2/4] computability/recursive-functions: corrections (19 places) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bounded-minimization.tex: - l. 14: Decidability of a predicate gives a partial least-witness search, not guaranteed termination. - l. 48: The final bounded-search case changes the fixed parameter vector from x to z. - l. 50: The equations define the whole function m_R; m_R(vec x,0) denotes only its base value. composition.tex: - l. 27: h has n arguments, x_0 to x_{n-1}. - l. 38: The projection functions displayed just above are the P^n_i. examples.tex: - l. 20: The doubling example needs const_2, while the preceding prose names generic const_n. The same sentence also lacks the subject we before can obtain. non-pr-functions.tex: - l. 51: The coding display silently changes the previously fixed Zero and Succ notation constructors to 0 and S. Restore the established constructors while preserving tags 0 and 1; this is a notation consistency repair, not a false enumeration theorem. - l. 60: The summary says every code is assigned a number, although the preceding equations assign numbers to notations. This is an imprecise referent, not a reversal of the displayed function. - l. 70: 'one can not computably avoid these repetitions' is false (Liu, Tohoku Math. J. 12 (1960) 400-402: effective enumeration of the p.r. functions without repetition). Claim replaced by the undecidability of equality of notations. pr-relations.tex: - l. 43: IsZero(x - y) defines <=, called 'less-than'. 'less-than-or-equal'. primes.tex: - l. 16: Remainder/division language is undefined when x=0, although the displayed divisibility relation is defined on all natural pairs and includes 0|0. - l. 16: The divisibility parenthesis reverses the dividend y and divisor x. - l. 16: For x=y=0 every natural z satisfies x*z=y, including z=1>y, so the universal bound on every witness is false. Nevertheless z=0 is a bounded witness; for positive x every solution is at most y. - l. 64: There is no largest prime ≤x for x=0 or 1, so the given proof omits cases in its all-natural claim. primitive-recursion.tex: - l. 24: 'define h(x) from h(x+1)'. h(x+1) from h(x). sequences.tex: - l. 118: Not every number is the code of a sequence; the test Seq(s) is defined, and shown primitive recursive, here. - l. 151: The expression uses nonexistent p_(−1) when k=0. - l. 161: With both 0 and 1 accepted as empty codes, recursive concat(1,0)=1, whereas the proposed bounded minimum gives 0; they are not literally the same numerical function on all accepted codes. - l. 166: The bounded search admits invalid sequence codes having the right decoded length and entries; require valid initial-prime support. - l. 190: A finite sequence has no subsequence of length n starting at i when i+n exceeds its length. A PR function must nevertheless be total. trees.tex: - l. 42: hSubtreeSeq(t,n) accumulates all levels <= n. 'at most n nodes'. Co-Authored-By: Claude Opus 5.5 --- .../bounded-minimization.tex | 19 +++++++------ .../recursive-functions/composition.tex | 4 +-- .../recursive-functions/examples.tex | 2 +- .../recursive-functions/non-pr-functions.tex | 10 +++---- .../recursive-functions/pr-relations.tex | 2 +- .../recursive-functions/primes.tex | 13 +++++---- .../primitive-recursion.tex | 2 +- .../recursive-functions/sequences.tex | 28 +++++++++++++++---- .../recursive-functions/trees.tex | 2 +- 9 files changed, 50 insertions(+), 32 deletions(-) diff --git a/content/computability/recursive-functions/bounded-minimization.tex b/content/computability/recursive-functions/bounded-minimization.tex index bd361e519..fc9724ff0 100644 --- a/content/computability/recursive-functions/bounded-minimization.tex +++ b/content/computability/recursive-functions/bounded-minimization.tex @@ -11,13 +11,14 @@ \begin{explain} It is often useful to define a function as the least number satisfying -some property or relation~$P$. If $P$ is decidable, we can compute -this function simply by trying out all the possible numbers, $0$, $1$, -$2$, \dots, until we find the least one satisfying~$P$. This kind of -unbounded search takes us out of the realm of primitive recursive -functions. However, if we're only interested in the least number -\emph{less than some independently given bound}, we stay primitive -recursive. In other words, and a bit more generally, suppose we have a +some property or relation~$P$. If $P$ is decidable, we can search for such a number by trying +$0$, $1$, $2$, \dots, and return the least one satisfying~$P$ if one +exists; otherwise the search does not terminate. This kind of +unbounded search can take us out of the realm of primitive recursive +functions. If $P$ is primitive recursive and we are only interested +in the least number \emph{less than some independently given bound}, +with a specified default when no witness exists, the resulting +function is primitive recursive. In other words, and a bit more generally, suppose we have a primitive recursive relation~$R(x,z)$. Consider the function that maps $x$ and~$y$ to the least $z < y$ such that $R(x, z)$. It, too, can be computed, by testing whether $R(x, 0)$, $R(x, 1)$, \dots, $R(x, y-1)$. @@ -45,9 +46,9 @@ \item There is no such~$z 0$, we write $x \nmid y$.) In other -words, $x \mid y$ iff for some~$z$, $x \cdot z = y$. Obviously, any -such $z$, if it exists, must be $\leq y$. So, we have that $x \mid y$ +$y$ is an integer multiple of~$x$. When $x>0$, this says that division +of $y$ by~$x$ is possible without remainder. (If $x \mid y$ does not +hold, we write $x \nmid y$.) In other +words, $x \mid y$ iff for some~$z$, $x \cdot z = y$. Obviously, if +such a $z$ exists, there is one that is $\leq y$. So, we have that $x \mid y$ iff for some $z \le y$, $x \cdot z = y$. We can define the relation $x \mid y$ by bounded existential quantification from $=$ and multiplication by @@ -61,7 +61,8 @@ This shows, that $\fn{nextPrime}(x)$ and hence $p(x)$ are (not just computable but) primitive recursive. -(If you're curious, here's a quick proof of Euclid's theorem. Suppose +(If you're curious, here's a quick proof of Euclid's theorem. For +$x=0$ or $x=1$, the prime $2$ has the required property. Otherwise, suppose $p_n$ is the largest prime $\le x$ and consider the product $p = p_0\cdot p_1 \cdot \dots \cdot p_n$ of all primes~$\le x$. Either $p+1$ is prime or there is a prime between $x$ and~$p+1$. Why? diff --git a/content/computability/recursive-functions/primitive-recursion.tex b/content/computability/recursive-functions/primitive-recursion.tex index 6ef58eeff..8d9295eed 100644 --- a/content/computability/recursive-functions/primitive-recursion.tex +++ b/content/computability/recursive-functions/primitive-recursion.tex @@ -21,7 +21,7 @@ compute $h(1) = h(0+1)$ from~$h(0)$. Using the same instructions for $x=1$, we compute $h(2) = h(1+1)$ from~$h(1)$, and so on. For every natural number~$x$, we'll eventually reach the step where we define -$h(x)$ from $h(x+1)$, and so $h(x)$ is defined for all $x \in \Nat$. +$h(x+1)$ from $h(x)$, and so $h(x)$ is defined for all $x \in \Nat$. For instance, suppose we specify $h\colon \Nat \to \Nat$ by the following two equations: diff --git a/content/computability/recursive-functions/sequences.tex b/content/computability/recursive-functions/sequences.tex index 98d6f1476..eff465853 100644 --- a/content/computability/recursive-functions/sequences.tex +++ b/content/computability/recursive-functions/sequences.tex @@ -116,6 +116,16 @@ Note that if $s$ has length~$k$, the elements of $s$ are $(s)_0$, \dots,~$(s)_{k-1}$. +Not every natural number is the code of a sequence. The primitive +recursive predicate $\fn{Seq}(s)$ tests this: +\[ +\fn{Seq}(s) \defiff s=0 \lor + s=\prod_{i<\len{s}} p_i^{(s)_i+1}. +\] +The empty product is $1$, so both codes for the empty sequence are +included. The equality excludes extra prime factors and gaps in the +initial sequence of primes. + \begin{prop} The function $\fn{concat}(s,t)$, which concatenates two sequences, is primitive recursive. @@ -148,7 +158,11 @@ most~$p_{k-1}$, and each raised to at most $x+1$ in the prime factorization of~$s$. In other words, if we define \[ -\fn{sequenceBound}(x,k) = p_{k-1}^{k \cdot (x+1)}, +\fn{sequenceBound}(x,k) = +\begin{cases} +1 & \text{if $k=0$},\\ +p_{k-1}^{k \cdot (x+1)} & \text{if $k>0$}. +\end{cases} \] then the numeric code of the sequence~$s$ described above is at most~$\fn{sequenceBound}(x,k)$. @@ -158,13 +172,15 @@ $\fn{concat}$ using bounded search. All we need to do is write down a primitive recursive \emph{specification} of the object (number of the concatenated sequence) we are looking for, and a bound on how far to -look. The following works: +look. If $\len{t}=0$, set $\fn{concat}(s,t)=s$. For $\len{t}>0$, +the following works: \begin{align*} \fn{concat}(s,t) = {} & \bmin{v < \fn{sequenceBound}(s+t,\len{s} + \len{t})}{} \\ & \quad(\len{v} = \len{s} + \len{t} \land {}\\ - & \qquad \bforall{i < \len{s}}{((v)_i = (s)_i) \land {} \\ - & \qquad \bforall{j < \len{t}}{((v)_{\len{s}+j} = (t)_j)})} + & \qquad \bforall{i < \len{v}}{(p_i \mid v)} \land {} \\ + & \qquad \bforall{i < \len{s}}{((v)_i = (s)_i)} \land {} \\ + & \qquad \bforall{j < \len{t}}{((v)_{\len{s}+j} = (t)_j)}) \end{align*} \begin{prob} @@ -187,8 +203,8 @@ \begin{prop} \ollabel{prop:subseq} The function $\fn{subseq}(s, i, n)$ which returns the subsequence - of $s$ of length~$n$ beginning at the $i$th element, is primitive - recursive. + of $s$ of length~$n$ beginning at the $i$th element when + $i+n\leq\len{s}$, and returns $0$ otherwise, is primitive recursive. \end{prop} \begin{proof} diff --git a/content/computability/recursive-functions/trees.tex b/content/computability/recursive-functions/trees.tex index 95388abb3..a32efae97 100644 --- a/content/computability/recursive-functions/trees.tex +++ b/content/computability/recursive-functions/trees.tex @@ -39,7 +39,7 @@ primitive recursive and returns the codes of the immediate subtrees of a tree~$t$. Now we can define a helper function $\fn{hSubtreeSeq}(t,n)$ which computes the sequence of all subtrees - which are $n$ nodes removed from the root. The sequence of subtrees + which are at most $n$ nodes removed from the root. The sequence of subtrees of~$t$ which is $0$ nodes removed from the root---in other words, begins at the root of~$t$---is the sequence consisting just of~$t$. To obtain a sequence of all level~$n+1$ subtrees of $t$, we From 4f56aaf54df81373951534ec4f9f47583a5d2ae2 Mon Sep 17 00:00:00 2001 From: KokunoYumeto <208192274+KokunoYumeto@users.noreply.github.com> Date: Mon, 30 Nov 2026 22:30:30 +0100 Subject: [PATCH 3/4] turing-machines/machines-computations: corrections (16 places) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit combining-machines.tex: - l. 39: First case of delta'' also covers undefined delta(q,s), overlapping the third case. 'and delta(q,s) is defined'. - l. 155, 162: With unequal alphabets, plain concatenation can halt in a non-designated state of M′ when it reads an output symbol outside Σ′. configuration.tex: - l. 54: The head position 1 must be within the tape. - l. 60: The old prose says to the left end marker and omits the right-of relation. disciplined-machines.tex: - l. 44: The informal promise of identical halting inputs and output is too broad under conditional output decoding: an original marker-erasing halt has no output, but every disciplined halt preserves the marker and has a decodable output. - l. 54, 74: No q0/marker transition is shown, so it halts in q0, not its designated h. The diagram meets the claimed discipline on the specified unary-number inputs; restrict only that example and caption, retaining the general normalization proposition and every edge. - l. 93: At n = 0 the output asked for is one blank, but trailing blanks are stripped from outputs, so no machine has that output. introduction.tex: - l. 43: Head starts on the leftmost square (the marker) in the intro, square 1 in the definition. - l. 119: The parents-living-room detail belongs to the 1938 Z1, while the 1941 Z3 was in Zuse’s workshop. - l. 119: 'his parent's living room'. parents'. - l. 119: The branch corrects the mistaken Turing attribution. The independent punched-tape versus rewiring claim is 0429. - l. 126: According to the Heinz Nixdorf MuseumsForum the Z3 read its programs from punched film, so not all earlier machines had to be rewired by hand. representing-tms.tex: - l. 88: The prose says the represented machine starts in state one, while the initial-state arrow targets q0. - l. 173: The displayed nonempty table entries list the symbol, then state, then direction. The explanatory prose instead lists state before symbol. unary-numbers.tex: - l. 232: The second clause lacks "halts", so that "does not" seems to extend over it. variants.tex: - l. 53: Deleting left transitions on the end marker only detects physical position zero if that marker remains there. The footnote handles extra copies of the marker, but not overwriting its original occurrence. Co-Authored-By: Claude Opus 5.5 --- .../machines-computations/combining-machines.tex | 7 ++++--- .../machines-computations/configuration.tex | 6 ++++-- .../machines-computations/disciplined-machines.tex | 12 +++++++----- .../machines-computations/introduction.tex | 13 +++++++------ .../machines-computations/representing-tms.tex | 4 ++-- .../machines-computations/unary-numbers.tex | 2 +- .../machines-computations/variants.tex | 3 ++- 7 files changed, 27 insertions(+), 20 deletions(-) diff --git a/content/turing-machines/machines-computations/combining-machines.tex b/content/turing-machines/machines-computations/combining-machines.tex index e406fe0c1..126712782 100644 --- a/content/turing-machines/machines-computations/combining-machines.tex +++ b/content/turing-machines/machines-computations/combining-machines.tex @@ -36,7 +36,7 @@ \item The transition function is the function $\delta''$ given by: \[\delta''(q,\sigma) = \begin{cases} - \delta(q,\sigma) & \text{if $q \in Q$}\\ + \delta(q,\sigma) & \text{if $q \in Q$ and $\delta(q,\sigma)$ is defined}\\ \delta'(q,\sigma) & \text{if $q \in Q'$}\\ \tuple{q_0', \sigma, \TMstay} & \text{if $q \in Q$ and $\delta(q,\sigma)$ is undefined} @@ -152,14 +152,15 @@ \begin{prop} If $M$ and $M'$ are disciplined and compute the functions $f\colon \Nat^k \to \Nat$ and $f'\colon \Nat \to \Nat$, respectively, then - $M \frown M'$ is disciplined and computes~$\comp{f}{f'}$. + $M \frown M'$ computes~$\comp{f}{f'}$. If $M$ and $M'$ have the + same tape alphabet, $M \frown M'$ is also disciplined. \end{prop} \begin{proof} Since $M$ is disciplined, when it halts with output~$f(n_1,\dots,n_k) = m$, the head is scanning square~$1$. If we now enter the start state of~$M'$, the machine will halt with - output $f'(m)$, again scanning square~$1$. The other conditions of + output $f'(m)$, again scanning square~$1$. If the tape alphabets agree, the other conditions of \olref[dis]{defn:disciplined} are also satisfied. \end{proof} diff --git a/content/turing-machines/machines-computations/configuration.tex b/content/turing-machines/machines-computations/configuration.tex index abe28f2ff..459c3d9a9 100644 --- a/content/turing-machines/machines-computations/configuration.tex +++ b/content/turing-machines/machines-computations/configuration.tex @@ -51,13 +51,15 @@ \begin{defn}[Initial configuration] The \emph{initial configuration} of $M$ for input $I \in \Sigma^*$ is \[ -\tuple{\TMendtape \frown I, 1, q_0}. +\tuple{\TMendtape \frown I \frown \TMblank, 1, q_0}. \] \end{defn} \begin{explain} The~$\frown$ symbol is for \emph{concatenation}---the input string -begins immediately to the left end marker. +begins immediately to the right of the left end marker. The +final~$\TMblank$ makes sure that square~$1$ exists even if the input is +empty. \end{explain} \begin{defn} diff --git a/content/turing-machines/machines-computations/disciplined-machines.tex b/content/turing-machines/machines-computations/disciplined-machines.tex index e11f77c16..f6f5e7056 100644 --- a/content/turing-machines/machines-computations/disciplined-machines.tex +++ b/content/turing-machines/machines-computations/disciplined-machines.tex @@ -41,8 +41,8 @@ $\delta(q, \sigma) = \tuple{h, \sigma, N}$ for any pair $\tuple{q,\sigma}$ where the original $\delta$~is undefined. It is true, although tedious to prove, that any Turing machine~$M$ can be -turned into a disciplined Turing machine~$M'$ which halts on the same -inputs and produces the same output. For instance, if the Turing +turned into a disciplined Turing machine~$M'$ which produces the same +output whenever $M$ has an output, and does not halt if $M$ does not halt. For instance, if the Turing machine halts and is not on square~$1$, we can add some instructions to make the head move left until it finds the tape-end marker, then move one square to the right, then halt. We'll leave you to think @@ -51,7 +51,8 @@ \begin{ex} In \olref{fig:adder-disc}, we turn the addition machine - from \olref[una]{ex:adder} into a disciplined machine. + from \olref[una]{ex:adder} into a machine that is disciplined on + the specified numerical inputs. \begin{figure}\[ \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=2.8cm, semithick] @@ -71,7 +72,7 @@ (D) edge [loop above] node {\TMtrans{\TMstroke}{\TMstroke}{\TMleft}} (D) edge node {\TMtrans{\TMendtape}{\TMendtape}{\TMright}} (H); \end{tikzpicture} -\]\caption{A disciplined addition machine} +\]\caption{An addition machine disciplined on numerical inputs} \ollabel{fig:adder-disc} \end{figure} \end{ex} @@ -90,7 +91,8 @@ \begin{prob}\label{tur:mac:dis:prob:copier} Find a disciplined machine which, when started on input $\TMstroke^n$ -produces output $\TMstroke^n \concat \TMblank \concat \TMstroke^n$. +produces output $\TMstroke^n \concat \TMblank \concat \TMstroke^n$ +for $n>0$, and empty output for $n=0$. \end{prob} \end{document} diff --git a/content/turing-machines/machines-computations/introduction.tex b/content/turing-machines/machines-computations/introduction.tex index 65b9d23b4..0a57bb68f 100644 --- a/content/turing-machines/machines-computations/introduction.tex +++ b/content/turing-machines/machines-computations/introduction.tex @@ -40,7 +40,7 @@ $\TMendtape$, and a finite number of squares which contain the \emph{input}. At any time, the mechanism is in one of a finite number of \emph{states}. At the outset, the head scans the leftmost square -and in a specified \emph{initial state}. At each step of the +of the input and the mechanism is in a specified \emph{initial state}. At each step of the mechanism's run, the content of the square currently scanned together with the state the mechanism is in and the Turing machine program determine what happens next. The Turing machine program is given by a @@ -116,15 +116,16 @@ that it is not hard to adapt his notions to computable functions on the natural numbers, and so on. Notice that this was a full five years before the first working general purpose computer was built in -1941 (by the German Konrad Zuse in his parent's living room), seven -years before Turing and his colleagues at Bletchley Park built the -code-breaking Colossus (1943), nine years before the American ENIAC +1941 (by the German Konrad Zuse in his Berlin workshop), seven +years before Tommy Flowers built the code-breaking Colossus for +Bletchley Park (1943), nine years before the American ENIAC (1945), twelve years before the first British general purpose computer---the Manchester Small-Scale Experimental Machine---was built in Manchester (1948), and thirteen years before the Americans first tested the BINAC (1949). The Manchester SSEM has the distinction of -being the first stored-program computer---previous machines had to be -rewired by hand for each new task. +being the first stored-program computer---previous machines read their +programs from punched tape, or had to be rewired by hand for each new +task. \end{history} \end{document} diff --git a/content/turing-machines/machines-computations/representing-tms.tex b/content/turing-machines/machines-computations/representing-tms.tex index 7336ab8c4..e6cea6047 100644 --- a/content/turing-machines/machines-computations/representing-tms.tex +++ b/content/turing-machines/machines-computations/representing-tms.tex @@ -85,7 +85,7 @@ \TMendtape \TMstroke_0 \TMstroke \TMstroke \TMstroke \TMblank \ldots \] The above configuration is straightforward. As can be seen, the -machine starts in state one, scanning the leftmost~$\TMstroke$. This +machine starts in state~$q_0$, scanning the leftmost~$\TMstroke$. This is represented by a subscript of the state name on the first~$\TMstroke$. The applicable instruction at this point is $\delta(q_0, \TMstroke) = \tuple{q_1, \TMstroke, \TMright}$, and so @@ -170,7 +170,7 @@ machines. Machine tables have the tape alphabet displayed on the $x$-axis, and the set of machine states across the $y$-axis. Inside the table, at the intersection of each state and symbol, is written the -rest of the instruction---the new state, new symbol, and direction of +rest of the instruction---the new symbol, new state, and direction of movement. Machine tables make it easy to determine in what state, and for what symbol, the machine halts. Whenever there is a gap in the table is a possible point for the machine to halt. Unlike state diff --git a/content/turing-machines/machines-computations/unary-numbers.tex b/content/turing-machines/machines-computations/unary-numbers.tex index 0d595a11d..db0c4090f 100644 --- a/content/turing-machines/machines-computations/unary-numbers.tex +++ b/content/turing-machines/machines-computations/unary-numbers.tex @@ -229,7 +229,7 @@ \begin{enumerate} \item $M$ halts on input $\TMstroke^{n_1}\concat\TMblank\concat \dots \concat\TMblank\concat\TMstroke^{n_k}$ with output $\TMstroke^{m}$ if $f(n_1, \dots, n_k) = m$. - \item $M$ does not halt at all, or with an output that is not a + \item $M$ does not halt at all, or halts without an output that is a single block of~$\TMstroke$'s if $f(n_1, \dots, n_k)$ is undefined. \end{enumerate} \end{defn} diff --git a/content/turing-machines/machines-computations/variants.tex b/content/turing-machines/machines-computations/variants.tex index 7721ec7e2..db720eeb8 100644 --- a/content/turing-machines/machines-computations/variants.tex +++ b/content/turing-machines/machines-computations/variants.tex @@ -50,7 +50,8 @@ definition, it just stays put instead of ``falling off'', but we could have defined it so that it halts when that happens. This definition is also equivalent: we could simulate the behavior of a Turing machine -that halts when it attempts to move left from square~$0$ by deleting +that preserves a tape-end marker unique to square~$0$ and halts when +it attempts to move left from square~$0$, by deleting every transition $\delta(q,\TMendtape) = \tuple{q',\sigma,\TMleft}$---then instead of attempting to move left on~$\TMendtape$ the machine halts.\footnote{This doesn't \emph{quite} From 40314d56497562d40eb0fb0fdf0b1611ad3f7703 Mon Sep 17 00:00:00 2001 From: KokunoYumeto <208192274+KokunoYumeto@users.noreply.github.com> Date: Mon, 30 Nov 2026 22:30:31 +0100 Subject: [PATCH 4/4] turing-machines/undecidability: corrections (32 places) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit decision-problem.tex: - l. 30: h is a mathematical function, proved noncomputable; it does not itself run or halt. enumerating-tms.tex: - l. 149: Machines are simulated; their numerical functions are computed. The exercise has a category error in its verb. halting-problem.tex: - l. 67: Returning the head to cell 1 is one discipline condition, not an equivalent definition of discipline. representing-tms.tex: - l. 114: A(x,y) has free variables: formulas, not sentences. formulas. - l. 145: Left move: written square is x', so the other squares are kept by A(x', y), not A(x, y) (which contradicts the write). A(x', y); in trakhtenbrot.tex also the missing B(y'). Also 'after' at 166 (noticed). trakhtenbrot.tex: - l. 37: n = max(k, len w): the last step can reach n, where n' = n and n < n; A and B(y') fail (B(n) false). max(k, len w) + 1. - l. 70: The exercise explicitly declares a single state q0 and refers back to the q0 self-loop machine just described. The branch replaces it by q0. - l. 72: The exercise defines the three-element structure M-double-prime. Both adjacent successor values and its domain use that structure; M-prime is the separate earlier model and has no role in this definition. - l. 118, 182: Every transition consequent in T-prime must assert B(y-prime) to distinguish the next time from its predecessors. The nonboundary left-move clause alone omits it, contrary to the paragraph defining the strengthened construction. - l. 189, 200: Both the finite-model verification exercise and the nonhalting contradiction must use the strengthened T-prime that includes B in transition consequents. - l. 189, 200: The section consistently names the halting sentence by !E, whose formula token renders differently from plain E. The two finite-model verification sentences drop that marker at lines 184 and 189. - l. 205, 207, 220: The transition axioms add B at successor times; they do not assert B(0). The nonhalting proof only needs distinct positive-time numerals, which already force an infinite domain. universal-tm.tex: - l. 87: Squares beyond the represented tape, including the first one for the input 0, have no block: blocks for blank squares are appended. - l. 112: Blindly decrementing the unary head counter at 0 does not implement the clamped left boundary. - l. 123: The final local test does not correctly skip the origin, admit trailing blanks, or reject a later stroke after an interior blank. It can reject valid outputs or accept malformed ones. unsolvability-decision-problem.tex: - l. 26: D starts on the first square of its input, square 1, which is where E must halt. verification.tex: - l. 52: The machine is M; T denotes the encoding sentence, not a machine. - l. 69: The cutoff must be at least the length of the input word, which may end in blanks. - l. 95: The displayed disjunct introduction must use the chosen halting pair and separately bound disjunction indices. - l. 109: The later halting argument applies the configuration lemma at the exact first halting time. Therefore its condition must allow halting at that time, while excluding earlier halting. The branch changes after n steps to before the nth step. - l. 114: For an empty input the cutoff is 1, and the facts about square 1 must be derived. - l. 122: The proof establishes the base at n=0 and must derive the n+1 case from every n≥0. The branch deletes that unnecessary restriction, retaining the independently corrected lemma timing in 0108. - l. 165: Both post-step displays syntactically retain the old symbol at the overwritten cell, although the prose excludes it. This is false when a transition changes that symbol. - l. 207, 210, 218, 227: Left move: written square is x', so the other squares are kept by A(x', y), not A(x, y) (which contradicts the write). A(x', y); in trakhtenbrot.tex also the missing B(y'). Also 'after' at 166 (noticed). - l. 207, 210, 218, 227: The instruction in this proof is q→q′, but the origin subcase retains unrelated q_i,q_j from the general encoding. - l. 221: The states and symbols are those of the instruction chosen. - l. 248: The formula needs numeral arguments, and meta-level i≠m does not itself entail an object-language comparison under the listed premises. Co-Authored-By: Claude Opus 5.5 --- .../undecidability/decision-problem.tex | 4 +- .../undecidability/enumerating-tms.tex | 2 +- .../undecidability/halting-problem.tex | 5 +- .../undecidability/representing-tms.tex | 4 +- .../undecidability/trakhtenbrot.tex | 21 ++++---- .../undecidability/universal-tm.tex | 33 ++++++------ .../unsolvability-decision-problem.tex | 2 +- .../undecidability/verification.tex | 54 ++++++++++--------- 8 files changed, 65 insertions(+), 60 deletions(-) diff --git a/content/turing-machines/undecidability/decision-problem.tex b/content/turing-machines/undecidability/decision-problem.tex index 2bf561391..a57d770ad 100644 --- a/content/turing-machines/undecidability/decision-problem.tex +++ b/content/turing-machines/undecidability/decision-problem.tex @@ -27,8 +27,8 @@ Our strategy for proving that the decision problem is unsolvable is to reduce the halting problem to it. This means the following: We have -proved that the function~$h(e,w)$ that halts with output~$1$ if the -Turing machine described by~$e$ halts on input~$w$ and outputs~$0$ +proved that the function~$h(e,w)$ that has value~$1$ if the +Turing machine described by~$e$ halts on input~$w$ and value~$0$ otherwise, is not Turing computable. We will show that if there were a Turing machine that decides validity of first-order sentences, then there is also Turing machine that computes~$h$. Since $h$ cannot be diff --git a/content/turing-machines/undecidability/enumerating-tms.tex b/content/turing-machines/undecidability/enumerating-tms.tex index ce7d9110b..0098609e0 100644 --- a/content/turing-machines/undecidability/enumerating-tms.tex +++ b/content/turing-machines/undecidability/enumerating-tms.tex @@ -146,7 +146,7 @@ Can you think of a way to describe Turing machines that does not require that the states and alphabet symbols are explicitly listed? You may define your own notion of ``standard'' machine, but say - something about why every Turing machine can be computed by a + something about why every Turing machine can be simulated by a ``standard'' machine in your new sense. \end{prob} diff --git a/content/turing-machines/undecidability/halting-problem.tex b/content/turing-machines/undecidability/halting-problem.tex index 34f105b56..61a411212 100644 --- a/content/turing-machines/undecidability/halting-problem.tex +++ b/content/turing-machines/undecidability/halting-problem.tex @@ -64,9 +64,8 @@ \begin{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 (i.e., that it is -disciplined). This machine can be ``hooked up'' to another +computes~$s$. We may assume, without loss of generality, that $S$ is +disciplined. In particular, it halts while scanning square~$1$. This machine can be ``hooked up'' to another machine~$J$, which halts if it is started on input~$0$ (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 diff --git a/content/turing-machines/undecidability/representing-tms.tex b/content/turing-machines/undecidability/representing-tms.tex index 7dac94bb0..c5b5eaab7 100644 --- a/content/turing-machines/undecidability/representing-tms.tex +++ b/content/turing-machines/undecidability/representing-tms.tex @@ -111,7 +111,7 @@ \item Axioms describing the transition from one configuration to the next: -For the following, let $!A(x, y)$ be the conjunction of all !!{sentence}s +For the following, let $!A(x, y)$ be the conjunction of all !!{formula}s of the form \[ \lforall[z][ @@ -142,7 +142,7 @@ & \lforall[x][\lforall[y][ ((\Obj Q_{q_i}(x', y) \land \Obj S_{\sigma}(x', y)) \lif {}]]\\ & \qquad (\Obj Q_{q_j}(x, y') \land \Obj S_{\sigma'}(x', y') \land -!A(x, y))) \land {}\\ +!A(x', y))) \land {}\\ & \lforall[y][((\Obj Q_{q_i}(\num{0}, y) \land \Obj S_{\sigma}(\num{0}, y)) \lif {}]\\ & \qquad (\Obj Q_{q_j}(\num{0}, y') \land \Obj S_{\sigma'}(\num{0}, diff --git a/content/turing-machines/undecidability/trakhtenbrot.tex b/content/turing-machines/undecidability/trakhtenbrot.tex index e26a01871..2fac2e7bc 100644 --- a/content/turing-machines/undecidability/trakhtenbrot.tex +++ b/content/turing-machines/undecidability/trakhtenbrot.tex @@ -34,7 +34,7 @@ input~$w$, we can build a finite model~$\Struct M'$ in the same way. Suppose $M$ started on input~$w$ halts after~$k$ steps. Take as domain~$\Domain{M'}$ the set $\{0, \dots, n\}$, where $n$ is the - larger of~$k$ and the length of~$w$, and let + larger of~$k$ and the length of~$w$, plus~$1$, and let \[ \Assign{\prime}{M'}(x) = \begin{cases} @@ -67,9 +67,9 @@ \begin{prob} Let $M$ be a Turing machine with the single state $q_0$ and single - instruction $\delta(q_0,\TMblank) = \tuple{q,\TMblank,\TMstay}$. + instruction $\delta(q_0,\TMblank) = \tuple{q_0,\TMblank,\TMstay}$. Let $\Domain{M''} = \{0, 1, 2\}$, $\Assign{\prime}{M''}(0) = - \Assign{\prime}{M'}(1) = 1$ and $\Assign{\prime}{M''}(2) = 2$, and + \Assign{\prime}{M''}(1) = 1$ and $\Assign{\prime}{M''}(2) = 2$, and $\Assign{<}{M''} = \{\tuple{0,1}, \tuple{1,1}, \tuple{2,2}\}$. Define $\Assign{\Obj Q_{q_0}}{M''}$, $\Assign{\Obj S_{\TMblank}}{M''}$, and $\Assign{\Obj S_{\TMendtape}}{M''}$ so @@ -115,7 +115,7 @@ & \lforall[x][\lforall[y][ ((\Obj Q_{q_i}(x', y) \land \Obj S_{\sigma}(x', y)) \lif {}]]\\ & \qquad (\Obj Q_{q_j}(x, y') \land \Obj S_{\sigma'}(x', y') \land -!A(x, y))) \land {}\\ +!A(x', y) \land !B(y'))) \land {}\\ & \lforall[y][((\Obj Q_{q_i}(\num{0}, y) \land \Obj S_{\sigma}(\num{0}, y)) \lif {}]\\ & \qquad (\Obj Q_{q_j}(\num{0}, y') \land \Obj S_{\sigma'}(\num{0}, @@ -179,14 +179,14 @@ \end{cases} \\ \tuple{x,y} \in \Assign{<}{M'} &\text{iff $x < y$ or $x = y = n$,} \end{align*} - where $n = \max(k,\len{w})$ and $k$~is the least number such that + where $n = \max(k,\len{w}) + 1$ and $k$~is the least number such that $M$ started on input~$w$ has halted after~$k$ steps. We leave the verification that $\Sat{M'}{!T'(M,w) \land E(M,w)}$ as an exercise. \end{proof} \begin{prob} Complete the proof of \olref[tur][und][tra]{lem:halts-sat} by - proving that $\Sat{M'}{!T(M,w) \land E(M,w)}$. + proving that $\Sat{M'}{!T'(M,w) \land !E(M,w)}$. \end{prob} \begin{lem}\ollabel{lem:sat-halts} @@ -197,14 +197,15 @@ \begin{proof} We show the contrapositive. Suppose that $M$ started on~$w$ does not halt. If $!T'(M,w) \land !E(M,w)$ has no model at all, we are done. - So assume $\Struct{M}$ is a model of~$!T(M,w) \land !E(M, w)$. We + So assume $\Struct{M}$ is a model of~$!T'(M,w) \land !E(M, w)$. We have to show that it cannot be finite. We can prove, just like in \olref[ver]{lem:config}, that if~$M$, started on input~$w$, has not halted after~$n$ steps, then $!T'(M,w) - \Entails !C(M, w, n) \land !B(\num{n})$. Since $M$ started on + \Entails !C(M, w, n)$, and also $!T'(M,w) \Entails !B(\num{n})$ if + $n > 0$. Since $M$ started on input~$w$ does not halt, $!T'(M,w) \Entails !C(M, w, n) \land - !B(\num{n})$ for all~$n \in \Nat$. Note that by + !B(\num{n})$ for all~$n > 0$. Note that by \olref[rep]{prop:mlessk}, $!T'(M,w) \Entails \num{k} < \num{n}$ for all~$k < n$. Also $!B(\num{n}) \Entails \num{k} < \num{n} \lif \eq/[\num{k}][\num{n}]$. So, $\Sat{M}{\eq/[\num{k}][\num{n}]}$ for @@ -217,7 +218,7 @@ \begin{prob} Complete the proof of \olref[tur][und][tra]{lem:sat-halts} by proving that if~$M$, started on input~$w$, has not halted after~$n$ - steps, then $!T'(M,w) \Entails !B(\num{n})$. + steps and $n > 0$, then $!T'(M,w) \Entails !B(\num{n})$. \end{prob} \begin{thm}[Trakhtenbrot's Theorem] diff --git a/content/turing-machines/undecidability/universal-tm.tex b/content/turing-machines/undecidability/universal-tm.tex index 177859c46..9583af49a 100644 --- a/content/turing-machines/undecidability/universal-tm.tex +++ b/content/turing-machines/undecidability/universal-tm.tex @@ -84,7 +84,9 @@ symbol is~$3$, $1$ being the number of~$\TMendtape$ and $2$ being the number of~$\TMblank$). At the left end of this sequence of blocks (separated by $\TMblank$ symbols on the tape of~$U$), it writes a - single~$\TMstroke$, the code for~$\TMendtape$. + single~$\TMstroke$, the code for~$\TMendtape$. It also appends a + block of two strokes for an initial blank square; whenever the simulated + head moves beyond the represented tape, it appends another such block. $U$ now has on its tape: the index~$e$, the number~$n$, the code number of the start state (the ``current state''), the number of the @@ -109,8 +111,9 @@ \item Move the head to where it records the current ``state'' and replace the number there with the number of the new state, \item Move to the place where it records the ``tape position'' and - erase a~$\TMstroke$ or add a~$\TMstroke$ (if the instruction says - to move left or right, respectively). + erase a~$\TMstroke$ if the instruction says to move left and the + counter is nonempty, or add a~$\TMstroke$ if it says to move right. + Leave the counter unchanged for a stay instruction or a left move at $0$. \item Repeat.\footnote{We're glossing over some subtle difficulties here. E.g., $U$~may need some extra space when it increases the counter where it keeps track of the ``current head @@ -120,20 +123,16 @@ If $M_e$ started on input~$n$ never halts, then $U$ also never halts, so its output is undefined. - If in step~\olref{find-inst} it turns out that the description - of~$M_e$ contains no instruction for the current - ``state''/``symbol'' pair, then $M_e$ would halt. If this happens, - $U$ erases the part of its tape to the left of the ``tape.'' For - each block of three~$\TMstroke$'s (representing a~$\TMstroke$ on - $M_e$'s tape), it writes a $\TMstroke$ on the left end of its own - tape, and successively erases the ``tape.'' When this is done, - $U$'s~tape contains a single block of~$\TMstroke$'s of length~$m$. - - If $U$ encounters something other than a block of - three~$\TMstroke$'s on the ``tape,'' it immediately halts. Since - $U$'s~tape in this case does not contain a single block - of~$\TMstroke$'s, its output is not a natural number, i.e., $f(e,n)$ - is undefined in this case. + If in step~\olref{find-inst} there is no instruction for the current + ``state''/``symbol'' pair, then $M_e$ would halt. Check whether the + encoded ``tape'' consists of the code for $\TMendtape$, followed by + $m$ codes for $\TMstroke$ and then zero or more codes for $\TMblank$. + In that case, $U$ erases its working data, preserving its own tape-end + marker, writes $m$ strokes immediately to its right, and halts. + This includes $m=0$, when the output is empty. Otherwise, $U$ erases + its working data and halts with output $\TMblank\TMstroke$, which is + not a single block of strokes. Thus $U$ halts whenever $M_e$ halts, + and its numerical output is defined exactly when $M_e$ has one. \end{proof} \end{document} diff --git a/content/turing-machines/undecidability/unsolvability-decision-problem.tex b/content/turing-machines/undecidability/unsolvability-decision-problem.tex index 94456e06d..150468b9d 100644 --- a/content/turing-machines/undecidability/unsolvability-decision-problem.tex +++ b/content/turing-machines/undecidability/unsolvability-decision-problem.tex @@ -23,7 +23,7 @@ follows. We construct a Turing machine~$E$ that, given as input the number~$e$ of Turing machine~$M_e$ and input~$w$, computes the corresponding !!{sentence}~$!T(M_e, w) \lif !E(M_e, w)$ and halts, -scanning the leftmost square on the tape. The machine $E \concat D$ +scanning square~$1$, the first square of its output. The machine $E \concat D$ would then, given input $e$ and $w$, first compute~$!T(M_e, w) \lif !E(M_e, w)$ and then run the decision problem machine~$D$ on that input. $D$ halts with output~$1$ iff $!T(M_e, w) \lif !E(M_e, w)$ is diff --git a/content/turing-machines/undecidability/verification.tex b/content/turing-machines/undecidability/verification.tex index a0316f755..b3ec0a40e 100644 --- a/content/turing-machines/undecidability/verification.tex +++ b/content/turing-machines/undecidability/verification.tex @@ -49,7 +49,7 @@ $!T(M, w)$ is true: its domain will be $\Nat$, and the interpretation of all the $\Obj Q_q$ and $\Obj S_\sigma$ will be given by the configurations of~$M$ during a run on input~$w$. So, e.g., -$\Sat{M}{\Obj Q_q(\num{m}, \num{n})}$ iff $T$, when run on input~$w$ +$\Sat{M}{\Obj Q_q(\num{m}, \num{n})}$ iff $M$, when run on input~$w$ for $n$ steps, is in state~$q$ and scanning square~$m$. Now since $!T(M, w) \Entails !E(M, w)$ by hypothesis, and since $\Sat{M}{!T(M, w)}$ by construction, $\Sat{M}{!E(M, w)}$. But $\Sat{M}{!E(M, w)}$ @@ -66,9 +66,9 @@ \] where $q$ is the state of $M$ at time~$n$, $M$ is scanning square~$m$ at time~$n$, square~$i$ contains symbol~$\sigma_i$ at time~$n$ for $0 -\le i \le k$ and $k$ is the right-most non-blank square of the tape at -time~$0$, or the right-most square the tape head has visited after $n$ -steps, whichever is greater. +\le i \le k$ and $k$ is the greater of the length of the full input +word~$w$ and the right-most square the tape head has visited up to time~$n$ +(including its initial position~$1$). \end{defn} \begin{lem}\ollabel{lem:halt-config-implies-halt} @@ -92,10 +92,10 @@ \lexists[x][\lexists[y][(\bigvee_{\tuple{q, \sigma} \in X}(\Obj Q_q(x, y) \land \Obj S_\sigma(x, y)))]] \] -since $\Obj Q_{q'}(\num{m}, \num{n}) \land S_{\sigma'}(\num{m}, -\num{n}) \Entails \bigvee_{\tuple{q, \sigma} \in X} (\Obj Q_q(\num{m}, -\num{n}) \land \Obj S_{\sigma}(\num{m}, \num{n}))$, as -$\tuple{q',\sigma'} \in X$. +since $\Obj Q_q(\num{m}, \num{n}) \land \Obj S_\sigma(\num{m}, +\num{n}) \Entails \bigvee_{\tuple{q', \sigma'} \in X} (\Obj Q_{q'}(\num{m}, +\num{n}) \land \Obj S_{\sigma'}(\num{m}, \num{n}))$, as +$\tuple{q,\sigma} \in X$. \end{proof} \begin{explain} @@ -106,20 +106,25 @@ \begin{lem} \ollabel{lem:config} -For each $n$, if $M$ has not halted after $n$ steps, $!T(M, w) +For each $n$, if $M$ has not halted before the $n$th step, $!T(M, w) \Entails !C(M, w, n)$. \end{lem} \begin{proof} -Induction basis: If $n = 0$, then the conjuncts of $!C(M, w, 0)$ are -also conjuncts of $!T(M, w)$, so entailed by it. +Induction basis: If $n = 0$ and $w$ is nonempty, the conjuncts of +$!C(M, w, 0)$ are conjuncts of $!T(M, w)$. If $w$ is empty, then +$k=1$. The input tail axiom and $\num{0}<\num{1}$ give +$\Obj S_\TMblank(\num{1},\num{0})$. Transitivity gives +$\num{1} 0$ and after $n$ steps, $M$ started on $w$ is in +Suppose after $n$ steps, $M$ started on $w$ is in state~$q$ scanning square~$m$. Since $M$ does not halt after~$n$ steps, there must be an instruction of one of the following three forms in the program of~$M$: @@ -162,8 +167,8 @@ \intertext{We now get} & \Obj Q_{q'}(\num{m}', \num{n}') \land \Obj S_{\sigma'}(\num{m}, \num{n}') \land {}\\ -& \qquad\Obj S_{\sigma_0}(\num{0}, \num{n}') \land \dots \land - \Obj S_{\sigma_k}(\num{k}, \num{n}') \land {}\\ +& \qquad\bigwedge_{\substack{0\leq i\leq k\\ i\neq m}} + \Obj S_{\sigma_i}(\num{i}, \num{n}') \land {}\\ & \qquad \lforall[x][(\num{k} < x \lif \Obj S_\TMblank(x, \num{n}'))] \end{align*} as follows: The first line comes directly from the consequent of the @@ -204,10 +209,10 @@ & \lforall[x][\lforall[y][((\Obj Q_{q}(x', y) \land \Obj S_{\sigma}(x', y)) \lif {}]]\\ & \qquad (\Obj Q_{q'}(x, y') \land \Obj - S_{\sigma'}(x', y') \land !A(x, y))) \land {}\\ -& \lforall[y][((\Obj Q_{q_i}(\num{0}, y) \land \Obj S_{\sigma}(\num{0}, + S_{\sigma'}(x', y') \land !A(x', y))) \land {}\\ +& \lforall[y][((\Obj Q_q(\num{0}, y) \land \Obj S_{\sigma}(\num{0}, y)) \lif {}]\\ -& \qquad (\Obj Q_{q_j}(\num{0}, y') \land \Obj S_{\sigma'}(\num{0}, y') +& \qquad (\Obj Q_{q'}(\num{0}, y') \land \Obj S_{\sigma'}(\num{0}, y') \land !A(\num{0}, y))) \intertext{is a conjunct of $!T(M,w)$. If $m>0$, then let $l = m - 1$ (i.e., $m = l+1$). The first conjunct of the above !!{sentence} @@ -215,17 +220,17 @@ & (\Obj Q_{q}(\num{l}', \num{n}) \land \Obj S_{\sigma}(\num{l}', \num{n})) \lif {} \\ & \qquad (\Obj Q_{q'}(\num{l}, \num{n}') \land \Obj S_{\sigma'}(\num{l}', -\num{n}') \land !A(\num{l}, \num{n})) +\num{n}') \land !A(\num{l}', \num{n})) \intertext{Otherwise, let $l = m = 0$ and consider the following !!{sentence} entailed by the second conjunct:} -& ((\Obj Q_{q_i}(\num{0}, \num{n}) \land \Obj S_{\sigma}(\num{0}, \num{n})) \lif {}\\ -& \qquad (\Obj Q_{q_j}(\num{0}, \num{n}') \land \Obj S_{\sigma'}(\num{0}, \num{n}') \land +& ((\Obj Q_q(\num{0}, \num{n}) \land \Obj S_{\sigma}(\num{0}, \num{n})) \lif {}\\ +& \qquad (\Obj Q_{q'}(\num{0}, \num{n}') \land \Obj S_{\sigma'}(\num{0}, \num{n}') \land !A(\num{0}, \num{n}))) \intertext{Either sentence implies} & \Obj Q_{q'}(\num{l}, \num{n}') \land \Obj S_{\sigma'}(\num{m}, \num{n}') \land {}\\ -&\qquad \Obj S_{\sigma_0}(\num{0}, \num{n}')\land \dots \land - \Obj S_{\sigma_k}(\num{k}, \num{n}') \land {} \\ +&\qquad \bigwedge_{\substack{0\leq i\leq k\\ i\neq m}} + \Obj S_{\sigma_i}(\num{i}, \num{n}') \land {} \\ & \qquad \lforall[x][(\num{k} < x \lif \Obj S_\TMblank(x, \num{n}'))] \end{align*} @@ -245,8 +250,9 @@ \begin{prob} Give !!a{derivation} of $\Obj S_{\sigma_i}(\num{i}, \num{n}')$ from -$\Obj S_{\sigma_i}(\num{i}, \num{n})$ and $!A(m, n)$ (assuming $i \neq -m$, i.e., either $i < m$ or $m < i$). +$\Obj S_{\sigma_i}(\num{i}, \num{n})$ and $!A(\num{m}, \num{n})$, +together with the successor-growth and transitivity axioms for $<$ in +$!T(M,w)$ (assuming $i \neq m$, i.e., either $i