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×AQ defined by

δ(q,a)=[wa]𝒩L,wq, (1)


F={qQwLwq}. (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 qQ, aA, wA. Define f:QA/𝒩L{} as

f(q)={[w]𝒩Lifδ(q0,w)=qifδ(q0,w)qwA (3)

Then f is well defined. In fact, suppose q1=q2=q: then either f(q1)=f(q2)=, or there are w1,w2A such that δ(q0,w1)=δ(q0,w2)=q. But in the latter case, δ(q0,w1u)=δ(q0,w2u)=δ(q,u) for any uA, hence w1𝒩Lw2 since 𝒜 recognizes L. Finally, for any wA 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