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.
A deterministic finite automaton is a tuple with finite state set , finite input alphabet , transition function , initial state , and accepting-state set . It accepts a word when the extended transition function of a deterministic finite automaton carries to a state in . A regular language is a language accepted by some deterministic finite automaton.
The pumping lemma for regular languages says that if a regular language is accepted by an automaton with states, every accepted word of length at least has a decomposition with , , and in the language for every . Indeed, among the states visited before and after the first symbols, two are equal by the pigeonhole principle. The intervening nonempty word labels a loop, which may be traversed any number of times without changing the final accepting state.
In base two, the powers of two have representations , so their language is the regular expression and is regular.
Suppose instead that their base-ten representations formed a regular language. Apply the pumping lemma to a sufficiently long decimal power of two , and put . Pumping gives decimal integers represented by , all powers of two. A direct place-value calculation shows that
for a constant independent of . The lengths, and hence the exponents in , tend to infinity. Dividing by gives
For large , the right side has absolute value less than one while the left side is an integer, so it must vanish. This would make a power of two equal to , impossible for by unique prime factorization. Thus the decimal powers of two are not a regular language.
For a deterministic finite automaton the extended transition function of a deterministic finite automaton is recursively
The accepted language is
For a nondeterministic finite automaton, is the set of all states reachable from while reading ; recursively,
Thus
The powerset construction has state set , initial state , transition
and accepting states . Induction on gives
so the two automata accept exactly the same language. If and has one state, exactly of the subset states contain it and are accepting, including states that may be unreachable.
Extend to
by
The extended transition function of a deterministic finite automaton processes a whole word from left to right. The language accepted by is