# Kleene's recursion theorem

Kleene's recursion theorem Not to be confused with Kleene's theorem for regular languages.

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] 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.

Contenuti 1 Notazione 2 Rogers's fixed-point theorem 2.1 Proof of the fixed-point theorem 2.2 Fixed-point-free functions 3 Kleene's second recursion theorem 3.1 Comparison to Rogers's theorem 3.2 Application to quines 3.3 Application to elimination of recursion 3.4 Reflexive programming 4 The first recursion theorem 4.1 Esempio 4.2 Proof sketch for the first recursion theorem 4.3 Comparison to the second recursion theorem 5 Generalized theorem 6 Guarda anche 7 Riferimenti 8 Ulteriori letture 9 External links Notation The statement of the theorems refers to an admissible numbering {stile di visualizzazione varphi } of the partial recursive functions, such that the function corresponding to index {stile di visualizzazione e} è {displaystyle varphi _{e}} .

Se {stile di visualizzazione F} e {stile di visualizzazione G} are partial functions on the natural numbers, the notation {displaystyle Fsimeq G} indicates that, for each n, o {stile di visualizzazione F(n)} e {stile di visualizzazione G(n)} are both defined and are equal, or else {stile di visualizzazione F(n)} e {stile di visualizzazione G(n)} are both undefined.

Rogers's fixed-point theorem Given a function {stile di visualizzazione F} , a fixed point of {stile di visualizzazione F} is an index {stile di visualizzazione e} tale che {displaystyle varphi _{e}simeq varphi _{F(e)}} . Rogers describes the following result as "a simpler version" of Kleene's (secondo) recursion theorem.[4] Rogers's fixed-point theorem. Se {stile di visualizzazione F} is a total computable function, it has a fixed point. Proof of the fixed-point theorem The proof uses a particular total computable function {stile di visualizzazione h} , defined as follows. Given a natural number {stile di visualizzazione x} , the function {stile di visualizzazione h} outputs the index of the partial computable function that performs the following computation: Given an input {stile di visualizzazione y} , first attempt to compute {displaystyle varphi _{X}(X)} . If that computation returns an output {stile di visualizzazione e} , then compute {displaystyle varphi _{e}(y)} and return its value, se del caso.

così, for all indices {stile di visualizzazione x} of partial computable functions, Se {displaystyle varphi _{X}(X)} è definito, poi {displaystyle varphi _{h(X)}simeq varphi _{varfi _{X}(X)}} . Se {displaystyle varphi _{X}(X)} is not defined, poi {displaystyle varphi _{h(X)}} is a function that is nowhere defined. La funzione {stile di visualizzazione h} can be constructed from the partial computable function {stile di visualizzazione g(X,y)} described above and the s-m-n theorem: per ciascuno {stile di visualizzazione x} , {stile di visualizzazione h(X)} is the index of a program which computes the function {displaystyle ymapsto g(X,y)} .

To complete the proof, permettere {stile di visualizzazione F} be any total computable function, and construct {stile di visualizzazione h} come sopra. Permettere {stile di visualizzazione e} be an index of the composition {displaystyle Fcirc h} , which is a total computable function. Quindi {displaystyle varphi _{h(e)}simeq varphi _{varfi _{e}(e)}} by the definition of {stile di visualizzazione h} . Ma, perché {stile di visualizzazione e} is an index of {displaystyle Fcirc h} , {displaystyle varphi _{e}(e)=(Fcirc h)(e)} , e quindi {displaystyle varphi _{varfi _{e}(e)}simeq varphi _{F(h(e))}} . By the transitivity of {displaystyle simeq } , questo significa {displaystyle varphi _{h(e)}simeq varphi _{F(h(e))}} . Quindi {displaystyle varphi _{n}simeq varphi _{F(n)}} per {displaystyle n=h(e)} .

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

Fixed-point-free functions A function {stile di visualizzazione F} tale che {displaystyle varphi _{e}not simeq varphi _{F(e)}} per tutti {stile di visualizzazione e} 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; vedere "Application to quines" sotto.

The second recursion theorem. For any partial recursive function {stile di visualizzazione Q(X,y)} there is an index {stile di visualizzazione p} tale che {displaystyle varphi _{p}simeq lambda y.Q(p,y)} .

The theorem can be proved from Rogers's theorem by letting {stile di visualizzazione F(p)} be a function such that {displaystyle varphi _{F(p)}(y)=Q(p,y)} (a construction described by the S-m-n theorem). One can then verify that a fixed-point of this {stile di visualizzazione F} is an index {stile di visualizzazione p} come richiesto. The theorem is constructive in the sense that a fixed computable function maps an index for Q into the index p.

Comparison to Rogers's theorem Kleene's second recursion theorem and Rogers's theorem can both be proved, rather simply, from each other.[6] Tuttavia, 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 {stile di visualizzazione Q(X,y)=x} . The corresponding index {stile di visualizzazione p} 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 {stile di visualizzazione p} in the corollary can be effectively produced from the function {stile di visualizzazione Q} . 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.

(setq Q '(lambda (x y) X)) (setq s11 '(lambda (fx) (list 'lambda '(y) (list f x 'y)))) (setq n (list 'lambda '(x y) (list Q (list s11 'x 'x) 'y))) (setq p (eval (list s11 n n))) The results of the following expressions should be the same. {stile di visualizzazione varphi } p(nil) (eval (list p nil)) Q(p, nil) (eval (list Q p nil)) Application to elimination of recursion Suppose that {stile di visualizzazione g} e {stile di visualizzazione h} are total computable functions that are used in a recursive definition for a function {stile di visualizzazione f} : {stile di visualizzazione f(0,y)simeq g(y),} {stile di visualizzazione f(x+1,y)simeq h(f(X,y),X,y),} 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 (Per esempio, it may be defined by μ-recursion, or by Turing machines). This recursive definition can be converted into a computable function {displaystyle varphi _{F}(e,X,y)} that assumes {stile di visualizzazione e} is an index to itself, to simulate recursion: {displaystyle varphi _{F}(e,0,y)simeq g(y),} {displaystyle varphi _{F}(e,x+1,y)simeq h(varfi _{e}(X,y),X,y).} The recursion theorem establishes the existence of a computable function {displaystyle varphi _{f}} tale che {displaystyle varphi _{f}(X,y)simeq varphi _{F}(f,X,y)} . così {stile di visualizzazione f} 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); poi, 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 (UN,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 {stile di visualizzazione Phi (X)={nmid exists Asubseteq X[(UN,n)in Phi ]}.} 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. 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. For any recursive operator Ψ there is a partial computable function φ such that Ψ(Phi) = φ and φ is the smallest partial computable function with this property. 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: {stile di visualizzazione f(0)=1} {stile di visualizzazione f(n+1)=(n+1)cdot f(n)} The corresponding recursive operator Φ will have information that tells how to get to the next value of f from the previous value. Tuttavia, the recursive operator will actually define the graph of f. Primo, Φ will contain the pair {stile di visualizzazione (varnothing ,(0,1))} . This indicates that f(0) is unequivocally 1, and thus the pair (0,1) is in the graph of f.

Prossimo, for each n and m, Φ will contain the pair {stile di visualizzazione ({(n,m)},(n+1,(n+1)cdot m))} . This indicates that, if f(n) is m, then f(n + 1) è (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 particolare, parte 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, come desiderato.

The restriction to recursion equations that can be recast as recursive operators ensures that the recursion equations actually define a least fixed point. Per esempio, consider the set of recursion equations: {stile di visualizzazione g(0)=1} {stile di visualizzazione g(n+1)=1} {stile di visualizzazione g(2n)=0} 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. Primo, a sequence Fk is constructed, per {displaystyle k=0,1,ldots } . Let F0 be the empty set. Proceeding inductively, for each k, let Fk + 1 be {stile di visualizzazione F_{K}cup Phi (F_{K})} . Infine, F is taken to be {displaystyle bigcup F_{K}} . 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.[10] 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.[11] Given a precomplete numbering {stile di visualizzazione n } , then for any partial computable function {stile di visualizzazione f} with two parameters there exists a total computable function {stile di visualizzazione t} with one parameter such that {displaystyle forall nin mathbb {N} :nu circ f(n,t(n))=nu circ t(n).} See also Denotational semantics, where another least fixed point theorem is used for the same purpose as the first recursion theorem. Fixed-point combinators, which are used in lambda calculus for the same purpose as the first recursion theorem. Diagonal lemma a closely related result in mathematical logic References Ershov, Yuri L. (1999). "Part 4: Mathematics and Computability Theory. 14. Theory of numbering". In Griffor, Edward R. (ed.). Handbook of Computability Theory. Studies in logic and the foundations of mathematics. vol. 140. Amsterdam: Altro. pp. 473–503. ISBN 9780444898821. OCLC 162130533. Recuperato 6 Maggio 2020. Jones, Neil D. (1997). Computability and complexity: From a Programming Perspective. Cambridge, Massachusetts: MIT stampa. ISBN 9780262100649. OCLC 981293265. Kleine, Stephen C. (1952). Introduction to Metamathematics. Bibliotheca Mathematica. North-Holland Publishing. ISBN 9780720421033. OCLC 459805591. Recuperato 6 Maggio 2020. Rogers, Hartley (1967). Theory of recursive functions and effective computability. Cambridge, Massachusetts: MIT stampa. ISBN 9780262680523. OCLC 933975989. Recuperato 6 Maggio 2020.

Footnotes ^ 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. Recuperato 6 Maggio 2020. ^ Kleene 1952. ^ Salta su: a b Rogers 1967. ^ Rogers 1967, §11.2. ^ Soare, R.I. (1987). Recursively Enumerable Sets and Degrees: A Study of Computable Functions and Computably Generated Sets. Prospettive in logica matematica. Berlin and New York City: Springer-Verlag. p. 88. ISBN 9780387152998. OCLC 318368332. ^ Jones 1997, pp. 229–30. ^ Kleene 1952, pp. 352–3. ^ Cutland, Nigel J. (1980). Computability: An Introduction to Recursive Function Theory. Cambridge University Press. p. 204. doi:10.1017/cbo9781139171496. ISBN 9781139935609. OCLC 488175597. Recuperato 6 Maggio 2020. ^ Jones 1997. ^ 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. Recuperato 6 Maggio 2020. p. 1151. ^ See Ershov 1999, §4.14 for a survey in English. Further reading Jockusch, C. G.; Lerman, M.; Sole, RI; Solovay, R.M. (1989). "Recursively enumerable sets modulo iterated jumps and extensions of Arslanov's completeness criterion". Il diario della logica simbolica. 54 (4): 1288–1323. doi:10.1017/S0022481200041104. ISSN 0022-4812. JSTOR 2274816. link esterno "Recursive Functions" entry by Piergiorgio Odifreddi in the Stanford Encyclopedia of Philosophy, 2012. Categorie: Computability theoryTheorems in the foundations of mathematics

Se vuoi conoscere altri articoli simili a Kleene's recursion theorem puoi visitare la categoria Computability theory.

Vai su

Utilizziamo cookie propri e di terze parti per migliorare l'esperienza dell'utente Maggiori informazioni