Definition (Church's recursive functions)

The basic functions are

Given $f: \mathbb{N}^k\dashrightarrow \N$ and $g_1, \ldots, g_k: \N^l \dashrightarrow \N$, the composition of $f$ with $(g_1, \ldots, g_k)$ is $$ \begin{align*} \N^l &\dashrightarrow \N \\ \v n &\mapsto f(g_1(\v n), \ldots, g_k(\v n)). \end{align*} $$

Given $f: \N^k \dashrightarrow \N$ and $g: \N^{k+2}\dashrightarrow \N$, the recursion result of $f$ and $g$ is $$ \begin{align*} h: \N^{k+1} &\dashrightarrow \N \\ (\v n, 0) &\mapsto f(\v n), \\ (\v n, \;n_{k+1}+ 1) &\mapsto g(\v n, \; n_{k+1}, \; h(\v n, n_{k+1})). \end{align*} $$

Given $f: \N^{k+1} \dashrightarrow \N$, the minimisation result of $f$ is $$ \begin{align*} \N^k &\dashrightarrow \N \\ \v n &\mapsto \begin{cases} m, &\text{minimal $m$ such that $f(\v n, m) = 0$}, \\ \uparrow, &\text{if $f(\v n, m) > 0$ for all $m$}. \end{cases} \end{align*} $$

The class of primitive recursive functions is the smallest class of partial functions containing all basic functions that is closed under composition and recursion.

The class of (partial) recursive functions is the smallest class of partial functions containing all basic functions that is closed under composition, recursion and minimisation.