Although the accepted answer is complete in its own way, I had to add a few things. I have a very playful way to exploit the pumping lemma to be able to prove that a given language is not a Regular language.
Just to have a context to talk about, let me state the lemma:
Pumping Lemma for Regular Languages:
For any regular language L, there exists an integer k.
Such that for all x ∈ L with |x| ≥ k, there exists u, v, w ∈ Σ∗, such
that x = uvw, and
(1) |uv| ≤ k
(2) |v| ≥ 1
(3) for all i ≥ 0: u(v^i)w ∈ L
The k is called the Pumping lemma constant
. Let me come straight to the point and show you how to go about proving a language L is not regular.
Now to start the game you need two players here. One is the Reader(R
) and the other is the Adversary(A
).
Input: A language L
The Goal of R
: Somehow prove the language L is not regular by some contradiction.
The Goal of A
: Somehow be prepared enough to face the arguments of R
and do not let him/her create a contradiction.
Now let us start the argument.
A
: The language L is not Irregular because none could show the contradiction using pumping lemma with a certain pumping constant k. (Each language is mapped to only one integer k)
R
: Let me assume what you say. If language L is regular then it must satisfy the conditions of the pumping lemma. So, let me choose a suitable string x ∈ L (|x| >= k), such that it helps me create a contradiction later.
A
: Challenged by the R
, A
tries its best to find at least one suitable partitioning u, v and w of the string x, such that
x = uvw and |uv| <= k and |v| > 0
R
: With any possible partition given by A
, wins the the argument if able to show an integer i >= 0 such that
u(v^i)w ∉ L
Because now the R
has shown that the Language L has at least one string x which doesn't have any partition(u, v, w) such that it satisfies the pumping lemma. The contradiction happened because our assumption that L is regular is FALSE
. Therefore the language L is proven to be not regular.
If the R
is not able to show the above, this is not a Proof of the language being Regular. It just means that L can be a Regular or Irregular language which just happens to satisfy the pumping lemma conditions.
Always remember, the pumping lemma is if
(L
is regular), then
Statements. The vice-versa is not necessarily TRUE
. Although it might be TRUE
in some cases.
Therefore the pumping lemma is useful only if you want to prove that a language is not regular.
(Source: Theory of Computation(NPTEL): Prof. Somenath Biswas(IIT Kanpur)