The Question
For any languages , if is decidable, is it true that both will be decidable?
Answer
No, as we can prove here with two counter examples:
Simple case
First, consider the case where is some undecidable language, which we know exists. Let , then is the empty language. We can decide this language with a decider that rejects any input. In this case, the empty language is decidable by this decider, while are undecidable.
Complex case
Again, we can show this with an example where and are strictly different languages: Consider language , where is a TM that accepts all inputs. We can decide this language by a Turing Machine :
- Define as a TM that takes input , a tuple of machine and input value .
- We hard code the binary of and into
- If the input and , the machine accept. Otherwise reject.
- This machine inspects two finite length input strings once each in linear time and never loops, so it halts on all input.
- In fact, we can hard code this TM as two DFAs, which halt on all input.
Consider language halts on input x. This is an undecidable language as shown in lecture (if not, soon). Since accepts all inputs, . Then, consider . With a brief proof, we can show that . Given that is undecidable, we can now show that is undecidable as well, by proof of contradiction:
- Seeking contradiction, assume that is decidable. By definition, there is some TM that decides .
- Therefore, we can construct a decider that decides language using and as follows:
- accepts some input if either or accepts . If both machines reject the input, rejects the input.
- We can prove that decides : If the input is in , by construction, it is either in or in , so either or accepts the input, making accept the input. Otherwise, if the input is in neither or , both machines will reject the input, making reject the input.
- halts on all input because both and are deciders that halt on all input by definition.
We have now constructed a decider for given that is decidable. This introduces a contradiction since is undecidable. Therefore, must be undecidable as well.
Thus, we have constructed different languages , such that is decidable but neither or is decidable.