The bounded configuration graph
Lax733996.ConfigurationGraph · concepts/Lax733996/ConfigurationGraph.lean · lax-733996
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
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.
Concept map
In the paper
- page 1 of this submission's paper
Lean source view on GitHub
| 1 | import Lax733996.BoundedConfigurations |
| 2 | import Lax733996.Reachability |
| 3 | import Mathlib.Data.Fintype.EquivFin |
| 4 | import Mathlib.Data.Nat.Log |
| 5 | |
| 6 | set_option backward.isDefEq.respectTransparency false |
| 7 | |
| 8 | /-! |
| 9 | --- |
| 10 | title: The bounded configuration graph |
| 11 | type: definition |
| 12 | --- |
| 13 | Vertices are configurations whose work tape has a fixed finite bound. |
| 14 | Edges are machine transitions. Acceptance is reachability from the initial |
| 15 | configuration to a terminal accepting configuration. The search predicate |
| 16 | replaces reachability by the recursive finite graph test. |
| 17 | -/ |
| 18 | |
| 19 | namespace Lax733996.ConfigurationGraph |
| 20 | |
| 21 | open Lax434930.PolynomialTime Lax434930.SpaceMachines BoundedConfigurations Reachability |
| 22 | |
| 23 | noncomputable def numbering (M : Machine) (n s : ℕ) : |
| 24 | Config M n s ≃ Fin (Fintype.card (Config M n s)) := Fintype.equivFin _ |
| 25 | |
| 26 | noncomputable def graph (M : Machine) (w : Word) (s : ℕ) : |
| 27 | Graph (Fintype.card (Config M w.length s)) := by |
| 28 | classical |
| 29 | exact fun a b => decide (M.Step w (expand ((numbering M w.length s).symm a)) |
| 30 | (expand ((numbering M w.length s).symm b))) |
| 31 | |
| 32 | def AcceptsBounded (M : Machine) (w : Word) (s : ℕ) : Prop := |
| 33 | ∃ a b : Config M w.length s, |
| 34 | expand a = M.initial ∧ M.Terminal w (expand b) ∧ M.accept b.state = true ∧ |
| 35 | Reachable (graph M w s) (numbering M w.length s a) (numbering M w.length s b) |
| 36 | |
| 37 | def SearchAccepts (M : Machine) (w : Word) (s : ℕ) : Prop := |
| 38 | ∃ a b : Config M w.length s, |
| 39 | expand a = M.initial ∧ M.Terminal w (expand b) ∧ M.accept b.state = true ∧ |
| 40 | search (graph M w s) (Nat.clog 2 (Fintype.card (Config M w.length s))) |
| 41 | (numbering M w.length s a) (numbering M w.length s b) = true |
| 42 | |
| 43 | end Lax733996.ConfigurationGraph |
| 44 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments