## 2.4 Effective enumerability

Similar to effective computability and effective decidability, *effective enumerability* describes which sets can be enumerated using a strictly mechanical procedure (such as our Turing machines described in secion 2.2). Now it is easy to imagine a program that enumerates a finite set: it just spits out the elements of the set and then halts. Consider the program:

This program will enumerate the set . But what does it mean to effectively enumerate an infinite set? Consider the program:

We can get an intuitive sense that this program will enumerate the set of all natural numbers, , but can we formalize the notion of a non-terminating program being used to enumerate an infinite set? This isn’t discussed in the book, but I like to think of it as follows:

A program is said to list an element iff there, after some finite number of steps of execution prints out . If lists every element in a set then is said to enumerate . Thus, is effectively enumerable iff there exists a program which enumerates it.

So in our program above, we can now see formally that every element of will be listed after exactly steps (if we ignore steps involved in managing the loop logic.

An interesting fact is that every finite set is enumerable. To observe this, consider a finite set . This set is then enumerable by the program:

Thus, given any finite set, we can in essence simply store every element in the set into memory and spit them out on demand.

## 2.5 Effectively enumerating pairs of numbers

What follows is a useful theorem that we will use time and time again.

**Theorem 2.2: ***The set of ordered pairs of numbers is effectively enumerable.*

*Proof:* Consider a table of ordered pairs of numbers:

We can use a computer to zig-zag through this table (in the order indicated by the arrows) which will eventually arrive at every possible combination. Since the table will be stored somehow in memory, we must generate it on the fly since we can’t operate on an infinite table, but we can make the table of arbitrarily large size and increase it as needed due to the infinite memory capabilities of our idealized computer system. Thus, we have created a program which enumerates the set .

QED

The book mentions that you can explicitly create a computable function that will do this without the use of the table, however it doesn’t go into details and even if it did, this exercise can be quite messy. The way I actually know how to do it doesn’t involve the table at all and actually goes the other way, . It looks like:

You can also define inverse functions such that , but this is complex and involves -calculus which I’m not ready to get into yet.

That wraps up chapter 2. Next time: axiomatized formal theories and why we should care.