Total dominating set
AbbreviationInstances of TOTAL DOMINATING SET#✓fully proved
An instance of TOTAL DOMINATING SET is a triple \((n, E, K)\) consisting 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 TotalDominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
DefinitionGraph of a total dominating set instance#✓fully proved
The graph of an instance \((n, E, K)\) of TOTAL DOMINATING SET 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\). Loops are dropped, and pairs with an endpoint at least \(n\) contribute no edge.
def Graph (i : TotalDominatingSetInstance) : SimpleGraph (Fin i.1) :=
Cslib.Complexity.Karp.edgeGraph i.1 i.2.1
abbrev TotalDominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/TotalDominatingSetWanted.lean:49
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 total dominating set instances#✓fully proved
An instance \((n, E, K)\) of TOTAL 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\) and \(u \ne v\), and its reversal \((v, u)\) does not belong to \(E\).
def WellFormed (i : TotalDominatingSetInstance) : 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 TotalDominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/TotalDominatingSetWanted.lean:49
Uses 1 · Used by 1
DefinitionFeasibility of a total dominating set instance#✓fully proved
An instance \((n, E, K)\) of TOTAL DOMINATING SET is feasible when there is a set \(S\) of at most \(K\) vertices of its graph such that every vertex \(v\) of the graph, including the vertices of \(S\), is adjacent to some vertex \(u \in S\).
def TotalDominatingSetFeasible
(i : TotalDominatingSetInstance) : Prop :=
∃ S : Finset (Fin i.1), S.card ≤ i.2.2 ∧
∀ v : Fin i.1, ∃ u ∈ S, (Graph i).Adj u v
abbrev TotalDominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/TotalDominatingSetWanted.lean:49
def Graph (i : TotalDominatingSetInstance) : SimpleGraph (Fin i.1) :=
Cslib.Complexity.Karp.edgeGraph i.1 i.2.1
WantedExt/Complexity/NPComplete/TotalDominatingSetWanted.lean:52
Uses 2 · Used by 1
DefinitionThe decision problem TOTAL DOMINATING SET#✓fully proved
TOTAL DOMINATING SET accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding of triples of a natural number, a list of pairs of natural numbers and a natural number, to an instance \((n, E, K)\) that is well formed and feasible: some set of at most \(K\) vertices of the graph of the instance contains a neighbor of every vertex. Bitstrings that do not decode to an instance are rejected.
noncomputable def totalDominatingSetDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := TotalDominatingSetInstance) x with
| some i => decide (WellFormed i ∧ TotalDominatingSetFeasible 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 TotalDominatingSetInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/TotalDominatingSetWanted.lean:49
def WellFormed (i : TotalDominatingSetInstance) : 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/TotalDominatingSetWanted.lean:57
def TotalDominatingSetFeasible
(i : TotalDominatingSetInstance) : Prop :=
∃ S : Finset (Fin i.1), S.card ≤ i.2.2 ∧
∀ v : Fin i.1, ∃ u ∈ S, (Graph i).Adj u v
WantedExt/Complexity/NPComplete/TotalDominatingSetWanted.lean:61
Uses 12 · Used by 1
TheoremTOTAL DOMINATING SET is NP-complete#●ready to prove
The decision problem TOTAL DOMINATING SET belongs to NP, and every decision problem in NP reduces to TOTAL DOMINATING SET by a polynomial-time many-one reduction.
public theorem_wanted totalDominatingSet_npComplete :
totalDominatingSetDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L totalDominatingSetDec
noncomputable def totalDominatingSetDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := TotalDominatingSetInstance) x with
| some i => decide (WellFormed i ∧ TotalDominatingSetFeasible i)
| none => false
WantedExt/Complexity/NPComplete/TotalDominatingSetWanted.lean:68
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
- E. J. Cockayne, R. M. Dawes, and S. T. Hedetniemi, "Total domination in graphs", Networks 10 (1980), 211-219; R. Laskar, J. Pfaff, S. M. Hedetniemi, and S. T. Hedetniemi, "On the algorithmic complexity of total domination", SIAM Journal on Algebraic and Discrete Methods 5 (1984), 420-425.
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.