Myhill-Nerode theorem


Let L be a languagePlanetmathPlanetmath on the finite alphabet A and let 𝒩L be its Nerode equivalence. The following are equivalentMathworldPlanetmathPlanetmathPlanetmathPlanetmath.

  1. 1.

    L is recognized by a deterministic finite automaton.

  2. 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 wordPlanetmathPlanetmathPlanetmath on A. Construct a DFA 𝒜=⟨Q,A,q0,δ,F⟩ (called the Nerode automaton for L) with δ:Q×A→Q defined by

δ⁢(q,a)=[w⁢a]𝒩L,w∈q, (1)

and

F={q∈Q∣∃w∈L∣w∈q}. (2)

Then δ is well defined because w1⁢𝒩L⁢w2 implies w1⁢u⁢𝒩L⁢w2⁢u. 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,a⁢w)=δ⁢(δ⁢(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,w1⁢u)=δ⁢(q0,w2⁢u)=δ⁢(q,u) for any u∈A∗, hence w1⁢𝒩L⁢w2 since 𝒜 recognizes L. Finally, for any w∈A∗ we have [w]𝒩L=f⁢(δ⁢(q0,w)), so every class of 𝒩L has a preimageMathworldPlanetmath 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