Predecessor Function is Primitive Recursive

Theorem
The predecessor function $\operatorname{pred}: \N \to \N$ defined as:
 * $\operatorname{pred} \left({n}\right) = \begin{cases}

0 & : n = 0 \\ n-1 & : n > 0 \end{cases}$ is primitive recursive.

Proof
We can use Primitive Recursion on One Variable to find $g: \N^2 \to \N$ and $h: \N \to \N$ such that:


 * $h \left({n}\right) = \begin{cases}

\operatorname{zero} \left({n}\right) & : n = 0 \\ g \left({n-1, h \left({n-1}\right)}\right) & : n > 0 \end{cases} $

By setting:
 * $g \left({n, m}\right) = \operatorname{pr}^2_1\left({n, m}\right)$

we see that setting $h = \operatorname{pred}$ fits the pattern.

We have that the $\operatorname{pr}^2_1$ and $\operatorname{zero}$ functions are basic primitive recursive functions.

Hence the result.