Lecture from: 28.10.2025 | Video: Videos ETHZ

We have previously established the boundaries of what is computable. We defined the Turing Machine as our model for any algorithm, and we discovered that there are strict limits to this model. Specifically, we used diagonalization to find a specific language, the Diagonal Language (), which cannot be solved by any Turing Machine.

However, is an artificial construction. It was built specifically to break the machine. To prove that “real world” problems (like analyzing code) are unsolvable, we need a more general tool. We cannot invent a new diagonalization argument for every single problem. This tool is Reduction.

The Method of Reduction

Reduction is the central engine of complexity theory and computability. The core philosophy is: “If I can solve problem B, I can surely solve problem A.”

Recursive Reduction ()

Imagine we have two languages (decision problems), and . We want to understand the difficulty of .

We say that is recursively reducible to (denoted ) if the following scenario holds: Assume we possess a hypothetical “Black Box” (or Oracle) that solves instantly and correctly. Even if we don’t know how the Black Box works, we assume it exists. If we can write an algorithm (a Turing Machine) that solves by using this Black Box as a subroutine, then reduces to .

The Implication for Undecidability

This relationship implies that is at least as hard as .

  • If we know is undecidable (impossible to solve), and we show that , then must also be undecidable.
  • Why? Because if were solvable, our reduction algorithm would effectively solve the unsolvable problem , which is a contradiction.

Many-One Reduction ()

We often use a more specific, “stricter” version of reduction called Many-One Reduction (or Input-to-Input Reduction). Instead of using the Black Box as a general subroutine (calling it multiple times, processing its output), we simply transform the input.

We say if there exists a computable function (a Turing Machine that halts and produces an output) that maps inputs from the domain of to the domain of such that:

The Reduction Machine

If we have this function , and a hypothetical machine that decides , we can build a machine for :

  1. Take input .
  2. Compute .
  3. Feed into machine .
  4. Output exactly what outputs.

If is a “Yes” instance for , must be a “Yes” instance for . If is a “No” instance, must be a “No” instance. The answer is preserved perfectly.

Key Relationship: If , then . Many-one reduction is a special case of recursive reduction where the oracle is called exactly once at the very end.

Classes of Languages and Complements

To understand which problems are solvable, we must look at the relationship between a language and its complement.

Recursive Languages ()

A language is Recursive (Decidable) if there exists a TM that accepts all and rejects all . The machine always halts.

Theorem

If is Recursive, then its complement is also Recursive.

Proof: Take the machine for . Construct a new machine that simulates .

  • If accepts, rejects.
  • If rejects, accepts. Since always halts, always halts. Thus is decidable.

Recursively Enumerable Languages ()

A language is Recursively Enumerable (RE) if there exists a TM that accepts all . If , the machine may reject or loop forever.

The Trap of Complements in

If is RE but not Recursive, what about ? We cannot simply swap the “accept” and “reject” states. If the original machine loops forever on an input , the swapped machine will still loop forever. It will never reach a state where it can say “Accept”.

Therefore, for a language :

  1. is RE (semi-decidable).
  2. is not RE (completely unrecognizable).

If both and were RE, we could run both machines in parallel. One of them would eventually accept, telling us definitively whether or . This would make recursive (decidable).

The Diagonal Language and its Complement

Recall the Diagonal Language , which consists of binary strings such that the machine encoded by does not accept . We proved previously that . No Turing Machine can recognize this language.

Now consider the complement, : Is this language recognizable?

Yes. We can build a Universal Turing Machine . Given input :

  1. Decode (find out what canonical index it belongs to) to find the description of machine (by enumerating Turing machines…).
  2. Simulate on input .
  3. If accepts, accepts.

If loops, loops, but that is allowed for RE languages.

Conclusion: is in , but it is not in (because if it were, its complement would be RE, which we know is false).

The Universal Language ()

The artificial nature of the diagonal language () might make it seem like an edge case. However, we can immediately identify a very natural language that is closely related. Turing introduced the concept of a machine that can simulate any other machine: the Universal Turing Machine ().

The corresponding decision problem is the Universal Language (). It asks whether a given Turing Machine accepts a given input word.

Constructing the Universal Turing Machine

We can prove that is recursively enumerable (RE) by actually building a machine that recognizes it. This machine is an interpreter.

Encoding and Input: The machine takes a single input string .

  1. It first checks if is a valid encoding of a pair , typically separated by a delimiter like #. If the syntax is wrong, it rejects.
  2. If valid, contains the “blueprint” of a machine and the input data .

Simulation Process: To keep things simple, let’s imagine as a 3-tape machine (which we know is equivalent to a 1-tape machine):

  • Tape 1: Stores the description of (its states, transitions , etc.).
  • Tape 2: Stores the “current” tape content of the simulated machine . Initially, this is just .
  • Tape 3: Stores the current state of (e.g., a number like 0 for , 27 for ).

The Universal Machine operates in a loop:

  1. Read State & Symbol: It looks at Tape 3 to find ‘s current state (e.g., ) and looks at the head position on Tape 2 to see the symbol being read (e.g., 1).
  2. Find Transition: It scans Tape 1 (the description of ) to find the transition rule that matches state and symbol 1.
    • Example Rule: (q_5, 1) -> (q_9, 0, R)
  3. Execute Transition:
    • Update State: Overwrite Tape 3 with the new state index 9.
    • Write Symbol: Overwrite the symbol on Tape 2 with 0.
    • Move Head: Move the head on Tape 2 one step to the Right.
  4. Check Halting:
    • If the new state is , halts and Accepts.
    • If the new state is , halts and Rejects.
    • If the transition cannot be found (or loops), continues the simulation indefinitely.

This machine accepts exactly those pairs where accepts . Therefore, is Recursively Enumerable.

Undecidability of

While can recognize YES instances, it cannot solve the decision problem. If runs forever on , will simply simulate it forever. It will never stop to say “No.”

Theorem

is not Recursive (it is undecidable).

Proof by Reduction ()

We know that the complement of the diagonal language () is undecidable. We will show that if we could decide , we could decide .

Recall: . (Here is the machine whose encoding corresponds to the index of word ).

The Reduction Algorithm

We construct a Turing Machine that translates questions about into questions about .

  1. Input: A word . We want to know if .
  2. Compute Index: Calculate the index such that is the -th word () in the standard enumeration.
  3. Generate Machine: Construct the encoding of the -th Turing Machine, . This is computable because we have a standard lexicographical enumeration of all valid TM strings.
  4. Output: The pair .

Verification:

  • If , then by definition accepts . Thus, the pair is in .
  • If , then does not accept . Thus, the pair is not in .

This function is a valid Many-One reduction. Since is undecidable, must also be undecidable.

The Halting Problem ()

This leads us to the Halting Problem ( or ). This is subtly different from .

  • asks: “Does reach the Accept state?”
  • asks: “Does reach ANY halting state ( or )?”

We will prove is undecidable by reducing to it (). The logic is: “If I could determine whether a machine stops, I could determine whether it accepts.”

Method 1: Recursive Reduction ()

This method uses a hypothetical “Halting Oracle” as a subroutine.

The Algorithm for Deciding

Input: A pair .

  1. Call Oracle: Ask the Halting Oracle “Does halt on ?”
  2. Case NO: The Oracle says runs forever.
    • Since it never stops, it can never reach the state.
    • Therefore, does not accept.
    • Output: REJECT.
  3. Case YES: The Oracle says halts eventually.
    • We don’t know if it accepts, only that it stops.
    • But because we know it stops, it is safe to simulate it!
    • Run . The simulation is guaranteed to finish.
    • If the simulation ends in , Output: ACCEPT.
    • If the simulation ends in , Output: REJECT.

This algorithm would perfectly decide . But is undecidable. Therefore, the Halting Oracle cannot exist.

Method 2: Many-One Reduction ()

We can also achieve this by transforming the machine itself, avoiding the need for an “Oracle” concept. We want a computable function that takes an instance of and creates an instance of . such that accepts halts on .

The Construction of

Given the input code for , we can write the code for a new machine that modifies the behavior of .

  • runs exactly like on input , with one crucial change to its transition function.
  • Redirection: We identify all transitions in that lead to the reject state (). We redirect these transitions to point to a new state that enters an infinite loop.
    • Original rule: (q_5, a) -> (q_rej, b, L)
    • New rule in : (q_5, a) -> (q_loop, b, L)
    • Loop rule: (q_loop, any) -> (q_loop, any, N)
Behavior Analysis
  1. If accepts : simulates , reaches , and halts. Halts.
  2. If rejects : simulates , would have gone to , but is redirected to . It runs forever. Loops.
  3. If loops on : simulates and just loops naturally. Loops.
Conclusion

halts accepts.

We have successfully reduced to . Since is undecidable, the Halting Problem is undecidable.

Summary of the Undecidability Landscape

We have built a hierarchy of impossible problems, each proof resting on the previous one.

  1. (Diagonal Language): Not Recursively Enumerable (Not RE).
    • Proof: Cantor’s Diagonalization on the table of all TMs.
  2. (Complement of Diagonal): RE but Undecidable.
    • Proof: It is RE because we can simulate on . It is undecidable because if it were, its complement () would be RE.
  3. (Universal Language): RE but Undecidable.
    • Proof: Undecidable by reduction from . Solving allows us to solve .
  4. (Halting Problem): RE but Undecidable.
    • Proof: Undecidable by reduction from . Solving Halting allows us to solve Acceptance.

This chain of reductions is the standard methodology for proving undecidability. We start with a known hard problem and show that our new problem is “at least as hard.”