The purpose of this exercise is to provide a direct proof of the fact that Ackerman's function is recursive.
Define the following binary relation $\ll$ on $\mathbb{N}^{3}:(a, b, c) \ll\left(a^{\prime}, b^{\prime}, c^{\prime}\right)$ if and only if
$$
\begin{aligned}
&\sup (a, b, c)<\sup \left(a^{\prime}, b^{\prime}, c^{\prime}\right), \quad \text { or } \\
&\sup (a, b, c)=\sup \left(a^{\prime}, b^{\prime}, c^{\prime}\right) \text { and } a<a^{\prime}, \quad \text { or } \\
&\sup (a, b, c)=\sup \left(a^{\prime}, b^{\prime}, c^{\prime}\right) \text { and } a=a^{\prime} \text { and } b<b^{\prime}, \quad \text { or } \\
&\sup (a, b, c)=\sup \left(a^{\prime}, b^{\prime}, c^{\prime}\right) \text { and } a=a^{\prime} \text { and } b=b^{\prime} \text { and } c \leq c^{\prime} .
\end{aligned}
$$
(a) Show that $\ll$ is a total ordering.
If $\alpha$ and $\beta$ belong to $\mathbb{N}^{3}$, we will say that $\alpha$ is less than or equal (respectively, greater than or equal) to $\beta$ if $\alpha \ll \beta$ (respectively, $\beta \ll \alpha$ ). We will say that $\alpha$ is strictly less (respectively, strictly greater) than $\beta$ if, in addition, $\alpha \neq \beta$.
Show that for all $(a, b, c) \in \mathbb{N}^{3}$, the set
$$
\left\{(x, y, z) \in \mathbb{N}^{3}:(x, y, z) \ll(a, b, c)\right\}
$$
has at most $(\sup (a, b, c)+1)^{3}$ elements. Show that every element $(a, b, c) \in$ $\mathbb{N}^{3}$ has an immediate successor [i.e. there exists an element that is strictly greater than $(a, b, c)$ and is less than or equal to all elements that are strictly greater than $(a, b, c)]$. We will explicitly describe this immediate successor.
(b) Show that there exist three primitive recursive functions $\gamma_{1}, \gamma_{2}$, and $\gamma_{3}$ from $\mathbb{N}$ into $\mathbb{N}$ such that (i) the function $\Gamma$ from $\mathbb{N}$ into $\mathbb{N}^{3}$ defined by
$$
\Gamma(n)=\left(\gamma_{1}(n), \gamma_{2}(n), \gamma_{3}(n)\right)
$$
is a bijection;
(ii) for all integers $n$ and $m, n \leq m$ if and only if $\Gamma(n) \ll \Gamma(m)$.
(c) Let $H$ be the subset of $\mathbb{N}$ defined recursively by the following condition: $n \in H$ if and only if
$$
\begin{array}{lll}
\gamma_{2}(n)=0 & \text { and } & \gamma_{1}(n)=2^{\gamma_{3}(n)} ; & \text { or } \\
\gamma_{3}(n)=0 & \text { and } & \gamma_{1}(n)=1 ; & \text { or }
\end{array}
$$
$$
\gamma_{2}(n) \neq 0 \quad \text { and } \quad \gamma_{3}(n) \neq 0
$$
and there exist integers $p$ and $q$ strictly less than $n$ such that $p \in H, q \in H$, $\gamma_{2}(p)=\gamma_{2}(n), \gamma_{3}(p)=\gamma_{3}(n)-1, \gamma_{2}(q)=\gamma_{2}(n)-1, \gamma_{3}(q)=\gamma_{1}(p)$ and $\gamma_{1}(n)=\gamma_{1}(q)$.
Show that $H$ is primitive recursive.
As in the body of Chapter 5 , let $\zeta$ denote Ackerman's function. Show that, for every integer $n, n \in H$ if and only if $\gamma_{\mathrm{I}}(n)=\zeta\left(\gamma_{2}(n), \gamma_{3}(n)\right)$.
(d) Show that the graph
$$
G=\{(y, x, z): z=\zeta(y, x)\}
$$
of Ackerman's function is primitive recursive. Show that Ackerman's function is recursive.