2

Proving the language $L=\{ a^i b a^j |\ i<j,\text{ or }i>j;\ i,j>0 \} $ is not regular, I am trying to use the pumping lemma for regular languages:

pumping length $:= m$

case 1: $i<j; j=m$

$w_1 = a^i b a^m = xyz$
$|xy| < m$
$|y| > 0$

$\Rightarrow$
$y$ can be:

  • $a$s only
  • $a$s + $b$
  • just $b$

However, this leads to $xy^hz\ \not \in L\ \forall h,\ h>0$.

case 2: $i>j; i=m$

$w_2 = a^m b a^j = xyz$
$|xy| < m$
$|y| > 0$

$\Rightarrow$
$y$ can be:

  • $a$s only

Pumping with this $y$:
$xy^hz\ \in L\ \forall h$ holds true.

As this answer does not seem to even consider the second case, is the first case sufficient to proof the language is not regular?
However, taking a look at this answer I think I'd have to considere the second case as well, in order to cover all possible $xyz$ combinations.

cocoseis
  • 153
  • 5
  • I don't understand your attempted proof – what is your starting word? In any case, we don't check proofs here. It's not clear what you mean by first case / second case, but to use the pumping lemma it suffices to use a single starting word, and then you need to check all of its possible partitions, and to show that each one can be pumped out of the language. – Yuval Filmus Feb 23 '17 at 20:27
  • But how can you describe it with the conditions: $i<j\text{, or }i>j$ in one word? – cocoseis Feb 23 '17 at 20:37
  • To prove that a language is not regular using the pumping lemma, you choose a word in the language (given the pumping constant) and show that it doesn't satisfy the pumping property. You can choose any word you want, as long as it's not shorter than the pumping length. – Yuval Filmus Feb 23 '17 at 20:40
  • In other words, case 1 is sufficient? – cocoseis Feb 23 '17 at 20:42
  • 1
    Yes, a single word suffices. – Yuval Filmus Feb 23 '17 at 20:42
  • The "or" was just confusing me then, I guess. Sorry. – cocoseis Feb 23 '17 at 20:45
  • @GoodDeeds I'm afraid you're wrong. I suggest reviewing basic logic. – Yuval Filmus Feb 23 '17 at 20:49
  • The real problem is that the current proof just doesn't work, since the pumped word could still be in the language. But choosing two different words is simply not the solution. – Yuval Filmus Feb 23 '17 at 20:51
  • @YuvalFilmus I am sorry, I worded that incorrecly. I did not mean that the language with both $i\lt j$ and $i\gt j$ must be regular, by any means. I meant that, if some language $L$ is regular, there is no necessity that $L$ union a set of strings need be regular as well, the opposite of which is what I had (mis)understood as being implied from the earlier comments. The "case 1 suffices" confused me, as it is clearly not true - case 1 is just a subset of the given language. I understood the intended meaning now – GoodDeeds Feb 23 '17 at 20:55
  • @GoodDeeds Yet case 1 suffices, or more accurately, a single word suffices (not the one chosen by the OP). – Yuval Filmus Feb 23 '17 at 20:56
  • @YuvalFilmus Did you mean that choosing a word such that $i\lt j,j=m$ is ok, (any single word) but showing that the number of a s that occur before the b s is more than the number after is not sufficient to show that the language is not regular? I misunderstood it as "case 1 (as shown) is sufficient". I am sorry for the misunderstanding. – GoodDeeds Feb 23 '17 at 21:03
  • @GoodDeeds Choosing a single word is sufficient. The current argument simply doesn't work. – Yuval Filmus Feb 23 '17 at 21:03
  • @YuvalFilmus Yes, I agree. I had misunderstood the comments. Thank you. – GoodDeeds Feb 23 '17 at 21:05

2 Answers2

1

Here is the contrapositive form of the pumping lemma, which is what we use to prove that a language is not regular:

Let $L$ be a language. Suppose that for all $p \geq 1$ there exists a word $w \in L$ of length at least $p$ such that for every decomposition $w=xyz$ in which $|xy| \leq p$ and $y \neq \epsilon$ there exists an integer $i \geq 0$ such that $xy^iz \notin L$. Then $L$ is not regular.

Using the pumping lemma directly for the language $L$ in the question is a bit tricky. Given $p \geq 1$, let $w = a^p b a^{p+p!} \in L$; note that $|w| \geq p$. We have to show that for every decomposition $w = xyz$ in which $|xy| \leq p$ and $y \neq \epsilon$ there exists an integer $i \geq 0$ such that $xy^iz \notin L$. Consider any such decomposition. It is easy to check that $y = a^\ell$ for some $1 \leq \ell \leq p$, and that $xy^ij = a^{p+(i-1)\ell}ba^{p+p!}$. For $i = p!/\ell+1$ (which is an integer!), $xy^ij = a^{p+p!}ba^{p+p!} \notin L$. Thus the condition in the pumping lemma is satisfied, and we conclude that $L$ is not regular.

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503
1

Let $$L_1 = \{a^iba^j | i\lt j\text{ and } i,j\gt 0\}$$ $$L_2 = \{a^iba^j | i\gt j\text{ and } i,j\gt 0\}$$

Here, $$L = L_1\cup L_2$$

From Case 1, you have shown that $L_1$ is not regular.

You are trying to conclude that if $L_1$ is not regular, $L$ is not regular. It is not sufficient that $L_1$ is not regular to show that $L$ is not regular. A simple counter example will be $L_1 = \{a^nb^n|n\gt 0\}$ and $L_2=\{a^m b^n |m\ne n\}$. Neither $L_1$ nor $L_2$ are regular, yet their union is regular.


In the first answer you have linked, it is not true that only one case has been considered. You need to find any one string $s$ whose length is at least than every possible pumping length $p$ such that no matter how you partition it into $s=xyz$, the resulting string goes out of the language.

The key difference between your case 1 and the answer you linked is that you have taken a string in $L_1\subset L$, pumped it and shown that it goes out of $L_1$ only. However, what you need to show is that it cannot lie in $L$ at all, no matter how you split it and pump it, which is what the linked answer shows.

GoodDeeds
  • 851
  • 5
  • 14