Feedback vertex set
AbbreviationInstances of FEEDBACK VERTEX SET#✓fully proved
An instance of FEEDBACK VERTEX SET is a triple \((n, es, K)\) of a natural number \(n\) (the number of vertices), a list \(es\) of pairs of natural numbers (the edges) and a natural number \(K\) (the bound).
abbrev FeedbackVertexSetInstance := ℕ × List (ℕ × ℕ) × ℕ
DefinitionGraph of a FEEDBACK VERTEX SET instance#✓fully proved
For an instance \((n, es, K)\) of FEEDBACK VERTEX SET, its graph is the simple graph on \(\{0, \dots, n-1\}\) in which distinct vertices \(i\) and \(j\) are adjacent when \((i, j)\) or \((j, i)\) belongs to \(es\).
def Graph (i : FeedbackVertexSetInstance) : SimpleGraph (Fin i.1) :=
Cslib.Complexity.Karp.edgeGraph i.1 i.2.1
abbrev FeedbackVertexSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/FeedbackVertexSetWanted.lean:47
def edgeGraph (n : ℕ) (es : List (ℕ × ℕ)) : SimpleGraph (Fin n) :=
SimpleGraph.fromRel fun i j => ((i : ℕ), (j : ℕ)) ∈ es
CSLibExt/Computability/Complexity/Karp/Color.lean:51
Uses 2 · Used by 1
DefinitionWell-formed FEEDBACK VERTEX SET instances#✓fully proved
An instance \((n, es, K)\) of FEEDBACK VERTEX SET is well formed when the list \(es\) has no repeated entries and every pair \((u, v)\) in \(es\) satisfies \(u < n\), \(v < n\) and \(u \ne v\), and \((v, u)\) does not belong to \(es\).
def WellFormed (i : FeedbackVertexSetInstance) : Prop :=
i.2.1.Nodup ∧ ∀ e ∈ i.2.1, e.1 < i.1 ∧ e.2 < i.1 ∧ e.1 ≠ e.2 ∧ (e.2, e.1) ∉ i.2.1
abbrev FeedbackVertexSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/FeedbackVertexSetWanted.lean:47
Uses 1 · Used by 1
DefinitionFeedback vertex sets within the bound#✓fully proved
An instance \((n, es, K)\) of FEEDBACK VERTEX SET is feasible when there is a set \(S\) of at most \(K\) vertices of its graph such that the subgraph of its graph induced on the vertices outside \(S\) is acyclic.
def FeedbackVertexSetFeasible
(i : FeedbackVertexSetInstance) : Prop :=
∃ S : Finset (Fin i.1), S.card ≤ i.2.2 ∧
((Graph i).induce (↑Sᶜ : Set (Fin i.1))).IsAcyclic
abbrev FeedbackVertexSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/FeedbackVertexSetWanted.lean:47
def Graph (i : FeedbackVertexSetInstance) : SimpleGraph (Fin i.1) :=
Cslib.Complexity.Karp.edgeGraph i.1 i.2.1
WantedExt/Complexity/NPComplete/FeedbackVertexSetWanted.lean:50
Uses 2 · Used by 1
DefinitionFEEDBACK VERTEX SET as a decision problem#✓fully proved
The decision problem FEEDBACK VERTEX SET accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding of instances, to an instance of FEEDBACK VERTEX SET that is well formed and feasible. Bitstrings that do not decode to an instance are rejected.
noncomputable def feedbackVertexSetDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := FeedbackVertexSetInstance) x with
| some i => decide (WellFormed i ∧ FeedbackVertexSetFeasible 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 FeedbackVertexSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/FeedbackVertexSetWanted.lean:47
def WellFormed (i : FeedbackVertexSetInstance) : Prop :=
i.2.1.Nodup ∧ ∀ e ∈ i.2.1, e.1 < i.1 ∧ e.2 < i.1 ∧ e.1 ≠ e.2 ∧ (e.2, e.1) ∉ i.2.1
WantedExt/Complexity/NPComplete/FeedbackVertexSetWanted.lean:55
def FeedbackVertexSetFeasible
(i : FeedbackVertexSetInstance) : Prop :=
∃ S : Finset (Fin i.1), S.card ≤ i.2.2 ∧
((Graph i).induce (↑Sᶜ : Set (Fin i.1))).IsAcyclic
WantedExt/Complexity/NPComplete/FeedbackVertexSetWanted.lean:59
Uses 12 · Used by 1
TheoremFEEDBACK VERTEX SET is NP-complete#●ready to prove
The decision problem FEEDBACK VERTEX SET belongs to NP, and every decision problem in NP reduces to FEEDBACK VERTEX SET by a polynomial-time many-one reduction.
public theorem_wanted feedbackVertexSet_npComplete :
feedbackVertexSetDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L feedbackVertexSetDec
noncomputable def feedbackVertexSetDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := FeedbackVertexSetInstance) x with
| some i => decide (WellFormed i ∧ FeedbackVertexSetFeasible i)
| none => false
WantedExt/Complexity/NPComplete/FeedbackVertexSetWanted.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 VERTEX SET.
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.