Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Original file line number Diff line number Diff line change
Expand Up @@ -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
\[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions content/computability/computability-theory/complement-ce.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
11 changes: 7 additions & 4 deletions content/computability/computability-theory/complete-ce-sets.tex
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,23 @@
\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}
So, it turns out that all the examples of computably enumerable sets
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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions content/computability/computability-theory/equiv-ce-defs.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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$.}

Expand All @@ -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
Expand Down
14 changes: 7 additions & 7 deletions content/computability/computability-theory/fixed-point-thm.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand All @@ -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
\]
Expand Down
10 changes: 8 additions & 2 deletions content/computability/computability-theory/k-1.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions content/computability/computability-theory/prop-reduce.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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 \\
Expand All @@ -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}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions content/computability/computability-theory/rice-theorem.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions content/computability/computability-theory/s-m-n.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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$
Expand Down
2 changes: 1 addition & 1 deletion content/computability/computability-theory/total.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
19 changes: 10 additions & 9 deletions content/computability/recursive-functions/bounded-minimization.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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)$.
Expand Down Expand Up @@ -45,9 +46,9 @@
\item There is no such~$z<y$ but $R(\vec{x}, y)$ holds, then
$m_R(\vec{x}, y+1) = y$.
\item There is no $z < y+1$ such that $R(\vec{x}, z)$, then
$m_R(\vec{z}, y+1) = y+1$.
$m_R(\vec{x}, y+1) = y+1$.
\end{enumerate}
So we can define $m_R(\vec x, 0)$ by primitive recursion as follows:
So we can define $m_R$ by primitive recursion as follows:
\begin{align*}
m_R(\vec{x}, 0) & = 0\\
m_R(\vec{x}, y+1) & =
Expand Down
4 changes: 2 additions & 2 deletions content/computability/recursive-functions/composition.tex
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
If $f$ and all $g_i$ are computable, so is $h$: To compute $h(x_0,
\dots, x_{n-1})$, first compute the values $y_i = g_i(x_0, \dots,
x_{n-1})$ for each $i = 0$, \dots,~$k-1$. Then feed these values into
$f$ to compute $h(x_0, \dots, x_{k-1}) = f(y_0, \dots, y_{k-1})$.
$f$ to compute $h(x_0, \dots, x_{n-1}) = f(y_0, \dots, y_{k-1})$.

This may seem like an overly restrictive characterization of what
happens when we compute a new function using some existing ones. For
Expand All @@ -35,7 +35,7 @@
\[
\Proj{n}{i}(x_0, \dots, x_{n-1}) = x_i
\]
The functions~$\Proj{k}{i}$ are called \emph{projection} functions:
The functions~$\Proj{n}{i}$ are called \emph{projection} functions:
$\Proj{n}{i}$ is an $n$-place function. Then $g$ can be defined by
\[
g(x, y, z) = \Succ(\Proj{3}{2}(x, y, z)).
Expand Down
2 changes: 1 addition & 1 deletion content/computability/recursive-functions/examples.tex
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
primitive recursive since they can be defined from $\Zero$ and $\Succ$
by successive composition. This is useful when we want to use
constants in primitive recursive definitions, e.g., if we want to
define the function $f(x) = 2 \cdot x$ can obtain it by composition
define the function $f(x) = 2 \cdot x$ we can obtain it by composition
from $\fn{const}_n(x)$ and multiplication as $f(x) =
\Mult(\fn{const}_2(x), \Proj{1}{0}(x))$. We'll make use of this trick
from now on.
Expand Down
10 changes: 5 additions & 5 deletions content/computability/recursive-functions/non-pr-functions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@
notations. We can assign a natural number $\#(F)$ to each notation $F$,
recursively, as follows:
\begin{eqnarray*}
\#(0) & = & \langle 0 \rangle \\
\#(S) & = & \langle 1 \rangle \\
\#(\Zero) & = & \langle 0 \rangle \\
\#(\Succ) & = & \langle 1 \rangle \\
\#(\Proj{n}{i}) & = & \langle 2, n, i \rangle \\
\#(\fn{Comp}_{k,l}[H,G_0,\dots,G_{k-1}]) & = & \langle
3,k,l,\#(H),\#(G_0),\dots,\#(G_{k-1}) \rangle \\
\#(\fn{Rec}_l[G,H]) & = & \langle 4, l, \#(G), \#(H) \rangle
\end{eqnarray*}
Here we are using the fact that every sequence of numbers can be viewed
as a natural number, using the codes from the last section. The upshot
is that every code is assigned a natural number. Of course, some
is that every notation is assigned a natural-number code. Of course, some
sequences (and hence some numbers) do not correspond to notations; but
we can let $f_i$ be the unary primitive recursive function with
notation coded as $i$, if $i$ codes such a notation; and the constant
Expand All @@ -67,8 +67,8 @@
(In fact, some functions, like the constant zero function, will appear
more than once on the list. This is not just an artifact of our
coding, but also a result of the fact that the constant zero function has
more than one notation. We will later see that one can not computably
avoid these repetitions; for example, there is no computable function
more than one notation. We will later see that one cannot computably
decide which notations represent the same function; for example, there is no computable function
that decides whether or not a given notation represents the constant
zero function.)

Expand Down
2 changes: 1 addition & 1 deletion content/computability/recursive-functions/pr-relations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
\begin{enumerate}
\item The equality relation, $x = y$, defined by $\fn{IsZero}(\left|x -
y\right|)$
\item The less-than relation, $x \leq y$, defined by $\fn{IsZero}(x
\item The less-than-or-equal relation, $x \leq y$, defined by $\fn{IsZero}(x
\tsub y)$
\end{enumerate}

Expand Down
Loading
Loading