Interchange lemma

In the theory of formal languages, the interchange lemma states a necessary condition for a language to be context-free, just like the pumping lemma for context-free languages.

It states that for every context-free language $$L$$ there is a $$c>0$$ such that for all $$n\geq m\geq 2$$ for any collection of length $$n$$ words $$R\subset L$$ there is a $$Z=\{z_1,\ldots,z_k\}\subset R$$ with $$k\ge |R|/(cn^2)$$, and decompositions $$z_i=w_ix_iy_i$$ such that each of $$|w_i|$$, $$|x_i|$$, $$|y_i|$$ is independent of $$i$$, moreover, $$m/2<|x_i|\leq m$$, and the words $$w_ix_jy_i$$ are in $$L$$ for every $$i$$ and $$j$$.

The first application of the interchange lemma was to show that the set of repetitive strings (i.e., strings of the form $$xyyz$$ with $$|y|>0$$) over an alphabet of three or more characters is not context-free.