Neural Sync Active
Reductions — Proving Undecidability
Registry Synced
Reductions — Proving Undecidability
1939 words
10 min read
Reading compass
Now · 🎯 Learning Objectives
Reductions — Proving Undecidability
🎯 Learning Objectives
- Define mapping reductions and their properties
- Reduce the Halting problem to other problems
- Apply Rice's theorem to prove undecidability
- Distinguish between Turing-recognizable and co-recognizable
- Construct reduction functions
1. Introduction to Reductions
1.1 Intuition
A reduction is like converting a problem you want to solve into one you already know how to solve. If you know how to decide whether a number is even, you can decide whether a number is odd by checking if (n+1) is even. Similarly, if we know the Halting problem is undecidable, we can prove other problems are undecidable by showing: "If I could decide problem X, I could decide the Halting problem — which is impossible."
1.2 Mapping Reduction
A≤mB means: There exists a computable function f such that w∈A⟺f(w)∈B.
(Diagram)
Properties:
- If B is decidable and A≤mB, then A is decidable
- If A is undecidable and A≤mB, then B is undecidable
- If A≤mB and B≤mC, then A≤mC (transitive)
2. The Halting Problem
2.1 Definition
ATM={⟨M,w⟩∣M is a TM and M accepts w}
Theorem: ATM is undecidable.
Proof (diagonalization): Assume H decides ATM. Construct D:
- D = "On input ⟨M⟩:
- Run H on ⟨M,⟨M⟩⟩
- If H accepts, reject; if H rejects, accept" Then D(⟨D⟩) accepts iff D does not accept ⟨D⟩ — contradiction.
3. Reduction Examples
3.1 Halting Problem HALTTM
HALTTM={⟨M,w⟩∣M halts on w}
Reduction from ATM: f(⟨M,w⟩)=⟨M′,w⟩ where:
- M′ runs M on w
- If M accepts, M′ accepts
- If M rejects, M′ loops forever Check: ⟨M,w⟩∈ATM⟺M accepts w⟺M′ halts on w⟺⟨M′,w⟩∈HALTTM
3.2 Empty Language ETM
ETM={⟨M⟩∣L(M)=∅}
Reduction from ATM: f(⟨M,w⟩)=⟨M′⟩ where:
- M′ = "On input x:
- If x=w, reject
- Run M on w and accept if M accepts" Check: ⟨M,w⟩∈ATM⟺M accepts w⟺L(M′)={w}=∅⟺⟨M′⟩∈/ETM Wait — we need f such that w∈ATM⟺f(w)∈ETM. Let me fix. f(⟨M,w⟩)=⟨M′⟩ where:
- M′ ignores input and runs M on w
- If M accepts, M′ accepts Then:
- If M accepts w: M′ accepts all inputs → L(M′)=Σ∗=∅ → ⟨M′⟩∈/ETM
- If M does not accept w: M′ hangs or rejects → L(M′)=∅ → ⟨M′⟩∈ETM So ATM≤mETM, which means ETM is undecidable.
3.3 Regular Language REGTM
REGTM={⟨M⟩∣L(M) is regular}
Reduction from ATM: Transform ⟨M,w⟩ into ⟨M′⟩ where:
- M′ = "On input x:
- If x is of form 0n1n, accept
- Run M on w; if M accepts, accept" Then:
- If M accepts w: L(M′)=Σ∗ (regular)
- If M does not accept w: L(M′)={0n1n} (not regular) Thus ATM≤mREGTM, so REGTM is undecidable.
4. Rice's Theorem
4.1 Statement
Theorem: Any non-trivial property of Turing machine languages is undecidable.
A property P of languages is:
- Non-trivial: Some recognizable languages have it, some don't
- Semantic: Only depends on L(M), not on M's implementation Examples of undecidable properties:
- Is L(M) empty?
- Is L(M) regular?
- Is L(M) finite?
- Does L(M) contain the string ε?
- Is L(M)=Σ∗?
4.2 Proof Sketch
- Let P be a non-trivial property
- Assume WLOG that ∅ does NOT have property P (otherwise use P)
- Let B be a language with property P (exists because P is non-trivial)
- Reduce ATM to P: Transform ⟨M,w⟩ to ⟨M′⟩ where M′:
- On input x, run M on w; if M accepts, run a TM that recognizes B on x
- If M accepts w: L(M′)=B (has property P)
- If M doesn't accept w: L(M′)=∅ (does NOT have property P)
- Deciding P would decide ATM → impossible
5. Common Pitfalls
Pitfall 1: Reversing the Reduction Direction
The mistake: Reducing B to ATM to prove B is undecidable.
Why students make it: The logic "this problem is hard" suggests it must reduce to something.
How to catch it: To prove B undecidable, reduce a KNOWN undecidable problem (ATM) TO B. If B were decidable, ATM would be decidable.
Correct approach: ATM≤mB to prove B undecidable.
Pitfall 2: Assuming Rice's Theorem Applies to Syntactic Properties
The mistake: Using Rice's theorem to prove properties about the machine itself (number of states, running time) are undecidable.
Why students make it: Rice's theorem sounds like "everything about TMs is undecidable."
How to catch it: Rice's theorem applies only to SEMANTIC properties — properties of the language L(M), not of the machine M itself.
Correct approach: Does the property depend only on L(M)? If it depends on how M works (state count, time complexity), Rice's theorem doesn't apply.
Pitfall 3: Forgetting to Show Both Directions
The mistake: Only showing one direction of the reduction.
Why students make it: It's easier to reason about one direction.
How to catch it: A reduction requires w∈A⟺f(w)∈B. Both directions must hold for the reduction to be valid.
Correct approach: Prove both directions: If w∈A then f(w)∈B, AND if f(w)∈B then w∈A.
6. Key Concepts Reference
| Concept | Definition | Application |
|---|---|---|
| Mapping reduction | f computable, w∈A⟺f(w)∈B | Proving undecidability |
| ** ATM ** | {⟨M,w⟩∣M accepts w} | Prototypical undecidable problem |
| ** HALTTM ** | {⟨M,w⟩∣M halts on w} | Undecidable via ATM reduction |
| Rice's theorem | Non-trivial semantic properties undecidable | Quick undecidability proofs |
| ** ≤m ** | Reduction direction | A≤mB means A reduces to B |
| TM-recognizable | Some TM halts-accepts on strings in L | Also called semi-decidable |
| Co-TM-recognizable | Complement is TM-recognizable | L is recognizable |
7. 📝 Practice Questions
Q1: Prove that HALTTM is undecidable by reduction from ATM.Answer:Define reduction f(⟨M,w⟩)=⟨M′,w⟩ where:
- M′ runs M on w
- If M accepts, M′ halts (accepts)
- If M rejects, M′ enters infinite loop
- If M loops (doesn't halt), M′ also loops
Then: ⟨M,w⟩∈ATM (M accepts w) ⇒ M halts on w ⇒ M' halts on w ⇒ ⟨M′,w⟩∈HALTTM. And ⟨M,w⟩∈/ATM (M doesn't accept w) ⇒ M either rejects or loops ⇒ M' loops ⇒ ⟨M′,w⟩∈/HALTTM.Thus ATM≤mHALTTM, so HALTTM is undecidable. Q2: Use Rice's theorem to prove that ETM (empty language) is undecidable.Answer:ETM={⟨M⟩∣L(M)=∅}. This is a semantic property of TM languages:
- It's non-trivial: some TMs accept ∅ (e.g., TM that immediately rejects), some don't (e.g., TM that accepts everything).
- It's semantic: it depends only on L(M), not on M's implementation.
By Rice's theorem, any non-trivial semantic property is undecidable. Therefore ETM is undecidable. Q3: Show that the complement of ATM (the set of ⟨M,w⟩ where M does NOT accept w) is not Turing-recognizable.Answer:If ATM were Turing-recognizable, then both ATM and ATM would be recognizable, making ATM decidable. But ATM is undecidable. Therefore ATM is not Turing-recognizable.More formally: A language is decidable iff both it and its complement are Turing-recognizable. Since ATM is not decidable (it's undecidable), and ATM IS Turing-recognizable (the universal TM recognizes it), its complement ATM must NOT be Turing-recognizable. Q4: Construct a reduction from ATM to ETM.Answer:f(⟨M,w⟩)=⟨M′⟩ where M′:
- On input x:
- If x=w, reject
- Run M on w; if M accepts, accept
Then:
- If M accepts w: L(M′)={w}=∅ → ⟨M′⟩∈/ETM
- If M doesn't accept w: L(M′)=∅ → ⟨M′⟩∈ETM
This shows ATM≤mETM. So ETM is undecidable (if it were decidable, so would ETM and thus ATM). Q5: Why doesn't Rice's theorem apply to the property "M has exactly 25 states"?Answer: Because this is a syntactic property of the TM description, not a semantic property of the language L(M). It depends on how the machine is constructed, not on which strings it accepts. Rice's theorem only applies to semantic properties of the LANGUAGE. The number of states is a property of the machine representation ⟨M⟩, not of L(M). Q6: Prove Rice's theorem: Any non-trivial property of TM languages is undecidable.Answer: (Sketch)
- Let P be non-trivial property of TM languages
- Assume ∅ does NOT satisfy P (if it does, work with P)
- Let B be a language that DOES satisfy P (exists because P is non-trivial)
- Define reduction f(⟨M,w⟩)=⟨M′⟩:
- M′ on input x: runs M on w; if M accepts, runs a recognizer for B on x
- If M accepts w: L(M′)=B → ⟨M′⟩ has property P
- If M doesn't accept w: L(M′)=∅ → ⟨M′⟩ doesn't have property P
- Thus ATM≤mP, so P is undecidable. Q7: Show that ATM is Turing-recognizable but not co-Turing-recognizable.
Answer:ATM is Turing-recognizable: The universal TM U recognizes ATM. On input ⟨M,w⟩, U simulates M on w and accepts if M accepts. If M loops, U loops. So U recognizes ATM.ATM is NOT co-Turing-recognizable: If ATM were also recognizable, then ATM would be decidable (since both ATM and its complement are recognizable). But ATM is undecidable. Therefore ATM is not recognizable. Q8: Define the language EQTM={⟨M1,M2⟩∣L(M1)=L(M2)}. Show it's undecidable.Answer:Reduce ETM to EQTM. Let Mreject be a TM that rejects all inputs (L(Mreject) = ∅). Define f(⟨M⟩)=⟨M,Mreject⟩.Then: ⟨M⟩∈ETM⟺L(M)=∅⟺L(M)=L(Mreject)⟺⟨M,Mreject⟩∈EQTM.Since ETM is undecidable, EQTM is undecidable. (Also follows from Rice's theorem: "does M₁ equal M₂?" is a non-trivial semantic property.)
8. 🔗 Cross-References
- Week 8 - Decidability: Undecidable problems
- Week 10 - Complexity: From undecidability to intractability
- BSCS4021 (Advanced Algorithms): NP-completeness reductions Join Discord PreviousDecidabilityNextComplexity