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.Coloring.EdgeLabeling

41 declarations. Mathlib docs · Source

Edge labelings

This module defines labelings of the edges of a graph.

Main definitions

  • SimpleGraph.EdgeLabeling: An assignment of a label from a given type to each edge of the graph.

  • SimpleGraph.EdgeLabeling.labelGraph: the graph consisting of all edges with a given label.

theorem SimpleGraph.EdgeLabeling.get.congr_simp E1 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} (C C_1 : G.EdgeLabeling K),
  C = C_1 → ∀ (x x_1 : V) (e_x : x = x_1) (y y_1 : V) (e_y : y = y_1) (h : G.Adj x y), C.get x y h = C_1.get x_1 y_1 ⋯

theorem SimpleGraph.toTopEdgeLabeling.congr_simp E1 #

∀ {V : Type u_1} (G G_1 : SimpleGraph V),
  G = G_1 →
    ∀ {inst : DecidableRel G.Adj} [inst_1 : DecidableRel G_1.Adj] (a a_1 : ↑⊤.edgeSet),
      a = a_1 → G.toTopEdgeLabeling a = G_1.toTopEdgeLabeling a_1

def SimpleGraph.EdgeLabeling E3 #

{V : Type u_1} → SimpleGraph V → Type u_5 → Type (max u_1 u_5)

An edge labeling of a simple graph G with labels in type K. Sometimes this is called an edge-coloring, but we reserve that terminology for labelings where incident edges cannot share a label.

instance SimpleGraph.instFintypeEdgeLabelingOfDecidableEqOfElemSym2EdgeSet E0 #

{V : Type u_1} →
  {G : SimpleGraph V} →
    {K : Type u_3} → [DecidableEq V] → [Fintype ↑G.edgeSet] → [Fintype K] → Fintype (G.EdgeLabeling K)

instance SimpleGraph.instFiniteEdgeLabelingOfElemSym2EdgeSet E0 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} [Finite ↑G.edgeSet] [Finite K], Finite (G.EdgeLabeling K)

instance SimpleGraph.instUniqueEdgeLabelingOfIsEmptyElemSym2EdgeSet E0 #

{V : Type u_1} → {G : SimpleGraph V} → {K : Type u_3} → [IsEmpty ↑G.edgeSet] → Unique (G.EdgeLabeling K)

instance SimpleGraph.instIsEmptyEdgeLabelingOfNonemptyElemSym2EdgeSet E0 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} [Nonempty ↑G.edgeSet] [IsEmpty K], IsEmpty (G.EdgeLabeling K)

instance SimpleGraph.instNonemptyEdgeLabeling E0 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} [Nonempty K], Nonempty (G.EdgeLabeling K)

instance SimpleGraph.instInhabitedEdgeLabeling E0 #

{V : Type u_1} → {G : SimpleGraph V} → {K : Type u_3} → [Inhabited K] → Inhabited (G.EdgeLabeling K)

instance SimpleGraph.instSubsingletonEdgeLabeling E0 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} [Subsingleton K], Subsingleton (G.EdgeLabeling K)

instance SimpleGraph.instNontrivialEdgeLabelingOfNonemptyElemSym2EdgeSet E0 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} [Nonempty ↑G.edgeSet] [Nontrivial K], Nontrivial (G.EdgeLabeling K)

instance SimpleGraph.instUniqueEdgeLabeling E0 #

{V : Type u_1} → {G : SimpleGraph V} → {K : Type u_3} → [Unique K] → Unique (G.EdgeLabeling K)

abbrev SimpleGraph.TopEdgeLabeling E1 #

Type u_5 → Type u_6 → Type (max u_5 u_6)

An edge labeling of the complete graph on V with labels in type K.

theorem SimpleGraph.card_topEdgeLabeling E1 #

∀ {V : Type u_1} {K : Type u_3} [inst : DecidableEq V] [inst_1 : Fintype V] [inst_2 : Fintype K],
  Fintype.card (SimpleGraph.TopEdgeLabeling V K) = Fintype.card K ^ (Fintype.card V).choose 2

def SimpleGraph.EdgeLabeling.get E1 #

{V : Type u_1} → {G : SimpleGraph V} → {K : Type u_3} → G.EdgeLabeling K → (x y : V) → G.Adj x y → K

Convenience function to get the color of the edge x ~ y in the coloring of the complete graph on V.

theorem SimpleGraph.EdgeLabeling.get_eq E0 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} (C : G.EdgeLabeling K) (x y : V) (h : G.Adj x y),
  C.get x y h = C ⟨s(x, y), h⟩

theorem SimpleGraph.EdgeLabeling.get_comm E1 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} {C : G.EdgeLabeling K} (x y : V) (h : G.Adj y x),
  C.get y x h = C.get x y ⋯

theorem SimpleGraph.EdgeLabeling.ext_get_iff E0 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} {C C' : G.EdgeLabeling K},
  C = C' ↔ ∀ (x y : V) (h : G.Adj x y), C.get x y h = C'.get x y h

theorem SimpleGraph.EdgeLabeling.ext_get E1 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} {C C' : G.EdgeLabeling K},
  (∀ (x y : V) (h : G.Adj x y), C.get x y h = C'.get x y h) → C = C'

def SimpleGraph.EdgeLabeling.compRight E1 #

{V : Type u_1} →
  {G : SimpleGraph V} → {K : Type u_3} → {K' : Type u_4} → G.EdgeLabeling K → (K → K') → G.EdgeLabeling K'

Compose an edge-labeling with a function on the color set.

def SimpleGraph.EdgeLabeling.pullback E1 #

{V : Type u_1} →
  {V' : Type u_2} →
    {G : SimpleGraph V} → {G' : SimpleGraph V'} → {K : Type u_3} → G.EdgeLabeling K → G' →g G → G'.EdgeLabeling K

Compose an edge-labeling with a graph embedding.

theorem SimpleGraph.EdgeLabeling.pullback_apply E0 #

∀ {V : Type u_1} {V' : Type u_2} {G : SimpleGraph V} {G' : SimpleGraph V'} {K : Type u_3} {C : G.EdgeLabeling K}
  {f : G' →g G} (e : ↑G'.edgeSet), C.pullback f e = C (f.mapEdgeSet e)

theorem SimpleGraph.EdgeLabeling.get_pullback E0 #

∀ {V : Type u_1} {V' : Type u_2} {G : SimpleGraph V} {G' : SimpleGraph V'} {K : Type u_3} {C : G.EdgeLabeling K}
  {f : G' ↪g G} (x y : V') (h : G'.Adj x y), (C.pullback (RelEmbedding.toRelHom f)).get x y h = C.get (f x) (f y) ⋯

theorem SimpleGraph.EdgeLabeling.compRight_apply E0 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} {K' : Type u_4} {C : G.EdgeLabeling K} (f : K → K')
  (e : ↑G.edgeSet), C.compRight f e = f (C e)

theorem SimpleGraph.EdgeLabeling.compRight_get E0 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} {K' : Type u_4} {C : G.EdgeLabeling K} (f : K → K') (x y : V)
  (h : G.Adj x y), (C.compRight f).get x y h = f (C.get x y h)

def SimpleGraph.EdgeLabeling.mk E1 #

{V : Type u_1} →
  {G : SimpleGraph V} →
    {K : Type u_3} →
      (f : (x y : V) → G.Adj x y → K) → (∀ (x y : V) (H : G.Adj x y), f y x ⋯ = f x y H) → G.EdgeLabeling K

Construct an edge labeling from a symmetric function on adjacent vertices.

theorem SimpleGraph.EdgeLabeling.get_mk E0 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} (f : (x y : V) → G.Adj x y → K)
  (f_symm : ∀ (x y : V) (H : G.Adj x y), f y x ⋯ = f x y H) (x y : V) (h : G.Adj x y),
  (SimpleGraph.EdgeLabeling.mk f f_symm).get x y h = f x y h

def SimpleGraph.EdgeLabeling.labelGraph E3 #

{V : Type u_1} → {G : SimpleGraph V} → {K : Type u_3} → G.EdgeLabeling K → K → SimpleGraph V

Given an edge labeling and a choice of label k, construct the graph corresponding to the edges labeled k.

theorem SimpleGraph.EdgeLabeling.labelGraph_adj E1 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} {C : G.EdgeLabeling K} {k : K} (x y : V),
  (C.labelGraph k).Adj x y ↔ ∃ (H : G.Adj x y), C ⟨s(x, y), H⟩ = k

instance SimpleGraph.EdgeLabeling.instDecidableRelAdjLabelGraphOfDecidableEq E0 #

{V : Type u_1} →
  {G : SimpleGraph V} →
    {K : Type u_3} →
      [DecidableRel G.Adj] → [DecidableEq K] → (k : K) → {C : G.EdgeLabeling K} → DecidableRel (C.labelGraph k).Adj

theorem SimpleGraph.EdgeLabeling.labelGraph_le E1 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} (C : G.EdgeLabeling K) {k : K}, C.labelGraph k ≤ G

theorem SimpleGraph.EdgeLabeling.pairwise_disjoint_labelGraph E1 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} {C : G.EdgeLabeling K},
  Pairwise fun k l ↦ Disjoint (C.labelGraph k) (C.labelGraph l)

theorem SimpleGraph.EdgeLabeling.pairwiseDisjoint_univ_labelGraph E1 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} {C : G.EdgeLabeling K}, Set.univ.PairwiseDisjoint C.labelGraph

theorem SimpleGraph.EdgeLabeling.iSup_labelGraph E1 #

∀ {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} (C : G.EdgeLabeling K), ⨆ k, C.labelGraph k = G

abbrev SimpleGraph.TopEdgeLabeling.pullback E1 #

{V : Type u_1} →
  {V' : Type u_2} → {K : Type u_3} → SimpleGraph.TopEdgeLabeling V K → (V' ↪ V) → SimpleGraph.TopEdgeLabeling V' K

Compose an edge-labeling, by an injection into the vertex type. This must be an injection, else we don't know how to color x ~ y in the case f x = f y.

theorem SimpleGraph.TopEdgeLabeling.labelGraph_adj E0 #

∀ {V : Type u_1} {K : Type u_3} {C : SimpleGraph.TopEdgeLabeling V K} {k : K} (x y : V),
  (SimpleGraph.EdgeLabeling.labelGraph C k).Adj x y ↔ ∃ (H : x ≠ y), SimpleGraph.EdgeLabeling.get C x y H = k

def SimpleGraph.toTopEdgeLabeling E1 #

{V : Type u_1} → (G : SimpleGraph V) → [DecidableRel G.Adj] → SimpleGraph.TopEdgeLabeling V (Fin 2)

From a simple graph on V, construct the edge labeling on the complete graph of V given where edges are labeled 1 and non-edges are labeled 0.

theorem SimpleGraph.toTopEdgeLabeling_get E0 #

∀ {V : Type u_1} {G : SimpleGraph V} [inst : DecidableRel G.Adj] {x y : V} (H : x ≠ y),
  SimpleGraph.EdgeLabeling.get G.toTopEdgeLabeling x y H = if G.Adj x y then 1 else 0

theorem SimpleGraph.toTopEdgeLabeling_labelGraph E0 #

∀ {V : Type u_1} (G : SimpleGraph V) [inst : DecidableRel G.Adj],
  SimpleGraph.EdgeLabeling.labelGraph G.toTopEdgeLabeling 1 = G

theorem SimpleGraph.toTopEdgeLabeling_labelGraph_compl E0 #

∀ {V : Type u_1} (G : SimpleGraph V) [inst : DecidableRel G.Adj],
  SimpleGraph.EdgeLabeling.labelGraph G.toTopEdgeLabeling 0 = Gᶜ

theorem SimpleGraph.TopEdgeLabeling.labelGraph_toTopEdgeLabeling E1 #

∀ {V : Type u_1} [inst : DecidableEq V] (C : SimpleGraph.TopEdgeLabeling V (Fin 2)),
  (SimpleGraph.EdgeLabeling.labelGraph C 1).toTopEdgeLabeling = C