Skip to main content

Reductions and the Recursion Theorem

Reductions are the main transport mechanism for impossibility results. Instead of proving every undecidable problem from scratch by diagonalization, we transform known hard instances into new instances. If a solver for the new problem would give a solver for the old problem, then the new problem cannot be decidable.

The recursion theorem deepens the same theme of self-reference. It says, roughly, that a Turing machine can obtain and use its own description. This formalizes self-reproducing and self-aware constructions without relying on informal paradoxes. Together, reductions and self-reference explain why many semantic program questions are beyond total algorithmic decision.

Definitions

A mapping reduction from language AA to language BB, written AmBA\le_m B, is a computable function ff such that for every string ww, wAw\in A if and only if f(w)Bf(w)\in B.

A computable function is a function on strings whose output is produced by some Turing machine that halts on every input.

A language BB is undecidable by reduction if a known undecidable language AA maps to BB. If BB were decidable, then deciding AA would be possible by computing f(w)f(w) and running the decider for BB.

A many-one reduction is another name for mapping reduction. It converts one instance into one instance and then uses only the final yes-or-no answer.

The recursion theorem states that for any computable transformation tt that maps machine descriptions to machine descriptions, there is a Turing machine RR whose behavior is the behavior of the machine described by t(R)t(\langle R\rangle). Informally, programs can be constructed with access to their own descriptions.

Key results

Mapping reductions preserve decidability downward. If AmBA\le_m B and BB is decidable, then AA is decidable. The contrapositive is the common use: if AA is undecidable and AmBA\le_m B, then BB is undecidable.

Mapping reductions also preserve recognizability downward. If AmBA\le_m B and BB is recognizable, then AA is recognizable. The recognizer for AA computes f(w)f(w) and runs the recognizer for BB. Contrapositives involving nonrecognizability are often useful.

Many language-theory problems are undecidable by reductions from ATMA_{TM} or HALTTMHALT_{TM}. Examples include emptiness of Turing-machine languages, equivalence of Turing-machine languages, and ambiguity or equality questions for sufficiently expressive grammar systems. The construction usually embeds one computation question into the behavior of a new machine or grammar.

The recursion theorem gives rigorous self-reference. It can prove the existence of machines that print their own descriptions, machines that refer to their own code inside a reduction, and fixed points for computable program transformations. It supports the idea that self-referential programs are not loopholes in the formal model; they are part of it.

A reduction proof should be readable as an algorithm plus two lemmas. The algorithm takes an arbitrary source instance and produces a target instance. The first lemma proves that yes source instances become yes target instances. The second lemma proves that no source instances become no target instances. If the target property is about a constructed machine, these lemmas usually analyze what that machine does in the cases where the original machine accepts, rejects, or loops.

For undecidability, the reduction function may perform extensive syntactic construction, but it may not solve the source problem along the way. When reducing from ATMA_{TM}, the function can write code for a new machine that simulates MM on ww later. It cannot first determine whether MM accepts ww and then choose an output accordingly, because that would already solve the undecidable problem. This distinction between building a simulator and knowing its outcome is essential.

Mapping reductions are stricter than Turing reductions. A mapping reduction gets one transformed instance and then uses the target answer directly. A Turing reduction may ask multiple adaptive oracle questions. Sipser's core development emphasizes mapping reductions because they are simple, composable, and strong enough for many undecidability and NP-completeness proofs. Later advanced topics may use broader reducibility notions.

Self-reference through the recursion theorem is often surprising because it removes the need for informal "this program reads its own file" assumptions. The theorem says that for any computable way of transforming program descriptions, some program is a fixed point of that transformation. This is a formal version of a quine, but it is also a proof tool. It lets machines refer to their own descriptions inside diagonal arguments without smuggling in an external naming mechanism.

In language-theory undecidability, reductions often build machines whose languages have a property exactly when the source computation behaves a certain way. For emptiness, the machine may accept everything if MM accepts ww and nothing otherwise. For equivalence, two machines may be constructed to differ only in the accepting case. For grammar-related problems, computation histories can be encoded so that a grammar generates invalid histories, making validity equivalent to a computation question.

It is useful to classify reductions by what the constructed object does on irrelevant inputs. In the ATMA_{TM} to nonemptiness reduction, the new machine ignores its own input entirely. That is allowed because the target property is about whether the language has at least one string. For other target properties, irrelevant inputs may need careful behavior. For equivalence, the constructed machines must agree in one case and disagree in the other. For universality, the constructed machine may accept all strings exactly in the accepting case.

Reduction functions manipulate descriptions, not running computations. A reduction can output a machine that contains the code of MM and the literal string ww embedded inside it. This is a finite syntactic operation, so it halts even if MM would loop on ww. The later behavior of the constructed machine carries the undecidable information into the target instance.

The recursion theorem is not needed for every self-reference proof, but it clarifies why self-reference is legitimate. In informal programming, a program can sometimes read its own source file, but file systems are not part of the Turing-machine model. The recursion theorem gives an internal mechanism: for computable transformations on descriptions, fixed-point machines exist. That is the formal basis for quines and for deeper undecidability constructions involving machines that know their own descriptions.

Visual

GoalReduction setupConclusion
prove BB undecidableATMmBA_{TM}\le_m Ba decider for BB would decide ATMA_{TM}
prove BB not recognizableATMmB\overline{A_{TM}}\le_m Ba recognizer for BB would recognize ATM\overline{A_{TM}}
prove complexity hardnessknown hard ApBA\le_p Befficient solver for BB gives efficient solver for AA
use recursion theoremmachine accesses own descriptionself-reference becomes formal

Worked example 1: Reducing ATMA_{TM} to TM emptiness complement

Problem. Let NETM={M:L(M)}NE_{TM}=\{\langle M\rangle:L(M)\ne\emptyset\}. Show that ATMmNETMA_{TM}\le_m NE_{TM}.

Method. Given M,w\langle M,w\rangle, build a machine NN whose language is nonempty exactly when MM accepts ww.

  1. Input to the reduction is M,w\langle M,w\rangle.
  2. Construct machine NN as follows: on any input xx, ignore xx and simulate MM on ww.
  3. If MM accepts ww, then NN accepts xx.
  4. If MM rejects or loops on ww, then NN does not accept xx.
  5. If MM accepts ww, then NN accepts every input, so L(N)L(N)\ne\emptyset.
  6. If MM does not accept ww, then NN accepts no input, so L(N)=L(N)=\emptyset.

Checked answer. The computable map M,wN\langle M,w\rangle\mapsto\langle N\rangle satisfies M,wATM\langle M,w\rangle\in A_{TM} exactly when NNETM\langle N\rangle\in NE_{TM}.

Worked example 2: A self-printing program idea

Problem. Explain the recursion-theorem idea behind a program that prints its own description.

Method. Use a computable transformation that inserts a description into a printer.

  1. Define a computable transformation t(x)t(x) that returns the description of a program PxP_x.
  2. Program PxP_x ignores its input and prints the string xx.
  3. The recursion theorem gives a machine RR whose behavior is the behavior of PRP_{\langle R\rangle}.
  4. Therefore RR ignores its input and prints R\langle R\rangle.
  5. No infinite regress is needed; the theorem supplies a fixed point of the transformation.

Checked answer. The existence of a self-printing machine follows from the recursion theorem as a fixed point of a computable program transformer.

Code

def mapping_reduction_A_to_NE(M_accepts_w):
# This is a Python analogy of the construction:
# build N_x that ignores x and accepts iff M accepts w.
def N(x):
return M_accepts_w()
return N

def sample_M_accepts_w():
return True

N = mapping_reduction_A_to_NE(sample_M_accepts_w)
print(N("anything"))

Common pitfalls

  • Reducing in the wrong direction. To prove BB hard, reduce a known hard problem to BB, not BB to the known hard problem.
  • Building a function that is not total. A mapping reduction must halt and output an instance for every input.
  • Preserving only one implication. Mapping reductions require wAw\in A if and only if f(w)Bf(w)\in B.
  • Assuming the target problem's decider exists in the construction itself. The reduction must compute instances without using the hypothetical decider.
  • Treating the recursion theorem as a programming trick only. It is a theorem about fixed points of computable transformations.

Connections