The regular language is nonempty because it represents every element of the group. Find any accepted word using Breadth-first search in its finite-state automaton. If is the empty word, it already represents the identity.
Otherwise begin with and repeatedly apply the linear-time multiplication in an automatic structure to the letters
These letters belong to by symmetry of the alphabet. All intermediate words lie in , and the final word represents
Hence an identity representative can be constructed effectively:
This is a finite preliminary computation depending only on the fixed automatic structure for a group; it uses no test for whether an arbitrary word represents the identity.
Write the input word over an alphabet as . Starting with , obtain from by linear-time multiplication in an automatic structure with . Mathematical induction gives
The time complexity of step is at most a constant times . Summing the costs gives
The automatic structure for a group, and are fixed, so the required representative is
For the empty word, return in constant time.