Maximum k-cut
AbbreviationInstances of MAXIMUM k-CUT#✓fully proved
An instance of MAXIMUM k-CUT is a quadruple \((n, E, k, K)\) of a natural number \(n\) (the number of vertices), a finite list \(E\) of ordered pairs of natural numbers (the edges), a natural number \(k\) (the number of parts) and a natural number \(K\) (the bound).
abbrev MaxKCutInstance := ℕ × List (ℕ × ℕ) × ℕ × ℕ
DefinitionWell-formed MAXIMUM k-CUT instances#✓fully proved
An instance \((n, E, k, K)\) of MAXIMUM k-CUT 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\), and the reversed pair \((v, u)\) does not occur in \(E\).
def WellFormed (i : MaxKCutInstance) : 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 MaxKCutInstance := ℕ × List (ℕ × ℕ) × ℕ × ℕ
WantedExt/Complexity/NPComplete/MaxKCutWanted.lean:47
Uses 1 · Used by 1
DefinitionFeasible MAXIMUM k-CUT instances#✓fully proved
An instance \((n, E, k, K)\) of MAXIMUM k-CUT is feasible when there are a list \((a_0, \dots, a_{n-1})\) of \(n\) natural numbers, each less than \(k\), and a list \(C\) of length at least \(K\) obtained from \(E\) by deleting zero or more of its entries, such that \(a_u \ne a_v\) for every pair \((u, v)\) in \(C\), where \(a_w\) is read as \(0\) when \(w \ge n\).
def MaxKCutFeasible
(i : MaxKCutInstance) : Prop :=
∃ assign : List ℕ, assign.length = i.1 ∧ (∀ v < i.1, assign.getD v 0 < i.2.2.1) ∧
∃ cut : List (ℕ × ℕ), cut.Sublist i.2.1 ∧ i.2.2.2 ≤ cut.length ∧
∀ e ∈ cut, assign.getD e.1 0 ≠ assign.getD e.2 0
abbrev MaxKCutInstance := ℕ × List (ℕ × ℕ) × ℕ × ℕ
WantedExt/Complexity/NPComplete/MaxKCutWanted.lean:47
Uses 1 · Used by 1
DefinitionMAXIMUM k-CUT as a decision problem#✓fully proved
The decision problem MAXIMUM k-CUT accepts a bitstring \(x\) exactly when decoding \(x\) with the canonical bitstring encoding of instances of MAXIMUM k-CUT succeeds and yields an instance that is well formed and feasible. All other bitstrings, including those that fail to decode, are rejected.
noncomputable def maxKCutDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := MaxKCutInstance) x with
| some i => decide (WellFormed i ∧ MaxKCutFeasible 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 MaxKCutInstance := ℕ × List (ℕ × ℕ) × ℕ × ℕ
WantedExt/Complexity/NPComplete/MaxKCutWanted.lean:47
def WellFormed (i : MaxKCutInstance) : 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/MaxKCutWanted.lean:50
def MaxKCutFeasible
(i : MaxKCutInstance) : Prop :=
∃ assign : List ℕ, assign.length = i.1 ∧ (∀ v < i.1, assign.getD v 0 < i.2.2.1) ∧
∃ cut : List (ℕ × ℕ), cut.Sublist i.2.1 ∧ i.2.2.2 ≤ cut.length ∧
∀ e ∈ cut, assign.getD e.1 0 ≠ assign.getD e.2 0
WantedExt/Complexity/NPComplete/MaxKCutWanted.lean:54
Uses 12 · Used by 1
TheoremMAXIMUM k-CUT is NP-complete#●ready to prove
The decision problem MAXIMUM k-CUT lies in NP, and every decision problem in NP has a polynomial-time many-one reduction to MAXIMUM k-CUT.
public theorem_wanted maxKCut_npComplete :
maxKCutDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L maxKCutDec
noncomputable def maxKCutDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := MaxKCutInstance) x with
| some i => decide (WellFormed i ∧ MaxKCutFeasible i)
| none => false
WantedExt/Complexity/NPComplete/MaxKCutWanted.lean:62
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), MAXIMUM k-CUT (the
k = 2slice is MAX CUT).
Uses 5
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.