Coloring, chromatic number and clique cover

Lax799700.Coloring · concepts/Lax799700/Coloring.lean · lax-799700

proven

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Theorem

    Three problems built on one generic property, ColorableOn: a map into kk colors separating the pairs related by a conflict relation. KCol kk, on graphs, asks whether the graph is kk-colorable for a kk fixed once and for all, and is NP-complete for every k≥3k \geq 3 by a first-order reduction from 3-colorability. ChromaticNumber, on marked graphs, asks whether the chromatic number is at most kk where kk is the cardinality of the marked set, the unary representation of a threshold; this is Karp's CHROMATIC NUMBER, and it is NP-hard by an ordered first-order reduction from 3-colorability. CliqueCover, on the same vocabulary, asks whether the vertices can be covered by at most kk cliques; a clique cover is a proper coloring of the complement graph, so the first-order interpretation complementing the edges off the diagonal reduces Chromatic Number to Clique Cover.

    The two threshold problems take their conflict relation off the diagonal, so they are about the underlying loopless graph. Their existential second-order definitions guess a coloring in palette form, a map into the marked set itself, since the number kk is not available to a formula.

    Concept map
    8 concepts
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A
    Evidence

    This concept declares 9 statements. Each proof establishes one of them relative to its assumptions.

    1 chromaticNumber_iff proven

    5 hasSmallChromaticNumber_iso proven

    6 hasSmallCliqueCover_iso proven

    Lean source view on GitHub

    1import Mathlib.Data.Fintype.EquivFin
    2import Mathlib.Data.Set.Card
    3import Mathlib.SetTheory.Cardinal.Finite
    4import Mathlib.Logic.Equiv.Prod
    5import Mathlib.ModelTheory.Semantics
    6import Mathlib.ModelTheory.Complexity
    7import Mathlib.Tactic.FinCases
    8import Mathlib.ModelTheory.Syntax
    9import Mathlib.ModelTheory.Order
    10import Mathlib.Data.Set.Finite.Lemmas
    11import Mathlib.Order.PiLex
    12import Mathlib.Data.Prod.Lex
    13import Mathlib.Logic.Equiv.Fin.Basic
    14import Mathlib.Data.Finite.Sigma
    15import Mathlib.Data.Fintype.Lattice
    16import Mathlib.ModelTheory.Graph
    17import Mathlib.Combinatorics.SimpleGraph.Coloring.Vertex
    18import Lax799700.CliqueFamily
    19import Lax904597.Classes
    20import Lax799700.Problems
    21
    22/-!
    23---
    24title: Coloring, chromatic number and clique cover
    25type: theorem
    26---
    27Three problems built on one generic property, ColorableOn: a map into
    28kk colors separating the pairs related by a conflict relation. KCol kk,
    29on graphs, asks whether the graph is kk-colorable for a kk fixed once
    30and for all, and is NP-complete for every k≥3k \geq 3 by a first-order
    31reduction from 3-colorability. ChromaticNumber, on marked graphs, asks
    32whether the chromatic number is at most kk where kk is the cardinality
    33of the marked set, the unary representation of a threshold; this is
    34Karp's CHROMATIC NUMBER, and it is NP-hard by an ordered first-order
    35reduction from 3-colorability. CliqueCover, on the same vocabulary, asks
    36whether the vertices can be covered by at most kk cliques; a clique
    37cover is a proper coloring of the complement graph, so the first-order
    38interpretation complementing the edges off the diagonal reduces
    39Chromatic Number to Clique Cover.
    40
    41The two threshold problems take their conflict relation off the diagonal,
    42so they are about the underlying loopless graph. Their existential
    43second-order definitions guess a coloring in palette form, a map into the
    44marked set itself, since the number kk is not available to a formula.
    45
    46-/
    47
    48namespace Lax799700.Coloring
    49
    50open Lax799700.CliqueFamily
    51
    52open FirstOrder
    53
    54open Language Structure
    55
    56section Generic
    57
    58variable {A : Type}
    59
    60/-- A `k`-coloring for the conflict relation `Cfl`: a map into `Fin k` giving
    61distinct values to conflicting elements. -/
    62def ColorableOn (Cfl : A → A → Prop) (k : ℕ) : Prop :=
    63 ∃ c : A → Fin k, ∀ x y, Cfl x y → c x ≠ c y
    64
    65end Generic
    66
    67section Fixed
    68
    69variable (k : ℕ) (V : Type) [Language.graph.Structure V]
    70
    71/-- A `Language.graph`-structure is `k`-colorable if the vertices can be
    72colored with `k` colors so that adjacent vertices get distinct colors. -/
    73def KColorable : Prop :=
    74 ColorableOn (fun x y : V => RelMap adj ![x, y]) k
    75
    76end Fixed
    77
    78section Conflicts
    79
    80variable {A : Type} [markedGraph.Structure A]
    81
    82/-- The conflict relation of the chromatic-number problem: adjacency off the
    83diagonal. -/
    84def MGConflict (x y : A) : Prop := x ≠ y ∧ MGAdj x y
    85
    86/-- The conflict relation of the clique-cover problem: non-adjacency off the
    87diagonal – two vertices may share a clique exactly when they are adjacent. -/
    88def MGCoConflict (x y : A) : Prop := x ≠ y ∧ ¬MGAdj x y
    89
    90end Conflicts
    91
    92section Threshold
    93
    94variable (A : Type) [markedGraph.Structure A]
    95
    96/-- A marked graph has chromatic number at most the size of its marked set.
    97(Finiteness of the universe is part of the property: cardinality thresholds
    98are only meaningful on finite structures.) -/
    99def HasSmallChromaticNumber : Prop :=
    100 Finite A ∧ ColorableOn (MGConflict (A := A)) {x : A | MGMarked x}.ncard
    101
    102/-- A marked graph can be covered by at most as many cliques as its marked
    103set has elements. -/
    104def HasSmallCliqueCover : Prop :=
    105 Finite A ∧ ColorableOn (MGCoConflict (A := A)) {x : A | MGMarked x}.ncard
    106
    107end Threshold
    108
    109open Lax904597.Problems Lax904597.Classes Lax799700.Problems
    110
    111/-- The property `HasSmallChromaticNumber` is isomorphism-invariant. -/
    112axiom hasSmallChromaticNumber_iso : ∀ {A B : Type} [Lax799700.CliqueFamily.markedGraph.Structure A] [Lax799700.CliqueFamily.markedGraph.Structure B],
    113 (A ≃[Lax799700.CliqueFamily.markedGraph] B) → (HasSmallChromaticNumber A ↔ HasSmallChromaticNumber B)
    114
    115/-- The problem ChromaticNumber: does the structure satisfy `HasSmallChromaticNumber`? -/
    116def ChromaticNumber : DecisionProblem Lax799700.CliqueFamily.markedGraph :=
    117 DecisionProblem.ofPred HasSmallChromaticNumber
    118
    119/-- The yes-instances of ChromaticNumber are exactly the structures satisfying
    120`HasSmallChromaticNumber`. -/
    121axiom chromaticNumber_iff : ∀ (A : Type) [Lax799700.CliqueFamily.markedGraph.Structure A], ChromaticNumber A ↔ HasSmallChromaticNumber A
    122
    123/-- ChromaticNumber is NP-complete. -/
    124axiom chromaticNumber_NP_complete : NP.Complete ChromaticNumber
    125
    126/-- The property `HasSmallCliqueCover` is isomorphism-invariant. -/
    127axiom hasSmallCliqueCover_iso : ∀ {A B : Type} [Lax799700.CliqueFamily.markedGraph.Structure A] [Lax799700.CliqueFamily.markedGraph.Structure B],
    128 (A ≃[Lax799700.CliqueFamily.markedGraph] B) → (HasSmallCliqueCover A ↔ HasSmallCliqueCover B)
    129
    130/-- The problem CliqueCover: does the structure satisfy `HasSmallCliqueCover`? -/
    131def CliqueCover : DecisionProblem Lax799700.CliqueFamily.markedGraph :=
    132 DecisionProblem.ofPred HasSmallCliqueCover
    133
    134/-- The yes-instances of CliqueCover are exactly the structures satisfying
    135`HasSmallCliqueCover`. -/
    136axiom cliqueCover_iff : ∀ (A : Type) [Lax799700.CliqueFamily.markedGraph.Structure A], CliqueCover A ↔ HasSmallCliqueCover A
    137
    138/-- CliqueCover is NP-complete. -/
    139axiom cliqueCover_NP_complete : NP.Complete CliqueCover
    140
    141/-- The property `KColorable k` is isomorphism-invariant, for every `k`. -/
    142axiom kColorable_iso : ∀ {k : ℕ} {A B : Type} [FirstOrder.Language.graph.Structure A]
    143 [FirstOrder.Language.graph.Structure B],
    144 (A ≃[FirstOrder.Language.graph] B) → (KColorable k A ↔ KColorable k B)
    145
    146/-- The problem KCol k: is the graph k-colorable? -/
    147def KCol (k : ℕ) : DecisionProblem FirstOrder.Language.graph :=
    148 DecisionProblem.ofPred (KColorable k)
    149
    150/-- The yes-instances of KCol k are exactly the k-colorable graphs. -/
    151axiom kCol_iff : ∀ (k : ℕ) (A : Type) [FirstOrder.Language.graph.Structure A],
    152 KCol k A ↔ KColorable k A
    153
    154/-- k-colorability is NP-complete for every k ≥ 3. -/
    155axiom kCol_NP_complete : ∀ {k : ℕ}, 3 ≤ k → NP.Complete (KCol k)
    156
    157end Lax799700.Coloring
    158
    Show ProofShow ProofShow ProofShow ProofShow ProofShow ProofShow ProofShow ProofShow Proof

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…