Let be the extended transition function of a deterministic finite automaton. States are equivalent, or indistinguishable, when
The quotient deterministic finite automaton by indistinguishable states has state set , initial state , accepting states , and transition
Right invariance of makes this well-defined, and the quotient accepts .
To prove minimality, choose for each state of the accessible automaton a word with . Run the same word in any DFA accepting , and assign the class the reached state of . If two distinct classes reached the same state of , every continuation would have the same acceptance result after and . Since and accept the same language, this would make and indistinguishable in , a contradiction. Thus has at least one distinct state for every class in , proving that the quotient is the minimal deterministic finite automaton.
For divisibility by seven, take states , initial state , accepting set , and transitions
After reading a word, the state is its binary value modulo seven, so this binary divisibility automaton accepts exactly the multiples of seven, with leading zeros allowed. Every state is accessible: the three-bit words representing reach the corresponding residues.
For distinct residues , let be the three-bit representation of , chosen in . Since , reading from state ends at
whereas reading it from ends at . Thus distinguishes from . All seven states are pairwise distinguishable, so the DFA is minimal by the Myhill-Nerode theorem.
The Knaster-Tarski theorem states that the fixed points of a monotone map on a complete lattice form a complete lattice. Let
For every , monotonicity gives , hence . Applying once more gives , so . The definition of then gives , and therefore . Thus
is the least fixed point. The order-dual argument shows that
is the greatest fixed point.
More generally, for a family of fixed points, let be the set of prefixed points satisfying and for every . Its meet is again prefixed. Since for every , the element also lies in , so the preceding argument gives . It is the join of within the fixed-point order. The dual construction gives the meet of within that order, proving completeness.
For the Myhill-Nerode theorem, let and define the Myhill-Nerode equivalence
This is an equivalence relation and a right congruence: implies for every letter .
If a deterministic finite automaton accepts , any two words reaching the same state are equivalent, because every continuation has the same subsequent run. Hence has at most as many classes as the automaton has states. Conversely, if has finitely many classes, define an automaton with state set , initial state , transition
and accepting states with . Right congruence makes the transition well defined, and induction on word length shows that the state reached by is , so the automaton accepts exactly . Therefore is a regular language exactly when has finite index. Moreover, every automaton for has at least one state for each equivalence class, so this quotient is the minimal deterministic finite automaton.
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.
The Myhill-Nerode theorem says this quotient is, up to isomorphism, the unique accessible DFA with the least possible number of states accepting the language.