Proof (computability of recursive functions)

Partial recursive $\implies$ partial computable

By induction.

Zero function

Successor

Projection

To move register $i$ to register $1$:

Composition

First transfer $R_1, \ldots, R_l$ to $R_{N+1}, \ldots, R_{N+l}$ with $N$ large.

Then for each $1\leq i\leq k$ in turn, copy $R_{N+1}, \ldots, R_{N+l}$ to $R_{k+1, \ldots, R_{k+l}}$, perform $g_i$ with all registers shifted up by $k$, and transfer the answer from $R_{k+1}$ to $R_i$, then clear $R_{k+2}, \ldots, R_N$.

Finally apply $f$.

Recursion

Copy $R_1, \ldots, R_k$ to $R_{N+1}, \ldots, R_{N+k}$. Transfer $R_{k+1}$ to $R_{N+k+2}$ (used to count down the $(k+1)$-th variable) then do $f$.

Minimisation

Partial computable $\implies$ partial recursive

Let $P$ be the program of a partial computable function $f$. We will show that the function $$ \begin{align*} g: \N^{k+2} &\to \N \\ (\v n, i, t) &\mapsto \begin{cases} \text{state} &\text{if $i=0$}, \\ \text{content of $R_i$} &\text{if $i\geq 1$} \end{cases} \quad \text{ at time $t$ of computing $P$ with input $\v n$} \end{align*} $$ is primitive recursive. Then by minimisation and composing with the zero function, $q: \N^{k}\to \N$ which is the minimum time such that $g(\v n, 0, q(\v n)) = 0$ is partial recursive. Therefore $f(\v n) = g(\v n, 1, q(\v n))$ is partial recursive by composition.

Let $M$ be the upper register index of $P$. Encode $P$ as a function $$ \begin{align*} σ: \N^{M+1} &\to \N^{M+1} \\ (\text{old state}, \text{old register content}) &\mapsto (\text{new state}, \text{new register content}), \end{align*} $$ and let $\bar σ:\N\to \N$ be the version using encoded tuples. $\bar σ$ is primitive recursive: $n\mapsto (n)_i$ is primitive recursive, and there are only finitely many instructions in $P$.

Now define by recursion $$ \begin{align*} h: \N^{k+2} &\mapsto \N \\ (k, \v n, 0) &\mapsto 2^{k} 3^{n_1} 5^{n_2} \ldots p_{k+1}^{n_k} \\ (k, \v n, t+1) &\mapsto \bar σ(h(k, \v n, t)). \end{align*} $$ Then $$ \begin{align*} g(\v n, i, t) = (h(1, \v n, t))_i. \end{align*} $$ Since $g(\v n, i, t) = 0$ for all $i>M$, we can write this as $$ \begin{align*} g(\v n, i, t) = \sum_{j=0}^{M} δ_j(i) \,(h(1, \v n, t))_j \end{align*} $$ where $δ_j$ and $(\cdot )_j$ are primitive recursive for each $j$.