Proof (computably enumerable iff range of partial computable function)

If $X$ is computably enumerable, then $$ \begin{align*} n \mapsto \begin{cases} n, &\text{if $n\in X$}, \\ \uparrow, &\text{otherwise} \end{cases} \end{align*} $$ is a partial computable function:

  1. Copy $R_1$ to an unused register $R_n$.

  2. Run $ψ_X(n)$.

  3. If it halts, move $R_n$ back to $R_1$.

Conversely if $X$ is the range of a partial computable function $f: \N^k \dashrightarrow \N$, given $x\in \N$, run a zig-zag to execute $f(\v n)$ for all $\v n\in \N^k$. When the computation of any $f(\v n)$ terminates, check if $f(\v n) = x$. If so, halt and output $1$, and otherwise return to the zig-zag.