All right, recursive functions. This is pretty simple, I just got tired last night.
First, I need to mention, again, that all variables are non-negative integers, and in this case, the output of every function is also a non-negative integer.
btw, I say “non-negative” integer instead of “natural number” because there’s no convention as to whether zero is a natural number, and I need it.
Initial functions
The following functions are taken to be recursive:[ol][li] The zero function, Z(x) = 0.[/li][li] The successor function, N(x) = x + 1.[/li][li] The projection function, U[sub]n, j[/sub](x[sub]1[/sub], …, x[sub]n[/sub]) = x[sub]j[/sub].[/ol]Note that I’m giving the definitions of these functions, not their representations in the language of arithmetic.[/li]
Substitution
Let g(x[sub]1[/sub], …, x[sub]m[/sub]) be recursive, and let h[sub]i[/sub](x[sub]1[/sub], …, x[sub]n[/sub]) be recursive for 1 < i < m. Then f(x[sub]1[/sub], …, x[sub]n[/sub]) = g(h[sub]1[/sub](x[sub]1[/sub], …, x[sub]n[/sub]), …, h[sub]m[/sub](x[sub]1[/sub], …, x[sub]n[/sub])) is also recursive. Note that a given h[sub]i[/sub] may be constant with respect to one or more variables.
Recursion
Define f(x[sub]1[/sub], …, x[sub]n[/sub], k) as follows:[ol][li]f(x[sub]1[/sub], …, x[sub]n[/sub], 0) = g(x[sub]1[/sub], …, x[sub]n[/sub])[/li][li]f(x[sub]1[/sub], …, x[sub]n[/sub], y + 1) = h(x[sub]1[/sub], …, x[sub]n[/sub], y, f(x[sub]1[/sub], …, x[sub]n[/sub], y))[/ol]If g and h are recursive, then f is recursive as well. Note that n may be equal to zero in this case.[/li]
The Restricted [symbol]m[/symbol]-Operator
Let g(x[sub]1[/sub], …, x[sub]n[/sub], y) be a function such that, for any values of the x[sub]i[/sub]'s, there is a y such that g(x[sub]1[/sub], …, x[sub]n[/sub], y) = 0. [symbol]m[/symbol]y(g(x[sub]1[/sub], …, x[sub]n[/sub], y) = 0) is the least y such that g(x[sub]1[/sub], …, x[sub]n[/sub], y) = 0.
A function obtained without use of the restricted [symbol]m[/symbol]-operator is called primitive recursive. Otherwise, it’s known as just recursive. There are functions which are recursive but not primitive recursive; Ackerman’s function is the simplest known example.
You can take a recursive function and add dummy variables, permute the variables, or set two of them equal (e.g., f(x, y) = g(y, x, y)), and you’ll get a recursive function.
That seems like enough for now. Later, I’ll talk about the difference between consistency and [symbol]w[/symbol]-consistency.