Feedback arc set
AbbreviationInstances of FEEDBACK ARC SET#✓fully proved
An instance of FEEDBACK ARC SET is a triple \((n, E, K)\) consisting of a natural number \(n\) (the number of vertices), a finite list \(E\) of ordered pairs of natural numbers (the arcs) and a natural number \(K\) (the bound).
abbrev FeedbackArcSetInstance := ℕ × List (ℕ × ℕ) × ℕ
DefinitionDirected adjacency for FEEDBACK ARC SET#✓fully proved
For a list \(E\) of ordered pairs of natural numbers and natural numbers \(u\) and \(v\), the directed adjacency test returns true when the pair \((u, v)\) occurs in \(E\), that is, when \(E\) contains an arc from \(u\) to \(v\), and false otherwise.
DefinitionWell-formed FEEDBACK ARC SET instances#✓fully proved
An instance \((n, E, K)\) of FEEDBACK ARC SET is well formed when the list \(E\) has no repeated entries and every pair \((u, v)\) in \(E\) satisfies \(u < n\), \(v < n\) and \(u \ne v\); that is, \(E\) lists distinct arcs, without loops, of a directed graph on the vertices \(0, \dots, n-1\).
def WellFormed (i : FeedbackArcSetInstance) : Prop :=
i.2.1.Nodup ∧ ∀ e ∈ i.2.1, e.1 < i.1 ∧ e.2 < i.1 ∧ e.1 ≠ e.2
abbrev FeedbackArcSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/FeedbackArcSetWanted.lean:46
Uses 1 · Used by 1
DefinitionFeasible FEEDBACK ARC SET instances#✓fully proved
An instance \((n, E, K)\) of FEEDBACK ARC SET is feasible when there is an ordering \(v_0, v_1, \dots, v_{n-1}\) of the vertices \(0, \dots, n-1\), in which each of them occurs exactly once, such that at most \(K\) entries \((u, v)\) of the list \(E\), counted with repetition, are backward, meaning that the position of \(v\) in the ordering is strictly smaller than the position of \(u\). Here \(v_j\) has position \(j\), and a number that is not among \(0, \dots, n-1\) has position \(n\).
def FeedbackArcSetFeasible
(i : FeedbackArcSetInstance) : Prop :=
∃ ord : List ℕ, ord.Perm (List.range i.1) ∧
(i.2.1.filter (fun e => decide (ord.idxOf e.2 < ord.idxOf e.1))).length ≤ i.2.2
abbrev FeedbackArcSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/FeedbackArcSetWanted.lean:46
Uses 1 · Used by 1
DefinitionFEEDBACK ARC SET as a decision problem#✓fully proved
The decision problem FEEDBACK ARC SET accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding of instances, to an instance \((n, E, K)\) of FEEDBACK ARC SET that is well formed and feasible. Bitstrings that do not decode to an instance are rejected.
noncomputable def feedbackArcSetDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := FeedbackArcSetInstance) x with
| some i => decide (WellFormed i ∧ FeedbackArcSetFeasible 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 FeedbackArcSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/FeedbackArcSetWanted.lean:46
def WellFormed (i : FeedbackArcSetInstance) : Prop :=
i.2.1.Nodup ∧ ∀ e ∈ i.2.1, e.1 < i.1 ∧ e.2 < i.1 ∧ e.1 ≠ e.2
WantedExt/Complexity/NPComplete/FeedbackArcSetWanted.lean:55
def FeedbackArcSetFeasible
(i : FeedbackArcSetInstance) : Prop :=
∃ ord : List ℕ, ord.Perm (List.range i.1) ∧
(i.2.1.filter (fun e => decide (ord.idxOf e.2 < ord.idxOf e.1))).length ≤ i.2.2
WantedExt/Complexity/NPComplete/FeedbackArcSetWanted.lean:59
Uses 12 · Used by 1
TheoremFEEDBACK ARC SET is NP-complete#●ready to prove
The decision problem FEEDBACK ARC SET belongs to NP, and every decision problem in NP reduces to FEEDBACK ARC SET by a polynomial-time many-one reduction.
public theorem_wanted feedbackArcSet_npComplete :
feedbackArcSetDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L feedbackArcSetDec
noncomputable def feedbackArcSetDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := FeedbackArcSetInstance) x with
| some i => decide (WellFormed i ∧ FeedbackArcSetFeasible i)
| none => false
WantedExt/Complexity/NPComplete/FeedbackArcSetWanted.lean:66
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), FEEDBACK ARC SET; R. M. Karp, "Reducibility among combinatorial problems" (1972).
Uses 5
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.