Documentation

Mathlib.Combinatorics.SimpleGraph.EdgeLabeling

Edge labelings #

This module defines labelings of the edges of a graph.

Main definitions #

def SimpleGraph.EdgeLabeling {V : Type u_1} (G : SimpleGraph V) (K : 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.

Instances For
    @[implicit_reducible]
    instance SimpleGraph.instFintypeEdgeLabelingOfDecidableEqOfElemSym2EdgeSet {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} [DecidableEq V] [Fintype โ†‘G.edgeSet] [Fintype K] :
    instance SimpleGraph.instNonemptyEdgeLabeling {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} [Nonempty K] :
    Nonempty (G.EdgeLabeling K)
    @[implicit_reducible]
    instance SimpleGraph.instInhabitedEdgeLabeling {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} [Inhabited K] :
    Inhabited (G.EdgeLabeling K)
    instance SimpleGraph.instSubsingletonEdgeLabeling {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} [Subsingleton K] :
    Subsingleton (G.EdgeLabeling K)
    @[implicit_reducible]
    instance SimpleGraph.instUniqueEdgeLabeling {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} [Unique K] :
    @[reducible, inline]
    abbrev SimpleGraph.TopEdgeLabeling (V : Type u_5) (K : Type u_6) :
    Type (max u_5 u_6)

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

    Instances For
      def SimpleGraph.EdgeLabeling.get {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} (C : G.EdgeLabeling K) (x y : V) (h : 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.

      Instances For
        theorem SimpleGraph.EdgeLabeling.get_eq {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 {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 {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} {C C' : G.EdgeLabeling K} (h : โˆ€ (x y : V) (h : G.Adj x y), C.get x y h = C'.get x y h) :
        C = C'
        theorem SimpleGraph.EdgeLabeling.ext_get_iff {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
        def SimpleGraph.EdgeLabeling.compRight {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} {K' : Type u_4} (C : G.EdgeLabeling K) (f : K โ†’ K') :

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

        Instances For
          def SimpleGraph.EdgeLabeling.pullback {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) :

          Compose an edge-labeling with a graph embedding.

          Instances For
            @[simp]
            theorem SimpleGraph.EdgeLabeling.pullback_apply {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)
            @[simp]
            theorem SimpleGraph.EdgeLabeling.get_pullback {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) โ‹ฏ
            @[simp]
            theorem SimpleGraph.EdgeLabeling.compRight_apply {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)
            @[simp]
            theorem SimpleGraph.EdgeLabeling.compRight_get {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 {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) :

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

            Instances For
              theorem SimpleGraph.EdgeLabeling.get_mk {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) :
              (mk f f_symm).get x y h = f x y h
              def SimpleGraph.EdgeLabeling.labelGraph {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} (C : G.EdgeLabeling K) (k : K) :

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

              Instances For
                theorem SimpleGraph.EdgeLabeling.labelGraph_adj {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
                @[implicit_reducible]
                instance SimpleGraph.EdgeLabeling.instDecidableRelAdjLabelGraphOfDecidableEq {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.iSup_labelGraph {V : Type u_1} {G : SimpleGraph V} {K : Type u_3} (C : G.EdgeLabeling K) :
                โจ† (k : K), C.labelGraph k = G
                @[reducible, inline]
                abbrev SimpleGraph.TopEdgeLabeling.pullback {V : Type u_1} {V' : Type u_2} {K : Type u_3} (C : TopEdgeLabeling V K) (f : V' โ†ช V) :

                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.

                Instances For
                  @[simp]
                  theorem SimpleGraph.TopEdgeLabeling.labelGraph_adj {V : Type u_1} {K : Type u_3} {C : TopEdgeLabeling V K} {k : K} (x y : V) :
                  (EdgeLabeling.labelGraph C k).Adj x y โ†” โˆƒ (H : x โ‰  y), EdgeLabeling.get C x y H = k
                  def SimpleGraph.toTopEdgeLabeling {V : Type u_1} (G : SimpleGraph V) [DecidableRel G.Adj] :
                  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.

                  Instances For
                    @[simp]
                    theorem SimpleGraph.toTopEdgeLabeling_get {V : Type u_1} {G : SimpleGraph V} [DecidableRel G.Adj] {x y : V} (H : x โ‰  y) :
                    EdgeLabeling.get G.toTopEdgeLabeling x y H = if G.Adj x y then 1 else 0