Prove that exponent is primitive recursive

28 Views Asked by At

I'm trying to answer the following:

Show that $f(x,y)=x^y$ is primitive recursive.

Here's my try:

We can derive exponent thus:

$ f(x,0)=1, \ \ f(x,1)=f(x,0) \times x, \ \ f(x,2)=f(x,1) \times x, \ ... \ \ f(x,n+1)=f(x,n) \times x $

Then we can formulate $g,h$ thus:

$g(x)=S(Z(x))=1$

To prove that $g$ is primitive recursive: $Z$ by zero rule, $S$ by successor rule, and $S(Z(x))$ by composition rule.

And

$h(x,y,z)=S^{z \times x} (Z(x,y,z))$

To prove that $h$ is primitive recursive: S by successor rule, Z by zero rule, $S^{z \times x} (Z(x,y,z))$ by composition rule.

I've already proven that $multiply$ is primitive recursive here: Show multiply function is primitive recursive

Now by recursion rule:

$f(x,0)=g(x)=S(Z(x))=1$

$f(x,n+1)=h(x,n,f(x,n))=S^{f(x,n) \times x} (Z(x,n,f(x,n)))=f(x,n) \times x$

$\square$

Are the steps correct and reasonable? Thanks a bunch!