Documentation

Complexitylib.Models.FiniteAutomaton.Complementation.Internal.Normalization

Two-way complementation: normalization #

Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a. Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Combinatorics/TwoWayAutomata/Normalization.lean

Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.

Only the first tape position carries the left endmarker.

Only the last original tape position carries the right endmarker.

def Complexity.FiniteAutomaton.Complementation.Internal.TwoNFA.reindex {Sigma : Type u_1} {Q : Type u_2} {Q' : Type u_3} (A : TwoNFA Sigma Q) (e : Q ≃ Q') :
TwoNFA Sigma Q'

Rename states along an equivalence, retaining all transitions and moves.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem Complexity.FiniteAutomaton.Complementation.Internal.TwoNFA.reindex_language {Sigma : Type u_1} {Q : Type u_2} {Q' : Type u_3} (A : TwoNFA Sigma Q) (e : Q ≃ Q') :

    Embed an original configuration while reserving one state and one exit position.

    Equations
    Instances For
      def Complexity.FiniteAutomaton.Complementation.Internal.TwoNFA.augmentedStep {Sigma : Type u_1} {Q : Type u_2} (A : TwoNFA Sigma Q) (w : List Sigma) :
      SetRel (Option Q × Fin (w.length + 3)) (Option Q × Fin (w.length + 3))

      Original moves, an accepting stay into the fresh state, and its rightward sweep.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem Complexity.FiniteAutomaton.Complementation.Internal.TwoNFA.augmented_run_cases {Sigma : Type u_1} {Q : Type u_2} (A : TwoNFA Sigma Q) (w : List Sigma) {c : Option Q × Fin (w.length + 3)} (hrun : (augmentConfig (A.initial, ⟨0, ⋯⟩), c) ∈ relStar (A.augmentedStep w)) :
        w ∈ A.language ∨ ∃ (x : Q × Fin (w.length + 2)), c = augmentConfig x ∧ ((A.initial, ⟨0, ⋯⟩), x) ∈ relStar (A.step w)

        Before entering the fresh state, every augmented finite path is an original run.

        The fresh state can sweep from any position to the designated right exit.

        Finite acceptance is equivalent to reaching the designated augmented exit.

        def Complexity.FiniteAutomaton.Complementation.Internal.TwoNFA.augmentedMove {Sigma : Type u_1} {Q : Type u_2} (A : TwoNFA Sigma Q) (symbol : Fin 2 ⊕ Sigma) (move : Fin 3) :

        Augmented moves at one symbol, including the original endmarker restrictions.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem Complexity.FiniteAutomaton.Complementation.Internal.TwoNFA.augmentedStep_local_iff {Sigma : Type u_1} {Q : Type u_2} (A : TwoNFA Sigma Q) (w : List Sigma) (c d : Option Q × Fin (w.length + 3)) :
          (c, d) ∈ A.augmentedStep w ↔ ∃ (p : Fin (w.length + 2)), c.2 = p.castSucc ∧ ∃ (move : Fin 3), (c.1, d.1) ∈ A.augmentedMove (tapeSymbol w p) move ∧ ↑↑d.2 = ↑↑p + ↑↑move - 1

          The global augmented graph is exactly the graph of the local moves and head displacement.