The two most important examples are the pumping lemma for regular languages and the pumping lemma for context-free languages. These are called 'lemmas' rather than 'theorems' not because they are unimportant, but because their primary use is to generate quick proofs that a particular language is not in the language class. However, they cannot be used to prove the statement that a language is in the class; satisfying the pumping lemma is a necessary, but not sufficient, condition.
Someone familiar with the pumping lemma for regular languages can see immediately that a language that allows parenthesized expressions, but requires the parentheses to balance, can not be a regular language, and so the language can not be generated by a regular grammar nor recognized by a finite state machine. Trying to compose such a proof directly would take a significant length of time.
Using this lemma, one can for instance prove that the language
L = {anbn : n ≥ 0}
over the alphabet Σ = {a, b} is not regular. For if it were, we could pick m as in the pumping lemma. The string w = ambm is in L, and the pumping lemma therefore yields a decomposition w = xyz with |xy|≤ m, |y|≥ 1 and
xykz in L for every k≥0. But then y has to consist of a non-zero number of a's, and xy2z has more a's than b's and is therefore not in L, a contradiction.
The proof that the language of balanced (i.e. properly nested) parentheses is not regular follows the same idea. Given m, there is a string of balanced parentheses that begins with more than m left parentheses, so that y will consist entirely of left parentheses. By repeating y, we can produce a string that does not even contain the same number of left and right parentheses, and so they can not be balanced.
The proof idea for the pumping lemma itself is as follows: the regular language is accepted by a certain deterministic finite acceptor; every string that's longer than the number m of states of that acceptor will revisit a certain state, thereby causing a loop which can be repeated; the loop corresponds to the string y.
Note that the pumping lemma does not give a sufficient condition for a language to be regular: for example, the language {anbm : n ≥ m} is not regular but can still be "pumped." For a practical test that exactly characterizes regular languages, see the Myhill-Nerode Theorem.Pumping lemma for regular languages
If a language L is regular, then there exists a number m > 0 such that every string w in L with length |w| ≥ m can be written in the form
with strings x, y and z such that |xy| ≤ m, |y| ≥ 1 and