Independent dominating set
AbbreviationIndependent dominating set instances#✓fully proved
An instance of INDEPENDENT DOMINATING SET is a triple \((n, E, K)\) of a natural number \(n\), the number of vertices, a list \(E\) of pairs of natural numbers, the edges, and a natural number \(K\), the bound on the size of the set.
abbrev IndependentDominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
DefinitionGraph of an independent dominating set instance#✓fully proved
For an independent dominating set instance with \(n\) vertices and edge list \(E\), the graph of the instance is the simple graph on \(\{0, \dots, n-1\}\) in which distinct vertices \(u\) and \(v\) are adjacent when \((u, v)\) or \((v, u)\) belongs to \(E\).
def Graph (i : IndependentDominatingSetInstance) : SimpleGraph (Fin i.1) :=
Cslib.Complexity.Karp.edgeGraph i.1 i.2.1
abbrev IndependentDominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/IndependentDominatingSetWanted.lean:46
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 independent dominating set instances#✓fully proved
An independent dominating set instance \((n, E, K)\) is well formed when the list \(E\) has no repeated entries and every pair \((a, b)\) in \(E\) satisfies \(a < n\), \(b < n\), \(a \ne b\), and \((b, a)\) does not belong to \(E\).
def WellFormed (i : IndependentDominatingSetInstance) : 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 IndependentDominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/IndependentDominatingSetWanted.lean:46
Uses 1 · Used by 1
DefinitionInstances with a small independent dominating set#✓fully proved
An independent dominating set instance \((n, E, K)\) has a small independent dominating set when there is a set \(S\) of vertices of its graph with at most \(K\) elements such that every vertex lies in \(S\) or is adjacent to a vertex of \(S\), and no two distinct vertices of \(S\) are adjacent.
def IndependentDominatingSetFeasible
(i : IndependentDominatingSetInstance) : Prop :=
∃ S : Finset (Fin i.1), S.card ≤ i.2.2 ∧
(∀ v : Fin i.1, v ∈ S ∨ ∃ u ∈ S, (Graph i).Adj u v) ∧
∀ u ∈ S, ∀ v ∈ S, u ≠ v → ¬ (Graph i).Adj u v
abbrev IndependentDominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/IndependentDominatingSetWanted.lean:46
def Graph (i : IndependentDominatingSetInstance) : SimpleGraph (Fin i.1) :=
Cslib.Complexity.Karp.edgeGraph i.1 i.2.1
WantedExt/Complexity/NPComplete/IndependentDominatingSetWanted.lean:49
Uses 2 · Used by 1
DefinitionINDEPENDENT DOMINATING SET as a decision problem#✓fully proved
The decision problem INDEPENDENT DOMINATING SET accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding, to an independent dominating set instance \((n, E, K)\) that is well formed and whose graph has an independent dominating set of at most \(K\) vertices. It rejects every bitstring that does not decode to an instance.
noncomputable def independentDominatingSetDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := IndependentDominatingSetInstance) x with
| some i => decide (WellFormed i ∧ IndependentDominatingSetFeasible 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 IndependentDominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/IndependentDominatingSetWanted.lean:46
def WellFormed (i : IndependentDominatingSetInstance) : 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/IndependentDominatingSetWanted.lean:54
def IndependentDominatingSetFeasible
(i : IndependentDominatingSetInstance) : Prop :=
∃ S : Finset (Fin i.1), S.card ≤ i.2.2 ∧
(∀ v : Fin i.1, v ∈ S ∨ ∃ u ∈ S, (Graph i).Adj u v) ∧
∀ u ∈ S, ∀ v ∈ S, u ≠ v → ¬ (Graph i).Adj u v
WantedExt/Complexity/NPComplete/IndependentDominatingSetWanted.lean:58
Uses 12 · Used by 1
TheoremINDEPENDENT DOMINATING SET is NP-complete#●ready to prove
The decision problem INDEPENDENT DOMINATING SET belongs to NP, and every decision problem in NP has a polynomial-time many-one reduction to it.
public theorem_wanted independentDominatingSet_npComplete :
independentDominatingSetDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L independentDominatingSetDec
noncomputable def independentDominatingSetDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := IndependentDominatingSetInstance) x with
| some i => decide (WellFormed i ∧ IndependentDominatingSetFeasible i)
| none => false
WantedExt/Complexity/NPComplete/IndependentDominatingSetWanted.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), INDEPENDENT DOMINATING SET (a small maximal independent set).
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.