Skip to content
Part IA Michaelmas, Lent Term

Correctness of the Subset Construction

Statement

Theorem: Let MM be an NFA-ε\varepsilon and P(M)\mathcal{P}(M) the result of subset construction. Then L(M)=L(P(M))L(M) = L(\mathcal{P}(M)).

We prove two directions:

  1. Soundness: L(P(M))L(M)L(\mathcal{P}(M)) \subseteq L(M)
  2. Completeness: L(M)L(P(M))L(M) \subseteq L(\mathcal{P}(M))

Examinable Proof: Soundness

Claim: If P(M)\mathcal{P}(M) accepts ww, then MM accepts ww.

Proof:

Suppose P(M)\mathcal{P}(M) accepts w=a1a2anw = a_1 a_2 \cdots a_n.

There is a DFA computation:

sa1S1a2anSns' \xrightarrow{a_1} S_1 \xrightarrow{a_2} \cdots \xrightarrow{a_n} S_n

where SnFS_n \cap F \neq \emptyset.

Build an NFA computation:

We show by induction on ii that for each SiS_i, and for each qSiq \in S_i, there is an NFA path from ss to qq on input a1aia_1 \cdots a_i.

Base (i=0i = 0): s=E(s)s' = E(s). Every qsq \in s' is reachable from ss via ε\varepsilon^*.

Step: Suppose for each qSi1q' \in S_{i-1}, there is an NFA path sa1ai1qs \Rightarrow a_1 \cdots a_{i-1} q'.

For qSiq \in S_i: By construction, qδ(Si1,ai)q \in \delta'(S_{i-1}, a_i).

So there exists qSi1q' \in S_{i-1} with qaiqεqq' \xrightarrow{a_i} q'' \xrightarrow{\varepsilon^*} q for some qq''.

By IH, sa1ai1qs \Rightarrow a_1 \cdots a_{i-1} q'. Thus sa1aiqs \Rightarrow a_1 \cdots a_i q.

Conclusion: Since SnFS_n \cap F \neq \emptyset, there exists qfFSnq_f \in F \cap S_n reachable from ss via ww. Hence MM accepts ww.

Examinable Proof: Completeness

Claim: If MM accepts ww, then P(M)\mathcal{P}(M) accepts ww.

Proof:

Suppose MM accepts w=a1anw = a_1 \cdots a_n.

There exists an NFA computation:

s=q0a1q1a2anqnFs = q_0 \xrightarrow{a_1} q_1 \xrightarrow{a_2} \cdots \xrightarrow{a_n} q_n \in F

(where each step may involve ε\varepsilon-transitions).

Build the DFA computation:

Define DFA states S0,S1,,SnS_0, S_1, \ldots, S_n where Si=S_i = the set of NFA states reachable from ss on input a1aia_1 \cdots a_i via any path.

Formally: Si=δ(Si1,ai)S_i = \delta'(S_{i-1}, a_i) with S0=E(s)=sS_0 = E(s) = s'.

Key lemma: By construction, qiSiq_i \in S_i for all ii.

Proof of lemma: By induction on ii.

  • q0E(s)=S0q_0 \in E(s) = S_0 (by definition of NFA computation starting at ss).
  • If qi1Si1q_{i-1} \in S_{i-1} and qi1aiqiq_{i-1} \xrightarrow{a_i} q_i, then qiδ(Si1,ai)=Siq_i \in \delta'(S_{i-1}, a_i) = S_i.

Conclusion: qnSnq_n \in S_n. Since qnFq_n \in F, we have SnFS_n \cap F \neq \emptyset. Thus P(M)\mathcal{P}(M) accepts ww.

Equivalence of NFA, NFA-ε\varepsilon, and DFA

Corollary

(NFA languages)=(NFA-ε languages)=(DFA languages)(\text{NFA languages}) = (\text{NFA-}\varepsilon\text{ languages}) = (\text{DFA languages})

All three formalisms recognise exactly the same class of languages: the regular languages.

Proof

  • NFA subset of NFA-ε\varepsilon: trivial (NFA is NFA-ε\varepsilon with empty τ\tau)
  • NFA-ε\varepsilon subset of DFA: subset construction (theorem above)
  • DFA subset of NFA: trivial (DFA is special case of NFA)

Summary

  • Soundness: DFA path gives NFA path by tracking which NFA states are reachable
  • Completeness: NFA path traced through DFA by tracking sets
  • All three automata types (NFA, NFA-ε\varepsilon, DFA) recognise the same languages