Lably
Skip to content

General recursive function

One of several equivalent definitions of a computable function

  • 6 min read
  • 7 chapters

Learn it on Lably

Other equivalent classes of functions are the functions of lambda calculus and the functions that can be computed by Markov algorithms.

The subset of all total recursive functions with values in {0,1} is known in computational complexity theory as the complexity class R.

Definition

The μ-recursive functions (or general recursive functions) are partial functions that take finite tuples of natural numbers and return a single natural number. They are the smallest class of partial functions that includes the initial functions and is closed under composition, primitive recursion, and the minimization operator μ.

The smallest class of functions including the initial functions and closed under composition and primitive recursion (i.e. without minimisation) is the class of primitive recursive functions. While all primitive recursive functions are total, this is not true of partial recursive functions; for example, the minimisation of the successor function is undefined. The primitive recursive functions are a subset of the total recursive functions, which are a subset of the partial recursive functions. For example, the Ackermann function can be proven to be total recursive, and to be non-primitive.

Primitive or "basic" functions:

  1. Constant functions Ck
    n
    : For each natural number n and every k
    Cnk(x1,…,xk)=defn
    Alternative definitions use instead a zero function as a primitive function that always returns zero, and build the constant functions from the zero function, the successor function and the composition operator.
  2. Successor function S:
    S(x)=defx+1
  3. Projection function Pik (also called the Identity function): For all natural numbers i,k such that 1≤i≤k:
    Pik(x1,…,xk)=defxi.

Operators (the domain of a function defined by an operator is the set of the values of the arguments such that every function application that must be done during the computation provides a well-defined result):

  1. Composition operator ∘ (also called the substitution operator): Given an m-ary function h(x1,…,xm) and m k-ary functions g1(x1,…,xk),…,gm(x1,…,xk):
    h∘(g1,…,gm)=deff,wheref(x1,…,xk)=h(g1(x1,…,xk),…,gm(x1,…,xk)).
    This means that f(x1,…,xk) is defined only if g1(x1,…,xk),…,gm(x1,…,xk), and h(g1(x1,…,xk),…,gm(x1,…,xk)) are all defined.
  2. Primitive recursion operator ρ: Given the k-ary function g(x1,…,xk) and k+2 -ary function h(y,z,x1,…,xk):
    ρ(g,h)=deffwhere the k+1-ary function f is defined byf(0,x1,…,xk)=g(x1,…,xk)f(S(y),x1,…,xk)=h(y,f(y,x1,…,xk),x1,…,xk).
    This means that f(y,x1,…,xk) is defined only if g(x1,…,xk) and h(z,f(z,x1,…,xk),x1,…,xk) are defined for all z<y.
  3. Minimization operator μ: Given a (k+1)-ary function f(y,x1,…,xk), the k-ary function μ(f) is defined by:
    μ(f)(x1,…,xk)=z⟺deff(i,x1,…,xk)>0fori=0,…,z−1andf(z,x1,…,xk)=0

Intuitively, minimisation seeks—beginning the search from 0 and proceeding upwards—the smallest argument that causes the function to return zero; if there is no such argument, or if one encounters an argument for which f is not defined, then the search never terminates, and μ(f) is not defined for the argument (x1,…,xk).

While some textbooks use the μ-operator as defined here, others demand that the μ-operator is applied to total functions f only. Although this restricts the μ-operator as compared to the definition given here, the class of μ-recursive functions remains the same, which follows from Kleene's normal form theorem (see below). The only difference is, that it becomes undecidable whether a specific function definition defines a μ-recursive function, as it is undecidable whether a computable (i.e. μ-recursive) function is total.

The strong equality relation ≃ can be used to compare partial μ-recursive functions. This is defined for all partial functions f and g so that

f(x1,…,xk)≃g(x1,…,xl)

holds if and only if for any choice of arguments either both functions are defined and their values are equal or both functions are undefined.

Sign in to keep reading

6 more chapters are free with a Lably account.

More in Foundations