"Nested" recursion preserves primitive recursive functions

749 Views Asked by At

Problem: Assume the functions $f$, $\pi$, and $g$ are given. They take one, two, and three arguments respectively. Prove a unique function $h$ exists such that:

$$h(0,y)\cong f(y)$$ $$h(x+1,y)\cong g(x,y,h(x,\pi(x,y)))$$

Furthermore, prove that if the functions $f$, $\pi$, and $g$ are primitive recursive, then so is $h$.

Attempted solution:

We have

$h(0,y)=f(y)$;

$h(1,y)=g(0,y,h(0,\pi(0,y))=g(0,y,f(\pi(0,y))$;

$h(2,y)=g(1,y,h(1,\pi(1,y))=g(1,y,g(0,\pi(1,y),f(\pi(0,\pi(1,y))))$;

$h(3,y)=g(2,y(h(2,\pi(2,y)))=g(2,y,g(1,\pi(2,y),g(0,\pi(1,\pi(2,y)),f(\pi(0,\pi(1,\pi(2,y))))))$

Let us define $P$ by:

$P(0,x,y)=y$

$P(n+1,x,y)=\pi(x \dot - (n+1),P(n,x,y))$

Now I need a new function $Q$ such that

$Q(0,x,y)=P(x,x,y)$

How should I continue? How should I go about the uniqueness of $h$? Any help would be appreciated.

1

There are 1 best solutions below

1
On BEST ANSWER

For uniqueness, suppose that there are $h_1$ and $h_2$ that both satisfy your conditions. If they are not equal, then there must be a minimal $x$ such that $h_1(x,y)\ne h_2(x,y)$ for some $y$. Argue that because $x$ is minimal $h_1(x,y)$ must equal $h_2(x,y)$, which is a contradiction.


For "primitive recursive", it looks like you're going in the right direction with your $P$, but if would be easier to rearrange things such that $n$ (which you sometimes call $s$?) is the first argument. Then $P(n,x,y)$ is easily seen to be primitive recursive.

I don't think you need the $Q$. Instead you need to rewrite the equations for $h$ such that the varying $y$ argument is computed anew from the original $y$ using $P$ for each iteration:

$$ H(0,x_0,y_0) = f(P(x_0,x_0,y_0)) $$ $$ H(x+1,x_0,y_0) = g(x,P(x_0\dot-(x+1), x_0, y_0), H(x,x_0,y_0))$$

$H$ is then clearly primitive recursive, and you should be able to prove by appropriate induction arguments and under appropriate conditions on the variables (unless I've made a fencepost error somewhere, which I probably have, in which case find and fix it!) that $$ P(n+1,x_0+1,y) = P(n,x_0,\pi(x_0,y)) $$ and then $$ H(x,x_0+1,y) = H(x,x_0,\pi(x_0,y)) $$ and then $$ h(x,y) = H(x,x,y) $$ which gives an alternative definition for $h$ that shows it to be primitive recursive.