Achromatic number
AbbreviationInstances of ACHROMATIC NUMBER#✓fully proved
An instance of ACHROMATIC NUMBER is a triple \((n, E, K)\) of a natural number \(n\) (the number of vertices), a finite list \(E\) of ordered pairs of natural numbers (the edges) and a natural number \(K\) (the bound).
abbrev AchromaticNumberInstance := ℕ × List (ℕ × ℕ) × ℕ
DefinitionWell-formed ACHROMATIC NUMBER instances#✓fully proved
An instance \((n, E, K)\) of ACHROMATIC NUMBER 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 : AchromaticNumberInstance) : 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 AchromaticNumberInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/AchromaticNumberWanted.lean:47
Uses 1 · Used by 1
DefinitionFeasible ACHROMATIC NUMBER instances#✓fully proved
An instance \((n, E, K)\) of ACHROMATIC NUMBER is feasible when there are a natural number \(q \ge K\) and a list \(c = (c_0, \dots, c_{n-1})\) of \(n\) natural numbers, with \(c_u\) read as \(0\) for \(u \ge n\), such that \(c_v < q\) for every \(v < n\), every \(a < q\) equals \(c_v\) for some \(v < n\), \(c_u \ne c_v\) for every pair \((u, v)\) in \(E\), and for all distinct \(a, b < q\) some pair \((u, v)\) in \(E\) has \((c_u, c_v) = (a, b)\) or \((c_u, c_v) = (b, a)\).
def AchromaticNumberFeasible
(i : AchromaticNumberInstance) : Prop :=
∃ q : ℕ, i.2.2 ≤ q ∧
∃ coloring : List ℕ, coloring.length = i.1 ∧ (∀ v < i.1, coloring.getD v 0 < q) ∧
(∀ c < q, ∃ v < i.1, coloring.getD v 0 = c) ∧
(∀ e ∈ i.2.1, coloring.getD e.1 0 ≠ coloring.getD e.2 0) ∧
∀ a < q, ∀ b < q, a ≠ b → ∃ e ∈ i.2.1,
(coloring.getD e.1 0 = a ∧ coloring.getD e.2 0 = b) ∨
(coloring.getD e.1 0 = b ∧ coloring.getD e.2 0 = a)
abbrev AchromaticNumberInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/AchromaticNumberWanted.lean:47
Uses 1 · Used by 1
DefinitionACHROMATIC NUMBER as a decision problem#✓fully proved
The ACHROMATIC NUMBER decision problem accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding of instances \((n, E, K)\), to an instance of ACHROMATIC NUMBER that is well-formed and feasible; it rejects every bitstring that does not decode to an instance.
noncomputable def achromaticNumberDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := AchromaticNumberInstance) x with
| some i => decide (WellFormed i ∧ AchromaticNumberFeasible 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 AchromaticNumberInstance := ℕ × List (ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/AchromaticNumberWanted.lean:47
def WellFormed (i : AchromaticNumberInstance) : 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/AchromaticNumberWanted.lean:50
def AchromaticNumberFeasible
(i : AchromaticNumberInstance) : Prop :=
∃ q : ℕ, i.2.2 ≤ q ∧
∃ coloring : List ℕ, coloring.length = i.1 ∧ (∀ v < i.1, coloring.getD v 0 < q) ∧
(∀ c < q, ∃ v < i.1, coloring.getD v 0 = c) ∧
(∀ e ∈ i.2.1, coloring.getD e.1 0 ≠ coloring.getD e.2 0) ∧
∀ a < q, ∀ b < q, a ≠ b → ∃ e ∈ i.2.1,
(coloring.getD e.1 0 = a ∧ coloring.getD e.2 0 = b) ∨
(coloring.getD e.1 0 = b ∧ coloring.getD e.2 0 = a)
WantedExt/Complexity/NPComplete/AchromaticNumberWanted.lean:54
Uses 12 · Used by 1
TheoremACHROMATIC NUMBER is NP-complete#●ready to prove
The ACHROMATIC NUMBER decision problem belongs to NP, and every decision problem in NP has a polynomial-time many-one reduction to it.
public theorem_wanted achromaticNumber_npComplete :
achromaticNumberDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L achromaticNumberDec
noncomputable def achromaticNumberDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := AchromaticNumberInstance) x with
| some i => decide (WellFormed i ∧ AchromaticNumberFeasible i)
| none => false
WantedExt/Complexity/NPComplete/AchromaticNumberWanted.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), ACHROMATIC NUMBER; M. Farber et al., "The achromatic number of graphs" (1986).
Uses 5
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.