A DFA has a fixed, finite set of states. Memory = current state only. So a DFA cannot count without bound — it cannot remember "I have seen exactly n a's" for arbitrarily large n, because that would need infinitely many states. The pumping lemma is the formal weapon that turns "can't count" into a contradiction proof.
Setup.L regular ⇒ there is a DFA M=(Q,Σ,δ,q0,F) accepting L. Let
p=∣Q∣(number of states).
Take anyw∈L with ∣w∣=n≥p. Write w=a1a2…an.
Trace the run. Define the sequence of states visited:
r0=q0,rk=δ(rk−1,ak)(k=1,…,n).
Since w∈L, rn∈F.
Pigeonhole. Look at the first p+1 states r0,r1,…,rp. That's p+1 states but only p distinct states exist. So two of them are equal: there exist indices
0≤j<k≤pwithrj=rk.
Split the string around the repeated state:
x=a1…aj,y=aj+1…ak,z=ak+1…an.
Check the three conditions:
∣y∣=k−j≥1 because j<k. ✓ (condition 1)
∣xy∣=k≤p because k≤p. ✓ (condition 2)
Why pumping works (condition 3). Reading x takes q0→rj. Reading y takes rj→rk=rj — a self-loop on state rj. So reading y again leaves us back at rj:
q0xrjyrjyrj⋯yrjzrn∈F.
Thus for everyi≥0, reading xyiz ends in rn∈F, so xyiz∈L. ■
It is an adversary game. The lemma gives you p (you don't choose it); you must beat every possible p and every split.
Memory aid for who-chooses-what: ∃p, ∀w, ∃split, ∀i — but for the proof of non-regularity we flip it: we pick w, the adversary picks the split, we pick i.
w=xyz satisfy?
∣y∣≥1; ∣xy∣≤p; and xyiz∈L for all i≥0.
Recall Which combinatorial principle drives the proof, and what plays the role of "pigeons" and "holes"?
Pigeonhole. Pigeons = the p+1 states r0…rp visited; holes = the p states of the DFA. Two pigeons share a hole ⇒ a repeated state ⇒ a loop y.
Recall Why must your chosen
w depend on p?
Because p is given by the adversary and unknown; w must satisfy ∣w∣≥p for any p.
Recall Does passing the pumping lemma prove a language is regular?
No. It is necessary, not sufficient. Use Myhill–Nerode or build a DFA to prove regularity.
Recall For
anbn, why does ∣xy∣≤p matter?
It forces y to lie entirely in the a-block, so pumping changes the number of a's only, breaking i=j.
Recall Explain it to a 12-year-old.
Imagine a toy train with only a few colored stations and a very long track of letters. If the track is longer than the number of stations, the train must visit some station twice. Whatever loop of track it drove between those two same-color stations, it could drive that loop again and again (or skip it) and still finish at the same place. So if a language is "made by such a train," repeating that middle loop must always still be allowed. If you find a word where repeating the loop gives something not in the language, then no such train (machine) exists — the language is too clever for finite memory.
Dekho, pumping lemma ka core idea bahut simple hai. Har regular language ke peeche ek DFA hota hai jiske paas sirf finite number of states hote hain — maan lo p states. Ab agar koi string isse lambi hai (∣w∣≥p), to machine ko string padhte waqt koi ek state do baar visit karni hi padegi — yeh pigeonhole principle hai (zyada pigeons, kam holes). Jo portion us repeated state ke beech padha gaya, woh ek loop ban jaata hai, jise hum y kehte hain. Loop ka matlab — usko 0 baar, 1 baar, 2 baar, jitni baar chaaho chala sakte ho aur machine same accepting state pe khatam hogi. Isiliye xyiz bhi language mein hona chahiye, har i≥0 ke liye.
Yeh lemma hum non-regularity prove karne ke liye use karte hain, ulta tareeke se. Maan lo language regular hai, to p exist karega. Phir tum ek clever string w choose karte ho jo p pe depend kare, jaise apbp. Ab adversary (lemma) split xyz deta hai, par condition ∣xy∣≤p ke wajah se y sirf shuru ke a's mein phasta hai. Phir tum i=2 ya i=0 choose karke count tod dete ho — a's badh jaate hain par b's same, to anbn wali equality break ho jaati hai. Contradiction! Matlab language regular thi hi nahi.
Do important traps yaad rakhna. Pehla: split tum nahi chunte, adversary chunta hai — isliye saare possible splits handle karne padte hain (par ∣xy∣≤p tumhari madad karta hai). Doosra: agar koi language pumping lemma pass kar leti hai, iska matlab regular nahi hota — yeh sirf one-way tool hai. Regular prove karna ho to DFA banao ya Myhill–Nerode use karo. Mnemonic "PUMP" yaad rakho: Pigeonhole, Unknown p, Middle y non-empty, Pick i.