Dominating set
AbbreviationInstances of DOMINATING SET#✓fully proved
An instance of 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).
abbrev DominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
DefinitionGraph of a DOMINATING SET instance#✓fully proved
For an instance \((n, E, K)\) of DOMINATING SET, its graph is 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 \(E\).
def Graph (i : DominatingSetInstance) : SimpleGraph (Fin i.1) :=
Cslib.Complexity.Karp.edgeGraph i.1 i.2.1
abbrev DominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/DominatingSetWanted.lean:45
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 DOMINATING SET instances#✓fully proved
An instance \((n, E, K)\) of DOMINATING SET is well formed when the list \(E\) has no repeated entries and every pair \((u, v) \in E\) satisfies \(u < n\), \(v < n\), \(u \ne v\) and \((v, u) \notin E\).
def WellFormed (i : DominatingSetInstance) : 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 DominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/DominatingSetWanted.lean:45
Uses 1 · Used by 1
DefinitionFeasibility of a DOMINATING SET instance#✓fully proved
An instance \((n, E, K)\) of DOMINATING SET is feasible when there is a set \(S\) of at most \(K\) vertices of its graph such that every vertex lies in \(S\) or is adjacent to a vertex of \(S\), where the graph has vertex set \(\{0, \dots, n - 1\}\) and distinct vertices \(i\) and \(j\) are adjacent when \((i, j)\) or \((j, i)\) belongs to \(E\).
def DominatingSetFeasible
(i : DominatingSetInstance) : Prop :=
∃ S : Finset (Fin i.1), S.card ≤ i.2.2 ∧
∀ v : Fin i.1, v ∈ S ∨ ∃ u ∈ S, (Graph i).Adj u v
abbrev DominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/DominatingSetWanted.lean:45
def Graph (i : DominatingSetInstance) : SimpleGraph (Fin i.1) :=
Cslib.Complexity.Karp.edgeGraph i.1 i.2.1
WantedExt/Complexity/NPComplete/DominatingSetWanted.lean:48
Uses 2 · Used by 1
DefinitionDOMINATING SET as a decision problem#✓fully proved
The decision problem DOMINATING SET accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding, to a triple \((n, E, K)\) of a natural number \(n\), a list \(E\) of pairs of natural numbers and a natural number \(K\) such that \(E\) has no repeated entries, every pair \((u, v) \in E\) satisfies \(u < n\), \(v < n\), \(u \ne v\) and \((v, u) \notin E\), and there is a set \(S\) of at most \(K\) vertices with every vertex in \(S\) or adjacent to a vertex of \(S\), in the graph on \(\{0, \dots, n - 1\}\) where distinct \(i\) and \(j\) are adjacent when \((i, j)\) or \((j, i)\) belongs to \(E\). Bitstrings that do not decode are rejected.
noncomputable def dominatingSetDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := DominatingSetInstance) x with
| some i => decide (WellFormed i ∧ DominatingSetFeasible 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 DominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/DominatingSetWanted.lean:45
def WellFormed (i : DominatingSetInstance) : 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/DominatingSetWanted.lean:53
def DominatingSetFeasible
(i : DominatingSetInstance) : Prop :=
∃ S : Finset (Fin i.1), S.card ≤ i.2.2 ∧
∀ v : Fin i.1, v ∈ S ∨ ∃ u ∈ S, (Graph i).Adj u v
WantedExt/Complexity/NPComplete/DominatingSetWanted.lean:57
Uses 12 · Used by 1
TheoremDOMINATING SET is NP-complete#●ready to prove
The decision problem DOMINATING SET belongs to NP, and every decision problem in NP reduces to DOMINATING SET by a polynomial-time many-one reduction.
public theorem_wanted dominatingSet_npComplete :
dominatingSetDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L dominatingSetDec
noncomputable def dominatingSetDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := DominatingSetInstance) x with
| some i => decide (WellFormed i ∧ DominatingSetFeasible i)
| none => false
WantedExt/Complexity/NPComplete/DominatingSetWanted.lean:64
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), DOMINATING SET.
Uses 5
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.