Kleene’s fixed point theorem, also called the recursion theorem, states that every total computable transformation of indices has a fixed point, in the sense that some index and its image compute the same function. Its main use is to build programs that refer to their own index: one may define a program by a description that mentions its own index, and the theorem guarantees that such a program exists. This device is used throughout computability theory, from Rice’s theorem to the constructions of the theory of c.e. degrees.
5.1 The theorem
For every total computable function , there is such that .
The equality is between partial functions: for every . In general ; the fixed point is extensional, at the level of the functions computed. A transformation such as has no fixed point in the literal sense, but by the theorem there is an such that the programs and compute the same function.
By Corollary 2.3, there is a total computable function such that for all and ,
where the right-hand side is undefined if : the program , on input , computes , and if this halts with value , runs on . The function is total computable; let be an index of it, so that for every , and is total. Let . Then
where the second equality uses , which holds since is total.
The proof is a diagonal argument. Consider the table whose row is the function , the function computed by the program found on the diagonal. The transformation applied along the diagonal gives the row ; so the row is both , by definition of the table, and , by the choice of . Where Cantor’s argument uses a transformation without fixed point to obtain a contradiction, here every transformation is shown to have a fixed point, as in the reading of the diagonal argument given by Lawvere's fixed point theorem.
For every partial computable , there is such that for every .
By Corollary 2.3, there is a total computable with . By Theorem 5.1, there is with , that is, .
The corollary is the form in which the theorem is used. To build a program with a property, describe its behavior as an algorithm that may use its own index as a known value; the corollary provides such an . The description must be uniform in , that is, define a partial computable function .
- A program that outputs its own index. With , there is such that for every . In a programming language, this is a quine, a program that prints its own text.
- A program halting only on its own index. With if and undefined otherwise, there is with .
- Two consecutive indices of the same function. With , there is with .
The corollary allows self-referential definitions that look paradoxical, such as a program with , obtained from . There is no contradiction: the equation forces for every , and is then satisfied, both sides being undefined. Partial functions absorb self-reference, as in Proposition 6.6 of “Diagonalization and computation”; the paradoxes of Russell or of the liar would arise only if every program had to produce a value.
5.2 Fixed points with parameters
The fixed point can be found uniformly in a parameter.
For every total computable , there is a total computable such that for every .
Follow the proof of Theorem 5.1, uniformly in . Let be as in that proof. By Corollary 2.3 applied to , there is a total computable with for all and . Let . Since is total,
Every total computable has infinitely many fixed points: for every , there is with .
The finitely many functions are not all the partial computable functions, since the constant functions are infinitely many and pairwise distinct, so there is an index with for every . Let for and for ; is total computable, the finite case distinction being computable. Let be a fixed point of . If , then , contradicting the choice of . So , and .
The proof uses the index as a fixed number; it need not be found by an algorithm, since only the computability of matters, and is computable for every value of the constant .
5.3 Applications
The fixed point theorem gives short proofs of results that otherwise require explicit diagonal constructions. Here is the undecidability of the halting problem again, and a result on the indices of a fixed function.
- The halting set is not computable.
- For every , the set is not computable.
- Suppose is computable. By Corollary 5.2, there is such that if , and is undefined if ; the definition is uniform in , since membership in is decided by an algorithm. If , then , so ; if , then , so . Both cases are contradictory.
- Let , suppose it computable, and fix with , for instance an index of a function differing from at . Let if and otherwise, a total computable function. For a fixed point of : if then , so ; if then , so .
The second argument works for every set of indices that is closed under equality of the functions computed and is neither empty nor everything. This is Rice’s theorem, the subject of the next lesson.
5.4 Exercises
Show that there is such that for all , and such that .
Solution
Apply Corollary 5.2 to , and to if , undefined otherwise. Both are partial computable functions of .
Show that there is no total computable such that, for every , the sets and differ by exactly one element. Show also that the conclusion of the fixed point theorem cannot be strengthened to .
Solution
A fixed point of satisfies , hence , which contradicts the hypothesis. For the second statement, is total computable, and for every : the fixed point given by the theorem is extensional only.
An index is minimal if for every . Show that the set of minimal indices contains no infinite c.e. subset.
Hint
Given an infinite c.e. set of minimal indices, consider the function sending to an element of greater than , and apply the fixed point theorem.
Solution
Let be an infinite c.e. set of minimal indices, and a total computable function with range . Let , a total computable function, since is infinite; its values lie in and . Let be a fixed point of . Then and , so is not minimal, although it belongs to .
5.5 Notes and references
The fixed point theorem was proved by Kleene in 1938, in a paper on notations for ordinals, where it is used to define functions by effective transfinite recursion. Rogers formulated the version for transformations of indices given here. The result on minimal indices is usually attributed to Blum (1967), in a paper on the size of programs. Moschovakis gives a survey of the many uses of the theorem.
- S. C. Kleene, On notation for ordinal numbers, Journal of Symbolic Logic 3 (1938), 150–155.
- H. Rogers, Theory of Recursive Functions and Effective Computability, McGraw-Hill, 1967.
- M. Blum, On the size of machines, Information and Control 11 (1967), 257–265.
- Y. N. Moschovakis, Kleene’s amazing second recursion theorem, Bulletin of Symbolic Logic 16 (2010), 189–239.