Documentation

LeanPool.Sabidussi.LoopMultigraph

Finite endpoint multigraphs with loops #

Edges are labelled objects with two numbered half-edges. The endpoints may coincide, so loops are represented without quotienting or special cases. Degree and parity always count half-edge incidences; consequently a loop contributes two incidences at its vertex.

def Sabidussi.LoopMultigraph.EulerTour.vertexAt {V : Type u_1} {E : Type u_2} [Fintype V] [Fintype E] {G : LoopMultigraph V E} (T : G.EulerTour) (i : T.Pos) :
V

The vertex of the transition from the previous edge into edge i.

Equations
Instances For
    def Sabidussi.LoopMultigraph.EulerTour.arrivalAt {V : Type u_1} {E : Type u_2} [Fintype V] [Fintype E] {G : LoopMultigraph V E} (T : G.EulerTour) (i : T.Pos) :
    V

    The vertex at which edge i arrives.

    Equations
    Instances For
      @[simp]
      theorem Sabidussi.LoopMultigraph.EulerTour.next_prev {V : Type u_1} {E : Type u_2} [Fintype V] [Fintype E] {G : LoopMultigraph V E} (T : G.EulerTour) (i : T.Pos) :
      T.next (T.prev i) = i
      @[simp]
      theorem Sabidussi.LoopMultigraph.EulerTour.prev_next {V : Type u_1} {E : Type u_2} [Fintype V] [Fintype E] {G : LoopMultigraph V E} (T : G.EulerTour) (i : T.Pos) :
      T.prev (T.next i) = i
      @[reducible, inline]
      abbrev Sabidussi.LoopMultigraph.EulerTour.Occurrence {V : Type u_1} {E : Type u_2} [Fintype V] [Fintype E] {G : LoopMultigraph V E} (T : G.EulerTour) (v : V) :

      Occurrences of v in the cyclic transition word.

      Equations
      Instances For
        @[implicit_reducible]
        Equations
        def Sabidussi.LoopMultigraph.EulerTour.transitionHalfEdge {V : Type u_1} {E : Type u_2} [Fintype V] [Fintype E] {G : LoopMultigraph V E} (T : G.EulerTour) {v : V} (o : T.Occurrence v) :
        Fin 2HalfEdge E

        The two edge ends paired at an occurrence of a transition vertex.

        Side 0 is the departing end of the current edge; side 1 is the arriving end of the previous edge. The two numbered half-edges remain distinct even when the underlying edge is a loop.

        Equations
        Instances For
          @[simp]
          theorem Sabidussi.LoopMultigraph.EulerTour.vertex_transitionHalfEdge {V : Type u_1} {E : Type u_2} [Fintype V] [Fintype E] {G : LoopMultigraph V E} (T : G.EulerTour) {v : V} (o : T.Occurrence v) (s : Fin 2) :

          A transition occurrence with a chosen side, mapped to the corresponding incident half-edge.

          Equations
          Instances For

            The underlying map from a position and transition side to an edge end.

            Equations
            Instances For

              The inverse map: a departure end belongs to its own position, and an arrival end belongs to side 1 of the next position.

              Equations
              Instances For

                Edge positions with a choice of transition side are exactly all edge ends.

                Equations
                Instances For

                  The two sides of all occurrences of v are exactly the half-edges incident with v.

                  Equations
                  Instances For

                    The degree at v is twice its number of occurrences in the transition word.

                    def Sabidussi.LoopMultigraph.edgeIncidence {V : Type u_3} {E : Type u_4} [Fintype V] [Fintype E] [DecidableEq V] (G : LoopMultigraph V E) (v : V) (e : E) :

                    The incidence indicator of an edge at a vertex, with both edge ends counted.

                    Equations
                    Instances For

                      An edge set is even when every vertex has even degree in the induced multigraph.

                      Equations
                      Instances For
                        structure Sabidussi.LoopMultigraph.Cycle {V : Type u_3} {E : Type u_4} [Fintype V] [Fintype E] [DecidableEq V] (G : LoopMultigraph V E) :
                        Type u_4

                        A (multigraph) cycle is a nonempty inclusion-minimal even edge set.

                        This includes singleton loops and pairs of parallel non-loop edges.

                        Instances For
                          theorem Sabidussi.LoopMultigraph.singleton_loop_even {V : Type u_3} {E : Type u_4} [Fintype V] [Fintype E] [DecidableEq V] (G : LoopMultigraph V E) (e : E) (hloop : G.endAt e 0 = G.endAt e 1) :

                          Both incidences of a loop cancel in characteristic two.

                          def Sabidussi.LoopMultigraph.loopCycle {V : Type u_3} {E : Type u_4} [Fintype V] [Fintype E] [DecidableEq V] (G : LoopMultigraph V E) (e : E) (hloop : G.endAt e 0 = G.endAt e 1) :

                          A loop is a one-edge circuit in the minimal-even-set definition.

                          Equations
                          • G.loopCycle e hloop = { edges := {e}, nonempty := , even := , minimal := }
                          Instances For
                            theorem Sabidussi.LoopMultigraph.decompose_even_edge_set {V : Type u_3} {E : Type u_4} [Fintype V] [Fintype E] [DecidableEq V] [DecidableEq E] (G : LoopMultigraph V E) (F : Finset E) (hF : G.IsEvenEdgeSet F) :
                            ∃ (L : List G.Cycle), ∀ (e : E), (List.filter (fun (C : G.Cycle) => decide (e C.edges)) L).length = if e F then 1 else 0

                            Every finite even edge set is an edge-disjoint union of multigraph cycles. The displayed equation records edge multiplicities and is stronger than mere equality of unions.

                            A partition of all edge objects into circuits.

                            Instances For

                              A circuit decomposition is compatible with an Euler tour when no one circuit contains both edge objects of a transition.

                              Equations
                              Instances For
                                structure Sabidussi.LoopMultigraph.CompatibleFourColoring {V : Type u_5} {E : Type u_6} [Fintype V] [Fintype E] [DecidableEq V] (G : LoopMultigraph V E) (T : G.EulerTour) :
                                Type u_6

                                The four-colour certificate produced by the cyclic-word part of the proof.

                                • color : EColor

                                  The colour assigned to each edge object.

                                • transition_ne (i : T.Pos) : self.color (T.edge (T.prev i)) self.color (T.edge i)

                                  Consecutive edges of the tour receive different colours.

                                • color_even (z : Color) : G.IsEvenEdgeSet {e : E | self.color e = z}

                                  Each colour class is an even edge set.

                                Instances For

                                  Every compatible four-colouring yields a compatible circuit decomposition.