<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass{article}

\usepackage{amsmath}
\usepackage{tikz}
\usepackage{utf8}

\usetikzlibrary{automata}
\usetikzlibrary{positioning}
\usetikzlibrary{fit}
\usetikzlibrary{calc}
\usetikzlibrary{shapes.misc}

\tikzset{machine/.style = {row sep=2em, column sep=2em}}
\tikzset{initial text = {}}

\newcommand{\machinebox}[2][]{
  \node[fit=#2,draw,rectangle,label={above left:#1}] {};
}

\usepackage{amsfonts}

\title{Structural induction and DFA union lecture summary}
\author{M. George}
\date{October 24, 2014}

\newcommand{\TODO}[1][fix]{\textbf{TODO --- #1}}

\begin{document}
\maketitle

\section{Proof of correctness of union construction}

Last time we constructed a machine that we claimed recognized the union of two
regular languages.  That is, given $M_1 = (Q_1, Î£, Î´_1, F_1, q_{01})$ and
$M_2 = (Q_2, Î£, Î´_2, F_2, q_{02})$, we constructed a machine $M$ and claimed
that $L(M) = L(M_1) \cup L(M_2)$.  In this lecture, we proved
that the construction is correct.

Here is the construction: $M = (Q_1 \times Q_2, Î£, Î´, F, (q_{01},q_{02}))$ where
\begin{align*}
Î´((q_1,q_2), a) &amp;= (Î´_1(q_1, a), Î´_2(q_2, a)) \\
F               &amp;= \{(q_1, q_2) \mid q_1 \in F_1 \text{ or } q_2 \in F_2\} \\
\end{align*}

To prove that this construction is correct, we first proved that the extended
transition function behaves as expected.

\paragraph{Claim:} for all $x \in Î£^*$, $q_1 âˆˆ Q_1$ and $q_2 âˆˆ Q_2$,
$\hat{Î´}((q_1, q_2), x) = (\hat{Î´}_1(q_1, x), \hat{Î´}_2(q_2, x))$.
\paragraph{Proof:} by induction on the structure of $x$.  If $x = Îµ$, then
the left-hand side is just $(q_1, q_2)$ (by definition of $\hat{Î´}$).
Similarly, plugging in the definition of $\hat{Î´}$ into the right hand side
also yields $(q_1,q_2)$.  So in the $x = Îµ$ case the claim holds.

If $x = ya$, we can simplify the left-hand side:
\begin{align*}
\hat{Î´}((q_1, q_2), xa)
 &amp;= Î´(\hat{Î´}((q_1,q_2), x), a) &amp;&amp; \text{by definition of $\hat{Î´}$} \\
 &amp;= Î´((\hat{Î´_1}(q_1, x), \hat{Î´_2}(q_2, x)), a) &amp;&amp; \text{by Inductive Hypothesis} \\
 &amp;= (Î´_1(\hat{Î´_1}(q_1, x), a), Î´_2(\hat{Î´_2}(q_2, x), a)) &amp;&amp; \text{by definition of $Î´$} \\
 &amp;= (\hat{Î´_1}(q_1, xa), \hat{Î´_2}(q_2, xa)) &amp;&amp; \text{by definition of $\hat{Î´_1}$ and $\hat{Î´_2}$} \\
\end{align*}
Which is equal to the right hand side.  This concludes the inductive proof of
the claim.

Using this fact and the definition of $L(M)$ we can prove that
$L(M) = L(M_1) \cup L(M_2)$.  We have
\begin{align*}
L(M)
 &amp;= \{x âˆˆ Î£^* \mid \hat{Î´}((q_{01}, q_{02}), x) âˆˆ F\} &amp;&amp; \text{by definition} \\
 &amp;= \{x âˆˆ Î£^* \mid \hat{Î´_1}(q_{01}, x) âˆˆ F_1 \text{ or } \hat{Î´_2}(q_{02}, x) âˆˆ F_2\} &amp;&amp; \text{by defintion of $F$ and the claim} \\
 &amp;= \{x âˆˆ Î£^* \mid \hat{Î´_1}(q_{01}, x) âˆˆ F_1\} \cup \{x âˆˆ Î£^* \mid \hat{Î´_2}(q_{02}, x) âˆˆ F_2\} \\
 &amp;= L(M_1) \cup L(M_2)
\end{align*}
as claimed.

\section{Regular expressions}

We discussed another way of describing sets of strings, regular expressions.
Regular expressions are a compact way of representing certain sets of strings.

The set of regular expressions is defined inductively:
\begin{itemize}
\item $\emptyset$ is a regular expression.
\item $Îµ$ is a regular expression.
\item for all $a âˆˆ Î£$, $a$ is a regular expression.
\item if $r_1$ and $r_2$ are regular expressions, then $r_1r_2$ is a regular expression (called the concatenation of $r_1$ and $r_2$).
\item if $r_1$ and $r_2$ are regular expressions, then $r_1 | r_2$ is a regular expression (called the alternation of $r_1$ and $r_2$).
\item if $r$ is a regular expression, then so is $r^*$, called the Kleene closure of $r$.
\end{itemize}

Each regular expression has an associated \emph{language} of strings that it
\emph{matches}, written as $L(r)$.  The function $L$ is defined inductively:
\begin{itemize}
\item $L(\emptyset) = \emptyset$
\item $L(Îµ) = \{Îµ\}$
\item $L(a) = \{a\}$
\item $L(r_1r_2) = \{xy \mid x \in L(r_1) \text{ and } y \in L(r_2)\}$
\item $L(r_1|r_2) = L(r_1) \cup L(r_2)$
\item $L(r^*) = \{x_1x_2x_3\cdots{}x_n \mid x_i \in L(r)\}$
\end{itemize}

\end{document}
</pre></body></html>