Prove that $L=\left\{ab^{k_1}ab^{k_2}...ab^{k_n}c^m|\forall i:k_i>0\text{ and } m>n>0\right\}$ is not regular using Pumping Lemma.
So here is my reasoning:
- Assume that $L \in Reg$ ($Reg$ is the set of regular languages)
- Since regular languages are closed under complement and intersection of sets, define $L'$ as $L'=\bar{L} \cap c^*(ab^*)^*$ where $L'=\left\{c^mab^{k_1}ab^{k_2}...ab^{k_n}|\exists i:k_i=0\text{ or } m\le n\text{ or }n = 0\right\}$
- Prove that $L'$ is not regular using the Pumping Lemma, if $L'$ is not regular then $\bar{L}$ is not regular and so $L$ is not regular.
So here are my questions:
- is step 2 legal? can I do $L'=\bar{L} \cap c^*(ab^*)^*$ to prove that $L$ is not regular?
- is the conditions of $L'=\left\{c^mab^{k_1}ab^{k_2}...ab^{k_n}|\exists i:k_i=0\text{ or } m\le n\text{ or }n = 0\right\}$ correct (after doing the complement operation on $\left\{\forall i:k_i>0\text{ and } m>n>0\right\}$ )?
- Is my approach is the right approach for such question?
Notes:
- I purposely avoided adding the part where I use the Pumping Lemma on $L'$ since the part I'm finding difficulty in is the above.
- I think (not sure) that this question can be solved without using Demorgan's laws, but the result may not be as elegant.
Here is a shorter approach. Let $L' = L \cap (ab)^+c^+$. Observe that $$ L_1 = L \cap (ab)^+c^+ = \{(ab)^nc^m \mid m > n > 0\} $$ Let $f: \{a,b\}^* \to \{a,b,c\}^*$ be the monoid morphism defined by $f(a) = ab$ and $f(b)=c$ and let $L_2 = f^{-1}(L_1)$. Then $$L_2 = \{a^nb^m \mid m > n > 0\}$$ Now, you probably already know that $L_2$ is not regular (otherwise, use the pumping lemma to prove it). Since regular languages are closed under intersection and under inverses of morphisms, $L$ is necessarily nonregular. Otherwise, $L_1$ and $L_2$ would be regular, a contradiction.