Constant Function is Primitive Recursive

Theorem
The constant function $f_c: \N \to \N$, defined as:
 * $f_c \left({n}\right) = c$ where $c \in \N$

is primitive recursive‎.

Proof
The proof proceeds by the Principle of Mathematical Induction.

Base Case
First we note that $f_0: \N \to \N$ is the zero function, which is a basic primitive recursive function.

This is our base case.

Induction Hypothesis
This is our induction hypothesis:


 * $f_k: \N \to \N$ is primitive recursive‎ for some given $k \in \N$.

Then we need to show:


 * $f_{k+1}: \N \to \N$ is primitive recursive‎.

Induction Step
This is our induction step:


 * $f_{k+1} \left({n}\right) = k + 1 = \operatorname{succ} \left({k}\right) = \operatorname{succ} \left({f_k \left({n}\right)}\right)$

Now $f_k \left({n}\right)$ is primitive recursive‎ from our induction hypothesis.

Thus $f_{k+1} \left({n}\right)$ is obtained from the basic primitive recursive function $\operatorname{succ}$ and $f_k \left({n}\right)$ by substitution.

The result follows by the Principle of Mathematical Induction.