Factorial is Primitive Recursive

Theorem
The factorial function $\operatorname{fac}: \N \to \N$ defined as:
 * $\operatorname{fac} \left({n}\right) = n!$

is primitive recursive.

Proof
From the definition of the factorial, we have that:


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

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

Thus $\operatorname{fac}$ is obtained by primitive recursion from the constant $1$ and the primitive recursive function $\operatorname{mult}$.

Hence $\operatorname{fac}$ is primitive recursive.