This is a great question about Rice's theorem, which is a fundamental result in computability theory. Let me state it carefully and then prove the specific case about empty languages.
Rice's Theorem - Formal Statement
Rice's theorem is about properties of Turing machines. Let me state it carefully:
Rice's Theorem: Let P be a non-trivial property of partial recursive functions (or equivalently, Turing-recognizable languages). Then the problem of determining whether a given Turing machine (or recursively enumerable set) has property P is undecidable.
More formally:
- Let L(M) denote the language accepted by Turing machine M
- Let P be a property of languages (i.e., a subset of all recursively enumerable languages)
- P is non-trivial if: there exist some RE languages with property P and some RE languages without property P
- P is a semantic property (meaning it depends only on the language accepted, not on the machine description)
Then the language PROP = {⟨M⟩ : L(M) ∈ P} is undecidable.
An important note: P needs to be non-trivial, meaning it's not true for all languages or false for all languages. Also, for Rice's theorem to apply, the property must be a semantic property - it depends on the language the machine recognizes, not on the specific encoding or description of the machine.
Application to Empty Language
Now let me prove that determining if L(M) = ∅ is undecidable using Rice's theorem.
Definition: EMPTY = {⟨M⟩ : L(M) = ∅}
Claim: EMPTY is undecidable.
Proof using Rice's Theorem:
We need to show that the property "L(M) = ∅" (or equivalently, "M accepts the empty language") is non-trivial and semantic.
-
The property is semantic: Whether L(M) = ∅ depends only on what language M accepts, not on the specific structure or encoding of M. If two Turing machines accept the same language, either both will have the property or neither will.
-
The property is non-trivial: Some machines accept nothing (like one that rejects or loops on all inputs), while others accept at least one string (like one that accepts "0"). This means both machines with the property and machines without it exist.
-
Conclusion: By Rice's theorem, since "L(M) = ∅" is a non-trivial semantic property, determining whether any given Turing machine has this property is undecidable.
Alternatively, I can establish this through a direct reduction from the Halting Problem. If EMPTY were decidable with some decider D, I could use it to solve the Halting Problem, which is impossible. Given a machine M and input w, I'd construct a new machine that behaves in a specific way based on M's behavior on w, then apply D to determine if the new machine accepts nothing—but this would let me determine whether M halts on w, contradicting the Halting Problem's undecidability. Given M and input w, I construct M' that ignores its input and simulates M on w. If M accepts w, then M' accepts all strings; if M doesn't halt on w, then M' accepts nothing. This means L(M') is non-empty exactly when M halts on w. A decider for EMPTY would therefore solve the halting problem, proving EMPTY is undecidable.
Rice's Theorem and the Empty Language Problem
Rice's Theorem - Formal Statement
Theorem (Rice, 1953): Let P be a non-trivial semantic property of recursively enumerable languages. Then the language
PROP={⟨M⟩:L(M)∈P}
is undecidable.
Key Definitions:
- Semantic property: P depends only on the language accepted by M, not on M's description
- Non-trivial: Both ∅ and some non-empty RE language have property P (i.e., P ≠ ∅ and P ≠ {all RE languages})
Proof: Empty Language is Undecidable
Problem: EMPTY = {⟨M⟩ : L(M) = ∅}
Claim: EMPTY is undecidable.
Proof using Rice's Theorem:
Step 1: The property is semantic
- Whether L(M) = ∅ depends only on the language M accepts, not on M's implementation
- If two machines accept identical languages, both have or both lack this property ✓
Step 2: The property is non-trivial
Two cases exist:
Since P = {∅} is neither the empty set nor the set of all RE languages, P is non-trivial ✓
Step 3: Apply Rice's Theorem
Since "L(M) = ∅" is a non-trivial semantic property of RE languages, EMPTY is undecidable by Rice's theorem. ∎
Direct Proof (by reduction from Halting Problem)
We can also prove this constructively:
Assume EMPTY is decidable with decider D. We show HALT is decidable, creating a contradiction.
Given ⟨M, w⟩, construct M':
M'(x): // x is any input
Simulate M on w (ignoring x)
If M halts on w: ACCEPT
Else: LOOP forever
Key observation:
- If M halts on w → L(M') = Σ* (non-empty)
- If M loops on w → L(M') = ∅
Running D on ⟨M'⟩ decides whether M halts on w, making HALT decidable—contradiction!
Therefore, EMPTY is undecidable. ∎