Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2023/ii/paper-3/12i/iv/solution

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 by
and
The 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 gives
so 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.

New to topics? Read the docs here!