Kleene's Recursion Theorems
Published May 19, 2022
-
By
Marco Garosi
Two of the most important and fundamental results in computability are those by Stephen Kleene — the so called “recursion theorems” — which were first proved by Kleene himself in 1938.
They have profound consequences in the whole field of computability; probably, the two most famous applications are to generate quines and construct fixed points.
A couple of notes about the notation used:
-
TM denotes a Turing Machine;
-
↓ denotes the termination of a function (program).
1º Recursion Theorem
Following is what the first recursion theorem states.
Let
t be a total, recursive function.
⟹∃e:φe=φt(e)
First Recursion Theorem
That is also known as the fixed-point theorem, since it proves there’s a fixed point — namely,
e.
Proof
Let’s define:
φQ(u,x)={φφu(u)(x)↑otherwiseif φu(u)↓
By applying s-m-n theorem (again, be Kleene) it is possible to fix the first parameter —
u —, thus building a new function which only takes one variable (
x).
The function thus obtained is
φg(Q,u)(x).
We know, from the premise, that
t is total and recursive. Function
g is total recursive as well, thanks to s-m-n theorem. This implies that
t∘g is also recursive.
This implies that
∃v TM:φv(u)=t(g(Q,u)).
By substituting
u (which is a generic Turing Machine, TM) with
v (which is a specific TM — we have just constructed it), we get
φv(v)=t(g(Q,v)).
Finally:
φg(Q,v)=φφv(v)=φt(g(Q,v))
Let’s define
e:=g(Q,v). Then,
φe=φt(e).
□
## 2º Recurstion Theorem
Following is what the second recursion theorem states.
Let
f:N2→N be a total recursive function.
⟹∀y ∃g total recursive:φf(g(y),y)=φg(y)
Second Recursion Theorem
Proof
Let’s define:
φp(x,y,z)={φf(φx(x),y)(z)↑otherwiseif φx(x)↓
By applying s-m-n theorem it is possible to fix the first two parameters —
x and
y —, thus getting
φs(p,x,y)(z). The function now has only one variable.
So,
φs(x,y)=φf(φx(x),y if φx(x)↓.
By construction,
s is total (it always terminates) and recursive (can be implemented as a computer program).
⟹∃Q TM:φs(x,y)=φQ(x,y)
So,
∃t total recursive such that:
φs(x,y)=φQ(x,y)=φt(Q,y)(x)
If we define
g(y):=φt(y)(t(y))=s(t(y),y) we get:
φg(y)=φt(y)(t(y))=φs(t(y),y)=φf(φt(y)(t(y),y))=φf(g(y),y)
This proves the statement aforementioned.
□
(Note that in the proof of the second Recursion Theorem the program
p has not been included in the notation throughout the steps to lighten the notation — which is already a bit heavy.)