Cite

This course has no released version yet: the text at this address may change. Cite a released version when one exists.

/courses/fundamentals/fixed-point
@misc{fundamentals-fixed-point,
  title = {{Kleene's fixed point theorem}},
  howpublished = {Lesson 5 of \emph{Fundamentals of computability}, Computability Theory course notes},
  url = {/courses/fundamentals/fixed-point},
  note = {Unreleased working version}
}

To cite a single statement, use the # link that appears next to its heading.

Lesson 5 of 6

Kleene's fixed point theorem

Every total computable transformation of indices has a fixed point up to the function computed; the version with parameters; self-referential programs and applications.

40 min6 questions
Fundamentals of computability · lesson 5 of 6
  1. Programs as numbers
  2. The universal function and the SMN theorem
  3. The halting problem
  4. Computably enumerable sets
  5. Kleene's fixed point theorem
  6. Rice's theorem

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

Theorem 5.1 (Fixed point theorem).#

For every total computable function f:N→Nf : \nat \to \nat, there is e∈Ne \in \nat such that Φf(e)=Φe\Phi_{f(e)} = \Phi_e.

The equality is between partial functions: Φf(e)(x)≃Φe(x)\Phi_{f(e)}(x) \simeq \Phi_e(x) for every xx. In general f(e)≠ef(e) \neq e; the fixed point is extensional, at the level of the functions computed. A transformation such as f(e)=e+1f(e) = e + 1 has no fixed point in the literal sense, but by the theorem there is an ee such that the programs ee and e+1e + 1 compute the same function.

Proof of Theorem 5.1.

By Corollary 2.3, there is a total computable function dd such that for all nn and xx,

Φd(n)(x)≃ΦΦn(n)(x),\Phi_{d(n)}(x) \simeq \Phi_{\Phi_n(n)}(x),

where the right-hand side is undefined if Φn(n) ⁣ ⁣↑\Phi_n(n)\diverge: the program d(n)d(n), on input xx, computes Φn(n)\Phi_n(n), and if this halts with value mm, runs Φm\Phi_m on xx. The function f∘df \circ d is total computable; let vv be an index of it, so that Φv(n)=f(d(n))\Phi_v(n) = f(d(n)) for every nn, and Φv\Phi_v is total. Let e=d(v)e = d(v). Then

Φe=Φd(v)=ΦΦv(v)=Φf(d(v))=Φf(e),\Phi_e = \Phi_{d(v)} = \Phi_{\Phi_v(v)} = \Phi_{f(d(v))} = \Phi_{f(e)},

where the second equality uses Φv(v) ⁣ ⁣↓\Phi_v(v)\converge, which holds since Φv\Phi_v is total.

The proof is a diagonal argument. Consider the table whose row nn is the function ΦΦn(n)\Phi_{\Phi_n(n)}, the function computed by the program found on the diagonal. The transformation ff applied along the diagonal gives the row vv; so the row vv is both ΦΦv(v)\Phi_{\Phi_v(v)}, by definition of the table, and Φf(d(v))\Phi_{f(d(v))}, by the choice of vv. 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.

Corollary 5.2.#

For every partial computable g:N2⇀Ng : \nat^2 \rightharpoonup \nat, there is ee such that Φe(x)≃g(e,x)\Phi_e(x) \simeq g(e, x) for every xx.

Proof of Corollary 5.2.

By Corollary 2.3, there is a total computable ss with Φs(n)(x)≃g(n,x)\Phi_{s(n)}(x) \simeq g(n, x). By Theorem 5.1, there is ee with Φe=Φs(e)\Phi_e = \Phi_{s(e)}, that is, Φe(x)≃g(e,x)\Phi_e(x) \simeq g(e, x).

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 ee as a known value; the corollary provides such an ee. The description must be uniform in ee, that is, define a partial computable function g(e,x)g(e, x).

Example 5.3.#
  1. A program that outputs its own index. With g(e,x)=eg(e, x) = e, there is ee such that Φe(x)=e\Phi_e(x) = e for every xx. In a programming language, this is a quine, a program that prints its own text.
  2. A program halting only on its own index. With g(e,x)≃0g(e, x) \simeq 0 if x=ex = e and undefined otherwise, there is ee with We={e}W_e = \{ e \}.
  3. Two consecutive indices of the same function. With f(e)=e+1f(e) = e + 1, there is ee with Φe=Φe+1\Phi_e = \Phi_{e+1}.
Remark 5.4 (Fixed points and paradoxes).#

The corollary allows self-referential definitions that look paradoxical, such as a program ee with Φe(x)≃Φe(x)+1\Phi_e(x) \simeq \Phi_e(x) + 1, obtained from g(e,x)≃Φe(x)+1g(e, x) \simeq \Phi_e(x) + 1. There is no contradiction: the equation forces Φe(x) ⁣ ⁣↑\Phi_e(x)\diverge for every xx, 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.

Theorem 5.5 (Fixed point theorem with parameters).#

For every total computable f:N2→Nf : \nat^2 \to \nat, there is a total computable n:N→Nn : \nat \to \nat such that Φn(y)=Φf(y,n(y))\Phi_{n(y)} = \Phi_{f(y, n(y))} for every yy.

Proof of Theorem 5.5.

Follow the proof of Theorem 5.1, uniformly in yy. Let dd be as in that proof. By Corollary 2.3 applied to (y,m)↦f(y,d(m))(y, m) \mapsto f(y, d(m)), there is a total computable vv with Φv(y)(m)=f(y,d(m))\Phi_{v(y)}(m) = f(y, d(m)) for all yy and mm. Let n(y)=d(v(y))n(y) = d(v(y)). Since Φv(y)\Phi_{v(y)} is total,

Φn(y)=Φd(v(y))=ΦΦv(y)(v(y))=Φf(y,d(v(y)))=Φf(y,n(y)).\Phi_{n(y)} = \Phi_{d(v(y))} = \Phi_{\Phi_{v(y)}(v(y))} = \Phi_{f(y, d(v(y)))} = \Phi_{f(y, n(y))}.
Proposition 5.6.#

Every total computable ff has infinitely many fixed points: for every kk, there is e≥ke \geq k with Φf(e)=Φe\Phi_{f(e)} = \Phi_e.

Proof of Proposition 5.6.

The finitely many functions Φ0,…,Φk−1\Phi_0, \dots, \Phi_{k-1} are not all the partial computable functions, since the constant functions are infinitely many and pairwise distinct, so there is an index cc with Φc≠Φi\Phi_c \neq \Phi_i for every i<ki < k. Let g(x)=cg(x) = c for x<kx < k and g(x)=f(x)g(x) = f(x) for x≥kx \geq k; gg is total computable, the finite case distinction being computable. Let ee be a fixed point of gg. If e<ke < k, then Φe=Φg(e)=Φc\Phi_e = \Phi_{g(e)} = \Phi_c, contradicting the choice of cc. So e≥ke \geq k, and Φe=Φg(e)=Φf(e)\Phi_e = \Phi_{g(e)} = \Phi_{f(e)}.

The proof uses the index cc as a fixed number; it need not be found by an algorithm, since only the computability of gg matters, and gg is computable for every value of the constant cc.

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.

Proposition 5.7.#
  1. The halting set ∅′\emptyset' is not computable.
  2. For every aa, the set {e:Φe=Φa}\{ e : \Phi_e = \Phi_a \} is not computable.
Proof of Proposition 5.7.
  1. Suppose ∅′\emptyset' is computable. By Corollary 5.2, there is ee such that Φe(x)≃0\Phi_e(x) \simeq 0 if e∉∅′e \notin \emptyset', and Φe(x)\Phi_e(x) is undefined if e∈∅′e \in \emptyset'; the definition is uniform in ee, since membership in ∅′\emptyset' is decided by an algorithm. If e∈∅′e \in \emptyset', then Φe(e) ⁣ ⁣↑\Phi_e(e)\diverge, so e∉∅′e \notin \emptyset'; if e∉∅′e \notin \emptyset', then Φe(e)=0\Phi_e(e) = 0, so e∈∅′e \in \emptyset'. Both cases are contradictory.
  2. Let P={e:Φe=Φa}P = \{ e : \Phi_e = \Phi_a \}, suppose it computable, and fix bb with Φb≠Φa\Phi_b \neq \Phi_a, for instance an index of a function differing from Φa\Phi_a at 00. Let f(x)=bf(x) = b if x∈Px \in P and f(x)=af(x) = a otherwise, a total computable function. For a fixed point ee of ff: if e∈Pe \in P then Φe=Φf(e)=Φb≠Φa\Phi_e = \Phi_{f(e)} = \Phi_b \neq \Phi_a, so e∉Pe \notin P; if e∉Pe \notin P then Φe=Φa\Phi_e = \Phi_a, so e∈Pe \in P.

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

Exercise 5.8 ★.

Show that there is ee such that Φe(x)=e+x\Phi_e(x) = e + x for all xx, and ee such that We={0,1,…,e}W_e = \{ 0, 1, \dots, e \}.

Solution

Apply Corollary 5.2 to g(e,x)=e+xg(e, x) = e + x, and to g(e,x)≃0g(e, x) \simeq 0 if x≤ex \leq e, undefined otherwise. Both are partial computable functions of (e,x)(e, x).

Exercise 5.9 ★★.

Show that there is no total computable ff such that, for every ee, the sets Wf(e)W_{f(e)} and WeW_e differ by exactly one element. Show also that the conclusion of the fixed point theorem cannot be strengthened to f(e)=ef(e) = e.

Solution

A fixed point ee of ff satisfies Φf(e)=Φe\Phi_{f(e)} = \Phi_e, hence Wf(e)=WeW_{f(e)} = W_e, which contradicts the hypothesis. For the second statement, f(e)=e+1f(e) = e + 1 is total computable, and f(e)≠ef(e) \neq e for every ee: the fixed point given by the theorem is extensional only.

Exercise 5.10 ★★★.

An index ee is minimal if Φi≠Φe\Phi_i \neq \Phi_e for every i<ei < e. Show that the set of minimal indices contains no infinite c.e. subset.

Hint

Given an infinite c.e. set AA of minimal indices, consider the function sending ee to an element of AA greater than ee, and apply the fixed point theorem.

Solution

Let AA be an infinite c.e. set of minimal indices, and hh a total computable function with range AA. Let f(e)=h(μm [h(m)>e])f(e) = h(\mu m\ [h(m) > e]), a total computable function, since AA is infinite; its values lie in AA and f(e)>ef(e) > e. Let ee be a fixed point of ff. Then e<f(e)e < f(e) and Φe=Φf(e)\Phi_e = \Phi_{f(e)}, so f(e)f(e) is not minimal, although it belongs to AA.

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.