Kleene’s Recursion Theorem

Motivation

  • Self Reproduction: A car factory must be more complex than the cars it produces. Can machines construct replicas of themselves?

Self-Pringting Machines

  • Can we design a Turing machine that ignores its input and prints a copy of its own description?

Lemma

There is a computable function , where if is any string, is the description of a Turing machine that prints out and then halts.

We construct a TM that prints ites code on the tape.

  • TM contains two parts and
  • runs first and passes the control to once completed
  • uses the machine , described by
    • So depends on machine and we cannot complete its description without specifying the details of
  • Construct
    • We cannot define it to be as it will be circular
    • However, we can computes from the output produces
    • On input , compute , combine the result with to make a complete TM, then it print the description of this TM and halt

If we now run ,

  1. First runs and it prints
  2. Then starts and get
  3. calculates and combines that with into a TM, which is
  4. prints and halt Impressive!

We can actually implement this construction in any Turing complete programming language to obtain a program that outputs a copy of itself.

s='s=%r;print(s%%s)';print(s%s)
Print out two copies of the following, the second one in quotes: “Print out two copies of the following, the second one in quotes:”

Kleene’s Recursion Theorem

Kleene's Recursion Theorem

Let be a TM that computes a function . There exists a TM computing function such that for every ,

We construct a TM in three parts .

  1. , here we redesign it so that writes its output after the input to preserve it.
  2. is the machine that finds the part on the tape and runs to obtain . Then combines and into a single machine and obtains its description . then transforms the content of the tape to and passes control to .

Applications

  • The theorem states that Turing machines can obtain their own description and then go on to compute with it
  • Except for making a machine that prints a copy of itself, it can be used to prove undecidability

Example

Assume there is a TM decides .

Consider machine : On input , obtains its own description and runs on input , then it does the oppotite of what says!

does not perform as required on .

Minimal Machine

We say a TM is minimal if no TM equivalent to has shorter description. And we claim that the set of minimal TM is not Turing recognizable.

If it is, we can find a enumerator that enumerates .

We can construct a TM : On input , it obtain its description , then run and find the first TM such that is longer than . Now it simulates . So is equivalent to but is shorter than . Contradiction.

Roger's Fixed-Point Theorem

Let be a computable function. Then there is a TM for which describes a machine equivalent to .

Consider machine : On input , it obtains , compute to obtain the description of a TM , then it simulate on .

Gödel’s Incompleteness Theorems

A proof system is an algorithm that satisfies:

  1. Effectiveness: For every statement and proof string , halts with output either 0 or 1. (It can judge whether a proof is correct)
  2. Soundness: If is not true, then for every , Completeness: True statements can be proved.

Gödel's Incompleteness Theorems

Any mathematical proof system which is sufficiently expressive and has computable axioms, cannot be both complete and consistent.

Consider the Halting problem :

If halts on input , there is a mathematical proof for it.

Define TM : On any input, it

  1. Obtain own description
  2. For all and all strings of length :
    1. Check if is a valid ZFC proof for the statement ’ halts’. If yes, then loop forever.
    2. Check if is a valid ZFC proof for the statement ’ loops’. If yes, halt.