Nondeterministic Finite Automaton (Sipser-style).
An NFA is a 5-tuple (Q, Σ, δ, q₀, F) where Q is a finite set of states,
Σ an alphabet, q₀ ∈ Q the start state, F ⊆ Q the accept states, and
δ : Q × Σ_ε → 𝒫(Q) the transition function (where Σ_ε = Σ ∪ {ε}).
Here δ q (some a) gives the transitions on input symbol a, while
δ q none gives the ε-transitions. Successor sets are represented as
Finset Q. The alphabet Σ and the implicit Q are tracked by the type
parameters.
- q₀ : Q
- accept : Finset Q
Instances For
The ε-closure of a set of states S ⊆ Q: all states reachable from S
by zero or more ε-transitions.
Instances For
M accepts the input word w iff some computation branch of the
underlying ε-NFA reaches an accept state after reading w.
Instances For
The language recognized by an NFA M: the set of words it accepts.
Instances For
NFA to DFA conversion (Sipser). If an NFA M with finite state
space Q recognizes a language A, then A is regular.
The proof passes through Mathlib's εNFA → NFA → DFA subset construction:
the resulting DFA has state space Set Q, which is finite since Q is.