A finite automaton over alphabet α with state space σ, defined as a DFA α σ.
In Sipser's textbook, a finite automaton is a 5-tuple (Q, Σ, δ, q₀, F) where
Q is a finite set of states, Σ a finite alphabet, δ : Q × Σ → Q the
transition function, q₀ the start state, and F ⊆ Q the accept states.
This is exactly the data packaged by Mathlib's DFA.
Instances For
A language L is regular if some finite automaton recognizes it.
Equivalent to Mathlib's Language.IsRegular. This matches Sipser's
definition: L is regular iff L = L(M) for some DFA M.
Instances For
Closure of regular languages under union.
If A and B are regular languages over the same alphabet, then so is their
union A ∪ B (written A + B). The proof takes DFAs M₁ and M₂ recognizing
A and B respectively and uses the product DFA M₁.union M₂ whose state
space is σ₁ × σ₂.
The Kleene star A* is closed under concatenation: if x, y ∈ A* then
x ++ y ∈ A*. Combine the witnessing factorizations of x and y.
Prepending a word w ∈ A to y ∈ A* stays in A*.
Splitting lemma for Kleene star.
If x ++ y ∈ A*, then either
- both
x ∈ A*andy ∈ A*(the split betweenxandyaligns with a word boundary in someA*-factorization), or - the boundary cuts through a single word of
A: there existp ∈ A*, nonemptyc, andd, rwithx = p ++ c,c ++ d ∈ A,r ∈ A*andy = d ++ r.
Transfer membership in A* between prefixes that have the same set of
"residual left-quotients" of nonempty pending words.
If every left-quotient A / c realized by a nonempty residual c of x₁ (with
some p ∈ A* so that x₁ = p ++ c) is also realized by x₂, and x₂ ∈ A*
whenever x₁ ∈ A*, then x₁ ++ y ∈ A* implies x₂ ++ y ∈ A*. This is the
core step in proving that A* has finitely many left-quotients.
If x₁ and x₂ induce the same set of residual A-left-quotients and the
same membership in A*, then their left-quotients under A* agree:
A* / x₁ = A* / x₂. This is the equivalence relation underlying the
Myhill–Nerode-style proof that A* is regular.
Closure of regular languages under Kleene star.
If A is a regular language then so is A* = A.kstar. The proof uses the
Myhill–Nerode characterization: A* has finitely many left-quotients because
each one is determined by the pair (set of residual A-left-quotients, membership of x in A*), and both components live in finite sets when A is regular.
Pumping lemma at the DFA level.
If a DFA M with finite state space σ accepts a string s of length at
least |σ|, then s factors as s = x ++ y ++ z with |xy| ≤ |σ|,
y ≠ [], and {x} · {y}* · {z} ⊆ L(M).
Pumping lemma for regular languages.
For every regular language A, there is a pumping length p > 0 such that any
s ∈ A with |s| ≥ p factors as s = xyz with
xyⁱz ∈ Afor alli ≥ 0(encoded here as{x} · {y}* · {z} ⊆ A),y ≠ ε,|xy| ≤ p.
The pumping length is taken to be the cardinality of the state space of a DFA
recognizing A.
Concatenation of two languages: A · B = { ab | a ∈ A, b ∈ B },
realized in Mathlib as A * B.
Instances For
The left-quotient of A * B by x is determined by the pair
(A.leftQuotient x, { B.leftQuotient c | a ∈ A, x = a ++ c }).
If two strings x₁, x₂ agree in both components then they have the same
left-quotient under the concatenation A * B. This is the key lemma for
showing A * B is regular via Myhill–Nerode.
Closure of regular languages under concatenation.
If A and B are regular then so is A · B = A * B. The proof uses the
Myhill–Nerode characterization, showing that A * B has finitely many
left-quotients because each is determined by a pair lying in the product of
two finite sets.