How to show a function is primitive recursive?

591 Views Asked by At

Show that the following function is primitive recursive, by giving its name in official notation, with names for functions drawn solely from the initial primitive recursive functions: f (x) = x^2 + 3x + 1.

I defined addition, multiplication and exponentiation but im not sure how to represent the function in official notation.

What i have...

add = p.r.(id(1,1), Cn[succ, id(3,3)])

mult = p.r.(zero, Cn[add, id(3,1), id(3,3)])

exp = p.r. (1, Cn[mult, id(3,1), id(3,3)])

Clearly the function is p.r. because it only uses addition, multiplication and exponentiation.

1

There are 1 best solutions below

0
On

At this point you merely expressed the general addition, multiplication, and exponentiation functions separately. To express the function of your question, you will actually need to combine those into one primitive recursive function. So, what you did will make for hand-dandy ingredients of your function, but yuou still need to put them together in the right way to get your function $f(x) = x^2 + 3x+1$

By the way, your $exp$ function refers to the constant function $f(x)=1$ .. which can to be expressed as $Cn(s,z)$. Your $f$ function also need constants $2$ and $3$. And let's also write out the add and mult functions as they are referred to in later functions, i.e.:

$add = Pr(id^1_1, Cn[succ, id^3_3])$

$mult = Pr(z, Cn[Pr(id^1_1, Cn[s, id^3_3]), id^3_1, id^3_3])$

$exp = Pr(Cn[s,z], Cn[Pr(z, Cn[Pr(id^1_1, Cn[s, id^3_3]), id^3_1, id^3_3]), id(3,1), id(3,3)])$

Then:

$f=s(x^2+3x)=Cn[s,x^2+3x]=Cn[s,Cn[add,x^2,3x]]=$

$Cn[s,Cn[add,Cn[exp,x,2],Cn[mult,3,x]]]=$

$Cn[s,Cn[add,Cn[exp,id^1_1,Cn[s,Cn[s,z]]],Cn[mult,Cn[s,Cn[s,Cn[s,z]]],id^1_1]]]=$

$Cn[s, Cn[Pr(id^1_1, Cn[succ, id^3_3]),Cn[Pr(Cn[s,z], Cn[Pr(z, Cn[Pr(id^1_1, Cn[s, id^3_3]), id^3_1, id^3_3]), id(3,1), id(3,3)]),id^1_1,Cn[s,Cn[s,z]]],Cn[Pr(z, Cn[Pr(id^1_1, Cn[s, id^3_3]), id^3_1, id^3_3]),Cn[s,Cn[s,Cn[s,z]]],id^1_1]]]$