Permutation of Variables of Primitive Recursive Function

Theorem
Let $$f: \N^k \to \N$$ be a primitive recursive function.

Let $$\sigma$$ be a permutation of $$\left({1, 2, \ldots, k}\right)$$.

Then the function $$h: \N^k \to \N$$ defined as:
 * $$h \left({n_1, n_2, \ldots, n_k}\right) = f \left({n_{\sigma \left({1}\right)}, n_{\sigma \left({2}\right)}, \ldots, n_{\sigma \left({k}\right)}}\right)$$

is also primitive recursive.

Proof
We have that:
 * $$\forall j: 1 \le j \le k: n_{\sigma \left({j}\right)} = \operatorname{pr}^k_{\sigma \left({j}\right)}$$.

Thus $$h$$ is obtained by substitution from $$f$$ and the projection functions $$\operatorname{pr}^k_{\sigma \left({j}\right)}$$.

The result follows.

It follows that if a function $$h$$ can be obtained from known primitive recursive functions by primitive recursion where a variable other than the last one is taken as the recursion variable, then $$h$$ is primitive recursive.