Proof (equivalence of regular expression and DFA)

Regular expression $\implies$ DFA

It suffices to produce an $ε$-NFA for each regular expression. We proceed by induction.

All automata shown here has one unique accept state, and no edges into the start state and out of the accept state.

DFA $\implies$ regular expression

Let $D = (Q, Σ, δ, q_0, F)$ be a DFA. WLOG, relabel $Q = \set{1, 2, \ldots, n}$ with $q_0 = 1$. We will construct a regular expression $R_{ij}^k$ for all $i,j=1,2,\ldots,n$ and $k=0,1,\ldots,n$ such that

$\mathcal{L}(R_{ij}^k)$ is all words $w\in Σ^\ast$ where reading $w$ from state $i$ results in a state sequence $q_0 = i, q_1, q_2, \ldots, q_{|w|-1}, q_{|w|} = j$ with intermediate states $q_l\leq k$ for all $0< l< |w|$.

Induct on $k$. For $k=0$, let $\set{σ_1, \ldots, σ_l} = \sb{σ}{δ(i,σ) = j}$.

Now suppose $R_{ij}^{k-1}$ has been constructed for all $i,j$. We claim $$ \begin{align*} R_{ij}^k := R_{ij}^{k-1} + R_{ik}^{k-1} (R_{kk}^{k-1})^\ast R_{kj}^{k-1} \end{align*} $$ works. Suppose $w\in Σ^\ast$ results in a state sequence which starts at $i$, ends at $j$ and passes through intermediate states at most $k$. Two cases:

Finally, writing $F = \set{q_1, \ldots, q_f}$, $$ \begin{align*} \mathcal{L}(D) = \mathcal{L}(R_{1q_1}^n + \ldots + R_{1q_f}^n). \end{align*} $$