I understand that pumping lemma can only be used to prove that a certain language is "non-regular", it cannot be used for proving regularity
But since, it's a property of regular language, we should be able to pick up a language that is regular, literally, and then see if this property exists in that language, which should def exist
Let's say our alphabet is { 0, 1 }
Our language L = { w | such that w ends in 11 } or in the form of regex it would be ( 0 + 1 )* 11 ~ basically any string that ends in 11 over the given alphabet
Now, since this is a regular language, if we were to pick up a string that is atleast as large as "number of states" (p) then we should be able to divide the string
Since, a string, atleast as long as 'p', in our mentioned language can be of different forms such as $0^p11$ or $1^p11$ or $(0 + 1)^p11$. Obviously, in the case of proving a language is non regular we just need to show that atleast 1 string fails to adhere to pumping lemma. But in here we are just trying to verify that a certain regular language has the pumping lemma, so in our case all the strings should be in language according to pumping lemma
Now, pumping lemma says that if the language is regular, in our case it is literally a regular language. Then, we should be able to divide a string that is atleast as large as p as follows:
- $s = xy^iz, where \ i>=0$
- $|y| > 0$
- $|xy| <= p$
So, let's assume our string is as follows $s = (01)^{p-2}1$, which is atleast length $p$ and $s$ can be divided as follows: $x= empty \ string \\ y = (01)^{p-2} \\ z = 1$
We can see that the way divided the string in language agrees to condition 2 and 3 but fails to adhere to condition 1:
$s = (01)^{p-2}1 \\ s = xyz \\ s=((01)^{p-2})^{i}1 \\ Now \ we \ will \ try \ to \ pump \ the \ string \ and \ check \ if \ it \ satisfies \ condition \ 1 \\ Put \ i = 0, s = 1\\ $
Hence, s = 1, when we put i = 0, But according to pummping lemma if a languge is regular, which it literally is in our case, then we should just be able to pump the string any number of times even remove that section and still our string should belong to our language
So, if our original laugnage was regular, why did the division and pumping of string failed?
Or is it that i am dividing the string in a wrong way? Like since i do $(01)^{p-2}$ that implies our string has $p-2$ concatenations of $01$, so in order to atleast have a string that is as large as p ~ i need to have 2 more $01$?
In that case since we need to have we can divide the string as follows:
$x = empty \ string \\ y = (01)^{p-2} \\ z = 010111 \ ( because \ we \ need \ the \ prefix \ 11 \ too ) \\ \\ or \ we \ can \ divide \ as \ follows \\ x = 01 \\ y = (01)^{p-2} \\ z = 0111 \\ \\ or \ we \ can \ divide \ as \ follows: \\ x = 0101 \\ y = (01) ^{p-2} \\ z = 11$
And as we can see, in either case of division ~ we do end up having each string in our language. Hence, we can conclude that regular langauges does adhere to a property called "pumping lemma" ( because pumping lemma exists because of regular languages )
Which is it? Was I dividing the string wrong? or is my former logic of string dividing actually correct?