Math 2.0

Computer science Automata and formal languages Lemma

Pumping lemma for regular languages

Builds on Regular languageDeterministic finite automatonString

Statement

Let L⊆Σ∗L \subseteq \Sigma^* be a regular language. Then there is an integer p≥1p \ge 1 such that every string w∈Lw \in L with length ∣w∣≥p\abs{w} \ge p can be written as w=xyzw = xyz with x,y,z∈Σ∗x, y, z \in \Sigma^* and:

  1. ∣y∣≥1\abs{y} \ge 1;
  2. ∣xy∣≤p\abs{xy} \le p;
  3. xyiz∈Lx y^i z \in L for every integer i≥0i \ge 0.

Remarks

Take a DFA for LL and let pp be its number of states. While reading the first pp letters of ww, the automaton visits p+1p + 1 states, so by the pigeonhole principle some state repeats. Let yy be the nonempty piece read between the two visits; this loop can be skipped or repeated any number of times without changing the final state. Example of use: suppose {anbn:n≥0}\set{a^n b^n : n \ge 0} were regular with constant pp, and take w=apbpw = a^p b^p. By clause 2 the piece yy lies inside the aa's, so xy2zx y^2 z has more aa's than bb's, which is a contradiction. The converse fails: there are non-regular languages that satisfy the conclusion, so the lemma can only show that a language is not regular.

Going deeper

For a student

The lemma is the usual first tool for proving that a language is not regular. One assumes regularity and picks a clever word of length at least pp. Then one shows that every allowed split leads to a pumped word outside the language. It is often combined with closure properties to reduce a hard case to a known one. Since the condition is only necessary, the Myhill–Nerode theorem, which gives a characterization, is needed in some cases. A similar pumping lemma holds for context-free languages, with two pumped pieces.

Reading path

To understand this page from the ground up, read these 4 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Deterministic finite automaton concept
  2. Regular language concept
  3. String concept
  4. Pumping lemma for regular languages statement

Where this leads

4 pages build on this one.

Further reading

  1. Web https://en.wikipedia.org/wiki/Pumping_lemma_for_regular_languages
About this page
TagCBR9WAGZGZ
URIm2://CBR9WAGZGZ
Kindstatement, lemma
WritingW0 stub
MSC68Q45
StatusThis copy of the site has no build data. Run m2 status CBR9WAGZGZ.
AboutRegular language
UsesRegular language, Deterministic finite automaton, String
Same as
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

Used by