Two-way complementation: retained #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Combinatorics/TwoWayAutomata/Retained.lean
Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.
Select the two 64-point families and a distinct hub.
Retaining a new pair and all external points removes exactly 127 points.
Before its turn, the selected pair is absent from the retained restriction.
At its turn, restriction adds precisely the selected pair to the retained identity.
The base case detects the off-diagonal pair using rectangle coverage and order reversal.
Every positive power of a sandwich is absorbed by its idempotent outer factor.