CLIQUE is NP-hard to VERTEX-COVER (exact size k) is NP-complete
TheoremCLIQUE is NP-hard#✓fully proved
Every decision problem \(L\) in NP has a polynomial-time many-one reduction to CLIQUE: a polynomial-time computable map \(f\) on bit strings such that, for every bit string \(x\), \(L\) accepts \(x\) exactly when CLIQUE accepts \(f(x)\).
theorem cliqueDec_npHard : ∀ L : DecisionProblem, L ∈ NP → PolyManyOneRed L cliqueDec
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
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
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
noncomputable def cliqueDec : MetaMathlibExt.ComplexityTheory.DecisionProblem :=
kgDec fun _ k G => ∃ s, G.IsNClique k s
CSLibExt/Computability/Complexity/Karp/Clique.lean:84
Uses 39 · Used by 2
TheoremINDEPENDENT-SET is NP-hard#✓fully proved
Every decision problem \(L\) in NP has a polynomial-time many-one reduction to INDEPENDENT-SET: a polynomial-time computable map \(f\) on bit strings such that, for every bit string \(x\), \(L\) accepts \(x\) exactly when INDEPENDENT-SET accepts \(f(x)\).
theorem indSetDec_npHard : ∀ L : DecisionProblem, L ∈ NP → PolyManyOneRed L indSetDec
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
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
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
noncomputable def indSetDec : MetaMathlibExt.ComplexityTheory.DecisionProblem :=
kgDec fun _ k G => ∃ s, G.IsNIndepSet k s
CSLibExt/Computability/Complexity/Karp/Clique.lean:88
Uses 20 · Used by 2
TheoremVERTEX-COVER (exact size k) is NP-hard#✓fully proved
Every decision problem in NP reduces by a polynomial-time many-one reduction to the decision problem VERTEX-COVER, which accepts exactly the valid encodings of a number \(k\) and a graph \(G\) such that \(G\) has a vertex cover of exactly \(k\) vertices.
theorem vertexCoverDec_npHard :
∀ L : DecisionProblem, L ∈ NP → PolyManyOneRed L vertexCoverDec
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
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
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
noncomputable def vertexCoverDec : MetaMathlibExt.ComplexityTheory.DecisionProblem :=
kgDec fun n k G => ∃ s : Finset (Fin n), s.card = k ∧ G.IsVertexCover (s : Set (Fin n))
CSLibExt/Computability/Complexity/Karp/Clique.lean:93
Uses 28 · Used by 2
AbbreviationThe CLIQUE, INDEPENDENT-SET and VERTEX-COVER verifier as a host component#✓fully proved
For a mode \(m\) (clique, independent set or vertex cover), this is the host component whose stacks are \(X, W, C, N, V, T\), each over the symbol alphabet of the SAT verifier, and whose labels and program are those of the verifier machine of mode \(m\).
abbrev kgVerifyComp (m : KGVerify.Mode) : Host.Comp where
K := KGVerify.K
Γ := fun _ => SatVerifier.Sym
finΓ := fun _ => SatVerifier.Sym.instFintype
L := KGVerify.Lab
prog := KGVerify.prog m
ks := [.X, .W, .C, .N, .V, .T]
ks_nodup := by decide
mem_ks k := by cases k <;> decide
inductive Mode | clique | indep | cover
deriving DecidableEq
CSLibExt/Computability/Complexity/Karp/CliqueVerify.lean:50
structure Comp where
/-- Stack indices. -/
K : Type
/-- Decidable equality of stack indices. -/
[decK : DecidableEq K]
/-- Finitely many stacks. -/
[finK : Fintype K]
/-- Stack alphabets. -/
Γ : K → Type
/-- Finite alphabets. -/
[finΓ : ∀ k, Fintype (Γ k)]
/-- Labels. -/
⋯
CSLibExt/Computability/Complexity/Host.lean:53
inductive K | X | W | C | N | V | T
deriving DecidableEq
CSLibExt/Computability/Complexity/Karp/CliqueVerify.lean:362
inductive Sym
| bit (b : Bool) | lit (p : Bool) | cl | val (b : Bool) | dead
deriving DecidableEq
CSLibExt/Computability/Complexity/SatVerifierSpec.lean:41
instance Sym.instFintype : Fintype Sym where
elems := ⟨↑[Sym.bit false, .bit true, .lit false, .lit true, .cl, .val false, .val true, .dead],
by decide⟩
complete := fun x => by rcases x with b | b | _ | b | _ <;> (try cases b) <;> decide
CSLibExt/Computability/Complexity/SatVerifierSpec.lean:155
inductive Lab | rdK | rdN | load | walk (c : Bool) | back | yes | no
deriving DecidableEq
CSLibExt/Computability/Complexity/Karp/CliqueVerify.lean:372
def prog (m : Mode) : Lab → TM2.Stmt (fun _ : K => Sym) Lab Bool
| .rdK => readU .C .rdK .rdN
| .rdN => readU .N .rdN .load
| .load => loadS
| .walk c => walkS m c
| .back => moveB .T .V Sym.bit? Sym.bit .back (.walk true)
| .yes => .halt
| .no => .halt
CSLibExt/Computability/Complexity/Karp/CliqueVerify.lean:422
TheoremNP membership from the CLIQUE, INDEPENDENT-SET and VERTEX-COVER verifier#✓fully proved
Let \(L\) be a decision problem, let \(m\) be a mode (clique, independent set or vertex cover), and let \(V_m\) be the verifier of mode \(m\). If for every bit string \(x\), \(L\) accepts \(x\) exactly when there is a bit string \(w\) with \(|w| \le |x|\) such that \(V_m\) accepts \((x, w)\), then \(L\) is in NP.
theorem mem_NP_of_kgCheck {L : DecisionProblem} (m : KGVerify.Mode)
(h : ∀ x, L x = true ↔ ∃ w, w.length ≤ x.length ∧ KGVerify.kgCheck m x w = true) : L ∈ NP
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
inductive Mode | clique | indep | cover
deriving DecidableEq
CSLibExt/Computability/Complexity/Karp/CliqueVerify.lean:50
def kgCheck (m : Mode) (x w : List Bool) : Bool :=
match decodeKG x with
| none => false
| some (k, n, bits) => bits.length == (pairs n).length && n ≤ w.length &&
(w.take n).count true == k &&
((pairs n).zip bits).all fun pb => m.ok pb.2 (w.getD pb.1.1 false) (w.getD pb.1.2 false)
CSLibExt/Computability/Complexity/Karp/CliqueVerify.lean:65
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
Uses 25 · Used by 3
TheoremCLIQUE is in NP#✓fully proved
CLIQUE is in NP.
theorem cliqueDec_mem_NP : cliqueDec ∈ NP
noncomputable def cliqueDec : MetaMathlibExt.ComplexityTheory.DecisionProblem :=
kgDec fun _ k G => ∃ s, G.IsNClique k s
CSLibExt/Computability/Complexity/Karp/Clique.lean:84
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
Uses 7 · Used by 1
TheoremINDEPENDENT-SET is in NP#✓fully proved
INDEPENDENT-SET is in NP.
theorem indSetDec_mem_NP : indSetDec ∈ NP
noncomputable def indSetDec : MetaMathlibExt.ComplexityTheory.DecisionProblem :=
kgDec fun _ k G => ∃ s, G.IsNIndepSet k s
CSLibExt/Computability/Complexity/Karp/Clique.lean:88
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
TheoremVERTEX-COVER (exact size k) is in NP#✓fully proved
The decision problem VERTEX-COVER, which accepts exactly the valid encodings of a number \(k\) and a graph \(G\) such that \(G\) has a vertex cover of exactly \(k\) vertices, is in NP.
theorem vertexCoverDec_mem_NP : vertexCoverDec ∈ NP
noncomputable def vertexCoverDec : MetaMathlibExt.ComplexityTheory.DecisionProblem :=
kgDec fun n k G => ∃ s : Finset (Fin n), s.card = k ∧ G.IsVertexCover (s : Set (Fin n))
CSLibExt/Computability/Complexity/Karp/Clique.lean:93
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
Uses 7 · Used by 1
TheoremCLIQUE is NP-complete#✓fully proved
CLIQUE lies in NP, and every decision problem in NP has a polynomial-time many-one reduction to CLIQUE.
theorem cliqueDec_npComplete :
cliqueDec ∈ NP ∧ ∀ L : DecisionProblem, L ∈ NP → PolyManyOneRed L cliqueDec
noncomputable def cliqueDec : MetaMathlibExt.ComplexityTheory.DecisionProblem :=
kgDec fun _ k G => ∃ s, G.IsNClique k s
CSLibExt/Computability/Complexity/Karp/Clique.lean:84
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
Uses 7
TheoremINDEPENDENT-SET is NP-complete#✓fully proved
INDEPENDENT-SET lies in NP, and every decision problem in NP has a polynomial-time many-one reduction to INDEPENDENT-SET.
theorem indSetDec_npComplete :
indSetDec ∈ NP ∧ ∀ L : DecisionProblem, L ∈ NP → PolyManyOneRed L indSetDec
noncomputable def indSetDec : MetaMathlibExt.ComplexityTheory.DecisionProblem :=
kgDec fun _ k G => ∃ s, G.IsNIndepSet k s
CSLibExt/Computability/Complexity/Karp/Clique.lean:88
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
Uses 7
TheoremVERTEX-COVER (exact size k) is NP-complete#✓fully proved
The decision problem VERTEX-COVER, which accepts exactly the valid encodings of a number \(k\) and a graph \(G\) such that \(G\) has a vertex cover of exactly \(k\) vertices, is in NP, and every decision problem in NP reduces to it by a polynomial-time many-one reduction.
theorem vertexCoverDec_npComplete :
vertexCoverDec ∈ NP ∧ ∀ L : DecisionProblem, L ∈ NP → PolyManyOneRed L vertexCoverDec
noncomputable def vertexCoverDec : MetaMathlibExt.ComplexityTheory.DecisionProblem :=
kgDec fun n k G => ∃ s : Finset (Fin n), s.card = k ∧ G.IsVertexCover (s : Set (Fin n))
CSLibExt/Computability/Complexity/Karp/Clique.lean:93
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
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.