Decision problems as computability of sets
Consider an encoding of grammars: for every $n\in \N$, there is a grammar $G_n$, and all grammars are of this form.
Then we can recast the decision problems:
-
the word problem: $\sb{(u,v)}{u\in \mathcal{L}(G_v)}$;
-
the emptiness problem: $\sb{u}{\mathcal{L}(G_u) = \emptyset}$;
-
the equivalence problem: $\sb{(u,v)}{\mathcal{L}(G_u) = \mathcal{L}(G_v)}$,
and we say a decision problem is solvable if the set is computable.
It can be shown that there are total computable functions that translate between codes of grammars and register machines and vice versa. They then witness the many-one equivalences $$ \begin{alignat}{1} \mathbf{K}_0 &= \sb{(w,v)}{w\in \mathrm{W}_v} &&\equiv_m \sb{(u,v)}{u\in \mathcal{L}(G_v)}, \\ \mathbf{Emp} &:= \sb{u}{\mathrm{W}_u = \emptyset} &&\equiv_m \sb{u}{\mathcal{L}(G_u) = \emptyset}, \\ \mathbf{Fin} &:= \sb{u}{\mathrm{W}_u \text{ is finite}} &&\equiv_m \sb{u}{\mathcal{L}(G_u) \text{ is finite}}, \\ \mathbf{Inf} &:= \sb{u}{\mathrm{W}_u \text{ is infinite}} &&\equiv_m \sb{u}{\mathcal{L}(G_u) \text{ is infinite}}, \\ \mathbf{Cof} &:= \sb{u}{\N \setminus \mathrm{W}_u \text{ is finite}} &&\equiv_m \sb{u}{Σ^\ast \setminus \mathcal{L}(G_u) \text{ is finite}}, \\ \mathbf{Tot} &:= \sb{u}{\mathrm{W}_u = \N} &&\equiv_m \sb{u}{\mathcal{L}(G_u) = Σ^\ast}, \\ \end{alignat} $$
$\mathbf{Emp}, \mathbf{Fin}, \mathbf{Inf}, \mathbf{Tot}$ are non-trivial index sets. By Rice's theorem, we obtain $\mathbb{N}\setminus \mathbf{K} \leq_m \mathbf{Emp}, \mathbf{Fin}$ and $\mathbf{K}\leq_m \mathbf{Inf}, \mathbf{Tot}$. This shows the emptiness problem for type 0 languages is not solvable.
By describing using the total computable set $T = \sb{(m,x,n)}{\text{program }m\text{ with input }x\text{ terminates in }n\text{ steps}}$, we see
-
$\mathbf{Emp} = \sb{m}{\forall x \forall n: (m,x,n)\not\in T}$ is $Π_1$;
-
$\mathbf{Fin} = \sb{m}{\exists X\forall x\forall n: x\leq X \text{ or } (m,x,n)\not\in T}$ is $Σ_2$ so $\mathbf{Inf}$ is $Π_2$;
-
$\mathbf{Cof} = \sb{m}{\exists X\forall x\exists n: x\leq X \text{ or } (m,x,n)\in T}$ is $Σ_3$;
-
$\mathbf{Tot} = \sb{m}{\forall x\exists n: (m,x,n)\in T}$ is $Π_2$.