I have that language $S=\{a^n b^m c^m\mid n,m \geq 0\}$. How can I prove with the pumping lemma that it isn't regular? Can I use the concatenation closure and say that it's the language $L_1 = \{a^n\mid n\geq0\}$ and $L_2 =\{b^m c^m\mid m \geq0\}$ prove that $L_2$ isnt regular so $L_1 L_2 = S$ is not regular too?
2 Answers
Your concatenation idea doesn't work. Although the concatenation of two regular languages is guaranteed to be regular, the concatenation of a regular language and a non-regular language is not guaranteed to be non-regular. For example, take $L_1=\Sigma^*$, $L_2=\{a^nb^n\mid n\geq 0\}$. $L_2$ is not regular but $L_1L_2=\Sigma^*$ is regular.
To prove that $S$ is non-regular using the pumping lemma, pump a string that contains more $b$s than $c$s.
- 82,470
- 26
- 145
- 239
Raphael is right: you can use a quite standard pumping argument. David Richerby is also right: your argument does not work in this way.
However ... If you want to have a result about closure of non-regular languages you can consider this one.
Theorem. If $L_1$ and $L_2$ are nonempty languages over disjoint alphabets, then their concatenation $L_1L_2$ is nonregular iff at least one of $L_1$ or $L_2$ is nonregular.
Of course, if either language is empty, then the concatenation will be empty, hence regular.
- 31,459
- 1
- 54
- 109