Linear Function is Primitive Recursive

Theorem
The function $f: \N \to \N$, defined as:
 * $f \left({n}\right) = a n + b$

where $a$ and $b$ are constants, is primitive recursive‎.

Proof
We have that:

where:
 * $\operatorname{mult}$ is primitive recursive
 * $\operatorname{add}$ is primitive recursive
 * $f_a$ and $f_b$ are primitive recursive
 * $\operatorname{pr}^1_1$ is a basic primitive recursive function.

Note that we need to use the projection function (in this case, the identity function) in order to satisfy the definition of substitution, even when there is only one variable.

So $\operatorname{mult}$ is obtained by using two levels of substitution from the above primitive recursive‎ functions.