Cite

This course has no released version yet: the text at this address may change. Cite a released version when one exists.

/courses/fundamentals/ce-sets
@misc{fundamentals-ce-sets,
  title = {{Computably enumerable sets}},
  howpublished = {Lesson 4 of \emph{Fundamentals of computability}, Computability Theory course notes},
  url = {/courses/fundamentals/ce-sets},
  note = {Unreleased working version}
}

To cite a single statement, use the # link that appears next to its heading.

Lesson 4 of 6

Computably enumerable sets

Characterizations of the computably enumerable sets, closure properties, the graph and selection theorems, and the m-completeness of the halting set.

45 min8 questions
Before this lesson:The halting problem
Fundamentals of computability · lesson 4 of 6
  1. Programs as numbers
  2. The universal function and the SMN theorem
  3. The halting problem
  4. Computably enumerable sets
  5. Kleene's fixed point theorem
  6. Rice's theorem

The halting set is not computable, but membership in it can be confirmed: if Φe(e) ⁣ ⁣↓\Phi_e(e)\converge, simulating the computation eventually establishes it. Sets with this property are the computably enumerable sets. They are the sets that an algorithm can list, the domains of partial computable functions, and the projections of computable relations. Examples outside computability theory include the set of theorems of a computably axiomatized theory, and the set of solvable Diophantine equations. This lesson proves the equivalence of these descriptions, the closure properties of the class, and the fact that the halting set is the hardest computably enumerable set.

4.1 Definition and characterizations

Definition 4.1.#

The ee-th computably enumerable set is We=dom(Φe)={x:Φe(x) ⁣ ⁣↓}W_e = \mathrm{dom}(\Phi_e) = \{ x : \Phi_e(x)\converge \}. A set A⊆NA \subseteq \nat is computably enumerable, or c.e., if A=WeA = W_e for some ee. Its approximation at stage ss is We[s]={x:Φe(x)[s] ⁣ ⁣↓}W_e[s] = \{ x : \Phi_e(x)[s]\converge \}.

Older texts say recursively enumerable, or r.e. By the conventions on stages (Definition 1.3), We[s]W_e[s] is a finite subset of {0,…,s−1}\{0, \dots, s - 1\}, computable from ee and ss, and We[0]⊆We[1]⊆⋯W_e[0] \subseteq W_e[1] \subseteq \cdots with ⋃sWe[s]=We\bigcup_s W_e[s] = W_e.

Definition 4.2.#

A c.e. approximation of a set AA is a uniformly computable sequence of sets A0⊆A1⊆A2⊆⋯A_0 \subseteq A_1 \subseteq A_2 \subseteq \cdots with ⋃sAs=A\bigcup_s A_s = A.

A relation R⊆NkR \subseteq \nat^k is c.e. if the set {⟨x1,…,xk⟩:x⃗∈R}\{ \langle x_1, \dots, x_k \rangle : \vec x \in R \} is.

Theorem 4.3.#

For every A⊆NA \subseteq \nat, the following are equivalent.

  1. AA is computably enumerable.
  2. A={x:∃y R(x,y)}A = \{ x : \exists y\ R(x, y) \} for some computable relation R⊆N2R \subseteq \nat^2.
  3. A=∅A = \emptyset, or AA is the range of a total computable function.
  4. AA is the range of a partial computable function.
  5. AA has a c.e. approximation.

Moreover, in item 2 the relation RR can be taken primitive recursive.

Proof of Theorem 4.3.

(1 ⇒ 2) If A=WeA = W_e, then x∈A  ⟺  ∃s Φe(x)[s] ⁣ ⁣↓x \in A \iff \exists s\ \Phi_e(x)[s]\converge, and the relation Φe(x)[s] ⁣ ⁣↓\Phi_e(x)[s]\converge of xx and ss is primitive recursive (Proposition 1.4).

(2 ⇒ 3) Suppose A≠∅A \neq \emptyset and fix a∈Aa \in A. Let f(n)=π0(n)f(n) = \pi_0(n) if R(π0(n),π1(n))R(\pi_0(n), \pi_1(n)), and f(n)=af(n) = a otherwise. This ff is total computable, its values lie in AA, and every x∈Ax \in A is a value: if R(x,y)R(x, y), then x=f(⟨x,y⟩)x = f(\langle x, y \rangle).

(3 ⇒ 4) A total function is partial, and ∅\emptyset is the range of the nowhere defined function.

(4 ⇒ 1) Let AA be the range of Φi\Phi_i. The partial function g(x)≃μn [Φi(π0(n))[π1(n)] ⁣ ⁣↓=x]g(x) \simeq \mu n\ [\Phi_i(\pi_0(n))[\pi_1(n)]\converge = x] is partial computable, by Proposition 1.6 and Proposition 1.4. It is defined if and only if Φi(y) ⁣ ⁣↓=x\Phi_i(y)\converge = x for some yy, that is, if and only if x∈Ax \in A. So A=dom(g)A = \mathrm{dom}(g) is c.e.

(1 ⇒ 5) If A=WeA = W_e, the sequence (We[s])s(W_e[s])_s is a c.e. approximation.

(5 ⇒ 2) If (As)(A_s) is a c.e. approximation, then x∈A  ⟺  ∃s x∈Asx \in A \iff \exists s\ x \in A_s, and the relation x∈Asx \in A_s is computable.

Item 2 says that the c.e. sets are the sets definable by an existential quantifier over a computable relation: they are the Σ10\Sigma^0_1 sets of the arithmetic hierarchy. Item 3 justifies the name: a non-empty c.e. set is listed, possibly with repetitions, by an algorithm f(0),f(1),f(2),…f(0), f(1), f(2), \dots. The proof of (2 ⇒ 3) runs through all pairs (x,y)(x, y) in the order of the pairing function, which interleaves the searches for witnesses of all xx at once. This technique is called dovetailing: running the searches one after the other would fail, since the search for a witness of some x∉Ax \notin A never ends.

Proposition 4.4.#

An infinite set AA is computably enumerable if and only if it is the range of an injective total computable function.

Proof of Proposition 4.4.

The range of a total computable function is c.e. by Theorem 4.3. Conversely, let ff be total computable with range AA. Define g(0)=f(0)g(0) = f(0), and g(n+1)=f(mn+1)g(n+1) = f(m_{n+1}), where mn+1m_{n+1} is the least mm with f(m)∉{g(0),…,g(n)}f(m) \notin \{ g(0), \dots, g(n) \}. The search terminates since AA is infinite, so gg is total computable, and it is injective by construction. Let m0=0m_0 = 0. By induction on nn, {f(0),…,f(mn)}={g(0),…,g(n)}\{ f(0), \dots, f(m_n) \} = \{ g(0), \dots, g(n) \}: the values f(m)f(m) for mn<m<mn+1m_n < m < m_{n+1} are already listed, by minimality of mn+1m_{n+1}. Hence m0<m1<⋯m_0 < m_1 < \cdots, and every value of ff is a value of gg.

4.2 Closure properties

Proposition 4.5.#
  1. If AA and BB are c.e., so are A∪BA \cup B and A∩BA \cap B.
  2. If R⊆Nk+1R \subseteq \nat^{k+1} is c.e., so is its projection {x⃗:∃y R(x⃗,y)}\{ \vec x : \exists y\ R(\vec x, y) \}.
  3. If R⊆Nk+1R \subseteq \nat^{k+1} is c.e., so is {(x⃗,y):∀z<y R(x⃗,z)}\{ (\vec x, y) : \forall z < y\ R(\vec x, z) \}.
  4. If AA is c.e. and ff is partial computable, then f−1(A)={x:f(x) ⁣ ⁣↓∈A}f^{-1}(A) = \{ x : f(x)\converge \in A \} and f(A)={f(x):x∈A, f(x) ⁣ ⁣↓}f(A) = \{ f(x) : x \in A,\ f(x)\converge \} are c.e.
Proof of Proposition 4.5.

By Theorem 4.3, write each c.e. set or relation as the projection of a computable relation, using a c.e. approximation for item 3.

  1. If x∈A  ⟺  ∃s P(x,s)x \in A \iff \exists s\ P(x, s) and x∈B  ⟺  ∃t Q(x,t)x \in B \iff \exists t\ Q(x, t), then x∈A∪B  ⟺  ∃s (P(x,s)∨Q(x,s))x \in A \cup B \iff \exists s\ (P(x, s) \vee Q(x, s)), and x∈A∩B  ⟺  ∃n (P(x,π0(n))∧Q(x,π1(n)))x \in A \cap B \iff \exists n\ (P(x, \pi_0(n)) \wedge Q(x, \pi_1(n))).
  2. If R(x⃗,y)  ⟺  ∃s Q(x⃗,y,s)R(\vec x, y) \iff \exists s\ Q(\vec x, y, s), then ∃y R(x⃗,y)  ⟺  ∃n Q(x⃗,π0(n),π1(n))\exists y\ R(\vec x, y) \iff \exists n\ Q(\vec x, \pi_0(n), \pi_1(n)).
  3. Let (Rs)(R_s) be a c.e. approximation of RR. Then ∀z<y R(x⃗,z)\forall z < y\ R(\vec x, z) holds if and only if ∃s ∀z<y Rs(x⃗,z)\exists s\ \forall z < y\ R_s(\vec x, z). Indeed, if each z<yz < y has a stage szs_z with Rsz(x⃗,z)R_{s_z}(\vec x, z), then s=max⁡z<yszs = \max_{z < y} s_z works since the approximation is increasing; the converse is clear. The relation ∀z<y Rs(x⃗,z)\forall z < y\ R_s(\vec x, z) of x⃗,y,s\vec x, y, s is computable, by bounded quantification (Proposition 1.6).
  4. Let f=Φif = \Phi_i and let (As)(A_s) be a c.e. approximation of AA. Then x∈f−1(A)  ⟺  ∃s (Φi(x)[s] ⁣ ⁣↓∧Φi(x)[s]∈As)x \in f^{-1}(A) \iff \exists s\ (\Phi_i(x)[s]\converge \wedge \Phi_i(x)[s] \in A_s), and y∈f(A)  ⟺  ∃x ∃s (x∈As∧Φi(x)[s] ⁣ ⁣↓=y)y \in f(A) \iff \exists x\, \exists s\ (x \in A_s \wedge \Phi_i(x)[s]\converge = y); both are projections of computable relations.

The c.e. sets are not closed under complement, and the relations they define are not closed under unbounded universal quantification: e∉∅′  ⟺  ∀s Φe(e)[s] ⁣ ⁣↑e \notin \emptyset' \iff \forall s\ \Phi_e(e)[s]\diverge, and the next section shows that N∖∅′\nat \setminus \emptyset' is not c.e.

4.3 The graph and selection theorems

Proposition 4.6 (Selection).#

For every c.e. relation R⊆N2R \subseteq \nat^2, there is a partial computable function gg with dom(g)={x:∃y R(x,y)}\mathrm{dom}(g) = \{ x : \exists y\ R(x, y) \} and R(x,g(x))R(x, g(x)) for every x∈dom(g)x \in \mathrm{dom}(g).

Proof of Proposition 4.6.

Write R(x,y)  ⟺  ∃s Q(x,y,s)R(x, y) \iff \exists s\ Q(x, y, s) with QQ computable, and let g(x)≃π0(μn Q(x,π0(n),π1(n)))g(x) \simeq \pi_0\big(\mu n\ Q(x, \pi_0(n), \pi_1(n))\big). The search terminates exactly when some pair (y,s)(y, s) satisfies Q(x,y,s)Q(x, y, s), that is, when ∃y R(x,y)\exists y\ R(x, y), and then g(x)=yg(x) = y for such a pair, so that R(x,g(x))R(x, g(x)).

The function gg selects a witness yy for each xx, namely the first one found by the dovetailed search. In general, it is not the least witness: finding the least yy with R(x,y)R(x, y) would require knowing that smaller yy are not witnesses, which is not confirmed at any finite stage.

Proposition 4.7 (Graph theorem).#

A partial function f:N⇀Nf : \nat \rightharpoonup \nat is partial computable if and only if its graph is c.e.

Proof of Proposition 4.7.

If f=Φef = \Phi_e, its graph is {(x,y):∃s Φe(x)[s] ⁣ ⁣↓=y}\{ (x, y) : \exists s\ \Phi_e(x)[s]\converge = y \}, c.e. by Theorem 4.3. Conversely, if the graph GG of ff is c.e., apply Proposition 4.6 to GG: the function gg has domain dom(f)\mathrm{dom}(f) and satisfies G(x,g(x))G(x, g(x)), that is, g(x)=f(x)g(x) = f(x), since GG is the graph of a function.

4.4 Computable and c.e. sets

Proposition 4.8.#

A set AA is computable if and only if both AA and N∖A\nat \setminus A are computably enumerable.

Proof of Proposition 4.8.

If AA is computable, A={x:∃y χA(x)=1}A = \{ x : \exists y\ \chi_A(x) = 1 \} is the projection of a computable relation (with a dummy variable), hence c.e.; and N∖A\nat \setminus A is computable as well.

Conversely, let A=WaA = W_a and N∖A=Wb\nat \setminus A = W_b. On input xx, search for the least ss such that x∈Wa[s]x \in W_a[s] or x∈Wb[s]x \in W_b[s], and output 11 in the first case, 00 in the second. The search terminates, since xx belongs to one of the two sets and hence appears in its approximation at some stage; the two cases do not overlap, since the sets are disjoint. So this algorithm computes χA\chi_A.

Theorem 4.9.#

The halting set ∅′\emptyset' is computably enumerable, and its complement N∖∅′\nat \setminus \emptyset' is not.

Proof of Theorem 4.9.

∅′={e:∃s Φe(e)[s] ⁣ ⁣↓}\emptyset' = \{ e : \exists s\ \Phi_e(e)[s]\converge \} is c.e. If its complement were c.e., then ∅′\emptyset' would be computable by Proposition 4.8, contradicting Theorem 3.2.

So the computable sets form a proper subclass of the c.e. sets, and the c.e. sets are not closed under complement. A set whose complement is c.e. is called co-c.e.

4.5 The halting set is m-complete

Proposition 4.10.#

If A≤mBA \leq_m B and BB is c.e., then AA is c.e.

If ff reduces AA to BB, then A=f−1(B)A = f^{-1}(B), which is c.e. by Proposition 4.5.

Definition 4.11.#

A c.e. set AA is m-complete if B≤mAB \leq_m A for every c.e. set BB.

Theorem 4.12.#

The halting set ∅′\emptyset' is m-complete.

Proof of Theorem 4.12.

Let B=WaB = W_a. By Corollary 2.3, there is a total computable ff such that Φf(x)(y)≃Φa(x)\Phi_{f(x)}(y) \simeq \Phi_a(x) for all xx and yy: the program f(x)f(x) ignores its input and runs Φa\Phi_a on xx. Then

x∈B  ⟺  Φa(x) ⁣ ⁣↓  ⟺  Φf(x)(f(x)) ⁣ ⁣↓  ⟺  f(x)∈∅′,x \in B \iff \Phi_a(x)\converge \iff \Phi_{f(x)}(f(x))\converge \iff f(x) \in \emptyset',

so ff reduces BB to ∅′\emptyset'.

Corollary 4.13.#
  1. A c.e. set AA is m-complete if and only if ∅′≤mA\emptyset' \leq_m A. The sets HH, {e:Φe(0) ⁣ ⁣↓}\{ e : \Phi_e(0)\converge \} and {e:We≠∅}\{ e : W_e \neq \emptyset \} are m-complete.
  2. Neither Tot={e:Φe is total}\mathrm{Tot} = \{ e : \Phi_e \text{ is total} \} nor its complement is c.e.
Proof of Corollary 4.13.
  1. If AA is m-complete, then ∅′≤mA\emptyset' \leq_m A since ∅′\emptyset' is c.e. (Theorem 4.9). Conversely, if ∅′≤mA\emptyset' \leq_m A, every c.e. set reduces to ∅′\emptyset' by Theorem 4.12, hence to AA by transitivity. The three sets are c.e., since ⟨e,x⟩∈H  ⟺  ∃s Φe(x)[s] ⁣ ⁣↓\langle e, x \rangle \in H \iff \exists s\ \Phi_e(x)[s]\converge and We≠∅  ⟺  ∃n Φe(π0(n))[π1(n)] ⁣ ⁣↓W_e \neq \emptyset \iff \exists n\ \Phi_e(\pi_0(n))[\pi_1(n)]\converge, and ∅′\emptyset' reduces to them by Proposition 3.5.
  2. By Proposition 3.5, N∖∅′≤mTot\nat \setminus \emptyset' \leq_m \mathrm{Tot}, and ∅′≤mTot\emptyset' \leq_m \mathrm{Tot}, which gives N∖∅′≤mN∖Tot\nat \setminus \emptyset' \leq_m \nat \setminus \mathrm{Tot}. If Tot\mathrm{Tot} or its complement were c.e., then N∖∅′\nat \setminus \emptyset' would be c.e. by Proposition 4.10, contradicting Theorem 4.9.

Post asked in 1944 whether every c.e. set that is not computable is m-complete, or at least as hard as ∅′\emptyset' in a weaker sense. For m-reducibility he answered negatively himself, with the simple sets; for Turing reducibility the question, known as Post’s problem, was solved by Friedberg and Muchnik with the priority method. These results are the subject of later courses.

4.6 Exercises

Exercise 4.14 ★.

An infinite set AA is enumerable in increasing order if A=f(N)A = f(\nat) for some total computable ff with f(n)<f(n+1)f(n) < f(n+1) for all nn. Show that an infinite set is computable if and only if it is enumerable in increasing order.

Solution

If AA is infinite and computable, its principal function pAp_A (Lemma 3.2 of “Countable sets”) is computable, by pA(0)=μx (x∈A)p_A(0) = \mu x\, (x \in A) and pA(n+1)=μx (x>pA(n)∧x∈A)p_A(n+1) = \mu x\, (x > p_A(n) \wedge x \in A), and it enumerates AA in increasing order. Conversely, to decide whether x∈Ax \in A, compute f(0),f(1),…f(0), f(1), \dots until a value greater than xx appears, which happens since f(n)≥nf(n) \geq n; then x∈Ax \in A if and only if xx is among the values computed, since later values are larger.

Exercise 4.15 ★.

Show that every infinite c.e. set contains an infinite computable subset.

Solution

Let ff be a total computable function with range AA. Let g(0)=f(0)g(0) = f(0), and g(n+1)=f(m)g(n+1) = f(m) for the least mm with f(m)>g(n)f(m) > g(n), which exists since AA is infinite. Then gg is total computable and strictly increasing, and its range is an infinite subset of AA, computable by the previous exercise.

Exercise 4.16 ★★.

(Reduction principle.) Show that for all c.e. sets AA and BB, there are disjoint c.e. sets A′⊆AA' \subseteq A and B′⊆BB' \subseteq B with A′∪B′=A∪BA' \cup B' = A \cup B.

Solution

Fix c.e. approximations (As)(A_s) and (Bs)(B_s). For x∈A∪Bx \in A \cup B, let sxs_x be the least ss with x∈As∪Bsx \in A_s \cup B_s. Let A′={x:x∈Asx}A' = \{ x : x \in A_{s_x} \} and B′={x:x∉Asx and x∈Bsx}B' = \{ x : x \notin A_{s_x} \text{ and } x \in B_{s_x} \}: an element is assigned to the set in which it appears first, with priority to AA in case of a tie. Both sets are c.e., since x∈A′  ⟺  ∃s (x∈As∧∀t<s x∉At∪Bt)x \in A' \iff \exists s\ (x \in A_s \wedge \forall t < s\ x \notin A_t \cup B_t), and similarly for B′B'. They are disjoint, contained in AA and BB respectively, and every x∈A∪Bx \in A \cup B belongs to one of them.

Exercise 4.17 ★★.

Show that the set {e:We is infinite}\{ e : W_e \text{ is infinite} \} is neither c.e. nor co-c.e.

Hint

Use the two reductions of Exercise 3.8.

Solution

By Exercise 3.8, ∅′\emptyset' and N∖∅′\nat \setminus \emptyset' both reduce to this set. As in the proof of Corollary 4.13, if the set or its complement were c.e., then N∖∅′\nat \setminus \emptyset' would be c.e.

4.7 Notes and references

Computably enumerable sets were introduced in the 1930s, in the work of Church, Kleene and Post on recursive functions; Post’s paper of 1944 made them a subject of study in their own right, introduced many-one and one-one reducibility, the notion of complete set, and simple sets. The selection theorem is due to Kleene. Soare’s textbook is the standard reference for the theory of c.e. sets.

  • E. L. Post, Recursively enumerable sets of positive integers and their decision problems, Bulletin of the American Mathematical Society 50 (1944), 284–316.
  • S. C. Kleene, Introduction to Metamathematics, North-Holland, 1952.
  • R. I. Soare, Recursively Enumerable Sets and Degrees, Springer, 1987.