Set of Codes for URM Instructions is Primitive Recursive

Theorem
The set $$\operatorname{Instr}$$ of codes of all basic URM instructions is primitive recursive.

Proof
Since the Union of Primitive Recursive Sets is itself primitive recursive, all we need to do is show that each of $$\operatorname{Zinstr}$$, $$\operatorname{Sinstr}$$, $$\operatorname{Cinstr}$$ and $$\operatorname{Jinstr}$$ are primitive recursive.


 * First we consider $$\operatorname{Zinstr}$$.
 * $$\operatorname{Zinstr} = \left\{{\beta \left({Z \left({n}\right)}\right): n \in \N^*}\right\} = \left\{{6 n - 3: n \in \N^*}\right\}$$.

So $$\operatorname{Zinstr}$$ is the set of natural numbers which are divisible by $$3$$ but not $$6$$.

Thus:
 * $$\chi_{\operatorname{Zinstr}} \left({k}\right) = \operatorname{div} \left({k, 3}\right) \times \overline{\sgn}\left({\operatorname{div} \left({k, 6}\right)}\right)$$

where:
 * $\operatorname{div}$ is primitive recursive;
 * $\overline{\sgn}$ is primitive recursive;
 * Multiplication is Primitive Recursive;
 * $3$ and $6$ are constants.

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