We return again with more on Turing recognizability and introducing the tools we need for showing that languages are decidable, recognizable, or neither.
First off, we showed that there are some languages that aren’t decidable last time. We’ve argued before, informally, that there must be languages that can’t be described by Turing machines at all and thus aren’t even recognizable. Here we’ll give a nice concrete example that also will demonstrate that Turing machines aren’t closed under complement.
Recall the language , now consider it’s complement . Intuitively, would we expect this to not be recognizable. Why? Because recognizing amounts to just simulating the action of on . That’s easy enough, because you can just sit and wait for an answer. If you get an accept eventually, then you can accept, but if the simulation loops well it’s okay to loop yourself because you can either fail or loop on a rejection. If you’re trying to simulate the complement, however, you hit an awkward problem: how do you sit around and wait forever on the loop and somehow still return an accept? You might object and say that there must be a more clever way to do this simulation and you’d be right, we didn’t write a proof we just made an appeal to intuition which is why we’ll do a formal proof that is unrecognizable after we introduce one more fact.
The lemma in question is the fact that if both a language and it’s complement are recognizable, then the language is actually decideable. Look at it this way, we have a language that is recognizable then that means there will be a machine that returns “accept” in finite time whenever a string is in . The complement being recognizable means that there will be some machine that returns “accept” in finite time whenever a string is in . Now, we can make a new machine that combines these two recognizers in a multitape dual simulation, where it alternates taking a step in one machine with taking a step in the other. This way, no matter whether a string is or isn’t in the language, then we’ll get an “accept” back from one of the two machines in finite time. As long as we reject when the complement machine accepts, then we have a decider for the language.
This means, however, that if a language isn’t decidable but is recognizable, then it’s complement cannot be recognizable. Clearly, is such a language and thus is not recognizable.
Great, now that we have concrete proven examples of both undecidable and unrecognizable languages now we can introduce the notion of a computable function whose definition we’re pretty much just going to steal wholesale from Sipser: a function is computable if there exists some Turing machine such that on every input , halts with just on the tape. Now, now Turing machines are starting to resemble computation as we normally think of it, aren’t they? We’re introducing this construction, though, to define the notion of a mapping reduction from one language to another.
Given languages and , is reducible to , written as , if there is a computable function such that if a string then and if then , in other words iff . What does this mean intuitively, though? It means that we can take the question “is in ” and turn it into the question “is in “, because by the condition that iff these questions are equivalent to each other. If you answer one, you’ve answered the other. Which means, in turn, that if we already know how to answer “is in ” then we automatically have a way to answer “is in ” without having to even build a machine for it, we only need the reduction.
We’ve seen this already, actually, because this is in essence what we did with the difference between , , and . Remember how, as we defined each of these machines in turn we just turned an NFA into a DFA or a RegExp into an NFA and then used the machine we defined previously. This is also how we defined , by reducing the problem to .
There’s a couple of really nice properties about reductions. First, that if and is decidable then we know that is decidable. We know this because our decider for is just to compute the reduction to and then run the decider for . This also means, however, that if and is undecidable then must be undecidable as well or else we’d get a contradiction.
Similarly for recognizable languages, if and is recognizable then so is and if is unrecognizable then so to must .
I think I’ll leave things here for now and next post will be lots and lots of examples of reductions because it’s a cool technique that’s worth savoring.