Myhill–Nerode theorem

Revision as of 06:30, 14 April 2025 by imported>JJMC89 bot III (Moving Category:Finite automata to Category:Finite-state machines per Wikipedia:Categories for discussion/Speedy)
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Template:Short description In the theory of formal languages, the Myhill–Nerode theorem provides a necessary and sufficient condition for a language to be regular. The theorem is named for John Myhill and Anil Nerode, who proved it at the University of Chicago in 1957 Template:Harv.

StatementEdit

Given a language <math>L</math>, and a pair of strings <math>x</math> and <math>y</math>, define a distinguishing extension to be a string <math>z</math> such that exactly one of the two strings <math>xz</math> and <math>yz</math> belongs to <math>L</math>. Define a relation <math>\sim_L</math> on strings as <math>x\; \sim_L\ y</math> if there is no distinguishing extension for <math>x</math> and <math>y</math>. It is easy to show that <math>\sim_L</math> is an equivalence relation on strings, and thus it divides the set of all strings into equivalence classes.

The Myhill–Nerode theorem states that a language <math>L</math> is regular if and only if <math>\sim_L</math> has a finite number of equivalence classes, and moreover, that this number is equal to the number of states in the minimal deterministic finite automaton (DFA) accepting <math>L</math>. Furthermore, every minimal DFA for the language is isomorphic to the canonical one Template:Harv.

Template:Math theorem

Generally, for any language, the constructed automaton is a state automaton acceptor. However, it does not necessarily have finitely many states. The Myhill–Nerode theorem shows that finiteness is necessary and sufficient for language regularity.

Some authors refer to the <math>\sim_L</math> relation as Nerode congruence,<ref>Template:Citation</ref><ref>Template:Citation</ref> in honor of Anil Nerode.

Template:Math proof

Use and consequencesEdit

The Myhill–Nerode theorem may be used to show that a language <math>L</math> is regular by proving that the number of equivalence classes of <math>\sim_L</math> is finite. This may be done by an exhaustive case analysis in which, beginning from the empty string, distinguishing extensions are used to find additional equivalence classes until no more can be found.

For example, the language consisting of binary representations of numbers that can be divided by 3 is regular. Given two binary strings <math>x, y</math>, extending them by one digit gives <math>2x + b, 2y + b</math>, so <math>2x + b \equiv 2y + b \mod 3 </math> iff <math>x \equiv y \mod 3 </math>. Thus, <math>00</math> (or <math>11</math>), <math>01</math>, and <math>10</math> are the only distinguishing extensions, resulting in the 3 classes. The minimal automaton accepting our language would have three states corresponding to these three equivalence classes.

Another immediate corollary of the theorem is that if for a language <math>L</math> the relation <math>\sim_L</math> has infinitely many equivalence classes, it is Template:Em regular. It is this corollary that is frequently used to prove that a language is not regular.

GeneralizationsEdit

The Myhill–Nerode theorem can be generalized to tree automata.<ref>Template:Cite book Here: Sect. 1.5, p.35-36.</ref>

See alsoEdit

ReferencesEdit

Template:Reflist

Further readingEdit