Pumping Lemma for Regular Languages

The pumping lemma for regular languages is a result from theoretical computer sience. It can be used to show that certain formal langauges are not regular.

Theorem
Let $\mathcal{L}_3$ be the set of regular languages. Then the following holds:

$ \forall L \in \mathcal{L}_3 \exists n_0 \in \N_0 \forall z \in L, \left|{z}\right| > n_0 \implies \exists u, v, w$ such that


 * $z = u \cdot v \cdot w$
 * $\left|v\right| > 0$
 * $\left|uv\right| < n_0$
 * $\forall i \in \N_0: u \cdot v^{i} \cdot w \in L$

For finite languages
For any finite regular language $L_{fin}$, the proof is simple.

Let $s_{maxlen} \in L_{fin}$ so that $\forall s \in L_{fin}, \left|{s}\right| \leq \left|{s_{maxlen}}\right|$. Now choose $n_0 > \left|{s_{maxlen}}\right|$.

The implication now trivially holds because the premise $\left({\left|{z}\right| > n_0}\right)$ is false.

For infinite languages
For any one infinite regular language $L_{inf}$, the following holds:


 * There exists a finite automaton $F = \left({\Sigma, Q, q_0, A, \delta}\right)$ such that $\mathcal{L}(F) = L_{inf}$. (See: Equivalende of Finite Automata and Regular Languages)
 * There exists an infinite number of words $s \in L_{inf}$ with $\left|{s}\right| \geq \left|{Q}\right|$.

Let $s \in L_{inf}$ be one of these words and $n_0 = \left|{Q}\right| + 1$. Now, if one considers all prefixes of this $s$, it becomes clear via the Pigeonhole Principle that for at least two of them $F$ needs to end in the same state (since $\left|{s}\right| > \left|{Q}\right|$). Let the first two indexes in $s$ for wich this is the case be called $i$ and $j$. The difference between $prefix_i$ and $prefix_j$ ($v$ in this formulation of the theorem) is a "loop" in $F$. This loop can be traversed and number of times (including 0) and $F$ will still be in the same state immediately afterwards. Hence $uv^iw \in L_{inf} \forall i \N_0$.

Furthermore, $\left|{uv}\right| = j-1 < n_0$. And since $i \neq j$ it follows that $\left|{v}\right| > 0$.

General case
Since it could be shown that the theorem holds for both all finite and all infinite regular languages, it can be stated that it holds for all regular langauges.