[step:Show that every partial recursive function is realised by a recursion tree]
We prove $\mathcal{R} \subseteq \mathcal{T}$ (and simultaneously $\mathcal{PR} \subseteq \mathcal{T}_{\text{pr}}$) by induction on the *construction* of a function $f \in \mathcal{R}$. The class $\mathcal{R}$ (resp. $\mathcal{PR}$) is defined as the smallest class closed under certain operations, which is equivalent to saying every member arises by finitely many applications of those operations to basic functions; we induct on the number of such applications (the *derivation depth*).
*Base case: $f$ is a basic function.* Let $(T_f, \ell_f)$ be the recursion tree consisting of a single leaf labelled $\text{basic}_f$ (which is a valid label because $f$ is one of zero, $s_a$, or $\pi_i^k$). Then $f_{T_f, \ell_f} = f$ by the leaf rule of the tree semantics, so $f \in \mathcal{T}$. The single-leaf tree is primitive-recursive (no $\text{min}$ node), so the same witness also shows $f \in \mathcal{T}_{\text{pr}}$.
*Inductive step: $f$ is obtained by a closure operation.* We split on which closure operation produced $f$.
- *$f$ from composition.* Suppose $f = g \circ (f_1, \ldots, f_m)$ with $g, f_1, \ldots, f_m \in \mathcal{R}$ each having smaller derivation depth than $f$. By the induction hypothesis there exist recursion trees $(T_g, \ell_g)$ and $(T_{f_i}, \ell_{f_i})$ with $f_{T_g, \ell_g} = g$ and $f_{T_{f_i}, \ell_{f_i}} = f_i$. Construct $(T, \ell)$ with a new root $r$ labelled $\text{comp}$, whose outer child subtree is $(T_g, \ell_g)$ and whose $m$ inner children subtrees are $(T_{f_1}, \ell_{f_1}), \ldots, (T_{f_m}, \ell_{f_m})$. By the tree semantics,
\begin{align*}
f_{T, \ell} &= f_{T_g, \ell_g} \circ (f_{T_{f_1}, \ell_{f_1}}, \ldots, f_{T_{f_m}, \ell_{f_m}}) = g \circ (f_1, \ldots, f_m) = f,
\end{align*}
so $f \in \mathcal{T}$. If $g, f_1, \ldots, f_m \in \mathcal{PR}$, then by induction hypothesis each subtree is primitive-recursive, and $(T, \ell)$ is primitive-recursive because the new root carries $\text{comp}$ (not $\text{min}$); hence $f \in \mathcal{T}_{\text{pr}}$.
- *$f$ from primitive recursion.* Suppose $f = h$, where $h$ is defined by primitive recursion from $g \in \mathcal{R}$ and a family $\{g_a : a \in \Sigma\} \subset \mathcal{R}$ of smaller derivation depth. By the induction hypothesis, these functions admit recursion trees $(T_g, \ell_g), (T_{g_a}, \ell_{g_a})$. Construct $(T, \ell)$ with a new root $r$ labelled $\text{rec}$, whose children subtrees are $(T_g, \ell_g)$ and $(T_{g_a}, \ell_{g_a})$ for each $a \in \Sigma$ in fixed order. By the tree semantics, $f_{T, \ell}$ is the function defined from $f_{T_g, \ell_g} = g$ and $f_{T_{g_a}, \ell_{g_a}} = g_a$ by primitive recursion, which is exactly $h = f$. So $f \in \mathcal{T}$. If all inputs are in $\mathcal{PR}$, the subtrees are primitive-recursive, and $(T, \ell)$ remains primitive-recursive because $\text{rec}$ is not $\text{min}$; hence $f \in \mathcal{T}_{\text{pr}}$.
- *$f$ from minimisation.* Suppose $f = \mu g$ for some $g \in \mathcal{R}$ of smaller derivation depth. By the induction hypothesis, $(T_g, \ell_g)$ satisfies $f_{T_g, \ell_g} = g$. Construct $(T, \ell)$ with a new root $r$ labelled $\text{min}$ and single child subtree $(T_g, \ell_g)$. Then $f_{T, \ell} = \mu f_{T_g, \ell_g} = \mu g = f$, so $f \in \mathcal{T}$. This case is not available in the $\mathcal{PR} \to \mathcal{T}_{\text{pr}}$ induction because minimisation is not among the closure operations defining $\mathcal{PR}$; so no case is missing there.
By induction on derivation depth, every $f \in \mathcal{R}$ satisfies $f \in \mathcal{T}$, and every $f \in \mathcal{PR}$ satisfies $f \in \mathcal{T}_{\text{pr}}$.
[/step]