Myhill-Nerode theorem
Let L be a language on the finite alphabet A
and let 𝒩L be its Nerode equivalence.
The following are equivalent
.
-
1.
L is recognized by a deterministic finite automaton.
-
2.
A∗/𝒩L is finite.
Moreover, the number of classes of 𝒩L is the smallest number of states of a DFA recognizing L.
Proof.
First, suppose
A∗/𝒩L={q0=[λ]𝒩L,…,qk-1}=Q,
where λ is the empty word on A.
Construct a DFA 𝒜=⟨Q,A,q0,δ,F⟩
(called the Nerode automaton for L)
with δ:Q×A→Q defined by
δ(q,a)=[wa]𝒩L,w∈q, | (1) |
and
F={q∈Q∣∃w∈L∣w∈q}. | (2) |
Then δ is well defined because w1𝒩Lw2 implies w1u𝒩Lw2u. It is also straightforward that 𝒜 recognizes L.
On the other hand, let 𝒜=⟨Q,A,q0,δ,F⟩ be a DFA that recognizes L. Extend δ to Q×A∗ by putting δ(q,λ)=q and δ(q,aw)=δ(δ(q,a),w) for every q∈Q, a∈A, w∈A∗. Define f:Q→A∗/𝒩L∪{∅} as
f(q)={[w]𝒩Lifδ(q0,w)=q∅ifδ(q0,w)≠q∀w∈A∗ | (3) |
Then f is well defined.
In fact, suppose q1=q2=q:
then either f(q1)=f(q2)=∅,
or there are w1,w2∈A∗ such that δ(q0,w1)=δ(q0,w2)=q.
But in the latter case, δ(q0,w1u)=δ(q0,w2u)=δ(q,u)
for any u∈A∗,
hence w1𝒩Lw2 since 𝒜 recognizes L.
Finally, for any w∈A∗ we have
[w]𝒩L=f(δ(q0,w)),
so every class of 𝒩L has a preimage according to f;
consequently, |Q|≥|A∗/𝒩L|.
□
Title | Myhill-Nerode theorem |
---|---|
Canonical name | MyhillNerodeTheorem |
Date of creation | 2013-03-22 18:52:13 |
Last modified on | 2013-03-22 18:52:13 |
Owner | Ziosilvio (18733) |
Last modified by | Ziosilvio (18733) |
Numerical id | 14 |
Author | Ziosilvio (18733) |
Entry type | Theorem |
Classification | msc 68Q70 |
Classification | msc 20M35 |
Synonym | Myhill-Nerode theorem for languages |