Proving a Language Non-Context-Free

Context: FIT2014_MOC Β· the exam-standard use of the CFL pumping lemma Β· the outer-ring twin of Proving a Language Non-Regular Problem it solves: given a language, prove it is not context-free β€” i.e. no CFG and no PDA can handle it.

Quick Revision

  • 🎯 Trigger: the language needs three or more unboundedly-coupled counts (or two interleaved copies) βž” two pumping blocks cannot keep them all in step.
  • ⚠️ Key Constraint: you choose ; you must then defeat every decomposition with and β€” so the case split must be exhaustive, not illustrative.

πŸ“ The recipe

  1. Assume is context-free ⟹ it has a CFG ⟹ it has one in CNF generating .
  2. Let = number of nonterminals in that CNF grammar. (You never see the grammar; is just a number the lemma hands you.)
  3. Choose a suitable with β€” parameterise it so the length condition is satisfiable, e.g. take and .
  4. Consider any with , , .
  5. Exhibit an with β€” in every case.
  6. Contradiction with the lemma ⟹ is not context-free.
  • ⚑ The case split writes itself βž” partition on where and sit: (1) each inside a single homogeneous stretch, (2) one of them straddles a boundary. Straddling cases die instantly, because pumping creates a second occurrence of a boundary pattern.

πŸ₯‡ Worked example β€”

Theorem. is not context-free. Proof (by contradiction). Assume it is. Take its CNF grammar, let , take so that , and choose . Consider any with , , .

CaseWhere sitPumped wordWhy it leaves
1 and are each all s, all s, or emptyeach of lies inside one of the three stretches, so β‰₯1 stretch is unaltered; since , β‰₯1 other stretch grows ⟹ the three lengths can no longer be equal
2 or contains the word now has two occurrences of ; every word of has at most one
3 or contains same argument β€” two occurrences of , impossible in

In every case some (here ) gives , violating the lemma. Contradiction ⟹ is not context-free.

  • πŸ”‘ The counting principle βž” two pumping blocks can keep two counts in step ( is context-free: pump ). Three coupled counts exhaust them β€” that is precisely the CFL frontier.
  • Note the unused hypothesis βž” this proof never needs ; the three-stretch pigeonhole alone does the work. Practice 2 is where that bound earns its keep.

✍️ Practice

⚠️ Common Mistakes

  • πŸ’‘ You choose ; you do NOT choose βž” the lemma says such a decomposition exists; to contradict it you must defeat every one. Picking a convenient yourself is the most common invalid proof.
  • πŸ’‘ Forgetting that or may be empty βž” only is guaranteed. Case analyses that assume both are non-empty miss decompositions.
  • πŸ’‘ Forgetting the straddling cases βž” a proof that only handles ” inside single blocks” is incomplete and loses marks even though those cases are the easy ones.
  • πŸ’‘ Reusing the regular lemma’s shape βž” there is no prefix bound here; the constraint is and it pins a window, not a prefix.
  • πŸ’‘ This never proves context-freeness βž” to show is a CFL, build a CFG or a PDA.

🧠 Active Recall