# When applying pumping lemma to prove that a language is not regular, do we need to apply it to all decompositions of a string or just one?

We know according to the pumping lemma if a language is regular, then a string already exists and it can be separated into 3 parts ( called decompositions ), 1 string can have multiple decompositions.

If we were to cross check this property with, basically prove for regular langauges, then we would need to prove it for all such decompositions of a string

But if we were to use the pumping lemma to prove that a language is non regular, then we just need to show for only 1 decomposition of a certain string, that the application of pumping lemma here leads to a contradiction, right?

Even in Michael Sipser's book, 3rd edition, "Introduction to theory of computation" chapter 1 ~ Pumping lemma for regular languages. He just applies pumping lemma to prove non regularity on one such decomposition

But here, and according to the contrapositive statement, we are supposed to apply pumping lemma to all possible decompositions when using it to prove non regularity

So, which is correct?

The decomposition of the input string matches exactly a cycle in the finite state machine used to parse the language.

So you have to either find one suitable decomposition that meets the conditions of the pumping lemma (in that case it is quite likely but not guaranteed the language is regular), or you show no such decomposition exists (in that case the language is not regular).

The Pumping Lemma says that if a language is regular then there is associated with that language a natural number, the pumping length. The point of that length is that for any string in the language at least as long as that length, that string has a decomposition into three substrings, which satisfy the conditions of the lemma. So the short answer is that you look at one decomposition type, not every possible decomposition (for instance, not a decomposition into four parts, or a decomposition into three parts that does not satisfy the conditions).

For example, we can show that $$L=\{a^nb^n| n\in\mathbb{N}\}$$ is not regular. For contradiction, suppose that it is regular. Let its pumping length be $$p$$. You now need to strategically pick a string longer than $$p$$. Maybe you say: let $$\sigma=a^pb^p$$. (So when you say "a string already exists", perhaps this is the point of confusion? Maybe you didn't know that your argument needs to name a particular string in the language?)

Then the Pumping Lemma says that there is a decomposition into three parts, $$\sigma=\alpha\beta\gamma$$, such that (1) the length of the concatenation $$\alpha\beta$$ is less than or equal to $$p$$, and therefore the substring $$\alpha$$ and the substring $$\beta$$ consist of only $$a$$'s since the first $$p$$-many characters of $$\sigma$$ are all $$a$$'s, and (2) the substring $$\beta$$ is not empty, so it consists of at least one $$a$$, and (3) all of the strings on this list are also in the language: $$\alpha\gamma$$, $$\alpha\beta\beta\gamma$$, $$\alpha\beta\beta\beta\gamma$$, etc. (That is, we do not look at all possible decompositions of $$\sigma$$, only this one.)

Now the contradiction is: $$\alpha\gamma$$ has fewer $$a$$'s but the same number of $$b$$'s as $$\sigma=\alpha\beta\gamma$$. It therefore does not have the same number of $$a$$'s as $$b$$'s.

• Oh, you got it! Indeed, I got confused about "specific string", I was thinking that we need to pick up a general string adhering to the pattern which made things more tough, you solved 1 major doubt of mine! Though, I have another doubt, you said "you just look at one decomposition of a particular string", but if you go back to the link i posted in my orginial post then you will see the accepted answer says "you have to show it for all decompositions", even michael sipser says that. We can also segregate the example string you took as they did in the linked post. Which is it? Jan 10, 2023 at 4:44
• Well, I was reading about pumping lemma and I realised something. There are 2 different ways of using pumping lemma to prove "non - regularity", first is ~ Assume the langauge is regular and proceed to show atleast 1 string decomposition contradicts the pumping lemma. Second is ~ Assume the language is non - regular and proceed to show that for a certain string, all possible decompositions, after pumping, result into strings that are not present in the language. The latter method is analogous to "picking up a regular language and seeing if pumping lemma exists as property" Jan 10, 2023 at 4:55
• Is my understanding correct? Jan 10, 2023 at 4:55
• Do you think, that michael sipser mentions "applying pumping lemma for all possible decompositions" even after assuming that the langugage is regular, inorder to make the proof of non regularity as strong as possible? If that's the case, then my doubt has been solved Jan 10, 2023 at 5:05
• Yes, I consider all possible decompositions $\alpha\beta\gamma$ subject to the three conditions. Jan 11, 2023 at 21:18