From ⟨M, w⟩ produce ⟨M1, M2⟩ such that M1 ≡ M2 iff M does not accept w. A mapping reduction ATM ≤m ¬EQTM.
CLO-2R1·30 ptsL6
🔊 Listen
1 · The problem and the construction
EQTM = {⟨M1, M2⟩ : L(M1) = L(M2)}. We want to show EQTM is undecidable by reducing ATM to it. The trick is to pick one fixed machine (M1) and engineer the other (M2) so the equality question turns into the ATM question in disguise.
Construction · the reduction function f(⟨M, w⟩)
M1: on every input x, reject. Therefore L(M1) = ∅.
M2: on input x, ignore x; simulate M on w; accept iff M accepts w. Therefore L(M2) = Σ* if M accepts w, and L(M2) = ∅ otherwise.
Output: f(⟨M, w⟩) = ⟨M1, M2⟩.
Why this works: M1 accepts the empty language, no matter what. M2 either accepts every string or accepts no string, depending on whether M accepts w. So L(M1) = L(M2) exactly when L(M2) = ∅, which is exactly when M does not accept w.
🔊 Listen
2 · The reduction as a picture
🔊 Listen
3 · Worked example · a concrete M
Let M be the TM that on input y, halts and accepts if y starts with a 1, otherwise loops. Pick w = "01".
Compute M(w): "01" starts with 0, so M(w) loops. M does not accept w.
Build M1: rejecter. L(M1) = ∅.
Build M2: on any input x, run M on "01"; that simulation loops; therefore M2 never accepts. L(M2) = ∅.
Now flip it: let w = "1xyz". Then M accepts w. M2 on every input runs M on "1xyz", accepts, so L(M2) = Σ*. L(M1) = ∅ ≠ Σ* = L(M2), so ⟨M1, M2⟩ ∉ EQTM. Contract holds again.
🔊 Listen
4 · Animated demo · auto-plays · loops
Build M1, M2, compare languages Auto-plays
🔊 Listen
5 · Why this is a many-one reduction (and matters)
A mapping (many-one) reduction is a single computable function f, no loops, no oracle calls. Our f takes the encoding ⟨M, w⟩ and outputs the encoding ⟨M1, M2⟩. The construction is purely syntactic — write down two new TM descriptions. No simulation happens during the reduction itself; the simulation only happens later, if and when M2 actually runs.
Because the reduction is many-one, undecidability transfers cleanly: if EQTM were decidable, composing with f would give a decider for ¬ATM and hence for ATM — contradiction. The same composition would not work for a Turing reduction without extra care.
🔊 Listen
6 · Pitfalls students stumble on
The reduction is to ¬EQTM, not EQTM. ⟨M, w⟩ ∈ ATM corresponds to ⟨M1, M2⟩ not in EQTM. That's fine — undecidability of ¬EQTM implies undecidability of EQTM immediately, since L is decidable iff ¬L is.
M2 ignores its input. A common mistake is to write "M2 on input x runs M on x." That doesn't work — you'd get L(M2) = L(M), not Σ* or ∅. M2must ignore its input and always test M against the fixed string w.
"Loops" is not "rejects" for L(M2). If M on w loops, M2 on every input runs M on w forever. M2 doesn't accept anything in that case, so L(M2) = ∅. We're using "doesn't accept" — looping is one way to not accept.
The construction never runs M. The reduction is a syntactic transformation of strings — write the description of M2 that says "simulate M on w." The actual simulation only happens later, if the EQTM-oracle decides to invoke M2.
🔊 Listen
7 · Q&A defence notes
Q1. Why use the empty-language M1?
It's a fixed reference. Comparing L(M2) against ∅ is the same as asking whether L(M2) = ∅, which is the ETM question for M2. So under the hood this reduction is showing EQTM is at least as hard as ETM, which we already know is undecidable.
Q2. Is EQTM recognizable?
No. Neither EQTM nor ¬EQTM is Turing-recognizable. It sits in the "neither" region of the recognizable/decidable Venn diagram. This is a stronger statement than mere undecidability — both directions fail.
Q3. What's the difference between a mapping reduction and a Turing reduction?
A mapping reduction is a single computable function f that translates instances of A into instances of B such that x ∈ A iff f(x) ∈ B. A Turing reduction is an algorithm for A that uses an oracle (black box) for B and is allowed to make any number of queries and post-processing. Mapping is stricter; it preserves both decidability and Turing-recognizability.
Q4. Why does mapping reduction preserve undecidability?
If EQTM had a decider D, then "on input ⟨M, w⟩, output the opposite of D(f(⟨M, w⟩))" would decide ATM. Since ATM is undecidable, no such D exists.
Q5. Could we have reduced to EQTM directly (not its complement)?
Yes — swap which machine plays which role. Make M1 the one that depends on M(w) and let M2 be a reference Σ*-acceptor. Then equality holds iff M accepts w. Either direction gives undecidability; the version above happens to use the simpler ∅-reference.
🔊 Listen
8 · Where to read more
Sipser: Theorem 5.4 and §5.3 on mapping reductions. Lecture notes: Module 2 slide 4 (reductions to HALTTM) and Module 3 slide 1 (the general reduction template). Companion problems: P5 (HALTTM), P6 (ETM), P14 (Rice's theorem — generalises this kind of argument to every non-trivial language property).