recursive function is URM-computable
Proposition 1.
Every recursive function is URM-computable function.
The proof can be broken down in several simple steps.
Proposition 2.
The zero function, the successor function, and the projection functions are URM-computable.
Proof.
The zero function is computed by , the successor function is computed by , and for any , the -th projection function is computed by .∎
Proposition 3.
URM-computability is closed under functional composition
.
Proof.
This is proved in the entry on combining URMs. ∎
Proposition 4.
URM-computability is closed under primitive recursion.
Proof.
Suppose are computed by respectively. Let be obtained from by primitive recursion, namely,
Let be the following URM:
where and . The program works as follows:
- :
transfer the first registers to another are on the tape:
- :
compute using
- :
if the content of register (formerly the content of register ) is the same as the content of (initially set to ), go to the last instruction whose index is ; otherwise continue to the next instruction:
- :
increment register by :
- :
compute , where is the content of register , using
- :
go to instruction :
- :
transfer result back to register : .
Note that if , then . Otherwise, is undefined. This can happen either is undefined, in which case diverges, is undefined, in which case diverges, or for all , in which case loops indefinitely. In all cases, diverges. This shows that computes .∎
Proposition 5.
URM-computability is closed under minimization.
Proof.
Suppose is computed by . Let be obtained from by minimization. In other words, for any , set
and define
Let be the following URM:
where and . The program works as follows:
- :
transfer the first registers to another are on the tape:
- :
compute using , where the content of register is set to initially.
- :
if the content of register (which is always ) is the same as the content of register (value of , if defined), go to the last instruction whose index is ; otherwise continue to the next instruction:
- :
increment register by (counter):
- :
go to instruction :
- :
transfer content of register to register : .
If , then . Otherwise, is undefined, which can happen either when for all , in which case loops indefinitely, or is undefined, while are defined and non-zero, for all , in which case diverges. In both cases, diverges. Hence computes .∎
Since a recursive function is obtained by a finite application of functional operations specified in Propositions 3,4,5 on the basic arithmetic functions specified in Proposition 2, every recursive function is URM computable as result, proving Proposition 1.