Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
primitive recursive function∗
CWoo†
2013-03-21 13:54:55
To define what a primitive recursive function is, the following notations are
used:
S
F = {Fk | k ∈ N}, where for each k ∈ N, Fk = {f | f : Nk → N}.
Definition. The set of primitive recursive functions is the smallest subset
PR of F where:
1. (zero function) z ∈ PR ∩ F1 , given by z(n) := 0;
2. (successor function) s ∈ PR ∩ F1 , given by s(n) := n + 1;
3. (projection functions) pkm ∈ PR∩Fk , where m ≤ k, given by pkm (n1 , . . . , nk ) :=
nm ;
4. PR is closed under composition: If {g1 , . . . , gm } ⊆ PR ∩ Fk and h ∈
PR ∩ Fm , then f ∈ PR ∩ Fk , where
f (n1 , . . . , nk ) = h(g1 (n1 , . . . , nk ), . . . , gm (n1 , . . . , nk ));
5. PR is closed under primitive recursion: If g ∈ PR∩Fk and h ∈ PR∩Fk+2 ,
then f ∈ PR ∩ Fk+1 , where
f (n1 , . . . , nk , 0)
f (n1 , . . . , nk , s(n))
=
g(n1 , . . . , nk )
= h(n1 , . . . , nk , n, f (n1 , . . . , nk , n)).
Many of the arithmetic functions that we encounter in basic math are primitive recursive, including addition, multiplication, and exponentiation. More
examples can be found in this entry.
Primitive recursive functions are computable by Turing machines. In fact, it
can be shown that PR is precisely the set of functions computable by programs
using FOR NEXT loops. However, not all Turing-computable functions are
primitive recursive: the Ackermann function is one such example.
∗ hPrimitiveRecursiveFunctioni
created: h2013-03-21i by: hCWooi version: h32801i
Privacy setting: h1i hDefinitioni h03D20i
† This text is available under the Creative Commons Attribution/Share-Alike License 3.0.
You can reuse this document or portions thereof only if you do so under terms that are
compatible with the CC-BY-SA license.
1
Since F is countable, so is PR. Moreover, PR is recursively enumerable
(can be listed by a Turing machine).
Remarks.
[1] Every primitive recursive function is total, since it is built from z, s, and
pkm , each of which is total, and that functional composition, and primitive
recursion preserve totalness. By including ∅ in PR above, and close it by
functional composition and primitive recursion, one gets the set of partial
primitive recursive functions.
[2] Primitive recursiveness can be defined on subsets of Nk : a subset S ⊆ Nk
is primitive recursive if its characteristic function ϕS , which is defined as
1 if x ∈ S,
ϕS (x) :=
0 otherwise.
is primitive recursive.
[3] Likewise, primitive recursiveness can be defined for predicates over tuples of natural numbers. A predicate Φ(x), where x ∈ Nk , is said to be
primitive recursive if the set S(Φ) := {x | Φ(x)} is primitive recursive.
2