There is this proof that I thought of that I am not quite sure if it's valid or not.
Suppose you had to prove the nonregularity of the following language:
A = { 0^n 1^n 2^n | n>= 0 }
The proof I devised picks a string that belongs in the language, such as 012, and show that it doesn't matter how it's divided, the pumping lemma is not wholly satisfied(I could post the entire proof, but the post is verbose as it is). According to my professor however, this proof cannot be accepted.
He did not explain why, and I don't see how such a proof would be insufficent to demonstrate that a language is not regular. If a string clearly belonging to an assumed regular language does not satisfy the pumping lemma, the language clearly has strings that are not regular as part of it set of strings, therefore the language is not regular.
I believe the reason my professor rejected this proof is because in the majority of problems the pumping length P cannot be correctly guessed. At the same time I do not see how my proof could be proven wrong with a counterexample.
You can only choose
p(the pumping length) to be a specific number if the language is regular andpactually exists. The fact itself, that you pick an exact number, means thatpexists, which is the thing to be actually proven.Suppose that
pexists. Lets choose a word, that is long enough:w=0^{p}1^{p}2^{p}. According to the pumping lemma there must exist a decomposition of each string in languageAasw=xyzwith|xy|≤pand|y|≥1such thatxy^{i}zin languageAfor everyi≥0. To satisfy|xy|≤pchoosexto be empty,y=0^{p}, and as a consequencez=1^{p}2^{p}. From the lemma,|y|≥1so|xy|≥1. The strings withi≠1(inxy^{i}z) are not in the languageA. The language is thus not regular, andpdoes not exist.If
pexisted then a finite state automaton could be constructed for this language. But no such automaton exists, because it would need memory to remember the number of0to later match the same number of1and2. Ifnwas a finite number, then you could construct, a probably large, automaton, but for infinitenno finite automaton can be constructed.This language is not even context-free, because there is no push-down automaton that can be constructed for it. It is context-sensitive.