Documentation

CslibFrontier.Logics.FirstOrder.Problems.Coloring

Colorability of graph structures #

A structure for Mathlib's language of graphs FirstOrder.Language.graph is a directed graph, possibly with loops. It is n-colorable (graph.Colorable) when its vertices can be colored with n colors so that the two ends of every edge have different colors; a loop makes it uncolorable, and on simple graphs this is SimpleGraph.Colorable. The classes graph.ThreeColorable of three-colorable graph structures (3COL, loops allowed) and graph.SimpleThreeColorable of three-colorable simple graphs (classical 3COL) are closed under isomorphism and invariant under disjoint copies. Their existential second-order definability is in CslibFrontier.Logics.SecondOrder.Coloring, and the machine-level problem, on graphs encoded as lists of vertices and edges, is Cslib.Complexity.ThreeColoring.

Main definitions #

Main results #

References #

A graph structure is n-colorable when its vertices can be colored with n colors so that the two ends of every edge have different colors.

3COL: the class of three-colorable graph structures, loops allowed.

theorem Cslib.Logic.FO.graph.eq_third_color {x y z w : Fin 3} (hx : x ≠ w) (hy : y ≠ w) (hxy : x ≠ y) (hzx : z ≠ x) (hzy : z ≠ y) :
z = w

In a palette of three colors, excluding two distinct colors determines the third.

Colorability is invariant under isomorphism.

The empty graph is colorable.

A positive number of disjoint copies of a graph is n-colorable exactly when the graph is.

A positive number of disjoint copies of a graph is a simple graph exactly when the graph is.