Vol. I a living index of named laws · est. mmxxvi no ads · no account
The Law Tomeindex of named laws

The Pumping Lemma

also known as — The pumping lemma for regular languages, The Bar-Hillel lemma
"Every long enough string in a regular language has a middle part you can repeat and still stay in the language."
In plain English

What does The Pumping Lemma mean?

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.

Reliability

Rated Empirical: grounded in studies or measurable evidence. The other 608.

Lineage
1959COINED
How it works

How does The Pumping Lemma work?

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.

Where you'll see it

What are examples of The Pumping Lemma?

Equal a's and b's The language of strings with n a's followed by n b's is not regular: pumping the a's in a chosen string adds unmatched a's, breaking the balance and leaving the language, a contradiction.
The loop in an automaton In a finite automaton with p states, a string of length at least p forces a repeated state, and the segment traversed between the two visits is the pumpable middle.
The context-free version The context-free pumping lemma splits a string into five parts and pumps two together, used to show, for instance, that strings with equal a's, b's, and c's are not context-free.
Types & variants

What are the types of The Pumping Lemma?

The context-free pumping lemma§

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.

Myhill-Nerode§

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.

Why it matters

Why does The Pumping Lemma matter?

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.

Working with it

How do you apply The Pumping Lemma?

  • Assume and pump — to prove a language non-regular, assume it is regular, take the pumping length, pick a long string in it, and pump to reach a contradiction.
  • Choose the string well — select a witness whose structure forces the pumpable part into a region where repeating it breaks membership.
  • Handle every split — since the adversary chooses the decomposition, ensure the contradiction holds for every valid way of splitting the string.
Where it breaks down

What are the limits of The Pumping Lemma?

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.

What it doesn't say

What are common misconceptions about The Pumping Lemma?

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.

Is it real?

Is The Pumping Lemma real?

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.

Occasionally printedin printed books: one of 240 names in its band, of 903 measured
36 of 69entries in software & systems carry the same rating

The best-known laws are the least likely to rest on measurement.

Origin

Where did The Pumping Lemma come from?

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.

How the name spread

When did people start saying “The Pumping Lemma”?

1800coined 19592019
How often “Pumping Lemma” appears in printed English, which takes hold around 1981 and peaks around 2000. The idea dates to 1959: the phrase took about 22 years to reach print in any quantity, which is the gap this chart measures. Source: Google Books Ngrams.
Known elsewhere as

What is The Pumping Lemma called in other languages?

  • GermanPumping-Lemma
  • Spanishlema del bombeo
  • FrenchLemme d’itération
  • ItalianPumping lemma
  • Japanese反復補題
  • Portugueselema do bombeamento
  • RussianЛемма о разрастании
  • Chinese泵引理

8 languages, as recorded on Wikidata. These are names the idea already goes by, not translations we made. The whole index by language.

Sources

Sources & further reading

  1. 1Pumping lemma for regular languages, Wikipedia. — the three conditions, the non-regularity proof method, and the necessary-not-sufficient point.secondary
  2. 2Pumping lemma for context-free languages, Wikipedia. — the five-part decomposition and the two-part pumping for context-free languages.secondary

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.

What we checked

  • 1,116entries in the tomeListed one by one on the browse page.
  • 1,116of them citing a sourceOpen any entry: its sources sit at the foot of the page.
  • 2,489source references in allEach is named, and linked wherever the source is online.