In the book Metamathematics of First-Order Arithmetic, I learned that a general recursive function can be defined by a $\Delta_1$-formula. I am curious about another matter: Since we have $Pr_T^\bullet (x)$that represents provability and a definition of a recursive function, perhaps we can discuss the finite sequence (arithmetic expression) of the supposed function expands into PA, and then find its corresponding value through provability.
For example, the exponentiation I define below:
Define a primitive recursive function:
$$ g(x) = \ulcorner 1 \urcorner \quad \text{(the code of 1)} $$
$$ h(a, b, c) = \ulcorner (\urcorner\overparen{} \ulcorner a \urcorner\overparen{} \ulcorner * \urcorner\overparen{} c \overparen{} \ulcorner )\urcorner $$
$$ f(x, 0) = g(x) = \ulcorner 1 \urcorner $$
$$ f(x, n+1) = h(x, n, f(x, n)) $$
Then there exists a formula $\varphi(x, y, z)$ such that $f(x, y) = z$ iff $\varphi(x, y, z)$. But here $z$ is just the code of a string of symbols, not the number as a result, so next define:
$$ \text{exp}(x, y) = (\text{min}\ z) (Pr_T^\bullet(\ulcorner (\urcorner\overparen{} f(x, y)\overparen{} \ulcorner = \urcorner\overparen{} \ulcorner z \urcorner\overparen{} \ulcorner )\urcorner )) $$
It seems to define exponentiation, but this should be wrong. The problem should occur in the last definition, because $(\text{min}\ z)$ acts on a predicate rather than a function. If so, how can this error be corrected? Another reason might be that $\{x | Pr_T^\bullet (x)\}$ is $\Sigma_1$, but I am not sure.