Kleene's recursion theorem

Last updated

In computability theory, Kleene's recursion theorems are a pair of fundamental results about the application of computable functions to their own descriptions. The theorems were first proved by Stephen Kleene in 1938 [1] and appear in his 1952 book Introduction to Metamathematics. [2] A related theorem, which constructs fixed points of a computable function, is known as Rogers's theorem and is due to Hartley Rogers, Jr. [3]

Contents

The recursion theorems can be applied to construct fixed points of certain operations on computable functions, to generate quines, and to construct functions defined via recursive definitions.

Notation

The statement of the theorems refers to an admissible numbering of the partial recursive functions, such that the function corresponding to index is .

If and are partial functions on the natural numbers, the notation indicates that, for each n, either and are both defined and are equal, or else and are both undefined.

Rogers's fixed-point theorem

Given a function , a fixed point of is an index such that . Note that the comparison of in- and outputs here is not in terms of numerical values, but in terms of their associated functions.

Rogers describes the following result as "a simpler version" of Kleene's (second) recursion theorem. [4]

Rogers's fixed-point theorem  If is a total computable function, it has a fixed point in the above sense.

Proof of the fixed-point theorem

The proof uses a particular total computable function , defined as follows. Given a natural number , the function outputs the index of the partial computable function that performs the following computation:

Given an input , first attempt to compute . If that computation returns an output , then compute and return its value, if any.

Thus, for all indices of partial computable functions, if is defined, then . If is not defined, then is a function that is nowhere defined. The function can be constructed from the partial computable function described above and the s-m-n theorem: for each , is the index of a program which computes the function .

To complete the proof, let be any total computable function, and construct as above. Let be an index of the composition , which is a total computable function. Then by the definition of . But, because is an index of , , and thus . By the transitivity of , this means . Hence for .

This proof is a construction of a partial recursive function which implements the Y combinator.

Fixed-point-free functions

A function such that for all is called fixed-point free. The fixed-point theorem shows that no total computable function is fixed-point free, but there are many non-computable fixed-point-free functions. Arslanov's completeness criterion states that the only recursively enumerable Turing degree that computes a fixed-point-free function is 0, the degree of the halting problem. [5]

Kleene's second recursion theorem

The second recursion theorem is a generalization of Rogers's theorem with a second input in the function. One informal interpretation of the second recursion theorem is that it is possible to construct self-referential programs; see "Application to quines" below.

The second recursion theorem. For any partial recursive function there is an index such that .

The theorem can be proved from Rogers's theorem by letting be a function such that (a construction described by the S-m-n theorem). One can then verify that a fixed-point of this is an index as required. The theorem is constructive in the sense that a fixed computable function maps an index for into the index .

This can be further extended to computable functions with this statement:

Let be a total computable function. Then, there exists a program such that .

This essentially means that if we take a program, we apply an effective transformation in an extensional way (say, replace instructions such as successor, jump, remove lines), there will always be a program which is not changed by the transformation of the function, even before or after it.

This theorem can therefore be interpreted in the following manner “given any effective procedure to transform programs, there is always a program such that, when modified by the procedure, it does exactly what it did before, or it's impossible to write a program that changes the extensional behaviour of all other programs”.

Comparison to Rogers's theorem

Kleene's second recursion theorem and Rogers's theorem can both be proved, rather simply, from each other. [6] However, a direct proof of Kleene's theorem [7] does not make use of a universal program, which means that the theorem holds for certain subrecursive programming systems that do not have a universal program.

Application to quines

A classic example using the second recursion theorem is the function . The corresponding index in this case yields a computable function that outputs its own index when applied to any value. [8] When expressed as computer programs, such indices are known as quines .

The following example in Lisp illustrates how the in the corollary can be effectively produced from the function . The function s11 in the code is the function of that name produced by the S-m-n theorem.

Q can be changed to any two-argument function.

(setqQ'(lambda(xy)x))(setqs11'(lambda(fx)(list'lambda'(y)(listfx'y))))(setqn(list'lambda'(xy)(listQ(lists11'x'x)'y)))(setqp(eval(lists11nn)))

The results of the following expressions should be the same. p(nil)

(eval(listpnil))

Q(p, nil)

(eval(listQpnil))

Application to elimination of recursion

Suppose that and are total computable functions that are used in a recursive definition for a function :

The second recursion theorem can be used to show that such equations define a computable function, where the notion of computability does not have to allow, prima facie, for recursive definitions (for example, it may be defined by μ-recursion, or by Turing machines). This recursive definition can be converted into a computable function that assumes is an index to itself, to simulate recursion:

The recursion theorem establishes the existence of a computable function such that . Thus satisfies the given recursive definition.

Reflexive programming

Reflexive, or reflective, programming refers to the usage of self-reference in programs. Jones presents a view of the second recursion theorem based on a reflexive language. [9] It is shown that the reflexive language defined is not stronger than a language without reflection (because an interpreter for the reflexive language can be implemented without using reflection); then, it is shown that the recursion theorem is almost trivial in the reflexive language.

The first recursion theorem

While the second recursion theorem is about fixed points of computable functions, the first recursion theorem is related to fixed points determined by enumeration operators, which are a computable analogue of inductive definitions. An enumeration operator is a set of pairs (A,n) where A is a (code for a) finite set of numbers and n is a single natural number. Often, n will be viewed as a code for an ordered pair of natural numbers, particularly when functions are defined via enumeration operators. Enumeration operators are of central importance in the study of enumeration reducibility.

Each enumeration operator Φ determines a function from sets of naturals to sets of naturals given by

A recursive operator is an enumeration operator that, when given the graph of a partial recursive function, always returns the graph of a partial recursive function.

A fixed point of an enumeration operator Φ is a set F such that Φ(F) = F. The first enumeration theorem shows that fixed points can be effectively obtained if the enumeration operator itself is computable.

First recursion theorem. The following statements hold.
  1. For any computable enumeration operator Φ there is a recursively enumerable set F such that Φ(F) = F and F is the smallest set with this property.
  2. For any recursive operator Ψ there is a partial computable function φ such that Ψ(φ) = φ and φ is the smallest partial computable function with this property.

The first recursion theorem is also called Fixed point theorem (of recursion theory) [10] . There is also a definition which can be applied to recursive functionals as follows:

Let be a recursive functional. Then has a least fixed point which is computable i.e.

1)

2) such that it holds that

3) is computable

Example

Like the second recursion theorem, the first recursion theorem can be used to obtain functions satisfying systems of recursion equations. To apply the first recursion theorem, the recursion equations must first be recast as a recursive operator.

Consider the recursion equations for the factorial function f:

The corresponding recursive operator Φ will have information that tells how to get to the next value of f from the previous value. However, the recursive operator will actually define the graph of f. First, Φ will contain the pair . This indicates that f(0) is unequivocally 1, and thus the pair (0,1) is in the graph of f.


Next, for each n and m, Φ will contain the pair . This indicates that, if f(n) is m, then f(n + 1) is (n + 1)m, so that the pair (n + 1, (n + 1)m) is in the graph of f. Unlike the base case f(0) = 1, the recursive operator requires some information about f(n) before it defines a value of f(n + 1).

The first recursion theorem (in particular, part 1) states that there is a set F such that Φ(F) = F. The set F will consist entirely of ordered pairs of natural numbers, and will be the graph of the factorial function f, as desired.

The restriction to recursion equations that can be recast as recursive operators ensures that the recursion equations actually define a least fixed point. For example, consider the set of recursion equations:

There is no function g satisfying these equations, because they imply g(2) = 1 and also imply g(2) = 0. Thus there is no fixed point g satisfying these recursion equations. It is possible to make an enumeration operator corresponding to these equations, but it will not be a recursive operator.

Proof sketch for the first recursion theorem

The proof of part 1 of the first recursion theorem is obtained by iterating the enumeration operator Φ beginning with the empty set. First, a sequence Fk is constructed, for . Let F0 be the empty set. Proceeding inductively, for each k, let Fk + 1 be . Finally, F is taken to be . The remainder of the proof consists of a verification that F is recursively enumerable and is the least fixed point of Φ. The sequence Fk used in this proof corresponds to the Kleene chain in the proof of the Kleene fixed-point theorem.

The second part of the first recursion theorem follows from the first part. The assumption that Φ is a recursive operator is used to show that the fixed point of Φ is the graph of a partial function. The key point is that if the fixed point F is not the graph of a function, then there is some k such that Fk is not the graph of a function.

Comparison to the second recursion theorem

Compared to the second recursion theorem, the first recursion theorem produces a stronger conclusion but only when narrower hypotheses are satisfied. Rogers uses the term weak recursion theorem for the first recursion theorem and strong recursion theorem for the second recursion theorem. [3]

One difference between the first and second recursion theorems is that the fixed points obtained by the first recursion theorem are guaranteed to be least fixed points, while those obtained from the second recursion theorem may not be least fixed points.

A second difference is that the first recursion theorem only applies to systems of equations that can be recast as recursive operators. This restriction is similar to the restriction to continuous operators in the Kleene fixed-point theorem of order theory. The second recursion theorem can be applied to any total recursive function.

Generalized theorem

In the context of his theory of numberings, Ershov showed that Kleene's recursion theorem holds for any precomplete numbering. [11] A Gödel numbering is a precomplete numbering on the set of computable functions so the generalized theorem yields the Kleene recursion theorem as a special case. [12]

Given a precomplete numbering , then for any partial computable function with two parameters there exists a total computable function with one parameter such that

See also

Related Research Articles

In computability theory, a primitive recursive function is, roughly speaking, a function that can be computed by a computer program whose loops are all "for" loops. Primitive recursive functions form a strict subset of those general recursive functions that are also total functions.

In computability theory, Rice's theorem states that all non-trivial semantic properties of programs are undecidable. A semantic property is one about the program's behavior, unlike a syntactic property. A property is non-trivial if it is neither true for every program, nor false for every program.

The Riesz representation theorem, sometimes called the Riesz–Fréchet representation theorem after Frigyes Riesz and Maurice René Fréchet, establishes an important connection between a Hilbert space and its continuous dual space. If the underlying field is the real numbers, the two are isometrically isomorphic; if the underlying field is the complex numbers, the two are isometrically anti-isomorphic. The (anti-) isomorphism is a particular natural isomorphism.

In mathematical logic and computer science, a general recursive function, partial recursive function, or μ-recursive function is a partial function from natural numbers to natural numbers that is "computable" in an intuitive sense – as well as in a formal one. If the function is total, it is also called a total recursive function. In computability theory, it is shown that the μ-recursive functions are precisely the functions that can be computed by Turing machines. The μ-recursive functions are closely related to primitive recursive functions, and their inductive definition (below) builds upon that of the primitive recursive functions. However, not every total recursive function is a primitive recursive function—the most famous example is the Ackermann function.

<span class="mw-page-title-main">Spherical harmonics</span> Special mathematical functions defined on the surface of a sphere

In mathematics and physical science, spherical harmonics are special functions defined on the surface of a sphere. They are often employed in solving partial differential equations in many scientific fields. A list of the spherical harmonics is available in Table of spherical harmonics.

In computability theory, a set S of natural numbers is called computably enumerable (c.e.), recursively enumerable (r.e.), semidecidable, partially decidable, listable, provable or Turing-recognizable if:

In computability theory, the μ-operator, minimization operator, or unbounded search operator searches for the least natural number with a given property. Adding the μ-operator to the primitive recursive functions makes it possible to define all computable functions.

In computability theory the S m
n
 
theorem
, written also as "smn-theorem" or "s-m-n theorem" is a basic result about programming languages. It was first proved by Stephen Cole Kleene (1943). The name S m
n
 
comes from the occurrence of an S with subscript n and superscript m in the original formulation of the theorem.

In computational complexity theory the Blum axioms or Blum complexity axioms are axioms that specify desirable properties of complexity measures on the set of computable functions. The axioms were first defined by Manuel Blum in 1967.

In mathematical logic, Heyting arithmetic is an axiomatization of arithmetic in accordance with the philosophy of intuitionism. It is named after Arend Heyting, who first proposed it.

In computability theory, productive sets and creative sets are types of sets of natural numbers that have important applications in mathematical logic. They are a standard topic in mathematical logic textbooks such as Soare (1987) and Rogers (1987).

In computability theory the Myhill isomorphism theorem, named after John Myhill, provides a characterization for two numberings to induce the same notion of computability on a set.

In computability theory, a function is called limit computable if it is the limit of a uniformly computable sequence of functions. The terms computable in the limit, limit recursive and recursively approximable are also used. One can think of limit computable functions as those admitting an eventually correct computable guessing procedure at their true value. A set is limit computable just when its characteristic function is limit computable.

In the mathematical discipline of set theory, there are many ways of describing specific countable ordinals. The smallest ones can be usefully and non-circularly expressed in terms of their Cantor normal forms. Beyond that, many ordinals of relevance to proof theory still have computable ordinal notations. However, it is not possible to decide effectively whether a given putative ordinal notation is a notation or not ; various more-concrete ways of defining ordinals that definitely have notations are available.

In mathematics, in the area of wavelet analysis, a refinable function is a function which fulfils some kind of self-similarity. A function is called refinable with respect to the mask if

In recursion theory, hyperarithmetic theory is a generalization of Turing computability. It has close connections with definability in second-order arithmetic and with weak systems of set theory such as Kripke–Platek set theory. It is an important tool in effective descriptive set theory.

In computability theory, the T predicate, first studied by mathematician Stephen Cole Kleene, is a particular set of triples of natural numbers that is used to represent computable functions within formal theories of arithmetic. Informally, the T predicate tells whether a particular computer program will halt when run with a particular input, and the corresponding U function is used to obtain the results of the computation if the program does halt. As with the smn theorem, the original notation used by Kleene has become standard terminology for the concept.

In constructive mathematics, Church's thesis is an axiom stating that all total functions are computable functions.

In computability theory, index sets describe classes of computable functions; specifically, they give all indices of functions in a certain class, according to a fixed Gödel numbering of partial computable functions.

In mathematics, calculus on Euclidean space is a generalization of calculus of functions in one or several variables to calculus of functions on Euclidean space as well as a finite-dimensional real vector space. This calculus is also known as advanced calculus, especially in the United States. It is similar to multivariable calculus but is somewhat more sophisticated in that it uses linear algebra more extensively and covers some concepts from differential geometry such as differential forms and Stokes' formula in terms of differential forms. This extensive use of linear algebra also allows a natural generalization of multivariable calculus to calculus on Banach spaces or topological vector spaces.

References

Footnotes

  1. Kleene, Stephen C. (1938). "On notation for ordinal numbers" (PDF). Journal of Symbolic Logic . 3 (4): 150–155. doi:10.2307/2267778. ISSN   0022-4812. JSTOR   2267778. S2CID   34314018 . Retrieved 6 May 2020.
  2. Kleene 1952.
  3. 1 2 Rogers 1967.
  4. Rogers 1967, §11.2.
  5. Soare, R.I. (1987). Recursively Enumerable Sets and Degrees: A Study of Computable Functions and Computably Generated Sets. Perspectives in Mathematical Logic. Berlin and New York City: Springer-Verlag. p. 88. ISBN   9780387152998. OCLC   318368332.
  6. Jones 1997, pp. 229–30.
  7. Kleene 1952, pp. 352–3.
  8. Cutland, Nigel J. (1980). Computability: An Introduction to Recursive Function Theory. Cambridge University Press. p. 204. doi:10.1017/cbo9781139171496. ISBN   9781139935609. OCLC   488175597 . Retrieved 6 May 2020.
  9. Jones 1997.
  10. Cutland, Nigel. Computability: an introduction to recursive function theory.
  11. Barendregt, Henk; Terwijn, Sebastiaan A. (2019). "Fixed point theorems for precomplete numberings" . Annals of Pure and Applied Logic. 170 (10): 1151–1161. doi:10.1016/j.apal.2019.04.013. hdl: 2066/205967 . ISSN   0168-0072. S2CID   52289429 . Retrieved 6 May 2020. p. 1151.
  12. See Ershov 1999 , §4.14 for a survey in English.

Further reading