Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 65

Mapping Reducibility for Proving Undecidability

Recommended resources

Hello! Welcome to your twelfth lesson.

In our last lesson, we proved one of the most significant results in computer science: the Halting Problem is undecidable. We used a direct, from-scratch proof method called diagonalization, which showed that any supposed "Halting-Problem-solver" could be used to construct a paradoxical machine that leads to a logical contradiction.

While powerful, diagonalization is complex to apply for every new problem. Today, we'll learn a more versatile technique that leverages the result we've already proven. Instead of building a new contradiction each time, we will show that other problems are "at least as hard as" the Halting Problem.

This lesson directly addresses the learning outcome: Explain the technique of mapping reducibility as a method for proving undecidability. By the end, you'll be able to formally prove that a new problem is undecidable by showing how to transform the Halting Problem into it.

From Diagonalization to Reducibility

Imagine you have a difficult problem, let's call it Problem A. You don't know how to solve it. However, you discover that if you had a magic box that could instantly solve a different problem, Problem B, you could use that box to solve Problem A. This relationship is called a reduction. We say that Problem A reduces to Problem B.

This implies that Problem A is "no harder than" Problem B. We can use this logic in reverse, which is the key to proving undecidability.

Suppose we already know that Problem A is undecidable (like ). If we can show that Problem A reduces to a new Problem B, what does that tell us about B? If B were decidable (i.e., "easy"), then A would also have to be decidable, because we could solve A using the easy solution for B. This contradicts what we know about A. Therefore, B must also be undecidable.

This method allows us to build a chain of undecidable problems, all starting from our foundational result for .

The following video introduces this powerful idea.

9. Reducibility

This clip from an MIT OpenCourseWare lecture provides a high-level overview of the concept of reducibility and explains the core logic we'll be using.

Please watch from 08:16 to 16:21. The video provides several intuitive examples of reductions and then explains the two ways we can use this concept: to prove a problem is easy, or, more importantly for us, to prove a problem is hard.


Formalizing the Technique: Mapping Reducibility

To use reductions in formal proofs, we need a precise definition. The type of reduction we will focus on is called mapping reducibility.

First, we need the concept of a computable function.
A function is computable if there is a Turing Machine that, for any input string , halts with exactly on its tape. Your experience building complex backends and data pipelines gives you a practical sense of this: a computable function is essentially any transformation for which you could write a program that is guaranteed to terminate and produce the output.

With that, we can define mapping reducibility.

Definition: Mapping Reducibility
A language is mapping reducible to a language , written , if there exists a computable function such that for every string :

This function is called the reduction. It acts as a translator, converting any instance of problem into an equivalent instance of problem .

Definition and Illustration of Mapping Reducibility
This diagram illustrates the core property of a mapping reduction. The computable function `f` maps strings from one universal set to another. Crucially, it maps all strings *inside* language A to strings *inside* language B, and all strings *outside* A to strings *outside* B. This preserves the membership answer.

To solidify these formal definitions, please review the following brief video and a short text excerpt.

Mapping Reducibility + Reductions, what are they?

The channel Easy Theory provides a very focused and clear definition of both computable functions and mapping reducibility.

Watch the first four minutes of the video (00:00 to 03:58). This will give you the formal definitions of a computable function and a mapping reduction.

Lecture 16 - Undecidability and the Halting problem

These lecture notes from the University of Waterloo offer a concise, formal write-up of the same definitions.

Read the sections 'Definition 16.1' (Computable function) and 'Definition 16.2' (Mapping reduction). This reinforces the formal language used to describe these concepts.


The Undecidability Theorem

Now we can state the main theorem that makes mapping reducibility so useful.

Theorem: If and is decidable, then is decidable.

Proof Idea:
To decide if , we can construct a decider for that:

  1. Computes using the computable function from the reduction.
  2. Runs the decider for on the result, .
  3. Accepts if the decider for accepts; rejects if it rejects.
    Since , this procedure correctly decides .

The corollary is what we'll use to prove undecidability:

Corollary: If and is undecidable, then is undecidable.

This is the contrapositive of the theorem. Proving that a language is undecidable using this method involves three steps:

  1. Choose a language that you already know is undecidable (e.g., ).
  2. Construct a computable function that maps instances of to instances of .
  3. Prove that your function satisfies the condition: .

A common mistake is getting the direction wrong. You must reduce the known hard problem to the new problem you want to prove is hard.


Example: Proving that HALTTM is Undecidable

Let's use mapping reducibility to prove that the language for the general Halting Problem is undecidable. We define it as:

We will prove this is undecidable by showing that .

  1. Known Undecidable Language: .

  2. Target Language: .

  3. Construct the Reduction :
    We need a computable function that takes an input for and outputs an input for . The function is computed by a TM that performs the following steps:

    On input :

    1. Construct the description of a new Turing Machine, .
    2. The machine is defined as follows:
      On input :
      a. Run on .
      b. If accepts, then accept.
      c. If rejects, then enter an infinite loop.
    3. The function outputs . Notice we pass the string w through, but modify the machine M.
  4. Prove Correctness:
    We must show that .

    • Forward direction (): Assume .

      • This means accepts .
      • When we run on input , it simulates on . Since accepts, proceeds to its 'accept' step.
      • Therefore, accepts , which means it halts.
      • So, .
    • Backward direction (): Assume .

      • This means halts on input .
      • Looking at the definition of , the only way it can halt is by reaching its 'accept' step. It loops if rejects.
      • For to accept, the simulation of on must have accepted.
      • Therefore, accepts .
      • So, .

Since we have constructed a valid mapping reduction from the undecidable language to , we conclude that is also undecidable.

The following notes provide a clear, written example of this exact reduction.

CS 341: Chapter 5

These slides from NJIT provide another clear walkthrough of the reduction from A_TM to HALT_TM, which we just covered.

Review slides 29 through 32, which are titled 'Example: Mapping Reduction ATM ≤m HALT TM' and 'Undecidability obeys ≤m Ordering'. This will reinforce the construction and logic of the proof.

Test your understanding!

Let's say we want to prove that the language is undecidable. In our proof using mapping reducibility, what should be our starting language () and our target language ()? In which direction must the reduction go?

Show answer

Our starting language must be a language we already know is undecidable, so we would choose .

Our target language is the new language we want to prove is undecidable, so (or its complement).

The reduction must go from the known hard problem to the new problem. Therefore, we must show that . We achieve this by creating a computable function that takes an input and produces a machine such that accepts if and only if is not empty. (This actually shows a reduction to the complement of , but proving the complement is undecidable is sufficient to prove is undecidable).


Conclusion

Today we've added a powerful and efficient tool to our theoretical toolkit. Reducibility allows us to classify the difficulty of problems relative to each other. By formalizing this with mapping reducibility, we've developed a rigorous method for proving undecidability that avoids the complexities of diagonalization.

Key Takeaways:

  • Reducibility is the technique of solving one problem by using a solution to another.
  • If reduces to , then is no harder than . The contrapositive is key: if is undecidable, then must also be undecidable.
  • A mapping reduction is a computable function that transforms instances such that .
  • To prove a language is undecidable, we can show . This involves constructing the transformation function and proving it preserves the membership property.

Preview of the Next Lesson:
With this technique, we can now rapidly expand our catalog of undecidable problems. In the next lesson, we will apply reductions from to prove that a variety of other fundamental questions about Turing Machines—such as whether a TM's language is regular, or whether two TMs accept the same language—are all undecidable. This will lead us to a sweeping generalization known as Rice's Theorem.