Interesting Decidability Problem

The Question

For any languages S,TS, T, if STS \setminus T is decidable, is it true that both S,TS, T will be decidable?

Answer

No, as we can prove here with two counter examples:

Simple case

First, consider the case where SS is some undecidable language, which we know exists. Let T=ST = S, then ST=S \setminus T = \emptyset is the empty language. We can decide this language with a decider that rejects any input. In this case, the empty language STS \setminus T is decidable by this decider, while S,TS, T are undecidable.

Complex case

Again, we can show this with an example where SS and TT are strictly different languages: Consider language L={Mall,0}L = \{ \langle M_{all}, 0 \rangle \}, where MallM_{all} is a TM that accepts all inputs. We can decide this language by a Turing Machine MMallM_{Mall}:

  • Define QLQ_L as a TM that takes input M,x\langle M, x \rangle, a tuple of machine MM and input value xx.
  • We hard code the binary of MallM_{all} and xx into QLQ_L
  • If the input M=Mall\langle M \rangle = \langle M_{all} \rangle and x=0\langle x \rangle = \langle 0 \rangle, 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 S=LHALT={M,x:machine MS = L_{HALT} = \{\langle M, x\rangle: \text{machine }M halts on input x. This is an undecidable language as shown in lecture (if not, soon). Since MallM_{all} accepts all inputs, Mall,0S\langle M_{all}, 0 \rangle \in S. Then, consider T=SLT = S \setminus L. With a brief proof, we can show that L=STL = S \setminus T. Given that SS is undecidable, we can now show that TT is undecidable as well, by proof of contradiction:

  • Seeking contradiction, assume that TT is decidable. By definition, there is some TM QTQ_T that decides TT.
  • Therefore, we can construct a decider QSQ_S that decides language SS using QTQ_T and QLQ_L as follows:
  • QSQ_S accepts some input M,x\langle M, x \rangle if either QTQ_T or QLQ_L accepts M,x\langle M, x \rangle. If both machines reject the input, QSQ_S rejects the input.
  • We can prove that QSQ_S decides SS: If the input is in SS, by construction, it is either in TT or in LL, so either QTQ_T or QLQ_{L} accepts the input, making QSQ_S accept the input. Otherwise, if the input is in neither TT or LL, both machines will reject the input, making QSQ_S reject the input.
  • QSQ_S halts on all input because both QLQ_L and QTQ_T are deciders that halt on all input by definition.

We have now constructed a decider for SS given that TT is decidable. This introduces a contradiction since SS is undecidable. Therefore, TT must be undecidable as well.

Thus, we have constructed different languages SS, TT such that STS \setminus T is decidable but neither SS or TT is decidable.

2023-2024 © Huaidian (Daniel) Hou all rights reserved.