The Pumping Lemma
"Every long enough string in a regular language has a middle part you can repeat and still stay in the language."
"Every long enough string in a regular language has a middle part you can repeat and still stay in the language."
The pumping lemma is a property that every regular language must satisfy, used chiefly to prove that a given language is not regular. It says that if a language is regular, there is a pumping length such that any string in the language at least that long can be split into three parts, x, y, and z, where the middle part y is non-empty, x and y together fit within the pumping length, and the string with y repeated any number of times, or removed, is still in the language. The middle can be pumped up or down without leaving the language. Because non-regular languages violate this, the lemma is a workhorse for proving non-regularity.
Rated Empirical: grounded in studies or measurable evidence. The other 608.
The lemma follows from the pigeonhole principle applied to finite automata. A regular language is recognised by a finite automaton with some number of states; reading a string longer than that number forces the machine to visit some state twice, and the loop between those two visits is the pumpable middle y. To prove a language is not regular, one assumes it is, obtains the pumping length, cleverly chooses a string in the language that must therefore be pumpable, and shows that some pumped version falls outside the language, a contradiction. An analogous lemma for context-free languages splits a string into five parts and pumps two of them together.
The analogue for context-free languages, in which a long string decomposes into five parts and two substrings are pumped together, used to prove non-context-freeness.
The Myhill-Nerode theorem, which unlike the pumping lemma gives a necessary and sufficient characterisation of regular languages, so it can prove regularity as well as its absence.
The pumping lemma is a fundamental tool in the theory of formal languages and automata, giving a clean, mechanical way to prove that languages such as balanced brackets or equal-count strings lie beyond the reach of regular expressions and finite automata. It sharpens the boundary between the regular languages and the richer classes above them, and its context-free analogue does the same one level up.
The pumping lemma is a necessary but not sufficient condition for regularity: some non-regular languages also satisfy the pumping property, so passing the lemma does not prove a language is regular, only failing it proves non-regularity. A definitive characterisation, both necessary and sufficient, is given instead by the Myhill-Nerode theorem. In applying the lemma, the prover chooses the witness string but the decomposition into x, y, and z is adversarial, so the argument must succeed against every valid split, which is where careless proofs go wrong.
The pumping lemma proves that a language is not regular; it never proves that a language is regular, since satisfying it is not enough. The condition is necessary but not sufficient, so a non-regular language can pass the test, and the Myhill-Nerode theorem is needed for a full characterisation. The prover selects the string, but the split into three parts is chosen adversarially, so the proof must handle every valid decomposition, not just a convenient one.
Yes, as far as the evidence goes. The Pumping Lemma is rated Empirical here: it rests on studies or measurements rather than on a saying.
Rated from two sources. 609 of the 1,116 entries carry this rating. How the scale works.
The best-known laws are the least likely to rest on measurement.
The regular pumping lemma was first proved by Michael Rabin and Dana Scott in 1959 and rediscovered by Yehoshua Bar-Hillel, Micha Perles, and Eli Shamir in 1961, who also gave the context-free version.
8 languages, as recorded on Wikidata. These are names the idea already goes by, not translations we made. The whole index by language.
Everything above traces to two pages on en.wikipedia.org: both secondary, accounts of the original rather than the original itself, which has not been located for this entry. Nothing is written from memory, and the method is written down. Spot an error or a better source? Suggest a fix.