# Documentation

Mathlib.Combinatorics.SimpleGraph.Partition

# Graph partitions #

This module provides an interface for dealing with partitions on simple graphs. A partition of a graph G, with vertices V, is a set P of disjoint nonempty subsets of V such that:

• The union of the subsets in P is V.

• Each element of P is an independent set. (Each subset contains no pair of adjacent vertices.)

Graph partitions are graph colorings that do not name their colors. They are adjoint in the following sense. Given a graph coloring, there is an associated partition from the set of color classes, and given a partition, there is an associated graph coloring from using the partition's subsets as colors. Going from graph colorings to partitions and back makes a coloring "canonical": all colors are given a canonical name and unused colors are removed. Going from partitions to graph colorings and back is the identity.

## Main definitions #

• SimpleGraph.Partition is a structure to represent a partition of a simple graph

• SimpleGraph.Partition.PartsCardLe is whether a given partition is an n-partition. (a partition with at most n parts).

• SimpleGraph.Partitionable n is whether a given graph is n-partite

• SimpleGraph.Partition.toColoring creates colorings from partitions

• SimpleGraph.Coloring.toPartition creates partitions from colorings

## Main statements #

• SimpleGraph.partitionable_iff_colorable is that n-partitionability and n-colorability are equivalent.
structure SimpleGraph.Partition {V : Type u} (G : ) :
• parts : Set (Set V)

parts: a set of subsets of the vertices V of G.

• isPartition : Setoid.IsPartition s.parts

isPartition: a proof that parts is a proper partition of V.

• independent : ∀ (s_1 : Set V), s_1 s.partsIsAntichain G.Adj s_1

independent: a proof that each element of parts doesn't have a pair of adjacent vertices.

A Partition of a simple graph G is a structure constituted by

• parts: a set of subsets of the vertices V of G
• isPartition: a proof that parts is a proper partition of V
• independent: a proof that each element of parts doesn't have a pair of adjacent vertices
Instances For
def SimpleGraph.Partition.PartsCardLe {V : Type u} {G : } (P : ) (n : ) :

Whether a partition P has at most n parts. A graph with a partition satisfying this predicate called n-partite. (See SimpleGraph.Partitionable.)

Instances For
def SimpleGraph.Partitionable {V : Type u} (G : ) (n : ) :

Whether a graph is n-partite, which is whether its vertex set can be partitioned in at most n independent sets.

Instances For
def SimpleGraph.Partition.partOfVertex {V : Type u} {G : } (P : ) (v : V) :
Set V

The part in the partition that v belongs to

Instances For
theorem SimpleGraph.Partition.partOfVertex_mem {V : Type u} {G : } (P : ) (v : V) :
P.parts
theorem SimpleGraph.Partition.mem_partOfVertex {V : Type u} {G : } (P : ) (v : V) :
theorem SimpleGraph.Partition.partOfVertex_ne_of_adj {V : Type u} {G : } (P : ) {v : V} {w : V} (h : ) :
def SimpleGraph.Partition.toColoring {V : Type u} {G : } (P : ) :

Create a coloring using the parts themselves as the colors. Each vertex is colored by the part it's contained in.

Instances For
def SimpleGraph.Partition.toColoring' {V : Type u} {G : } (P : ) :

Like SimpleGraph.Partition.toColoring but uses Set V as the coloring type.

Instances For
theorem SimpleGraph.Partition.to_colorable {V : Type u} {G : } (P : ) [Fintype P.parts] :
@[simp]
theorem SimpleGraph.Coloring.toPartition_parts {V : Type u} {G : } {α : Type v} (C : ) :
def SimpleGraph.Coloring.toPartition {V : Type u} {G : } {α : Type v} (C : ) :

Creates a partition from a coloring.

Instances For
instance SimpleGraph.instInhabitedPartition {V : Type u} {G : } :

The partition where every vertex is in its own part.