Documentation

Complexitylib.Models.FiniteAutomaton.Complementation.Internal.RelationMonoid

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.

Identity restricted to the retained points.

Equations
Instances For

    Singleton contexts test an individual relation edge.

    theorem Complexity.FiniteAutomaton.Complementation.Internal.relation_corner_identities {α : Type u_1} (P i : SetRel α α) (hP : P.comp P = P) (hiPi : (i.comp P).comp i = i) :
    have Q := (P.comp i).comp P; Q.comp Q = Q ∧ P.comp Q = Q ∧ Q.comp P = Q ∧ Q.comp i = P.comp i ∧ i.comp Q = i.comp P ∧ (i.comp Q).comp i = i

    Restriction-corner identities. The supporting relation i can be any idempotent with iPi = i.

    theorem Complexity.FiniteAutomaton.Complementation.Internal.relation_corner_inverse {α : Type u_1} (P i : SetRel α α) (hP : P.comp P = P) (hiPi : (i.comp P).comp i = i) :
    (∀ (Z : SetRel α α), (((P.comp i).comp P).comp Z).comp ((P.comp i).comp P) = Z → (P.comp ((i.comp Z).comp i)).comp P = Z) ∧ ∀ (A : SetRel α α), (i.comp A).comp i = A → (((P.comp i).comp P).comp ((P.comp A).comp P)).comp ((P.comp i).comp P) = (P.comp A).comp P ∧ (i.comp ((P.comp A).comp P)).comp i = A

    Restriction and extension are inverse on the two supported corners.

    theorem Complexity.FiniteAutomaton.Complementation.Internal.relation_corner_comp {α : Type u_1} (P i A B : SetRel α α) (hP : P.comp P = P) (hi : i.comp i = i) (hiPi : (i.comp P).comp i = i) (hA : (i.comp A).comp i = A) (hB : (i.comp B).comp i = B) :
    ((P.comp A).comp P).comp ((P.comp B).comp P) = (P.comp (A.comp B)).comp P

    Extension preserves products on the supported relation corner.

    @[reducible, inline]

    Relations in path order, using the opposite of Mathlib's endomorphism monoid.

    Equations
    Instances For

      The underlying binary relation.

      Equations
      Instances For

        Extending a relation on a subset and restricting it again loses no pairs.

        Extension of restriction is precisely the identity sandwich on the subset.

        Extension of relations on a subset preserves path composition.

        theorem Complexity.FiniteAutomaton.Complementation.Internal.relation_corner_equiv {H : Type u_1} (P : SetRel H H) (F : Set H) (hP : P.comp P = P) (hiPi : ((restrictedIdentity F).comp P).comp (restrictedIdentity F) = restrictedIdentity F) :
        ∃ (hQ : IsIdempotentElem (RelationMonoid.ofRel ((P.comp (restrictedIdentity F)).comp P))) (ρ : hQ.Corner ≃* RelationMonoid ↑F), ∀ (Z : hQ.Corner), (ρ Z).toRel = {xy : ↑F × ↑F | (↑xy.1, ↑xy.2) ∈ (↑Z).toRel}

        The full relation monoid on a subset is the compressed relation corner.