Code Number for Non-Positive Integer is Primitive Recursive

From ProofWiki
Jump to navigation Jump to search

Theorem

Let $c : \N \to \N$ be defined as:

$\map c n = m$

where $m$ is the code number for the integer $-n : \Z$.

Then $c$ is a primitive recursive function.


Proof

Let $c : \N \to \N$ be defined as:

$\map c n = n + n$

which is primitive recursive by:


For every $n \in \N$, we have:

$-n \le 0$

Thus:

$m = -2 \paren {-n} = 2 n$

Therefore:

$\map c n = m$

$\blacksquare$