# What is the pumping lemma for regular language?

There are two Pumping Lemmas (PL), which are defined for Regular Languages and Context - Free Languages.

## Pumping lemma for Regular languages

• It gives a method for pumping (generating) many substrings from a given string.
• In other words, we say it provides means to break a given long input string into several substrings.
• Lt gives necessary condition(s) to prove a set of strings is not regular.

## Theorem

For any regular language L, there exists an integer P, such that for all w in L

|w|>=P

We can break w into three strings, w=xyz such that.

(1)lxyl < P

(2)lyl > 1

(3)for all k>= 0: the string xykz is also in L

## Application of pumping lemma

Pumping lemma is to be applied to show that certain languages are not regular.

It should never be used to show a language is regular.

• If L is regular, it satisfies the Pumping lemma.
• If L does not satisfy the Pumping Lemma, it is not regular.

Steps to prove that a language is not regular by using PLare as follows−

• step 1 − We have to assume that L is regular
• step 2 − So, the pumping lemma should hold for L.
• step 3 − It has to have a pumping length (say P).
• step 4 − All strings longer that P can be pumped |w|>=p.
• step 5 − Now find a string 'w' in L such that |w|>=P
• step 6 − Divide w into xyz.
• step 7 − Show that xyiz ∉ L for some i.
• step 8 − Then consider all ways that w can be divided into xyz.
• step 9 − Show that none of these can satisfy all the 3 pumping conditions at same time.
• step 10 − w cannot be pumped = CONTRADICTION.