Definition. Reductions [reductions]

Say we have two problems.

Problem 1.
Shoot a red elephant.
Problem 2.
Shoot a blue elephant.

We can say that P1P_{1} reduces to P2P_{2} if we can design an algorithm for solving P1P_{1} that uses P2P_{2}.

The following are equivalent:

  • P1≤TP2P_{1}\underset{T}{\leq}P_{2}
  • P1P_{1} reduces to P2P_{2}
  • P1P_{1} can be solved in terms of P2P_{2}
  • P1P_{1} can be solved using P2P_{2} as a Subroutine

IMPORTANT: Note the order! This is easy to flip-flop!

Given our original problems: this means that the problem of shooting a red elephant can be solved by shooting a blue elephant.

What else does this tell us?

  • If P2P_{2} is easy, then P1P_{1} is easy
  • If P1P_{1} is hard, then P2P_{2} is hard (we’ll use this idea a lot)
  • P1P_{1} is no harder than P2P_{2}
  • P2P_{2} is at least as hard as P1P_{1}

We can similarly talk about languages this way. L1≤L2L_{1} \leq L_{2} means:

  • deciding L1L_{1} is no harder than deciding L2L_{2}, or
  • deciding L2L_{2} is at least as hard as deciding L1L_{1}.

Example. Showing the Halting problem to be undecidable

Last time: ATMA_{\text{TM}} is undecidable.

  • ATM={⟨M,w⟩:Macceptsw}A_{\text{TM}} = \left\{ {\left\langle {M,w} \right\rangle:M\ \text{accepts}\ w} \right\}
  • HALTTM={⟨M,w⟩:Mhalts on inputw}\text{HALT}_{\text{TM}} = \left\{ {\left\langle {M,w} \right\rangle:M\ \text{halts on input}\ w} \right\}

Recall: HALTTM\text{HALT}_{\text{TM}} is recognizable

  • You can create a Turing machine UU that takes an ⟨M,w⟩\left\langle {M,w} \right\rangle and simulate it: if UU halts, our original Turing machine MM accepts

We want to show that ATM≤THALTTMA_{\text{TM}}\underset{T}{\leq}\text{HALT}_{\text{TM}}.

Proof. (by contradiction.)

Suppose there is a Turing machine RR that decides HALTTM\text{HALT}_{\text{TM}} (it doesn’t exist).

We want to use RR to design a Turing machine SS that decides ATMA_{\text{TM}}.

Design:

  • Use RR to reject if the input runs forever
  • Otherwise, simply simulate the input (it is now guaranteed to be decidable)

So we can, and we do, and we arrive at a contradiction: as we know there is no such decider for ATMA_{\text{TM}}.

Then as ATMA_{\text{TM}} reduces to HALTTM\text{HALT}_{\text{TM}}: HALTTM\text{HALT}_{\text{TM}} is at least as hard as ATMA_{\text{TM}}, which is undecidable.

So HALTTM\text{HALT}_{\text{TM}} is undecidable.

Aside.

Reduction can go both ways! ATMA_{\text{TM}} reduces to HALTTM\text{HALT}_{\text{TM}}, and vice versa. There are (probably) problems that cannot be related, however.

Example. Showing that ETME_{\text{TM}} is undecidable

We will show by reduction: by reducing ATMA_{\text{TM}} to ETME_{\text{TM}}.

In other words, we will construct a Turing-machine for deciding ATMA_{\text{TM}} that uses ETME_{\text{TM}} as a subroutine.

  • ATM={⟨M,w⟩:Macceptsw}A_{\text{TM}} = \left\{ {\left\langle {M,w} \right\rangle:M\ \text{accepts}\ w} \right\}
  • ETM={⟨M⟩:Mis a Turing machine andL(M)is emptyE_{\text{TM}} = \{\left\langle M \right\rangle:M\ \text{is a Turing machine and}\ L(M)\ \text{is empty} (i.e. MM accepts nothing)
Proof.

Assume we have a decider RR that decides ETME_{\text{TM}}.

Idea: create a new Turing machine NN with M,wM,w hardcoded inside.

  • if y != w: reject
  • if y == w: then run MM on input ww
  • So the language is either ww or ⌀\varnothing.

Simulating a Turing machine SS on input xx:

  • if xx not of form ⟨M,w⟩\left\langle {M,w} \right\rangle then reject
  • Construct the Turing-machine NN above
  • Run RR on input NN
  • If RR accepts, then we know MM does not accept ww
  • If RR accepts, SS rejects, and if RR rejects, SS accepts.