Divisor Relation is Primitive Recursive

Theorem
The divisor relation $m \mathop \backslash n$ in $\N^2$ is primitive recursive.

Proof
We note that $m \mathop \backslash n \iff n = q m$ where $q \in \Z$.

So we see that $m \mathop \backslash n \iff \operatorname{rem} \left({n, m}\right) = 0$ (see Remainder is Primitive Recursive).

Thus we define the function $\operatorname{div}: \N^2 \to \N$ as:
 * $\operatorname{div} \left({n, m}\right) = \chi_{\operatorname{eq}} \left({\operatorname{rem} \left({n, m}\right), 0}\right)$

where $\chi_{\operatorname{eq}} \left({n, m}\right)$ is the characteristic function of the equality relation.

So we have:
 * $\operatorname{div} \left({n, y}\right) = \begin{cases}

1 & : y \mathop \backslash n \\ 0 & : y \nmid n \end{cases}$

So $\operatorname{div} \left({n, m}\right)$ is defined by substitution from:
 * the primitive recursive function $\operatorname{rem}$
 * the primitive recursive relation $\operatorname{eq}$
 * the constants $1$ and $0$.

Thus $\operatorname{div}$ is primitive recursive.

Hence the result.