Documentation

CslibFrontier.Computability.Complexity.Problems.BoundedSTCON

Length-bounded directed connectivity #

A BoundedSTCONInstance consists of an adjacency-matrix connectivity instance and a binary length bound. BoundedSTCON asks for a walk of at most that many arcs; allowing repeated vertices does not change this question, since cycles can be removed.

This module proves the mathematical layered-graph construction for Exercise 5.19 of [Gol08] (January 2007 draft, printed p. 197). The machine certificate and NL membership are in BoundedSTCON/LogSpace and BoundedSTCON/Membership.

Main results #

Directed connectivity with a bound on the number of arcs.

  • The adjacency-matrix graph and its source and target, in the existing STCON format.

  • bound : ℕ

    The maximum number of arcs, encoded in binary.

@[reducible, inline]

The tuple of the fields of encBoundedSTCON.

theorem Cslib.Complexity.encBoundedSTCON_bound_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → BoundedSTCONInstance} :
theorem Cslib.Complexity.encBoundedSTCON_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → STCONInstance} {T0 S0 x1 T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn encSTCON T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encNat T1 S1) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { graph := x0 x, bound := x1 x }) encIn encBoundedSTCON (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x
theorem Cslib.Complexity.encBoundedSTCON_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → STCONInstance} {x1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn encSTCON budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encNat budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { graph := x0 x, bound := x1 x }) encIn encBoundedSTCON budget
theorem Cslib.Complexity.encBoundedSTCON_graph_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → BoundedSTCONInstance} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ encBoundedSTCON S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).graph) encIn✝ encSTCON S✝

A framed encSTCON graph followed by the binary digits (encNat) of the length bound.

Instances admitting a directed source-to-target walk with at most bound arcs.

The number of useful transitions: longer walks can have their cycles removed.

Capping the binary bound at the vertex count preserves bounded reachability.

def Cslib.Complexity.BoundedSTCONInstance.node (I : BoundedSTCONInstance) (layer : Fin (I.cap + 1)) (vertex : Fin I.graph.n) :
Fin ((I.cap + 1) * I.graph.n)

Number a vertex in a layer by layer * n + vertex.

The directed layered instance: each arc advances one layer and follows an original arc or stays at the same original vertex.

theorem Cslib.Complexity.BoundedSTCONInstance.layered_adj_iff (I : BoundedSTCONInstance) (i j : Fin (I.cap + 1)) (u v : Fin I.graph.n) :
I.layered.Adj (I.node i u) (I.node j v) ↔ ↑j = ↑i + 1 ∧ Relation.ReflGen I.graph.Adj u v

The adjacency test in named layer and vertex coordinates.

The layered graph reaches its final-layer target exactly when the original graph has a source-to-target walk within the given bound. Zero bounds and coinciding terminals are included.