\begin{frame}{Exercises (3)}
    Show that $L = \{\,\ ww \mid w\in\{a,b\}^* \,\}$ is not context-free.
    Assume that $L$ was context-free.
    According to the pumping lemma there is $m>0$ such that
      \mpause[1]{a^mb^ma^mb^m} = uvxyz
    with $|vxy| \leq m$, $|vy| \geq 1$, and $uv^ixy^i z \in L$ for every $i \geq 0$.

    Since $|vxy| \leq m$, \alert{$vy = a^{\,j}b^k$} or \alert{$vy = b^ka^{\,j}$} for some $j,k \ge 0$.
    Since $|vy|\geq 1$ we have \alert{$j+k \geq 1$}.

    Since $|vxy| \leq m$, we have:
      \item If $|u| < m$, then \alert{$uv^0xy^0z = a^{m-j}b^{m-k}a^{m}b^{m} \not\in L$}.
      \item If $m \le |u| < 2m$, then \alert{$uv^0xy^0z = a^{m}b^{m-k}a^{m-j}b^{m} \not\in L$}.
      \item If $2m \le |u|$, then \alert{$uv^0xy^0z = a^{m}b^{m}a^{m-j}b^{m-k} \not\in L$}.
    \alert{Contradiction in each case!} Thus $L$ is not context-free.