Exponential state complexity of nondeterministic complementation #
The source is OpenAI's two-way complementation formalization: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Combinatorics/TwoWayAutomata/Main.lean
The public statements use the existing NMachine and ordinary Mathlib NFA.
Acceptance here permits a zero-step run (positive = false). The bridge
preserves the state count. The source's diagram argument also yields a lower
bound through every letter-to-word encoding, independent of codeword lengths.
Combining that bound with the existing binary liveness scanner proves an exponential lower bound for the full complement of a small binary NFA's language. The encoded-word agreement is only the proof method; the binary result concerns a language of all finite binary words. These are checked consequences without any assertion that the source authors were unaware of them.
Any encoded-word recognizer for the complement of liveness needs exponentially many states, even with two-way nondeterminism and arbitrary codeword lengths.
The complement of the ordinary h-state liveness NFA requires exponentially
many states in every two-way nondeterministic recognizer.
Already a one-way endmarker automaton has an exponentially expensive complement when the complementing machine may use two-way nondeterminism.
The complement of the 9 * (n + 2)-state binary scanner requires an
exponential number of states even in a two-way nondeterministic automaton.
No polynomial in the source state count bounds complementation of ordinary binary NFAs by two-way NFAs, under zero-step finite-run acceptance.