4.6.7 · D1Theory of Computation

Foundations — Pumping lemma for regular languages — proof and using to show non-regularity

3,040 words14 min readBack to topic

Before you can read the parent note, you must own every piece of its notation. This page builds each one from absolutely nothing, in an order where each idea leans only on the ones before it.


1. The alphabet — the box of allowed letters

The picture: a small box holding tiles. For the parent note the box is usually or .

Why the topic needs it: every string, language, and machine on this page is built out of these tiles. Nothing exists before we fix the box.


2. A string and its length — tiles in a row

The picture: tiles laid in a line. a a b is a string of length , so .

The special empty string is written (Greek "epsilon"): a row with zero tiles, . It is a real, legal string — like an empty hand of tiles.


3. Powers of a string: and — shorthand for repetition

The picture: a stamp. = stamp the letter exactly times.

Why the topic needs it: the whole lemma is about repeating a middle chunk . Writing is how we say "spin the loop times". And is exactly "pump the loop down to nothing" — the case beginners forget.


4. A language — the set of "accepted" strings

The picture: a fenced field. Every string is a dot; the ones inside the fence belong to , the ones outside do not. The symbol (" is an element of ") means the dot is inside the fence; means outside.

Why the topic needs it: "regular or not regular" is a question about a language — about which dots the fence encloses.


5. The DFA — a finite machine that walks a graph

This is the heart. The parent note writes . Let us unwrap every letter.

Figure — Pumping lemma for regular languages — proof and using to show non-regularity

The picture (figure above): circles connected by arrows. You start on , and for each tile in your string you follow the arrow labelled with that tile. When the tiles run out, look down: standing on a double-ring circle ⇒ accept; otherwise reject.

See Finite Automata (DFA NFA) for the full machine; here we only need "walk the graph, land on a circle."

Why the topic needs it: the DFA is what "regular" is defined by — the crack the pumping lemma pries open is the finiteness of .


6. Acceptance and the language — linking machine to language

The picture: each string is fed into the machine; the machine lights up green (accept) or red (reject). is the collection of all the green ones — exactly the dots inside the fence from Section 4.

Why the topic needs it: this notation is the bridge between a machine (Section 5) and a language (Section 4). Without "" we cannot say precisely what it means for a DFA to "recognise" a language — and that is the very next definition.


7. Regular language — defined precisely

The picture: a language is "regular" if you can draw a finite circles-and-arrows machine whose green set (Section 6) matches dot-for-dot.

Equivalently, is regular iff it is described by a regular expression or accepted by an NFA — see Finite Automata (DFA NFA). All three views describe the same class.

Why the topic needs it: the pumping lemma begins with the words "If is regular …". Everything downstream — the existence of a pumping length, the loop, the contradiction — hangs on this one definition. If you cannot cash out "regular" as " DFA with ", the lemma has no starting point.


8. The pumping length — where the number comes from

The picture: count the circles in the machine's graph. That count is .

Why the topic needs it: every later use of — "the first footprints", " holes", "" — is really about the number of circles in the DFA. The magic threshold is not pulled from thin air: it is exactly . That is why a string longer than is forced to repeat a state.


9. The run: the sequence of states

The picture: footprints on the graph, one footprint per tile read (plus the starting one). A string of length leaves footprints.

Why the topic needs it: the proof watches these footprints. If two footprints land on the same circle, everything between them is a loop — and that loop is the the lemma pumps.


10. The Pigeonhole Principle — why a repeat is forced

Figure — Pumping lemma for regular languages — proof and using to show non-regularity

The picture (figure above): pigeons trying to fit into holes — one hole is forced to double up.

In this topic: the pigeons are the first footprints ; the holes are the circles of the machine. More footprints than circles ⇒ two footprints share a circle ⇒ a repeated state ⇒ a loop exists.

Full treatment: Pigeonhole Principle.

Why the topic needs it: this is the engine of the proof. Without it "the machine must repeat a state" is just a hope; pigeonhole makes it a certainty.


11. The split — cutting the string at the loop

Figure — Pumping lemma for regular languages — proof and using to show non-regularity

The picture (figure above): the string is a ribbon in three coloured segments; the middle segment corresponds to a circular arrow that returns to the same circle. Because takes you , you may run it times and always end on before continuing with .

The two size rules that make the split useful:

  • : the loop is non-empty, because means at least one tile is inside it.
  • : the repeat was found among the first footprints, so the cut sits within the first tiles.

Why the topic needs it: is the entire vocabulary of the pumping lemma. Every proof manipulates these three pieces.


12. Subset and logic symbols — the glue

The picture: is a checklist you must pass every row of; is finding one winning row.

Why the topic needs it: the lemma's quantifier order decides who chooses what in the adversary game. Misreading these symbols is the most common way the whole proof goes wrong.


13. The Pumping Lemma — the statement these pieces build

Now every symbol is earned, we can write the theorem the parent note proves and uses. Read it slowly, matching each symbol to its section above.


Prerequisite map — how the pieces feed the lemma

Read the arrows as "is needed for". Follow the three parallel streams that meet at the lemma:

  • Language stream: alphabet → strings → language ; and separately, the DFA gives , which defines regular.
  • Combinatorics stream: the run's footprints + the pigeonhole principle force a repeated state.
  • Structure stream: the repeated state creates the split ; string powers let us spin its loop.

All three streams, plus the logic symbols, converge on the statement of the pumping lemma, which then powers non-regularity proofs.

Alphabet Sigma

Strings and length

Powers a to the n and y to the i

Language L a set of strings

DFA states Q delta q0 F

Acceptance and L of M

Regular language exists DFA

Pumping length p equals number of states

Run r0 to rn breadcrumb trail

Pigeonhole Principle

A state must repeat

Split w = xyz with a loop y

Logic symbols forall exists

Pumping Lemma statement

Prove non regularity

Related tools you will meet later: Regular Expressions and Finite Automata (DFA NFA) both define regular languages; Myhill–Nerode Theorem is an alternative non-regularity weapon; Closure Properties of Regular Languages often shortens proofs; and the same loop-idea reappears in the Pumping Lemma for Context-Free Languages. This whole page is the runway to the parent: the Pumping Lemma note.


Equipment checklist

Try to answer each before revealing. If any stalls you, re-read its section above.

What is in one phrase?
A finite set of allowed symbols (the box of letter-tiles).
What does measure?
The number of tiles in the string .
What is and its length?
The empty string; .
What does mean, and what is ?
written times; (zero copies).
What is a language ?
A set of strings over ; means is accepted.
Name the five parts of a DFA.
States , alphabet , transition , start , finals .
What does " accepts " mean?
The run of ends on a state in (a double-ring circle).
What is ?
The set of all strings accepts: .
Define "regular language".
is regular iff there exists a DFA with .
Where does come from?
, the number of states of a DFA accepting ; it is fixed, not chosen.
What is the "run" of a string?
The sequence of states (circles) visited while reading it.
State the pigeonhole principle.
More pigeons than holes forces two pigeons into one hole.
Who are the pigeons and holes here?
Pigeons = the states ; holes = the DFA states.
Why does a state repeat on a long string?
visited states but only states exist (pigeonhole).
What are , , ?
Tiles before the loop, inside the loop, after the loop.
Why is ?
The loop indices satisfy , so at least one tile lies inside .
Why is ?
The repeated state is found within the first footprints.
State the pumping lemma in words.
If is regular, some exists so every with splits as with , , and for all .
Read the quantifier order of the lemma.
— adversary, you, adversary, you.