Definition. Primitive recursive functions [mde-0015]

The class of primitive recursive functions is given by the closure of the zero, successor and projection functions under composition and primitive recursion combinators.

  • \(z : \mathbb {N}^{0} \to \mathbb {N} : \ast \mapsto 0\) is primitive recursive,
  • \(s : \mathbb {N} \to \mathbb {N} : x\mapsto x+1\) is primitive recursive,
  • \(\pi _n : \mathbb {N}^k \to \mathbb {N} : (x_1, ..., x_k) \mapsto n_i\) is primitive recursive,
  • if \(f : \mathbb {N}^k \to \mathbb {N}\) and \(g_1, ..., g_k : \mathbb {N}^n \to \mathbb {N}\) are primitive recursive, then \(f \circ (g_1, ..., g_k)\) is primitive recursive, where \[f \circ (g_1, ..., g_k) : \mathbb {N}^n \to \mathbb {N} : (x_1, ..., x_n) \mapsto f(g_1(x_1, ..., x_n), ..., g_k(x_1, ..., x_n))\]
  • if \(f : \mathbb {N}^k \to \mathbb {N}\) and \(g : \mathbb {N}^{k+2} \to \mathbb {N}\) are primitive recursive, then \(\text {Pr[f,g]} : \mathbb {N}^{k+1} \to \mathbb {N}\) is primitive recursive where
    • \(\text {Pr[f,g]}(0, x_1, ..., x_k) = f(x_1, ..., x_k)\)
    • \(\text {Pr[f,g]}(s(n), x_1, ..., x_k) = g(n,\text {Pr[f,g]}(n, x_1, ..., x_k), x_1, ..., x_k)\).