Create your own
Lesson illustration

Proving DFA Minimality: Reachability and State Distinguishability

Good to see you again. In the previous lesson, you used pairwise distinguishable strings to prove that every DFA for a language needs a certain number of states. We now apply the same idea to a DFA that has already been constructed.

This completes the regular-language proof techniques module. The goal is stronger than showing a lower bound in the abstract: you will prove that a particular DFA has exactly the smallest possible number of states. The two facts you must establish are that every state is reachable from the start and that every distinct pair of states is distinguishable by some common suffix.


The minimal-DFA criterion

Let

be a DFA. Recall that is minimal when no DFA with fewer than states recognizes the same language.

Two kinds of redundant states can make a DFA nonminimal:

  1. Unreachable states. If no input from the start state ever enters a state , then that state has no effect on the recognized language. It can be removed.

  2. Indistinguishable states. If two states have identical acceptance behavior under every possible future input, then the DFA never needs to remember which of those two states it is in. They can be merged.

The following theorem gives a precise test.

Minimal-DFA criterion. A DFA is minimal if and only if:

  1. every state is reachable from its start state, and
  2. every pair of distinct states is distinguishable.

The first condition shows that all listed states are genuinely used. The second shows that none of the used states can represent the same “future behavior.”

DFA Minimization Algorithm + Example

Watch “DFA Minimization Algorithm + Example” by Easy Theory for a compact visual account of state equivalence and distinguishability. It reinforces the crucial point that states are compared by what happens after the same continuation is read from each one.

Watch state behavior for the distinction between equivalent and distinguishable states, especially the use of a common suffix. Then watch the recursive rule to see why a symbol followed by a distinguishing suffix also distinguishes the original pair.

Reachability

A state is reachable if there exists a string such that

Here, is the extended transition function: it describes the state reached after a whole string rather than one symbol.

To prove reachability, give one access string for each state. The empty string always reaches the start state:

State distinguishability

Two states and are distinguishable if some string makes their future behavior differ:

or the reverse.

The string is a distinguishing suffix for the pair of states. As in the previous lesson, is allowed. Therefore, an accepting state and a rejecting state are immediately distinguishable by .

Be careful about the distinction between the two related ideas:

  • Distinguishable strings are compared by starting at , then reading and .
  • Distinguishable states are compared by starting directly from and , then reading the same suffix.

They fit together perfectly. If

and distinguishes and , then distinguishes the prefixes and with respect to .


Why these two conditions prove minimality

The minimal-DFA criterion is not merely a useful rule; it follows directly from the lower-bound argument from the previous lesson.

Suppose has states, every state is reachable, and every distinct pair of states is distinguishable. For each state , choose an access string such that

Because distinct states of are distinguishable, for each there is a suffix for which exactly one of

is accepting. Equivalently, exactly one of and belongs to . Thus the access strings

are pairwise distinguishable strings for .

By the Myhill–Nerode lower-bound principle, every DFA recognizing needs at least states. Since itself has states, no smaller equivalent DFA exists. Therefore is minimal.

This proof reveals the roles of the two requirements:

RequirementWhat it contributes to the lower-bound proof
Every state is reachableSupplies one actual input prefix for each state.
Every pair is distinguishableProves that no two of those prefixes may be represented by one state in any equivalent DFA.
has statesSupplies the matching upper bound: states are sufficient.

A common incomplete argument says: “Every pair of states is distinguishable, so the DFA is minimal.” This omits reachability. An unreachable state can be distinguishable from other states but still removable, because no actual computation from the start ever reaches it.


Worked proof: binary numbers divisible by three

Consider the DFA in the diagram below. It processes binary strings, allowing leading zeros. Its three states represent the remainder of the binary number read so far when divided by :

  • : remainder ,
  • : remainder ,
  • : remainder .

Only is accepting, so the DFA recognizes binary representations of multiples of .

A three-state DFA for binary values divisible by \(3\): \(S_0\) is the start and accepting state; the states encode remainders \(0\), \(1\), and \(2\) modulo \(3\).

Let us prove rigorously that this DFA is minimal.

Step 1: Establish reachability

We need an access string for every state.

StateAccess stringVerification
The empty string leaves the DFA at the start state .
From , reading enters .
From , reading enters , and then reading enters .

Hence every state is reachable.

Notice that access strings do not have to be accepted. The string , for example, is not accepted, but it is still a perfectly valid witness that is used.

Step 2: Distinguish every pair of states

There are only three unordered pairs:

Start with pairs involving . Since is accepting and are rejecting, the empty suffix works:

while

Thus and are distinguishable by . Likewise,

so and are distinguishable by .

The remaining pair is . They are both rejecting, so does not separate them. Try the suffix :

but

Therefore and are distinguishable by .

A compact witness table makes the full argument easy to inspect:

Pair of statesDistinguishing suffixResult from first stateResult from second state
, accepting, rejecting
, accepting, rejecting
, accepting, rejecting

Every pair of distinct states is distinguishable.

Step 3: State the conclusion

A polished final proof reads as follows:

Every state is reachable: reaches , reaches , and reaches .

The states and are distinguished by , as are and , because is accepting while and are rejecting. Finally, and are distinguished by , since reading sends to accepting state but leaves at rejecting state .

Thus every state is reachable and every pair of distinct states is distinguishable. By the minimal-DFA criterion, this DFA is minimal.

The remainder interpretation offers intuition, but it is not the proof. The proof consists of the explicit access strings and distinguishing suffixes.


How to find distinguishing suffixes

For small DFAs, use the following disciplined search strategy.

First, use acceptance status

For every accepting state and rejecting state , record

This immediately handles all mixed accepting/rejecting pairs.

Then, compare transitions from same-status pairs

Suppose and are both accepting or both rejecting. Inspect a symbol .

If and are already known to be distinguishable by , then distinguishes and . Indeed,

and similarly for . Since the two target states have opposite outcomes after , the original states have opposite outcomes after .

For the example DFA:

  • and are both rejecting.
  • On input , they reach and , respectively.
  • Those target states differ immediately in acceptance status.
  • Therefore distinguishes and .

This is the logical basis of the table-filling minimization method: distinguishability can be propagated backward through matching labeled transitions.


A proof-writing template

When asked to prove a given DFA minimal, organize your answer in this order.

1. List reachability witnesses

For each state , provide a string and verify

A compact table is often best.

2. List pairwise distinguishing witnesses

For every unordered pair of distinct states , provide a suffix . Verify explicitly that exactly one of

and

holds.

For a DFA with states, there are

pairs to account for. When state names have a regular pattern, one general argument may cover many pairs; otherwise, a witness table is precise and efficient.

3. Invoke the criterion

End with the exact logical conclusion:

Since every state is reachable and every pair of distinct states is distinguishable, is minimal.

Avoid weaker conclusions such as “the DFA seems to use all its states” or “no states look mergeable.” Minimality is a universal claim about all possible equivalent DFAs, so it needs the reachability-and-distinguishability theorem.


Common proof errors

ErrorWhy it is insufficientRepair
Showing only that every state has an incoming edgeAn edge from an unreachable component does not make a state reachable from the start.Give a string beginning at for each state.
Saying two states are different because they have different names or different outgoing edgesDifferent transition diagrams can still produce identical acceptance behavior.Find a common suffix that makes one run accept and the other reject.
Comparing states using different suffixesThe two computations must receive the same continuation.Use one string from both states in each pair.
Forgetting Accepting versus rejecting states are already distinguishable.Test before searching for a longer witness.
Proving only some pairs distinguishableOne unexamined pair may be mergeable.Account for every unordered pair, or give a general argument covering them.
Establishing distinguishability but not reachabilityAn unreachable state can be removed even if it differs from all others.Prove reachability first.

Key takeaways

To prove a particular DFA minimal, show both that:

  1. every state is reached by some input from the start state, and
  2. every two distinct states have different futures, witnessed by a suffix that makes exactly one computation accept.

The connection to the previous lesson is direct: choose one access string per reachable state. Pairwise state distinguishability makes those access strings pairwise distinguishable for the DFA’s language, forcing every equivalent DFA to retain at least as many states.

You have now completed the regular-language proof toolkit: closure arguments, pumping-lemma proofs, Myhill–Nerode lower bounds, and minimal-DFA proofs. The next module turns to context-free languages, beginning with the constructive task of designing a context-free grammar and proving that it generates exactly the intended language.

Can't find a good explanation? Sign up and we'll make it for you

Sign up