Math 2.0

Computer science Automata and formal languages Theorem

Myhill–Nerode theorem

Builds on Regular languageEquivalence relationEquivalence classDeterministic finite automaton

Statement

Let Σ\Sigma be an alphabet and let L⊆Σ∗L \subseteq \Sigma^*. For x,y∈Σ∗x, y \in \Sigma^*, write x∼Lyx \sim_L y when, for every z∈Σ∗z \in \Sigma^*, xz∈Lxz \in L if and only if yz∈Lyz \in L. Then ∼L\sim_L is an equivalence relation on Σ∗\Sigma^*, and:

  1. LL is a regular language if and only if ∼L\sim_L has finitely many equivalence classes;
  2. if LL is regular, the number of classes of ∼L\sim_L is the least number of states of a DFA that accepts LL;
  3. a DFA that accepts LL with this least number of states is unique up to renaming of the states.

Remarks

If a DFA AA accepts LL, then two words that lead AA to the same state are equivalent, so ∼L\sim_L has at most as many classes as AA has states. Conversely, if there are finitely many classes, the classes themselves are the states of a DFA. On the letter aa, the class of xx goes to the class of xaxa. The class of ε\varepsilon is initial, and the classes inside LL are accepting. This DFA is well defined because x∼Lyx \sim_L y implies xa∼Lyaxa \sim_L ya. Example: for L={anbn:n≥0}L = \set{a^n b^n : n \ge 0}, the words aia^i for i≥0i \ge 0 lie in pairwise different classes, since aibi∈La^i b^i \in L but ajbi∉La^j b^i \notin L for j≠ij \ne i; so LL is not regular. The class of xx corresponds to the Brzozowski derivative x−1L={z:xz∈L}x^{-1} L = \set{z : xz \in L}, since x∼Lyx \sim_L y means x−1L=y−1Lx^{-1} L = y^{-1} L.

Going deeper

For a student

Unlike the pumping lemma, this theorem characterizes regular languages, so it can prove both regularity and non-regularity. It also gives the theoretical basis of DFA minimization: minimizing a DFA means merging states that lead to equivalent words. The two-sided version of the same idea, the syntactic congruence, leads to the syntactic monoid of a language.

Reading path

To understand this page from the ground up, read these 5 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Deterministic finite automaton concept
  2. Equivalence class concept
  3. Equivalence relation concept
  4. Regular language concept
  5. Myhill–Nerode theorem statement

Further reading

  1. Web https://en.wikipedia.org/wiki/Myhill%E2%80%93Nerode_theorem
About this page
Tag96BRMR4P3N
URIm2://96BRMR4P3N
Kindstatement, theorem
WritingW0 stub
MSC68Q45, 68Q70
StatusThis copy of the site has no build data. Run m2 status 96BRMR4P3N.
AboutRegular language
UsesRegular language, Equivalence relation, Equivalence class, Deterministic finite automaton
Same as
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.