The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V30. Combinatorics

Mathlib.Combinatorics.SimpleGraph.Partition

22 declarations. Mathlib docs · Source

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.

def SimpleGraph.Partition.ctorIdx E1 #

{V : Type u} → {G : SimpleGraph V} → G.Partition → ℕ

theorem SimpleGraph.Partition.mk.injEq E0 #

∀ {V : Type u} {G : SimpleGraph V} (parts : Set (Set V)) (isPartition : Setoid.IsPartition parts)
  (independent : ∀ s ∈ parts, IsAntichain G.Adj s) (parts_1 : Set (Set V)) (isPartition_1 : Setoid.IsPartition parts_1)
  (independent_1 : ∀ s ∈ parts_1, IsAntichain G.Adj s),
  ({ parts := parts, isPartition := isPartition, independent := independent } =
      { parts := parts_1, isPartition := isPartition_1, independent := independent_1 }) =
    (parts = parts_1)

theorem SimpleGraph.Partition.mk.inj E1 #

∀ {V : Type u} {G : SimpleGraph V} {parts : Set (Set V)} {isPartition : Setoid.IsPartition parts}
  {independent : ∀ s ∈ parts, IsAntichain G.Adj s} {parts_1 : Set (Set V)} {isPartition_1 : Setoid.IsPartition parts_1}
  {independent_1 : ∀ s ∈ parts_1, IsAntichain G.Adj s},
  { parts := parts, isPartition := isPartition, independent := independent } =
      { parts := parts_1, isPartition := isPartition_1, independent := independent_1 } →
    parts = parts_1

structure SimpleGraph.Partition E3 #

{V : Type u} → SimpleGraph V → Type u

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.

ctor SimpleGraph.Partition.mk E0 #

{V : Type u} →
  {G : SimpleGraph V} →
    (parts : Set (Set V)) → Setoid.IsPartition parts → (∀ s ∈ parts, IsAntichain G.Adj s) → G.Partition

abbrev SimpleGraph.Partition.parts E1 #

{V : Type u} → {G : SimpleGraph V} → G.Partition → Set (Set V)

A set of subsets of the vertices V of G.

theorem SimpleGraph.Partition.isPartition E1 #

∀ {V : Type u} {G : SimpleGraph V} (self : G.Partition), Setoid.IsPartition self.parts

A proof that parts is a proper partition of V.

theorem SimpleGraph.Partition.independent E1 #

∀ {V : Type u} {G : SimpleGraph V} (self : G.Partition), ∀ s ∈ self.parts, IsAntichain G.Adj s

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

def SimpleGraph.Partition.PartsCardLe E3 #

{V : Type u} → {G : SimpleGraph V} → G.Partition → ℕ → Prop

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

def SimpleGraph.Partitionable E1 #

{V : Type u} → SimpleGraph V → ℕ → Prop

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

def SimpleGraph.Partition.partOfVertex E1 #

{V : Type u} → {G : SimpleGraph V} → G.Partition → V → Set V

The part in the partition that v belongs to.

theorem SimpleGraph.Partition.partOfVertex_mem E1 #

∀ {V : Type u} {G : SimpleGraph V} (P : G.Partition) (v : V), P.partOfVertex v ∈ P.parts

theorem SimpleGraph.Partition.mem_partOfVertex E0 #

∀ {V : Type u} {G : SimpleGraph V} (P : G.Partition) (v : V), v ∈ P.partOfVertex v

theorem SimpleGraph.Partition.partOfVertex_ne_of_adj E1 #

∀ {V : Type u} {G : SimpleGraph V} (P : G.Partition) {v w : V}, G.Adj v w → P.partOfVertex v ≠ P.partOfVertex w

def SimpleGraph.Partition.toColoring E3 #

{V : Type u} → {G : SimpleGraph V} → (P : G.Partition) → G.Coloring ↑P.parts

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

def SimpleGraph.Partition.toColoring' E1 #

{V : Type u} → {G : SimpleGraph V} → G.Partition → G.Coloring (Set V)

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

theorem SimpleGraph.Partition.colorable E1 #

∀ {V : Type u} {G : SimpleGraph V} (P : G.Partition) [inst : Fintype ↑P.parts], G.Colorable (Fintype.card ↑P.parts)

def SimpleGraph.Coloring.toPartition E3 #

{V : Type u} → {G : SimpleGraph V} → {α : Type v} → G.Coloring α → G.Partition

Creates a partition from a coloring.

theorem SimpleGraph.Coloring.toPartition_parts E0 #

∀ {V : Type u} {G : SimpleGraph V} {α : Type v} (C : G.Coloring α), C.toPartition.parts = C.colorClasses

instance SimpleGraph.Partition.instInhabited E0 #

{V : Type u} → {G : SimpleGraph V} → Inhabited G.Partition

The partition where every vertex is in its own part.

theorem SimpleGraph.Partition.default_def E0 #

∀ {V : Type u} {G : SimpleGraph V}, default = G.selfColoring.toPartition

theorem SimpleGraph.partitionable_iff_colorable E3 #

∀ {V : Type u} {G : SimpleGraph V} {n : ℕ}, G.Partitionable n ↔ G.Colorable n