[Math] Computable functions’ set is countable

computabilityproof-writing

I have to prove that computable functions (by computable we mean recursive functions or functions calculated by a program with a register machine) are countable. Let $\mathcal{C}$ be the set of computable $\mathbb{N} \to \mathbb{N}$ functions

$|\mathcal{C}|\geq\omega$. Well, this is trivial because we can consider functions of the kind $n \mapsto (s\circ\cdots \circ s)(n)$ where $s$ is the successor function; these maps are trivially computable and there are $\omega$ of them.

$|\mathcal{C}|\leq\omega$. We know that (I will not go in deeper details, but it can be done!) starting from a natural $j$, we can find a program $p_j$ tha computes a recursive function. Note that there are several programs computing the same function. In turn, we can consider a computable function $f$ and, since there is an entire class of programs that calculate $f$, we can map $f$ tho the minumum program index $j$ of a program that computes $f$. So we have an injective function between $\mathcal{C}$ and $\mathbb{N}$. QED

Is thi proof correct?

Best Answer

I think the proof to show that that the set of computable function is countable is far more basic than what you have above.

All partial computable functions can be enumerated by natural numbers. This is essentially the existence of the universal Turing Machine. Hence there are only countably many partial computable functions. The total computable functions are just those partial computable functions that happen to be totally defined. Hence the total computable functions are a subset of the countable set of partial computable functions. Subset of countable sets are countable.

Related Question