Primitive Recursive Functions
Primitive Recursive Functions
Definitions
Three basic functions, which will help us generate all numbers:
Zero function: the point of the zero function is to allow us to use
all constants with the minimal amount of machinery. z = 0, the zero
function, will be used here interchangeably with the character 0.
It has to be included in this definition so that this use of terminology
is unambiguously rigorous.
Successor function: s(0) = 1, s(1) = 2, s(2) = 3. One reason to see
why this successor function is important is that with just the characters s, (, ), and 0 (or, z) we can represent every natural
number
Identity function: idni (x1 , . . . , xi , . . . xn ) = xi selects entries from an
ntuple.
The point of these basic functions is that we want any set of functions
to have at least this much machinery - at the very least, however we define
function, we want to be able to have constants, find successors, and select
numbers from a finite list.
Of course, want our class of primitive recursive functions to be much more
powerful than these three functions - we need to be able to combine them
in certain ways. So we will take the class of primitive recursive functions to
be (the smallest one that is) closed under two operations:
Composition closure: If f is a k-ary PRF, and gi are nary PRFs,
then
Cn[f, g1 , . . . , gk ](x1 , . . . , xn ) = f (g1 (~x), . . . , gk (~x))
is an nary PRF. We might think of Cn as a generalization of the
familiar f g to k ary f functions and tuples of nary g functions.
Primitive Recursion closure: this is the powerful closure, which allows us to define functions recursively. In short, it says that if f is
nary, and g is n + 2ary, then
P r[f, g](~x, 0) = f (~x)
P r[f, g](~x, s(y)) = g(~x, y, P r[f, g](~x, y))
defines a PRF which is n + 1ary, taking inputs x1 . . . xn , y. The
class of PRFs includes functions that are defined recursively.
2. Examples
So, now that we got over the formal definitions of what constitutes a
primitive recursive function, we review some elementary examples that were
discussed in class. Here I use these examples to develop the methodology of
1
x3 ,
and so on; but thats unnecessary to see that this general product is
defined in PRF.
Closure properties of conditions
In class, we discussed how to define function using definition by
cases:
g1 (~x if C1
f (~x) = ...
gk (~x) if Ck
Clearly, this definition requires the conditions and all gi s to be p.r.
In fact, these are the only requirement as we mentioned in class that:
Theorem 1. Suppose {Ci }ki=1 is a family of mutually exclusive and
jointly exhaustive conditions on ~x. Let also ci be the characteristic
function of Ci . Then, if {gi }ki=1 is a family of primitive recursive
functions, and all c0i s are primitive recursive, then so is f .
Now we can actually justify it as it is an easy consequence of the
general summation formula.