Primitive recursive functions, general recursive functions, minimization, and the formal construction of computable numerical functions.
Recursive function theory gives a mathematical definition of computable numerical functions by specifying basic functions and closure operations that generate increasingly complex functions from simple ones, and this framework allows one to reason about computation purely within arithmetic.
All functions considered in this section have inputs and outputs in the natural numbers:
An ary function is written:
and the number is called the arity of the function.
Initial Functions
We begin with three basic types of functions, which are taken as primitive building blocks.
Definition 10.1 (Zero Function)
For each , the zero function is:
Definition 10.2 (Successor Function)
The successor function is:
Definition 10.3 (Projection Functions)
For , define:
Composition
Definition 10.4 (Composition)
Let:
and:
Define:
Then is obtained from and the by composition.
Primitive Recursion
Definition 10.5 (Primitive Recursion)
Let:
Define:
by:
Definition 10.6 (Primitive Recursive Function)
The class of primitive recursive functions is the smallest class containing , , and , and closed under composition and primitive recursion.
Example 10.7 (Addition)
Define:
Then addition is primitive recursive.
Proof
The base function is:
The step function is:
Both are primitive recursive, so addition is primitive recursive.
Example 10.8 (Multiplication)
Define:
Proof
The base function is:
The step function is:
Thus multiplication is primitive recursive.
Example 10.9 (Exponentiation)
Define:
Proof
The constant function is primitive recursive since:
The step function:
is primitive recursive by composition.
Thus exponentiation is primitive recursive.
Definition 10.10 (Predecessor)
Define:
Lemma 10.11
The predecessor function is primitive recursive.
Proof
Use primitive recursion with:
Thus is primitive recursive.
Definition 10.12 (Truncated Subtraction)
Define truncated subtraction by:
This function agrees with ordinary subtraction when , and returns when , since repeated application of the predecessor function never produces negative values.
Lemma 10.13
Truncated subtraction is primitive recursive.
Proof
Base:
Step:
Thus primitive recursive.
Definition 10.14 (Minimization)
Let:
Define:
This returns the least such that , if such a exists, and is undefined otherwise.
Definition 10.15 (Partial Recursive Function)
The class of partial recursive functions is obtained from the initial functions by closure under composition, primitive recursion, and minimization.
Definition 10.16 (General Recursive Function)
A function is general recursive if it is partial recursive and defined for all inputs.
Theorem 10.17
Every primitive recursive function is general recursive.
Proof
Primitive recursive functions are built from the initial functions using composition and primitive recursion.
The class of partial recursive functions contains the initial functions and is closed under these operations.
Thus every primitive recursive function is partial recursive.
Since primitive recursive functions are total, they are general recursive.
Remarks
Primitive recursion captures computations that always terminate with a bounded number of steps determined by the input, while minimization introduces unbounded search and allows the definition of functions that may fail to terminate on some inputs, which leads naturally to the study of partial computable functions.