Draft — mutable and not usable as a dependency; its citation marks the draft state.

Lax307052.ConfigurationGraph

The bounded configuration graph

concepts/Lax307052/ConfigurationGraph.lean · lax-307052

definition

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Concept map

    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Definition

    Vertices are configurations whose work tape has a fixed finite bound. Edges are machine transitions. Acceptance is reachability from the initial configuration to a terminal accepting configuration. The search predicate replaces reachability by the recursive finite graph test.

    Lean source view on GitHub

    1import Lax307052.BoundedConfigurations
    2import Lax307052.Reachability
    3import Mathlib.Data.Fintype.EquivFin
    4import Mathlib.Data.Nat.Log
    5
    6/-!
    7---
    8title: The bounded configuration graph
    9type: definition
    10---
    11Vertices are configurations whose work tape has a fixed finite bound.
    12Edges are machine transitions. Acceptance is reachability from the initial
    13configuration to a terminal accepting configuration. The search predicate
    14replaces reachability by the recursive finite graph test.
    15-/
    16
    17namespace Lax307052.ConfigurationGraph
    18
    19open Lax434930.PolynomialTime Lax434930.SpaceMachines BoundedConfigurations Reachability
    20
    21noncomputable def numbering (M : Machine) (n s : ℕ) :
    22 Config M n s ≃ Fin (Fintype.card (Config M n s)) := Fintype.equivFin _
    23
    24noncomputable def graph (M : Machine) (w : Word) (s : ℕ) :
    25 Graph (Fintype.card (Config M w.length s)) := by
    26 classical
    27 exact fun a b => decide (M.Step w (expand ((numbering M w.length s).symm a))
    28 (expand ((numbering M w.length s).symm b)))
    29
    30def AcceptsBounded (M : Machine) (w : Word) (s : ℕ) : Prop :=
    31 ∃ a b : Config M w.length s,
    32 expand a = M.initial ∧ M.Terminal w (expand b) ∧ M.accept b.state = true
    33 Reachable (graph M w s) (numbering M w.length s a) (numbering M w.length s b)
    34
    35def SearchAccepts (M : Machine) (w : Word) (s : ℕ) : Prop :=
    36 ∃ a b : Config M w.length s,
    37 expand a = M.initial ∧ M.Terminal w (expand b) ∧ M.accept b.state = true
    38 search (graph M w s) (Nat.clog 2 (Fintype.card (Config M w.length s)))
    39 (numbering M w.length s a) (numbering M w.length s b) = true
    40
    41end Lax307052.ConfigurationGraph
    42

    Community review

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above; your ORCID profile must share a public name.

    0 comments

    Loading discussion…