Two-way complementation: relation monoid #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Combinatorics/TwoWayAutomata/RelationMonoid.lean
Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.
Restriction and extension are inverse on the two supported corners.
Extension preserves products on the supported relation corner.
Relations in path order, using the opposite of Mathlib's endomorphism monoid.
Equations
- Complexity.FiniteAutomaton.Complementation.Internal.RelationMonoid H = (CategoryTheory.End (have this := H; this))ᵐᵒᵖ
Instances For
Regard a binary relation as a path-ordered endomorphism.
Equations
Instances For
The underlying binary relation.
Equations
- R.toRel = (MulOpposite.unop R).rel
Instances For
Extension of restriction is precisely the identity sandwich on the subset.
Extension of relations on a subset preserves path composition.
The full relation monoid on a subset is the compressed relation corner.