Vertex-disjoint paths in digraphs
AbbreviationDirected disjoint paths instances#✓fully proved
An instance of DIRECTED DISJOINT PATHS is a triple \((n, A, P)\) consisting of a natural number \(n\) (the number of vertices), a finite list \(A\) of ordered pairs of natural numbers (the arcs) and a finite list \(P\) of ordered pairs of natural numbers (the source-target pairs).
DefinitionDirected adjacency for DIRECTED DISJOINT PATHS#✓fully proved
For a finite list \(E\) of ordered pairs of natural numbers and natural numbers \(u\) and \(v\), the directed adjacency of \(u\) to \(v\) in \(E\) is the boolean value that is true exactly when the pair \((u, v)\) occurs in \(E\).
Used by 1
DefinitionWell-formed directed disjoint paths instances#✓fully proved
An instance \((n, A, P)\) of DIRECTED DISJOINT PATHS is well formed when the arc list \(A\) has no repeated entries, every arc \((u, v)\) in \(A\) satisfies \(u < n\), \(v < n\) and \(u \ne v\), and every source-target pair \((s, t)\) in \(P\) satisfies \(s < n\) and \(t < n\).
def WellFormed (i : DirectedDisjointPathsInstance) : Prop :=
i.2.1.Nodup ∧ (∀ e ∈ i.2.1, e.1 < i.1 ∧ e.2 < i.1 ∧ e.1 ≠ e.2) ∧
(∀ p ∈ i.2.2, p.1 < i.1 ∧ p.2 < i.1)
abbrev DirectedDisjointPathsInstance := ℕ × List (ℕ × ℕ) × List (ℕ × ℕ)
WantedExt/Complexity/NPComplete/DirectedDisjointPathsWanted.lean:47
Uses 1 · Used by 1
DefinitionFeasible directed disjoint paths instances#✓fully proved
Let \((n, A, P)\) be an instance of DIRECTED DISJOINT PATHS whose list of source-target pairs is \(P = ((s_0, t_0), \dots, (s_{k-1}, t_{k-1}))\). The instance is feasible when there are lists \(\pi_0, \dots, \pi_{k-1}\) of natural numbers such that, for every \(p < k\), the list \(\pi_p\) is nonempty, has no repeated entries, has first entry \(s_p\) and last entry \(t_p\), has all its entries less than \(n\), and every two consecutive entries \(u, v\) of \(\pi_p\) form an arc \((u, v)\) occurring in \(A\); and such that, for all distinct \(p, q < k\), no \(v < n\) is an entry of both \(\pi_p\) and \(\pi_q\).
def DirectedDisjointPathsFeasible
(i : DirectedDisjointPathsInstance) : Prop :=
∃ paths : List (List ℕ), paths.length = i.2.2.length ∧
(∀ p < i.2.2.length, (paths.getD p []).Nodup ∧ (paths.getD p []).length ≥ 1 ∧
(paths.getD p []).getD 0 0 = (i.2.2.getD p (0, 0)).1 ∧
(paths.getD p []).getD ((paths.getD p []).length - 1) 0 = (i.2.2.getD p (0, 0)).2 ∧
(∀ v ∈ paths.getD p [], v < i.1) ∧
∀ j, j + 1 < (paths.getD p []).length →
DAdj i.2.1 ((paths.getD p []).getD j 0) ((paths.getD p []).getD (j + 1) 0)) ∧
∀ p < i.2.2.length, ∀ q < i.2.2.length, p ≠ q → ∀ v < i.1,
v ∈ paths.getD p [] → v ∉ paths.getD q []
abbrev DirectedDisjointPathsInstance := ℕ × List (ℕ × ℕ) × List (ℕ × ℕ)
WantedExt/Complexity/NPComplete/DirectedDisjointPathsWanted.lean:47
def DAdj (edges : List (ℕ × ℕ)) (u v : ℕ) : Bool :=
edges.contains (u, v)
WantedExt/Complexity/NPComplete/DirectedDisjointPathsWanted.lean:51
Uses 2 · Used by 1
DefinitionDIRECTED DISJOINT PATHS as a decision problem#✓fully proved
The decision problem DIRECTED DISJOINT PATHS accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding, to an instance of DIRECTED DISJOINT PATHS that is well formed and feasible; bitstrings that do not decode to an instance are rejected.
noncomputable def directedDisjointPathsDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := DirectedDisjointPathsInstance) x with
| some i => decide (WellFormed i ∧ DirectedDisjointPathsFeasible i)
| none => false
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def bitDecode [BitstringEncoding α] (l : List Bool) : Option α := toEncoding.decode l
MathlibExt/Computability/Complexity.lean:58
abbrev DirectedDisjointPathsInstance := ℕ × List (ℕ × ℕ) × List (ℕ × ℕ)
WantedExt/Complexity/NPComplete/DirectedDisjointPathsWanted.lean:47
def WellFormed (i : DirectedDisjointPathsInstance) : Prop :=
i.2.1.Nodup ∧ (∀ e ∈ i.2.1, e.1 < i.1 ∧ e.2 < i.1 ∧ e.1 ≠ e.2) ∧
(∀ p ∈ i.2.2, p.1 < i.1 ∧ p.2 < i.1)
WantedExt/Complexity/NPComplete/DirectedDisjointPathsWanted.lean:56
def DirectedDisjointPathsFeasible
(i : DirectedDisjointPathsInstance) : Prop :=
∃ paths : List (List ℕ), paths.length = i.2.2.length ∧
(∀ p < i.2.2.length, (paths.getD p []).Nodup ∧ (paths.getD p []).length ≥ 1 ∧
(paths.getD p []).getD 0 0 = (i.2.2.getD p (0, 0)).1 ∧
(paths.getD p []).getD ((paths.getD p []).length - 1) 0 = (i.2.2.getD p (0, 0)).2 ∧
(∀ v ∈ paths.getD p [], v < i.1) ∧
∀ j, j + 1 < (paths.getD p []).length →
DAdj i.2.1 ((paths.getD p []).getD j 0) ((paths.getD p []).getD (j + 1) 0)) ∧
∀ p < i.2.2.length, ∀ q < i.2.2.length, p ≠ q → ∀ v < i.1,
v ∈ paths.getD p [] → v ∉ paths.getD q []
WantedExt/Complexity/NPComplete/DirectedDisjointPathsWanted.lean:61
Uses 12 · Used by 1
TheoremDIRECTED DISJOINT PATHS is NP-complete#●ready to prove
The decision problem DIRECTED DISJOINT PATHS belongs to NP, and every decision problem in NP reduces to it by a polynomial-time many-one reduction.
public theorem_wanted directedDisjointPaths_npComplete :
directedDisjointPathsDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L directedDisjointPathsDec
noncomputable def directedDisjointPathsDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := DirectedDisjointPathsInstance) x with
| some i => decide (WellFormed i ∧ DirectedDisjointPathsFeasible i)
| none => false
WantedExt/Complexity/NPComplete/DirectedDisjointPathsWanted.lean:75
def NP : DecisionComplexityClass :=
{ L | ∃ (p : Polynomial ℕ), ∃ R : (List Bool × List Bool) → Bool,
IsPolyTime R ∧
∀ x, L x ↔ ∃ w : List Bool, w.length ≤ p.eval x.length ∧ R (x, w) }
MathlibExt/Computability/Complexity.lean:200
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def PolyManyOneRed (L₁ L₂ : MetaMathlibExt.ComplexityTheory.DecisionProblem) : Prop :=
∃ reduce : List Bool → List Bool,
MetaMathlibExt.ComplexityTheory.IsPolyTime reduce ∧ ∀ x, L₁ x = L₂ (reduce x)
CSLibExt/Computability/CookLevin.lean:396
Sources
- M. R. Garey and D. S. Johnson, Computers and Intractability (1979), DISJOINT PATHS; S. Fortune, J. Hopcroft, and J. Wyllie, "The directed subgraph homeomorphism problem" (1980).
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.