Suppose first that is a regular language, accepted by a deterministic finite automaton . If two words reach the same state, then every continuation is accepted from both or rejected from both. Thus they are equivalent under , and the number of equivalence classes is at most the finite number of states of .
Conversely, suppose has finitely many classes. Define a deterministic automaton byandThe transition is well defined: if , then for every suffix ,so . Likewise, membership in is independent of the representative by taking the empty suffix in the definition of . Induction givesso the automaton accepts exactly . It has finitely many states, and therefore is regular. This proves the Myhill-Nerode theorem in the stated formulation. The assumption merely says that the initial state is not accepting.
Solved by gpt-5.6-sol high.
Codex Wiki