Example (showing a language is not regular with pumping lemma)

Consider $$ \begin{align*} L = \sb{0^k 1^k}{k>0}. \end{align*} $$

Suppose $L$ is regular. Then it satisfies the pumping lemma with pumping number $n$ for some $n$. Let $w = 0^n 1^n\in L$. Since $|w| > n$, the word can be pumped, i.e. $w = xyz$ with $|y|>0$ and $|xy|\leq n$ such that $xy^k z\in L$ for all $k\in \N$. Since $xy$ is an initial segment of $w$ of length at most $n$, they must consist entirely of zeros. Pumping down, we have $xz \in L$, but this contradicts with the definition of $L$: $xz$ has $n-|y|<n$ many zeros and $n$ many ones. Thus $L$ is not regular.