Roman domination
AbbreviationRoman domination instances#✓fully proved
An instance of ROMAN DOMINATION 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 weight bound.
abbrev RomanDominationInstance := ℕ × List (ℕ × ℕ) × ℕ
DefinitionGraph of a Roman domination instance#✓fully proved
For an instance \((n, E, K)\) of ROMAN DOMINATION, its graph is the graph of the edge list \(E\) on \(n\) vertices: 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 : RomanDominationInstance) : SimpleGraph (Fin i.1) :=
Cslib.Complexity.Karp.edgeGraph i.1 i.2.1
abbrev RomanDominationInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/RomanDominationWanted.lean:47
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 Roman domination instances#✓fully proved
An instance \((n, E, K)\) of ROMAN DOMINATION is well formed when the list \(E\) has no repeated entries and every pair \((u, v)\) in \(E\) has \(u < n\), \(v < n\), \(u \ne v\) and \((v, u) \notin E\).
def WellFormed (i : RomanDominationInstance) : 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 RomanDominationInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/RomanDominationWanted.lean:47
Uses 1 · Used by 1
DefinitionFeasible Roman domination instances#✓fully proved
An instance \((n, E, K)\) of ROMAN DOMINATION is feasible when there is a function \(f\) from the vertices \(\{0, \dots, n - 1\}\) of its graph to \(\{0, 1, 2\}\) such that every vertex \(v\) with \(f(v) = 0\) is adjacent to some vertex \(u\) with \(f(u) = 2\), and the total weight \(\sum_v f(v)\) is at most \(K\).
def RomanDominationFeasible
(i : RomanDominationInstance) : Prop :=
∃ labeling : Fin i.1 → ℕ, (∀ v, labeling v ≤ 2) ∧
(∀ v, labeling v = 0 → ∃ u, (Graph i).Adj u v ∧ labeling u = 2) ∧
(Finset.univ.sum labeling) ≤ i.2.2
abbrev RomanDominationInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/RomanDominationWanted.lean:47
def Graph (i : RomanDominationInstance) : SimpleGraph (Fin i.1) :=
Cslib.Complexity.Karp.edgeGraph i.1 i.2.1
WantedExt/Complexity/NPComplete/RomanDominationWanted.lean:50
Uses 2 · Used by 1
DefinitionROMAN DOMINATION as a decision problem#✓fully proved
The decision problem ROMAN DOMINATION accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding, to an instance \((n, E, K)\) of ROMAN DOMINATION that is well formed and feasible; it rejects every other bitstring.
noncomputable def romanDominationDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := RomanDominationInstance) x with
| some i => decide (WellFormed i ∧ RomanDominationFeasible 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 RomanDominationInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/RomanDominationWanted.lean:47
def WellFormed (i : RomanDominationInstance) : 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/RomanDominationWanted.lean:55
def RomanDominationFeasible
(i : RomanDominationInstance) : Prop :=
∃ labeling : Fin i.1 → ℕ, (∀ v, labeling v ≤ 2) ∧
(∀ v, labeling v = 0 → ∃ u, (Graph i).Adj u v ∧ labeling u = 2) ∧
(Finset.univ.sum labeling) ≤ i.2.2
WantedExt/Complexity/NPComplete/RomanDominationWanted.lean:59
Uses 12 · Used by 1
TheoremROMAN DOMINATION is NP-complete#●ready to prove
The decision problem ROMAN DOMINATION belongs to NP, and every decision problem in NP reduces to it by a polynomial-time many-one reduction.
public theorem_wanted romanDomination_npComplete :
romanDominationDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L romanDominationDec
noncomputable def romanDominationDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := RomanDominationInstance) x with
| some i => decide (WellFormed i ∧ RomanDominationFeasible i)
| none => false
WantedExt/Complexity/NPComplete/RomanDominationWanted.lean:67
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, P. A. Dreyer Jr., S. M. Hedetniemi, and S. T. Hedetniemi, "Roman domination in graphs", Discrete Mathematics 278 (2004), 11-22.
Uses 5
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.