Odd cycle transversal
AbbreviationOdd cycle transversal instances#✓fully proved
An odd cycle transversal instance 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 on the number of removed vertices).
abbrev OddCycleTransversalInstance := ℕ × List (ℕ × ℕ) × ℕ
DefinitionGraph of an odd cycle transversal instance#✓fully proved
For an odd cycle transversal instance \((n, es, K)\), its graph is the graph of the edge list \(es\) on \(n\) vertices: 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 : OddCycleTransversalInstance) : SimpleGraph (Fin i.1) :=
Cslib.Complexity.Karp.edgeGraph i.1 i.2.1
abbrev OddCycleTransversalInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/OddCycleTransversalWanted.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 odd cycle transversal instances#✓fully proved
An odd cycle transversal instance \((n, es, K)\) 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 : OddCycleTransversalInstance) : 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 OddCycleTransversalInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/OddCycleTransversalWanted.lean:47
Uses 1 · Used by 1
DefinitionFeasible odd cycle transversal instances#✓fully proved
An odd cycle transversal instance \((n, es, K)\) is feasible when there is a set \(S\) of at most \(K\) vertices of its graph such that the subgraph induced on the vertices outside \(S\) is bipartite.
def OddCycleTransversalFeasible
(i : OddCycleTransversalInstance) : Prop :=
∃ S : Finset (Fin i.1), S.card ≤ i.2.2 ∧
((Graph i).induce (↑Sᶜ : Set (Fin i.1))).IsBipartite
abbrev OddCycleTransversalInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/OddCycleTransversalWanted.lean:47
def Graph (i : OddCycleTransversalInstance) : SimpleGraph (Fin i.1) :=
Cslib.Complexity.Karp.edgeGraph i.1 i.2.1
WantedExt/Complexity/NPComplete/OddCycleTransversalWanted.lean:50
Uses 2 · Used by 1
DefinitionODD CYCLE TRANSVERSAL as a decision problem#✓fully proved
The decision problem ODD CYCLE TRANSVERSAL accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding, to an odd cycle transversal instance \((n, es, K)\) that is well formed and feasible. Well formed means that \(es\) has no repeated entries and every pair \((u, v)\) in \(es\) satisfies \(u < n\), \(v < n\), \(u \ne v\) and \((v, u) \notin es\); feasible means that some set of at most \(K\) vertices can be removed from the graph of the instance so that the remaining induced subgraph is bipartite. Bitstrings that do not decode to an instance are rejected.
noncomputable def oddCycleTransversalDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := OddCycleTransversalInstance) x with
| some i => decide (WellFormed i ∧ OddCycleTransversalFeasible 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 OddCycleTransversalInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/OddCycleTransversalWanted.lean:47
def WellFormed (i : OddCycleTransversalInstance) : 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/OddCycleTransversalWanted.lean:55
def OddCycleTransversalFeasible
(i : OddCycleTransversalInstance) : Prop :=
∃ S : Finset (Fin i.1), S.card ≤ i.2.2 ∧
((Graph i).induce (↑Sᶜ : Set (Fin i.1))).IsBipartite
WantedExt/Complexity/NPComplete/OddCycleTransversalWanted.lean:59
Uses 12 · Used by 1
TheoremODD CYCLE TRANSVERSAL is NP-complete#●ready to prove
The decision problem ODD CYCLE TRANSVERSAL, which accepts a bitstring exactly when it decodes to a well-formed instance \((n, es, K)\) whose graph becomes bipartite after removing some set of at most \(K\) vertices, belongs to NP, and every decision problem in NP has a polynomial-time many-one reduction to it.
public theorem_wanted oddCycleTransversal_npComplete :
oddCycleTransversalDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L oddCycleTransversalDec
noncomputable def oddCycleTransversalDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := OddCycleTransversalInstance) x with
| some i => decide (WellFormed i ∧ OddCycleTransversalFeasible i)
| none => false
WantedExt/Complexity/NPComplete/OddCycleTransversalWanted.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), ODD CYCLE TRANSVERSAL (vertex deletion to a bipartite graph).
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.