Can a machine self-reproduce? Intuition might tell us that a factory must be more complex than its output, however the human body seems to contradict this idea

On a simpler level, can an algorithm “self-reproduce”?

We will construct a Turing machine that prints out a copy of its own description, which we will call

To start, we can easily make a computable function , where if is any string, is the description of a Turing machine that prints out and then halts

We construct in two parts and
In whole,

  1. : Print on the tape
  2. : Look at the tape, calculate
  3. : Combine and into
  4. : Print and halt

This construction can be easily done in any programming language

Here’s an English example,

Title

Print out two copies of the following, the second one in quotes:
“Print out two copies of the following, the second one in quotes:”

In this example, the line with quotes acts as and the line without acts as

We can extend this technique slightly to obtain the theorem

Recursion theorem: Let be a Turing machine that computes a function . There is a Turing machine that computes a function where for every ,

In other words, we can make any Turing machine have a copy of its own description

This opens up interesting doors for how we can define a machine, for example now we can write,
“On any input:

  1. Obtain, via the recursion theorem,
  2. Print

Or a fun proof that a machine that decides cannot exist because it leads to contradictions,
“On input :

  1. Obtain, via the recursion theorem,
  2. Run on
  3. Do the opposite of what says.”

Definition: is minimal if there is no Turing machine equivalent to that has a shorter description,

Theorem: is not Turing-recognizable

Assume that some enumerates and obtain a contradiction,
“On input :

  1. Obtain, via the recursion theorem, .
  2. Run until a machine appears with a longer description than .
  3. Simulate on .”

Definition: A fixed point of a function is a value that isn’t changed by application of the function

Theorem: Let be a computable function, then there is a Turing machine for which describes a Turing machine equivalent to

“On input :

  1. Obtain, via the recursion theorem,
  2. Compute
  3. Simulate on .”