This contradicts that w is the shortest string accepted by M. Hence,
.
- Let M accept a string w with
. Then by pumping lemma w can be decomposed as w=xyz satisfying all the three constraints of the pumping lemma. Hence

Therefore, L(M) must be infinite.
Conversely, let L(M) be infinite, and let w be the shortest string accepted by M whose length is at least n i.e. w
. (Note that such a string must exist, since L(M) is infinite and there are only a finite number of strings of length less than n). Then, it must be the case that,
. Otherwise (i.e. if
, by the pumping lemma we can decompose w as w=xyz satisfying all the constrains of the pumping lemma. So,
. For i=0, in particular,
is a shorter string than w (since
), leading to a contradiction. Hence,
.