Ackermann function is total recursive
In this entry, we give a formal proof that the Ackermann function , given by
is both a total function and a recursive function. Actually, the fact that is total is proved in this entry (http://planetmath.org/PropertiesOfAckermannFunction). It remains to show that is recursive.
Recall that the computation of , given , can be thought of as an iterated operation performed on finite sequences of integers, starting with and ending with (see this entry (http://planetmath.org/ComputingTheAckermannFunction)). It is this process we will utilize to prove that is recursive.
In the proof below, the following notations and definitions are used to simplify matters:
-
•
if is the sequence , then or denote the code number of given the encoding ;
-
•
is the length of the sequence whose code number is ;
-
•
is the -th number in the sequence whose code number is ;
-
•
is the -th to the last number in the sequence whose code number is (so that is the last number in the sequence whose code number is );
-
•
is the code number of the sequence obtained by deleting the last number of the sequence whose code number is ;
-
•
is the code number of the sequence obtained by appending to the end of the sequence whose code number is .
If is a primitive recursive encoding, then each of the above function is primitive recursive. For example, .
Theorem 1.
is recursive.
Proof.
In this proof, the choice of encoding is the multiplicative encoding, for it is convenient and, more importantly, a primitive recursive encoding. Briefly,
where is the -th prime number (so that ).
We know that computing is basically a sequence of computations on finite sequences:
Let denote the sequence at step , then the above sequence can be rewritten:
Define . From this we see that
is the function that computes the smallest number of steps needed so that the code number becomes stationary. When the code number is decoded, we get the resulting value of :
where , decodes , and returns the last number in the sequence whose code number is .
Now the remaining task to show that is primitive recursive. First, note that
is primitive recursive. Next, we want to express
where is the function that changes the code number of the sequence to the code number of the sequence . Once we obtain and show that is primitive recursive, then is primitive recursive, as it is defined by primitive recursion via primitive recursive functions and .
To find out what is, recall the four rules of constructing the next sequence from the current one givne in this this entry (http://planetmath.org/ComputingTheAckermannFunction). Let and . We rewrite the four rules using the notations and definitions here:
-
1.
if , then ;
-
2.
if , and , then , where
-
3.
if , and and , then , where
or
-
4.
if , and and , then then , where
If we define predicates:
-
1.
,
-
2.
,
-
3.
,
-
4.
.
Then each is primitive recursive, pairwise exclusive, and . Now, define as follows:
Since is defined by cases, and each is primitive recursive, is also primitive recursive. ∎
Title | Ackermann function is total recursive |
---|---|
Canonical name | AckermannFunctionIsTotalRecursive |
Date of creation | 2013-03-22 19:07:53 |
Last modified on | 2013-03-22 19:07:53 |
Owner | CWoo (3771) |
Last modified by | CWoo (3771) |
Numerical id | 15 |
Author | CWoo (3771) |
Entry type | Theorem |
Classification | msc 03D75 |
Related topic | AckermannFunctionIsNotPrimitiveRecursive |