Maximum cut
AbbreviationInstances of MAXIMUM CUT#✓fully proved
An instance of MAXIMUM CUT is a triple \((n, E, K)\) of a natural number \(n\) (the number of vertices), a finite list \(E\) of ordered pairs of natural numbers (the edges) and a natural number \(K\) (the bound).
abbrev MaxCutInstance := ℕ × List (ℕ × ℕ) × ℕ
DefinitionWell-formed MAXIMUM CUT instances#✓fully proved
An instance \((n, E, K)\) of MAXIMUM 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 : MaxCutInstance) : 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 MaxCutInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/MaxCutWanted.lean:46
Uses 1 · Used by 1
DefinitionFeasible MAXIMUM CUT instances#✓fully proved
An instance \((n, E, K)\) of MAXIMUM CUT is feasible when there are a finite set \(S\) of natural numbers, all less than \(n\), and a list \(C\) of length at least \(K\) obtained from \(E\) by deleting zero or more of its entries, such that every pair \((u, v)\) in \(C\) has exactly one of \(u\) and \(v\) in \(S\).
def MaxCutFeasible
(i : MaxCutInstance) : Prop :=
∃ S : Finset ℕ, (∀ v ∈ S, v < i.1) ∧
∃ cut : List (ℕ × ℕ), cut.Sublist i.2.1 ∧ i.2.2 ≤ cut.length ∧
∀ e ∈ cut, (e.1 ∈ S ∧ e.2 ∉ S) ∨ (e.1 ∉ S ∧ e.2 ∈ S)
abbrev MaxCutInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/MaxCutWanted.lean:46
Uses 1 · Used by 1
DefinitionMAXIMUM CUT as a decision problem#✓fully proved
The decision problem MAXIMUM CUT accepts a bitstring \(x\) exactly when decoding \(x\) with the canonical bitstring encoding of instances of MAXIMUM 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 maxCutDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := MaxCutInstance) x with
| some i => decide (WellFormed i ∧ MaxCutFeasible 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 MaxCutInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/MaxCutWanted.lean:46
def WellFormed (i : MaxCutInstance) : 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/MaxCutWanted.lean:49
def MaxCutFeasible
(i : MaxCutInstance) : Prop :=
∃ S : Finset ℕ, (∀ v ∈ S, v < i.1) ∧
∃ cut : List (ℕ × ℕ), cut.Sublist i.2.1 ∧ i.2.2 ≤ cut.length ∧
∀ e ∈ cut, (e.1 ∈ S ∧ e.2 ∉ S) ∨ (e.1 ∉ S ∧ e.2 ∈ S)
WantedExt/Complexity/NPComplete/MaxCutWanted.lean:53
Uses 12 · Used by 1
TheoremMAXIMUM CUT is NP-complete#●ready to prove
The decision problem MAXIMUM CUT lies in NP, and every decision problem in NP has a polynomial-time many-one reduction to MAXIMUM CUT.
public theorem_wanted maxCut_npComplete :
maxCutDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L maxCutDec
noncomputable def maxCutDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := MaxCutInstance) x with
| some i => decide (WellFormed i ∧ MaxCutFeasible i)
| none => false
WantedExt/Complexity/NPComplete/MaxCutWanted.lean:61
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 CUT.
Uses 5
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.