[Math] Proving a language is not recognizable

formal-languagesproof-verificationturing-machines

I have the following question that I just want to verify I have done correctly.

Let $L$, $L_1$, $L_2$ $\subseteq \Sigma^*$ such that $L = L_1 \cup L_2$, and $L_2$ is decidable. Prove that if $L$ is not recognizable then $L_1$ is not recognizable.

Proof

By definition since we know $L_2$ is decidable then there exists a Turing machine $M$ over $\Sigma$ such that for some input $w \in L_2$, $M$ either accepts or reject $w$.

Case 1:

Suppose that $L_2 = \emptyset$ then, $L = L_1 \cup \emptyset$ and thus $L = L_1$. By the original assumption, if $L$ is not recognizable then neither is $L_1$.

Case 2:

We know that $L = L_1 \cup L_2$ and that $L_2$ is decidable. Since $L_2$ is decidable, by definition, it is also recognisable by some recogniser $R$. We also know that $L$ is not recognizable. Suppose now that $L_1$ was recognisable by some recogniser $Q$. This means that we can use the recogniser $R$ and $Q$ in an alternating fashion to recognise $L$, but $L$ is unrecognisable so this is a contradiction. Therefore $L_1$ must be unrecognisable.

Best Answer

Your proof is essentially correct, but a bit more convoluted than necessary: you don't need to distinguish between cases, and you don't need to run $R$ and $Q$ in parallel (if you use a decider for $L_2$). The following argument by contraposition suffices.

Suppose that $L_1$ is recognisable by some recogniser $Q$. By assumption $L_2$ is decidable by some decider $M$. We'll put these machines together to make a machine $T$ that recognises $L_1\cup L_2$. First, on input $w$, the machine $T$ runs $M$ on $w$. If $M$ accepts, then $T$ stops and accepts; if $M$ rejects, then $T$ runs $R$ on $w$. If $R$ accepts, then $T$ stops and accepts; if $R$ rejects, then $T$ stops and rejects. Note that

  • on input $w\in L_2$, the subprocedure $M$ of $T$ will accept, so $T$ will accept $w$;
  • on input $w\in L_1\setminus L_2$, $M$ will reject but the subprocedure $R$ will accept, so $T$ will accept $w$;
  • on input $w\notin L_1\cup L_2$, $M$ will reject and $R$ will reject or loop, so $T$ will reject $w$ or loop.

Thus, $T$ is a recogniser for the set $L_1\cup L_2=L$, contradictory to the assumption that $L$ is not recognisable.