Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Kleene's recursion theorem
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Theorem in computability theory}} {{distinguish|text=[[Kleene's theorem]] for regular languages}} {{Use shortened footnotes|date=May 2021}} In [[computability theory]], '''Kleene's recursion theorems''' are a pair of fundamental results about the application of [[computable function]]s to their own descriptions. The theorems were first proved by [[Stephen Cole Kleene|Stephen Kleene]] in 1938{{r|Kleene1938}} and appear in his 1952 book ''Introduction to Metamathematics''.{{sfn|Kleene|1952}} A related theorem, which constructs fixed points of a computable function, is known as '''Rogers's theorem''' and is due to [[Hartley Rogers, Jr.]]{{sfn|Rogers|1967}} The recursion theorems can be applied to construct [[fixed point (mathematics)|fixed points]] of certain operations on [[computable function]]s, to generate [[quine (computing)|quines]], and to construct functions defined via [[recursive definition]]s. == Notation == The statement of the theorems refers to an [[admissible numbering]] <math>\varphi</math> of the [[partial recursive function]]s, such that the function corresponding to index <math>e</math> is <math>\varphi_e</math>. If <math>F</math> and <math>G</math> are [[partial function]]s on the natural numbers, the notation <math>F \simeq G</math> indicates that, for each ''n'', either <math>F(n)</math> and <math>G(n)</math> are both defined and are equal, or else <math>F(n)</math> and <math>G(n)</math> are both undefined. == Rogers's fixed-point theorem == Given a function <math>F</math>, a '''fixed point''' of <math>F</math> is an index <math>e</math> such that <math>\varphi_e \simeq \varphi_{F(e)}</math>. 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.{{sfn|Rogers|1967|loc=§11.2}} {{math theorem | name = Rogers's fixed-point theorem | math_statement = If <math>F</math> is a total computable function, it has a fixed point in the above sense.}} This essentially means that if we apply an [[Effectiveness|effective]] transformation to programs (say, replace instructions such as successor, jump, remove lines), there will always be a program whose behaviour is not altered by the transformation. This theorem can therefore be interpreted in the following manner: “given any effective procedure to transform programs, there is always a program that, when modified by the procedure, does exactly what it did before”, or: “it’s impossible to write a program that changes the extensional behaviour of all programs”. === Proof of the fixed-point theorem === The proof uses a particular total computable function <math>h</math>, defined as follows. Given a natural number <math>x</math>, the function <math>h</math> outputs the index of the partial computable function that performs the following computation: :Given an input <math>y</math>, first attempt to compute <math>\varphi_{x}(x)</math>. If that computation returns an output <math>e</math>, then compute <math>\varphi_e(y)</math> and return its value, if any. Thus, for all indices <math>x</math> of partial computable functions, if <math>\varphi_x(x)</math> is defined, then <math>\varphi_{h(x)} \simeq \varphi_{\varphi_x(x)}</math>. If <math>\varphi_x(x)</math> is not defined, then <math>\varphi_{h(x)}</math> is a function that is nowhere defined. The function <math>h</math> can be constructed from the partial computable function <math>g(x,y)</math> described above and the [[s-m-n theorem]]: for each <math>x</math>, <math>h(x)</math> is the index of a program which computes the function <math>y \mapsto g(x,y)</math>. To complete the proof, let <math>F</math> be any total computable function, and construct <math>h</math> as above. Let <math>e</math> be an index of the composition <math>F \circ h</math>, which is a total computable function. Then <math>\varphi_{h(e)} \simeq \varphi_{\varphi_e(e)}</math> by the definition of <math>h</math>. But, because <math>e</math> is an index of <math>F \circ h</math>, <math>\varphi_e(e) = (F \circ h)(e)</math>, and thus <math>\varphi_{\varphi_e(e)} \simeq \varphi_{F(h(e))}</math>. By the transitivity of <math>\simeq</math>, this means <math>\varphi_{h(e)} \simeq \varphi_{F(h(e))}</math>. Hence <math>\varphi_n \simeq \varphi_{F(n)}</math> for <math>n = h(e)</math>. This proof is a construction of a [[partial recursive function]] which implements the [[Fixed-point combinator|Y combinator]]. === Fixed-point-free functions === A function <math>F</math> such that <math> \varphi_e \not \simeq \varphi_{F(e)}</math> for all <math>e</math> 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]].{{r|Soare1987_88}} == 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 <math>Q(x,y)</math> there is an index <math>p</math> such that <math>\varphi_p \simeq \lambda y.Q(p,y)</math>. The theorem can be proved from Rogers's theorem by letting <math>F(p)</math> be a function such that <math>\varphi_{F(p)}(y) = Q(p,y)</math> (a construction described by the [[Smn theorem|S-m-n theorem]]). One can then verify that a fixed-point of this <math>F</math> is an index <math>p</math> as required. The theorem is constructive in the sense that a fixed computable function maps an index for <math>Q</math> into the index <math>p</math>. === Comparison to Rogers's theorem === Kleene's second recursion theorem and Rogers's theorem can both be proved, rather simply, from each other.{{sfn|Jones|1997|pp=229-30}} However, a direct proof of Kleene's theorem{{sfn|Kleene|1952|pp=352-3}} 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 <math>Q(x,y)=x</math>. The corresponding index <math>p</math> in this case yields a computable function that outputs its own index when applied to any value.{{r|Cutland1980_204}} When expressed as computer programs, such indices are known as '''[[Quine (computing)|quine]]s'''. The following example in [[Lisp programming language|Lisp]] illustrates how the <math>p</math> in the corollary can be effectively produced from the function <math>Q</math>. The function <code>s11</code> in the code is the function of that name produced by the [[S-m-n theorem]]. <code>Q</code> can be changed to any two-argument function. <syntaxhighlight lang="lisp"> (setq Q '(lambda (x y) x)) (setq s11 '(lambda (f x) (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))) </syntaxhighlight> The results of the following expressions should be the same. <math>\varphi</math> <code>p(nil)</code> <syntaxhighlight lang="lisp"> (eval (list p nil)) </syntaxhighlight> <code>Q(p, nil)</code> <syntaxhighlight lang="lisp"> (eval (list Q p nil)) </syntaxhighlight> === Application to elimination of recursion === Suppose that <math>g</math> and <math>h</math> are total computable functions that are used in a recursive definition for a function <math>f</math>: :<math>f(0,y) \simeq g(y),</math> :<math>f(x+1,y) \simeq h(f(x,y),x,y),</math> 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 [[M-recursive function|μ-recursion]], or by [[Turing machine]]s). This recursive definition can be converted into a computable function <math>\varphi_{F}(e,x,y)</math> that assumes <math>e</math> is an index to itself, to simulate recursion: :<math>\varphi_{F}(e,0,y) \simeq g(y),</math> :<math>\varphi_{F}(e,x+1,y) \simeq h(\varphi_e(x,y),x,y).</math> The recursion theorem establishes the existence of a computable function <math>\varphi_f</math> such that <math>\varphi_f(x,y) \simeq \varphi_{F}(f,x,y)</math>. Thus <math>f</math> satisfies the given recursive definition. === Reflexive programming === Reflexive, or [[Reflection (computer programming)|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.{{sfn|Jones|1997}} 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 ([[Gödel number|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 :<math>\Phi(X) = \{ n \mid \exists A \subseteq X [(A,n) \in \Phi]\}.</math> 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 Ψ(φ) = φ and φ is the smallest partial computable function with this property. The first recursion theorem is also called Fixed point theorem (of recursion theory).<ref>{{Cite book |last=Cutland |first=Nigel |title=Computability: an introduction to recursive function theory}}</ref> There is also a definition which can be applied to [[Primitive recursive functional|recursive functionals]] as follows: Let <math>\Phi: \mathbb{F}(\mathbb{N}^k) \rightarrow (\mathbb{N}^k)</math> be a recursive functional. Then <math>\Phi</math> has a least fixed point <math>f_{\Phi}: \mathbb{N}^k \rightarrow \mathbb{N}</math> which is computable i.e. 1) <math>\Phi(f_{\phi})=f_{\Phi}</math> 2) <math>\forall g \in \mathbb{F}(\mathbb{N}^k)</math> such that <math>\Phi(g)=g</math> it holds that <math>f_{\Phi}\subseteq g</math> 3) <math>f_{\Phi}</math> 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'':<math display="block">\begin{align} &f(0) = 1 \\ &f(n+1) = (n + 1) \cdot f(n) \end{align}</math>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 <math>( \varnothing, (0, 1))</math>. 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 <math>( \{ (n, m) \}, (n+1, (n+1)\cdot m))</math>. This indicates that, if ''f''(''n'') is ''m'', then {{nowrap|''f''(''n'' + 1)}} is {{nowrap|(''n'' + 1)''m''}}, so that the pair {{nowrap|(''n'' + 1, (''n'' + 1)''m'')}} is in the graph of ''f''. Unlike the base case {{nowrap|1=''f''(0) = 1}}, the recursive operator requires some information about ''f''(''n'') before it defines a value of {{nowrap|''f''(''n'' + 1)}}. The first recursion theorem (in particular, part 1) states that there is a set ''F'' such that {{nowrap|1=Φ(''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:<math display="block">\begin{align} &g(0) = 1\\ &g(n + 1) = 1\\ &g(2n) = 0 \end{align}</math>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 ''F''<sub>''k''</sub> is constructed, for <math>k = 0, 1, \ldots</math>. Let ''F''<sub>0</sub> be the empty set. Proceeding inductively, for each ''k'', let ''F''<sub>''k'' + 1</sub> be <math>F_k \cup \Phi(F_k)</math>. Finally, ''F'' is taken to be <math display="inline">\bigcup F_k</math>. The remainder of the proof consists of a verification that ''F'' is recursively enumerable and is the least fixed point of Φ. The sequence ''F''<sub>''k''</sub> 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 ''F''<sub>''k''</sub> 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.{{sfn|Rogers|1967}} 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, [[Yury Yershov|Ershov]] showed that Kleene's recursion theorem holds for any [[precomplete numbering]].{{r|BarendregtTerwijn2019_1151}} 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.<ref>See {{harvnb|Ershov|1999|loc=§4.14}} for a survey in English.</ref> Given a precomplete numbering <math>\nu</math>, then for any partial computable function <math>f</math> with two parameters there exists a total computable function <math>t</math> with one parameter such that :<math>\forall n \in \mathbb{N} : \nu \circ f(n,t(n)) = \nu \circ t(n).</math> == See also == * [[Denotational semantics]], where another least fixed point theorem is used for the same purpose as the first recursion theorem. * [[Fixed-point combinator]]s, 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 == * {{Cite book |last=Ershov |first=Yuri L. |author-link=Yury Yershov |date=1999 |chapter=Part 4: Mathematics and Computability Theory. 14. Theory of numbering |editor-last=Griffor |editor-first=Edward R. |title=Handbook of Computability Theory |series=Studies in logic and the foundations of mathematics |volume=140 |location=Amsterdam |publisher=[[Elsevier]] |pages=473–503 |isbn=9780444898821 |oclc=162130533 |access-date=6 May 2020 |url=https://books.google.com/books?id=KqeXZ4pPd5QC }} * {{Cite book |last=Jones |first=Neil D. |author-link=Neil D. Jones |date=1997 |title=Computability and complexity: From a Programming Perspective |location=[[Cambridge, Massachusetts]] |publisher=[[MIT Press]] |isbn=9780262100649 |oclc=981293265 }} * {{Cite book |last=Kleene |first=Stephen C. |author-link=Stephen Cole Kleene |date=1952 |title=Introduction to Metamathematics |series=Bibliotheca Mathematica |publisher=[[North-Holland Publishing]] |isbn=9780720421033 |oclc=459805591 |url=https://archive.org/details/BubliothecaMathematicaStephenColeKleeneIntroductionToMetamathematicsWoltersNoordhoffPublishing1971 |access-date=6 May 2020 }} * {{Cite book |last=Rogers |first=Hartley |author-link=Hartley Rogers Jr. |date=1967 |title=Theory of recursive functions and effective computability |location=[[Cambridge, Massachusetts]] |publisher=[[MIT Press]] |isbn=9780262680523 |oclc=933975989 |access-date=6 May 2020 |url-access=registration |url=https://archive.org/details/theoryofrecursiv00roge}} '''Footnotes''' {{reflist|refs= <ref name=Kleene1938>{{Cite journal |last=Kleene |first=Stephen C. |author-link=Stephen Cole Kleene |date=1938 |title=On notation for ordinal numbers |journal=[[Journal of Symbolic Logic]] |volume=3 |issue=4 |pages=150–155 |issn=0022-4812 |doi=10.2307/2267778 |jstor=2267778 |s2cid=34314018 |access-date=6 May 2020 |url=http://www.thatmarcusfamily.org/philosophy/Course_Websites/Readings/Kleene%20-%20Ordinals.pdf}}</ref> <ref name=Soare1987_88>{{Cite book |last=Soare |first=R.I. |author-link=Robert I. Soare |date=1987 |title=Recursively Enumerable Sets and Degrees: A Study of Computable Functions and Computably Generated Sets|series=Perspectives in Mathematical Logic |location=Berlin and New York City |publisher=[[Springer-Verlag]] |page=88 |isbn=9780387152998 |oclc=318368332}}</ref> <ref name=Cutland1980_204>{{Cite book |last=Cutland |first=Nigel J. |author-link=Nigel Cutland |date=1980 |title=Computability: An Introduction to Recursive Function Theory |publisher=[[Cambridge University Press]] |at=[https://books.google.com/books?id=wAstOUE36kcC&pg=PA204 p. 204] |isbn=9781139935609 |doi=10.1017/cbo9781139171496 |oclc=488175597 |access-date=6 May 2020 |url=https://books.google.com/books?id=wAstOUE36kcC}}</ref> <ref name=BarendregtTerwijn2019_1151>{{Cite journal |last1=Barendregt |first1=Henk |author-link1=Henk Barendregt |last2=Terwijn |first2=Sebastiaan A. |date=2019 |title=Fixed point theorems for precomplete numberings |journal=Annals of Pure and Applied Logic |volume=170 |issue=10 |pages=1151–1161 |issn=0168-0072 |doi=10.1016/j.apal.2019.04.013 |hdl=2066/205967 |hdl-access=free |s2cid=52289429 |access-date=6 May 2020 |url-access=subscription |url=http://www.sciencedirect.com/science/article/pii/S016800721930048X }} p. 1151.</ref> }} ==Further reading== * {{Cite journal |last1=Jockusch |first1=C. G. |author-link1=Carl Jockusch |last2=Lerman |first2=M. |last3=Soare |first3=R.I. |author-link3=Robert I. Soare |last4=Solovay |first4=R.M. |author-link4=Robert M. Solovay |date=1989 |title=Recursively enumerable sets modulo iterated jumps and extensions of Arslanov's completeness criterion |journal=[[The Journal of Symbolic Logic]] |volume=54 |issue=4 |pages=1288–1323 |issn=0022-4812 |doi=10.1017/S0022481200041104 |jstor=2274816|s2cid=32203705 }} == External links == * {{SEP|recursive-functions|Recursive Functions|[[Piergiorgio Odifreddi]]|2012}}. [[Category:Computability theory]] [[Category:Theorems in the foundations of mathematics]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Distinguish
(
edit
)
Template:Harvnb
(
edit
)
Template:Math theorem
(
edit
)
Template:Nowrap
(
edit
)
Template:R
(
edit
)
Template:Reflist
(
edit
)
Template:SEP
(
edit
)
Template:Sfn
(
edit
)
Template:Short description
(
edit
)
Template:Use shortened footnotes
(
edit
)