Let P
be any nontrivial property of languages recognized by Turing Machines. Then there exists a Turing Machine Myes
such that L(Myes)
has property P
, and a Turing Machine Mno
such that L(Mno)
does not have property P
.
Without loss of generality, assume that the empty language ∅ does not have property P
(if it does, we can work with the complement of P
instead).
We will reduce the Halting Problem to the problem of determining whether a Turing Machine's language has property P
.
Given ⟨M, w⟩
from the Halting Problem, we construct a Turing Machine M'
that:
- On input x, simulates
M
on w
- If
M
halts on w
, M'
simulates Myes
on x - If
M
doesn't halt on w
, M'
rejects immediately (so L(M') = ∅
)
Now, if M
halts on w
, then L(M') = L(Myes)
, which has property P
.
If M
doesn't halt on w
, then L(M') = ∅
, which does not have property P
.
Therefore, M
halts on w
if and only if L(M')
has property P
.
Since the Halting Problem is undecidable, the problem of determining whether a Turing Machine's language has property P
is also undecidable.