Intuitive Computability

We have an intuitive, preformal notion of a definite procedure. A definite procedure is supposed to be a specification of a process such that if the process is carried out in accordance with the procedure, it will always be fully determined what to do next. The notion is taken to rule out, for example, flipping coins. The notion is independent of practical constraints: The following can be made into a perfectly good procedure: First write down 1, then write down 2, and so forth.

If we try to give a cogent philosophical analysis of what it means to abstract from practical limitations, we run into trouble. But, this is a math class, and we all know what I'm talking about. End of story.

Here is a kind of procedure I want to avoid: Turn on a light switch, wait one second, turn it off, wait one-half second turn it on, wait one-quarter second, turn it off, ... . This leads to a problem which (unfortunately) has been much discussed: is the light on or off at the end of two seconds?

For our purposes, procedures will mean quantized procedures: each step takes one unit, each symbol occupies one unit, we don't care what the units are.

Since we are doing mathematics, the only kinds of procedures we'll in fact be interested in are ones that involve manipulating symbols. Since the idea is supposed to be that a procedure is something a person can (ignoring medical limitations) carry out, I'll often act as if symbols are concrete tokens, for example written on paper. In fact, though, our descriptions will be completely abstract in the mathematical sense that any isomorphic version would work equally well.

It is procedures in this sense that are widely believed to coincide (in a sense I'll talk about later) with the mathematical class of recursive procedures that we'll define soon and discuss for most of the semester. However, the interest of a lot of the results lies in the belief that they apply not just to recursive procedures, but to all computable procedures.

We have lots of procedures surrounding mathematics: deciding whether a natural number is prime, multiplying, extracting square roots, listing the primes,... .

These procedures, though we speak loosely of them as procedures involving numbers, in fact involve procedure manipulating two-dimensional arrays of digits and spaces.

Sometimes we use procedures that have inputs, sometimes we use procedures that don't, sometimes we use procedures that result in a string, some procedures result in decisions, some stop, some do not (counting), and so it is useful to characterize various things we use procedures for. It is those things that we are usually interested in, not procedures in themselves.

Definition. Let $\mathcal{A}$ be an alphabet (a finite set of symbols), $W$ a set of words over the alphabet ($W\subset \mathcal{A}^*$), and $\mathcal{P}$ a procedure.
(a) $\mathcal{P}$ is a decision procedure for $W$ if, given any input from $\mathcal{A}^*$ it stops with output $\box$ if the input is in $W$ and with some other output otherwise.
(b) A set $W$ is decidable if there is a decision procedure for it.

Definition. Let $\mathcal{A}$ be an alphabet (a finite set of symbols), $W$ a set of words over the alphabet ($W\subset \mathcal{A}^*$), and $\mathcal{P}$ a procedure.
(a) $\mathcal{P}$ is an enumeration procedure $W$ if $\mathcal{P}$ has every member of $W$ in its output and nothing else. (b) $W$ is enumerable if there is an enumeration procedure that enumerates it.

Basic fact about enumerability: for any alphabet, the set of all words on the alphabet is enumerable (even for a countably infinite alphabet).

It follows that if a set is decidable, it is enumerable: Just list every word, test it, if it is in the set, output it.

The complement of any decidable set is also enumerable: list every word, test it, if it is not in the set, output it.

Is every enumerable set decidable? Answer: no, but proving that will be the main result of the semester.

A set is decidable if and only if both it and its complement are enumerable. Proof:
$\Rightarrow$: Done above.
$\Leftarrow$: Given a word, enumerate both the set and its complement. The word will eventually appear in one or the other. Do the obvious thing.

Example: The set of terms of first-order logic is decidable.

First, what are they?

The constant symbols, $c_{0},c_{1},\dots$ are terms. The variables $v_{0},\dots$ are terms. For every function symbol, $f^{n}{}_{m}$, where $m\ge 0$ and $n\ge 1$, followed by $n$ terms is a term.

Decision procedure. Our input is the word $w$. If $w$ has length zero, it is not a term.

If $w$ has length one, and it is a variable, it is a term. If it is a constant, it is a term. Otherwise, it is not a term.

This doesn't work, because there is no decision procdure for whether a symbol is a variable or a constant symbol. Ignore that. We'll patch it up later.

If $w$ is of length greater than one and the first symbol is not a function symbol, then $w$ is not a term. If the first symbol has superscript $n$ and what comes after that symbol is a string of $n$ terms, $w$ is a term, otherwise it is not.

We now have a subsidiary problem: how do we tell if a word is a string of $n$ terms? Take it and divide it up into $n$ pieces in all possible ways, for each way, test whether each piece is a term, ... .

You are, I hope, convinced that there is a procedure to divide up a string into $n$ pieces in all possible ways, since I'm going to postpone doing that.

The more substantial problem is how to recognize variables and constant symbols. We can't, given the problem as formulated. We need a new, finite, alphabet:

\[c,v,f,{}_{0},\dots{}_{9},{}^{0},\dots{}^{9}\]

Homework 1

p. 154, exercise 1.2; p. 156, exercises 1.9, 1.10. Exercise 1.11 is worthwhile, if you have the necessary background, but nothing like it will be discussed in class and nothing like it will appear on exams.

There is one last notion of intuitive computability that we'll need: that of a computable function. It was traditional to take that as the fundamental notion, not enumerable sets, as we'll be doing.

Definition. A function from words on alphabet $\mathcal{A}$ to words on alphabet $\mathcal{B}$ is a computable function if there is a procedure that takes any word $\zeta$ on alphabet $\mathcal{A}$ as input and returns $f(\zeta )$ (and nothing else) as output.

Definition. Let $f$ be a function from words on alphabet $\mathcal{A}$ to words on alphabet $\mathcal{B}$. Let # be a symbol not in either alphabet. The graph of $f$ is the set of words:

\[ \{\zeta \#f(\zeta ) |\zeta\in\mathcal{A}^*\}\]

Theorem. A function is computable iff its graph is enumerable iff its graph is decidable.

Theorem.

  1. A set $W$ is decidable iff its characteristic function ($f(\zeta)=0\Leftrightarrow \zeta\in W$; $f(\zeta)=1\Leftrightarrow \zeta\notin W$) is computable.
  2. A nonempty set $W$ is enumerable iff it is the range of a computable function.

Homework 2

Exercise 1.12, p. 156. -- ProfessorShaughanLavine? - 21 Jan 2005