Bounded Product is Primitive Recursive

Theorem
Let the function $f: \N^{k+1} \to \N$ be primitive recursive.

Then so is the function $g: \N^{k+1} \to \N$ defined as:
 * $\displaystyle g \left({n_1, n_2, \ldots, n_k, z}\right) = \begin{cases}

1 & : z = 0 \\ \prod_{y=1}^z f \left({n_1, n_2, \ldots, n_k, y}\right) & : z > 0 \end{cases}$

Proof
The function $g$ satisfies:
 * $g \left({n_1, n_2, \ldots, n_k, z}\right) = 0$
 * $g \left({n_1, n_2, \ldots, n_k, z+1}\right) = g \left({n_1, n_2, \ldots, n_k, z}\right) \times f \left({n_1, n_2, \ldots, n_k, z + 1}\right)$

Hence $g$ is defined by primitive recursion from:
 * the primitive recursive function $\operatorname{mult}$
 * $f$, which is primitive recursive
 * and constants, which are primitive recursive.

Hence the result.

Note
The product $\displaystyle \prod_{y=1}^z$ is referred to as a bounded product to distinguish it from $\displaystyle \prod_{y=1}^\infty$ which is not.