I would solve this without the lemma: - Consider h (a), where h (1) = 1 h (2) = 0 h (0) = 0. Applying h ^ -1 in your language, and then the intersection with 0 ^ * 1 ^ 2 ^ give you the language 0 ^ n1 ^ m2 ^ n. - Now we use h '(a), where h' (0) = a, h '(1) = epsilon, h' (2) = b. You get ^ nb ^ n which is not regular.
Why is it easier? Because after learning these basic tricks, you can easily solve these problems.
As for the lemma: - You will need that any substring of the word in when used as a substring destroys your language. There are 6 cases that I can see (only 0 from the beginning, 0 from the beginning from 1, etc.)
As already added, you do not need a CF lemma. The CF lemma is used to show that a language is usually not CF.
source share