Documentation

Mathlib.Combinatorics.SimpleGraph.Walk

Walk #

In a simple graph, a walk is a finite sequence of adjacent vertices, and can be thought of equally well as a sequence of directed edges.

Warning: graph theorists mean something different by "path" than do homotopy theorists. A "walk" in graph theory is a "path" in homotopy theory. Another warning: some graph theorists use "path" and "simple path" for "walk" and "path."

Some definitions and theorems have inspiration from multigraph counterparts in [Chou1994].

Main definitions #

Tags #

walks

inductive SimpleGraph.Walk {V : Type u} (G : SimpleGraph V) :
VVType u

A walk is a sequence of adjacent vertices. For vertices u v : V, the type walk u v consists of all walks starting at u and ending at v.

We say that a walk visits the vertices it contains. The set of vertices a walk visits is SimpleGraph.Walk.support.

See SimpleGraph.Walk.nil' and SimpleGraph.Walk.cons' for patterns that can be useful in definitions since they make the vertices explicit.

Instances For
    instance SimpleGraph.instDecidableEqWalk {V✝ : Type u_1} {G✝ : SimpleGraph V✝} {a✝ a✝¹ : V✝} [DecidableEq V✝] :
    DecidableEq (G✝.Walk a✝ a✝¹)
    Equations
    @[reducible, match_pattern]
    def SimpleGraph.Adj.toWalk {V : Type u} {G : SimpleGraph V} {u v : V} (h : G.Adj u v) :
    G.Walk u v

    The one-edge walk associated to a pair of adjacent vertices.

    Equations
    Instances For
      @[reducible, match_pattern, inline]
      abbrev SimpleGraph.Walk.nil' {V : Type u} {G : SimpleGraph V} (u : V) :
      G.Walk u u

      Pattern to get Walk.nil with the vertex as an explicit argument.

      Equations
      Instances For
        @[reducible, match_pattern, inline]
        abbrev SimpleGraph.Walk.cons' {V : Type u} {G : SimpleGraph V} (u v w : V) (h : G.Adj u v) (p : G.Walk v w) :
        G.Walk u w

        Pattern to get Walk.cons with the vertices as explicit arguments.

        Equations
        Instances For
          def SimpleGraph.Walk.copy {V : Type u} {G : SimpleGraph V} {u v u' v' : V} (p : G.Walk u v) (hu : u = u') (hv : v = v') :
          G.Walk u' v'

          Change the endpoints of a walk using equalities. This is helpful for relaxing definitional equality constraints and to be able to state otherwise difficult-to-state lemmas. While this is a simple wrapper around Eq.rec, it gives a canonical way to write it.

          The simp-normal form is for the copy to be pushed outward. That way calculations can occur within the "copy context."

          Equations
          Instances For
            @[simp]
            theorem SimpleGraph.Walk.copy_rfl_rfl {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
            p.copy = p
            @[simp]
            theorem SimpleGraph.Walk.copy_copy {V : Type u} {G : SimpleGraph V} {u v u' v' u'' v'' : V} (p : G.Walk u v) (hu : u = u') (hv : v = v') (hu' : u' = u'') (hv' : v' = v'') :
            (p.copy hu hv).copy hu' hv' = p.copy
            @[simp]
            theorem SimpleGraph.Walk.copy_nil {V : Type u} {G : SimpleGraph V} {u u' : V} (hu : u = u') :
            nil.copy hu hu = nil
            theorem SimpleGraph.Walk.copy_cons {V : Type u} {G : SimpleGraph V} {u v w u' w' : V} (h : G.Adj u v) (p : G.Walk v w) (hu : u = u') (hw : w = w') :
            (cons h p).copy hu hw = cons (p.copy hw)
            @[simp]
            theorem SimpleGraph.Walk.cons_copy {V : Type u} {G : SimpleGraph V} {u v w v' w' : V} (h : G.Adj u v) (p : G.Walk v' w') (hv : v' = v) (hw : w' = w) :
            cons h (p.copy hv hw) = (cons p).copy hw
            theorem SimpleGraph.Walk.exists_eq_cons_of_ne {V : Type u} {G : SimpleGraph V} {u v : V} (hne : u v) (p : G.Walk u v) :
            ∃ (w : V) (h : G.Adj u w) (p' : G.Walk w v), p = cons h p'
            def SimpleGraph.Walk.length {V : Type u} {G : SimpleGraph V} {u v : V} :
            G.Walk u v

            The length of a walk is the number of edges/darts along it.

            Equations
            Instances For
              def SimpleGraph.Walk.append {V : Type u} {G : SimpleGraph V} {u v w : V} :
              G.Walk u vG.Walk v wG.Walk u w

              The concatenation of two compatible walks.

              Equations
              Instances For
                def SimpleGraph.Walk.concat {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
                G.Walk u w

                The reversed version of SimpleGraph.Walk.cons, concatenating an edge to the end of a walk.

                Equations
                Instances For
                  theorem SimpleGraph.Walk.concat_eq_append {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
                  p.concat h = p.append (cons h nil)
                  def SimpleGraph.Walk.reverseAux {V : Type u} {G : SimpleGraph V} {u v w : V} :
                  G.Walk u vG.Walk u wG.Walk v w

                  The concatenation of the reverse of the first walk with the second walk.

                  Equations
                  Instances For
                    def SimpleGraph.Walk.reverse {V : Type u} {G : SimpleGraph V} {u v : V} (w : G.Walk u v) :
                    G.Walk v u

                    The walk in reverse.

                    Equations
                    Instances For
                      def SimpleGraph.Walk.getVert {V : Type u} {G : SimpleGraph V} {u v : V} :
                      G.Walk u vV

                      Get the nth vertex from a walk, where n is generally expected to be between 0 and p.length, inclusive. If n is greater than or equal to p.length, the result is the path's endpoint.

                      Equations
                      Instances For
                        @[simp]
                        theorem SimpleGraph.Walk.getVert_zero {V : Type u} {G : SimpleGraph V} {u v : V} (w : G.Walk u v) :
                        w.getVert 0 = u
                        @[simp]
                        theorem SimpleGraph.Walk.getVert_nil {V : Type u} {G : SimpleGraph V} (u : V) {i : } :
                        theorem SimpleGraph.Walk.getVert_of_length_le {V : Type u} {G : SimpleGraph V} {u v : V} (w : G.Walk u v) {i : } (hi : w.length i) :
                        w.getVert i = v
                        @[simp]
                        theorem SimpleGraph.Walk.getVert_length {V : Type u} {G : SimpleGraph V} {u v : V} (w : G.Walk u v) :
                        theorem SimpleGraph.Walk.adj_getVert_succ {V : Type u} {G : SimpleGraph V} {u v : V} (w : G.Walk u v) {i : } (hi : i < w.length) :
                        G.Adj (w.getVert i) (w.getVert (i + 1))
                        @[simp]
                        theorem SimpleGraph.Walk.getVert_cons_succ {V : Type u} {G : SimpleGraph V} {u v w : V} {n : } (p : G.Walk v w) (h : G.Adj u v) :
                        (cons h p).getVert (n + 1) = p.getVert n
                        theorem SimpleGraph.Walk.getVert_cons {V : Type u} {G : SimpleGraph V} {u v w : V} {n : } (p : G.Walk v w) (h : G.Adj u v) (hn : n 0) :
                        (cons h p).getVert n = p.getVert (n - 1)
                        @[simp]
                        theorem SimpleGraph.Walk.cons_append {V : Type u} {G : SimpleGraph V} {u v w x : V} (h : G.Adj u v) (p : G.Walk v w) (q : G.Walk w x) :
                        (cons h p).append q = cons h (p.append q)
                        @[simp]
                        theorem SimpleGraph.Walk.cons_nil_append {V : Type u} {G : SimpleGraph V} {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
                        (cons h nil).append p = cons h p
                        @[simp]
                        theorem SimpleGraph.Walk.nil_append {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                        @[simp]
                        theorem SimpleGraph.Walk.append_nil {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                        theorem SimpleGraph.Walk.append_assoc {V : Type u} {G : SimpleGraph V} {u v w x : V} (p : G.Walk u v) (q : G.Walk v w) (r : G.Walk w x) :
                        p.append (q.append r) = (p.append q).append r
                        @[simp]
                        theorem SimpleGraph.Walk.append_copy_copy {V : Type u} {G : SimpleGraph V} {u v w u' v' w' : V} (p : G.Walk u v) (q : G.Walk v w) (hu : u = u') (hv : v = v') (hw : w = w') :
                        (p.copy hu hv).append (q.copy hv hw) = (p.append q).copy hu hw
                        theorem SimpleGraph.Walk.concat_nil {V : Type u} {G : SimpleGraph V} {u v : V} (h : G.Adj u v) :
                        @[simp]
                        theorem SimpleGraph.Walk.concat_cons {V : Type u} {G : SimpleGraph V} {u v w x : V} (h : G.Adj u v) (p : G.Walk v w) (h' : G.Adj w x) :
                        (cons h p).concat h' = cons h (p.concat h')
                        theorem SimpleGraph.Walk.append_concat {V : Type u} {G : SimpleGraph V} {u v w x : V} (p : G.Walk u v) (q : G.Walk v w) (h : G.Adj w x) :
                        p.append (q.concat h) = (p.append q).concat h
                        theorem SimpleGraph.Walk.concat_append {V : Type u} {G : SimpleGraph V} {u v w x : V} (p : G.Walk u v) (h : G.Adj v w) (q : G.Walk w x) :
                        (p.concat h).append q = p.append (cons h q)
                        theorem SimpleGraph.Walk.exists_cons_eq_concat {V : Type u} {G : SimpleGraph V} {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
                        ∃ (x : V) (q : G.Walk u x) (h' : G.Adj x w), cons h p = q.concat h'

                        A non-trivial cons walk is representable as a concat walk.

                        theorem SimpleGraph.Walk.exists_concat_eq_cons {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
                        ∃ (x : V) (h' : G.Adj u x) (q : G.Walk x w), p.concat h = cons h' q

                        A non-trivial concat walk is representable as a cons walk.

                        @[simp]
                        theorem SimpleGraph.Walk.reverse_nil {V : Type u} {G : SimpleGraph V} {u : V} :
                        theorem SimpleGraph.Walk.reverse_singleton {V : Type u} {G : SimpleGraph V} {u v : V} (h : G.Adj u v) :
                        @[simp]
                        theorem SimpleGraph.Walk.cons_reverseAux {V : Type u} {G : SimpleGraph V} {u v w x : V} (p : G.Walk u v) (q : G.Walk w x) (h : G.Adj w u) :
                        (cons h p).reverseAux q = p.reverseAux (cons q)
                        @[simp]
                        theorem SimpleGraph.Walk.append_reverseAux {V : Type u} {G : SimpleGraph V} {u v w x : V} (p : G.Walk u v) (q : G.Walk v w) (r : G.Walk u x) :
                        @[simp]
                        theorem SimpleGraph.Walk.reverseAux_append {V : Type u} {G : SimpleGraph V} {u v w x : V} (p : G.Walk u v) (q : G.Walk u w) (r : G.Walk w x) :
                        theorem SimpleGraph.Walk.reverseAux_eq_reverse_append {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (q : G.Walk u w) :
                        @[simp]
                        theorem SimpleGraph.Walk.reverse_cons {V : Type u} {G : SimpleGraph V} {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
                        @[simp]
                        theorem SimpleGraph.Walk.reverse_copy {V : Type u} {G : SimpleGraph V} {u v u' v' : V} (p : G.Walk u v) (hu : u = u') (hv : v = v') :
                        (p.copy hu hv).reverse = p.reverse.copy hv hu
                        @[simp]
                        theorem SimpleGraph.Walk.reverse_append {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (q : G.Walk v w) :
                        @[simp]
                        theorem SimpleGraph.Walk.reverse_concat {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
                        @[simp]
                        theorem SimpleGraph.Walk.reverse_reverse {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                        @[simp]
                        theorem SimpleGraph.Walk.length_nil {V : Type u} {G : SimpleGraph V} {u : V} :
                        @[simp]
                        theorem SimpleGraph.Walk.length_cons {V : Type u} {G : SimpleGraph V} {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
                        (cons h p).length = p.length + 1
                        @[simp]
                        theorem SimpleGraph.Walk.length_copy {V : Type u} {G : SimpleGraph V} {u v u' v' : V} (p : G.Walk u v) (hu : u = u') (hv : v = v') :
                        (p.copy hu hv).length = p.length
                        @[simp]
                        theorem SimpleGraph.Walk.length_append {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (q : G.Walk v w) :
                        @[simp]
                        theorem SimpleGraph.Walk.length_concat {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
                        (p.concat h).length = p.length + 1
                        @[simp]
                        theorem SimpleGraph.Walk.length_reverseAux {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (q : G.Walk u w) :
                        @[simp]
                        theorem SimpleGraph.Walk.length_reverse {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                        theorem SimpleGraph.Walk.eq_of_length_eq_zero {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v} :
                        p.length = 0u = v
                        theorem SimpleGraph.Walk.adj_of_length_eq_one {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v} :
                        p.length = 1G.Adj u v
                        @[simp]
                        theorem SimpleGraph.Walk.exists_length_eq_zero_iff {V : Type u} {G : SimpleGraph V} {u v : V} :
                        (∃ (p : G.Walk u v), p.length = 0) u = v
                        @[simp]
                        theorem SimpleGraph.Walk.length_eq_zero_iff {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u} :
                        p.length = 0 p = nil
                        theorem SimpleGraph.Walk.getVert_append {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (q : G.Walk v w) (i : ) :
                        (p.append q).getVert i = if i < p.length then p.getVert i else q.getVert (i - p.length)
                        theorem SimpleGraph.Walk.getVert_reverse {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) (i : ) :
                        def SimpleGraph.Walk.concatRecAux {V : Type u} {G : SimpleGraph V} {motive : (u v : V) → G.Walk u vSort u_1} (Hnil : {u : V} → motive u u nil) (Hconcat : {u v w : V} → (p : G.Walk u v) → (h : G.Adj v w) → motive u v pmotive u w (p.concat h)) {u v : V} (p : G.Walk u v) :
                        motive v u p.reverse

                        Auxiliary definition for SimpleGraph.Walk.concatRec

                        Equations
                        Instances For
                          def SimpleGraph.Walk.concatRec {V : Type u} {G : SimpleGraph V} {motive : (u v : V) → G.Walk u vSort u_1} (Hnil : {u : V} → motive u u nil) (Hconcat : {u v w : V} → (p : G.Walk u v) → (h : G.Adj v w) → motive u v pmotive u w (p.concat h)) {u v : V} (p : G.Walk u v) :
                          motive u v p

                          Recursor on walks by inducting on SimpleGraph.Walk.concat.

                          This is inducting from the opposite end of the walk compared to SimpleGraph.Walk.rec, which inducts on SimpleGraph.Walk.cons.

                          Equations
                          Instances For
                            @[simp]
                            theorem SimpleGraph.Walk.concatRec_nil {V : Type u} {G : SimpleGraph V} {motive : (u v : V) → G.Walk u vSort u_1} (Hnil : {u : V} → motive u u nil) (Hconcat : {u v w : V} → (p : G.Walk u v) → (h : G.Adj v w) → motive u v pmotive u w (p.concat h)) (u : V) :
                            concatRec Hnil Hconcat nil = Hnil
                            @[simp]
                            theorem SimpleGraph.Walk.concatRec_concat {V : Type u} {G : SimpleGraph V} {motive : (u v : V) → G.Walk u vSort u_1} (Hnil : {u : V} → motive u u nil) (Hconcat : {u v w : V} → (p : G.Walk u v) → (h : G.Adj v w) → motive u v pmotive u w (p.concat h)) {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
                            concatRec Hnil Hconcat (p.concat h) = Hconcat p h (concatRec Hnil Hconcat p)
                            theorem SimpleGraph.Walk.concat_ne_nil {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) (h : G.Adj v u) :
                            theorem SimpleGraph.Walk.concat_inj {V : Type u} {G : SimpleGraph V} {u v v' w : V} {p : G.Walk u v} {h : G.Adj v w} {p' : G.Walk u v'} {h' : G.Adj v' w} (he : p.concat h = p'.concat h') :
                            ∃ (hv : v = v'), p.copy hv = p'
                            def SimpleGraph.Walk.support {V : Type u} {G : SimpleGraph V} {u v : V} :
                            G.Walk u vList V

                            The support of a walk is the list of vertices it visits in order.

                            Equations
                            Instances For
                              def SimpleGraph.Walk.darts {V : Type u} {G : SimpleGraph V} {u v : V} :
                              G.Walk u vList G.Dart

                              The darts of a walk is the list of darts it visits in order.

                              Equations
                              Instances For
                                def SimpleGraph.Walk.edges {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :

                                The edges of a walk is the list of edges it visits in order. This is defined to be the list of edges underlying SimpleGraph.Walk.darts.

                                Equations
                                Instances For
                                  @[simp]
                                  theorem SimpleGraph.Walk.support_nil {V : Type u} {G : SimpleGraph V} {u : V} :
                                  @[simp]
                                  theorem SimpleGraph.Walk.support_cons {V : Type u} {G : SimpleGraph V} {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
                                  (cons h p).support = u :: p.support
                                  @[simp]
                                  theorem SimpleGraph.Walk.support_concat {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
                                  @[simp]
                                  theorem SimpleGraph.Walk.support_copy {V : Type u} {G : SimpleGraph V} {u v u' v' : V} (p : G.Walk u v) (hu : u = u') (hv : v = v') :
                                  (p.copy hu hv).support = p.support
                                  theorem SimpleGraph.Walk.support_append {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (p' : G.Walk v w) :
                                  @[simp]
                                  theorem SimpleGraph.Walk.support_reverse {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  @[simp]
                                  theorem SimpleGraph.Walk.support_ne_nil {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  @[simp]
                                  theorem SimpleGraph.Walk.head_support {V : Type u} {G : SimpleGraph V} {a b : V} (p : G.Walk a b) :
                                  p.support.head = a
                                  @[simp]
                                  theorem SimpleGraph.Walk.getLast_support {V : Type u} {G : SimpleGraph V} {a b : V} (p : G.Walk a b) :
                                  p.support.getLast = b
                                  theorem SimpleGraph.Walk.tail_support_append {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (p' : G.Walk v w) :
                                  theorem SimpleGraph.Walk.support_eq_cons {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  @[simp]
                                  theorem SimpleGraph.Walk.start_mem_support {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  @[simp]
                                  theorem SimpleGraph.Walk.end_mem_support {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  @[simp]
                                  theorem SimpleGraph.Walk.support_nonempty {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  theorem SimpleGraph.Walk.mem_support_iff {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) :
                                  @[simp]
                                  theorem SimpleGraph.Walk.getVert_mem_support {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) (i : ) :
                                  @[simp]
                                  theorem SimpleGraph.Walk.mem_tail_support_append_iff {V : Type u} {G : SimpleGraph V} {t u v w : V} (p : G.Walk u v) (p' : G.Walk v w) :
                                  @[simp]
                                  theorem SimpleGraph.Walk.end_mem_tail_support_of_ne {V : Type u} {G : SimpleGraph V} {u v : V} (h : u v) (p : G.Walk u v) :
                                  @[simp]
                                  theorem SimpleGraph.Walk.mem_support_append_iff {V : Type u} {G : SimpleGraph V} {t u v w : V} (p : G.Walk u v) (p' : G.Walk v w) :
                                  @[simp]
                                  theorem SimpleGraph.Walk.subset_support_append_left {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (q : G.Walk v w) :
                                  @[simp]
                                  theorem SimpleGraph.Walk.subset_support_append_right {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (q : G.Walk v w) :
                                  theorem SimpleGraph.Walk.getVert_eq_support_get? {V : Type u} {G : SimpleGraph V} {u v : V} {n : } (p : G.Walk u v) (h2 : n p.length) :
                                  theorem SimpleGraph.Walk.coe_support {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  p.support = {u} + p.support.tail
                                  theorem SimpleGraph.Walk.coe_support_append {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (p' : G.Walk v w) :
                                  (p.append p').support = {u} + p.support.tail + p'.support.tail
                                  theorem SimpleGraph.Walk.coe_support_append' {V : Type u} {G : SimpleGraph V} [DecidableEq V] {u v w : V} (p : G.Walk u v) (p' : G.Walk v w) :
                                  (p.append p').support = p.support + p'.support - {v}
                                  theorem SimpleGraph.Walk.chain_adj_support {V : Type u} {G : SimpleGraph V} {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
                                  theorem SimpleGraph.Walk.chain'_adj_support {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  theorem SimpleGraph.Walk.chain_dartAdj_darts {V : Type u} {G : SimpleGraph V} {d : G.Dart} {v w : V} (h : d.toProd.2 = v) (p : G.Walk v w) :
                                  theorem SimpleGraph.Walk.chain'_dartAdj_darts {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  theorem SimpleGraph.Walk.edges_subset_edgeSet {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) ⦃e : Sym2 V :
                                  e p.edgese G.edgeSet

                                  Every edge in a walk's edge list is an edge of the graph. It is written in this form (rather than using ) to avoid unsightly coercions.

                                  theorem SimpleGraph.Walk.adj_of_mem_edges {V : Type u} {G : SimpleGraph V} {u v x y : V} (p : G.Walk u v) (h : s(x, y) p.edges) :
                                  G.Adj x y
                                  @[simp]
                                  theorem SimpleGraph.Walk.darts_nil {V : Type u} {G : SimpleGraph V} {u : V} :
                                  @[simp]
                                  theorem SimpleGraph.Walk.darts_cons {V : Type u} {G : SimpleGraph V} {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
                                  (cons h p).darts = { toProd := (u, v), adj := h } :: p.darts
                                  @[simp]
                                  theorem SimpleGraph.Walk.darts_concat {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
                                  (p.concat h).darts = p.darts.concat { toProd := (v, w), adj := h }
                                  @[simp]
                                  theorem SimpleGraph.Walk.darts_copy {V : Type u} {G : SimpleGraph V} {u v u' v' : V} (p : G.Walk u v) (hu : u = u') (hv : v = v') :
                                  (p.copy hu hv).darts = p.darts
                                  @[simp]
                                  theorem SimpleGraph.Walk.darts_append {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (p' : G.Walk v w) :
                                  (p.append p').darts = p.darts ++ p'.darts
                                  @[simp]
                                  theorem SimpleGraph.Walk.darts_reverse {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  theorem SimpleGraph.Walk.mem_darts_reverse {V : Type u} {G : SimpleGraph V} {u v : V} {d : G.Dart} {p : G.Walk u v} :
                                  theorem SimpleGraph.Walk.cons_map_snd_darts {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  u :: List.map (fun (x : G.Dart) => x.toProd.2) p.darts = p.support
                                  theorem SimpleGraph.Walk.map_snd_darts {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  List.map (fun (x : G.Dart) => x.toProd.2) p.darts = p.support.tail
                                  theorem SimpleGraph.Walk.map_fst_darts_append {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  List.map (fun (x : G.Dart) => x.toProd.1) p.darts ++ [v] = p.support
                                  theorem SimpleGraph.Walk.map_fst_darts {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  List.map (fun (x : G.Dart) => x.toProd.1) p.darts = p.support.dropLast
                                  @[simp]
                                  theorem SimpleGraph.Walk.head_darts_fst {V : Type u} {G : SimpleGraph V} {a b : V} (p : G.Walk a b) (hp : p.darts []) :
                                  (p.darts.head hp).toProd.1 = a
                                  @[simp]
                                  theorem SimpleGraph.Walk.getLast_darts_snd {V : Type u} {G : SimpleGraph V} {a b : V} (p : G.Walk a b) (hp : p.darts []) :
                                  (p.darts.getLast hp).toProd.2 = b
                                  @[simp]
                                  theorem SimpleGraph.Walk.edges_nil {V : Type u} {G : SimpleGraph V} {u : V} :
                                  @[simp]
                                  theorem SimpleGraph.Walk.edges_cons {V : Type u} {G : SimpleGraph V} {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
                                  (cons h p).edges = s(u, v) :: p.edges
                                  @[simp]
                                  theorem SimpleGraph.Walk.edges_concat {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
                                  @[simp]
                                  theorem SimpleGraph.Walk.edges_copy {V : Type u} {G : SimpleGraph V} {u v u' v' : V} (p : G.Walk u v) (hu : u = u') (hv : v = v') :
                                  (p.copy hu hv).edges = p.edges
                                  @[simp]
                                  theorem SimpleGraph.Walk.edges_append {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (p' : G.Walk v w) :
                                  (p.append p').edges = p.edges ++ p'.edges
                                  @[simp]
                                  theorem SimpleGraph.Walk.edges_reverse {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  @[simp]
                                  theorem SimpleGraph.Walk.length_support {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  @[simp]
                                  theorem SimpleGraph.Walk.length_darts {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  @[simp]
                                  theorem SimpleGraph.Walk.length_edges {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                  theorem SimpleGraph.Walk.dart_fst_mem_support_of_mem_darts {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) {d : G.Dart} :
                                  d p.dartsd.toProd.1 p.support
                                  theorem SimpleGraph.Walk.dart_snd_mem_support_of_mem_darts {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) {d : G.Dart} (h : d p.darts) :
                                  theorem SimpleGraph.Walk.fst_mem_support_of_mem_edges {V : Type u} {G : SimpleGraph V} {t u v w : V} (p : G.Walk v w) (he : s(t, u) p.edges) :
                                  theorem SimpleGraph.Walk.snd_mem_support_of_mem_edges {V : Type u} {G : SimpleGraph V} {t u v w : V} (p : G.Walk v w) (he : s(t, u) p.edges) :
                                  theorem SimpleGraph.Walk.darts_nodup_of_support_nodup {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v} (h : p.support.Nodup) :
                                  theorem SimpleGraph.Walk.edges_nodup_of_support_nodup {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v} (h : p.support.Nodup) :
                                  inductive SimpleGraph.Walk.Nil {V : Type u} {G : SimpleGraph V} {v w : V} :
                                  G.Walk v wProp

                                  Predicate for the empty walk.

                                  Solves the dependent type problem where p = G.Walk.nil typechecks only if p has defeq endpoints.

                                  Instances For
                                    @[simp]
                                    theorem SimpleGraph.Walk.nil_nil {V : Type u} {G : SimpleGraph V} {u : V} :
                                    @[simp]
                                    theorem SimpleGraph.Walk.not_nil_cons {V : Type u} {G : SimpleGraph V} {u v w : V} {h : G.Adj u v} {p : G.Walk v w} :
                                    ¬(cons h p).Nil
                                    theorem SimpleGraph.Walk.Nil.eq {V : Type u} {G : SimpleGraph V} {v w : V} {p : G.Walk v w} :
                                    p.Nilv = w
                                    theorem SimpleGraph.Walk.not_nil_of_ne {V : Type u} {G : SimpleGraph V} {v w : V} {p : G.Walk v w} :
                                    v w¬p.Nil
                                    theorem SimpleGraph.Walk.nil_iff_support_eq {V : Type u} {G : SimpleGraph V} {v w : V} {p : G.Walk v w} :
                                    theorem SimpleGraph.Walk.nil_iff_length_eq {V : Type u} {G : SimpleGraph V} {v w : V} {p : G.Walk v w} :
                                    p.Nil p.length = 0
                                    theorem SimpleGraph.Walk.not_nil_iff_lt_length {V : Type u} {G : SimpleGraph V} {v w : V} {p : G.Walk v w} :
                                    theorem SimpleGraph.Walk.not_nil_iff {V : Type u} {G : SimpleGraph V} {v w : V} {p : G.Walk v w} :
                                    ¬p.Nil ∃ (u : V) (h : G.Adj v u) (q : G.Walk u w), p = cons h q
                                    @[simp]
                                    theorem SimpleGraph.Walk.nil_append_iff {V : Type u} {G : SimpleGraph V} {u v w : V} {p : G.Walk u v} {q : G.Walk v w} :
                                    (p.append q).Nil p.Nil q.Nil
                                    theorem SimpleGraph.Walk.Nil.append {V : Type u} {G : SimpleGraph V} {u v w : V} {p : G.Walk u v} {q : G.Walk v w} (hp : p.Nil) (hq : q.Nil) :
                                    (p.append q).Nil
                                    @[simp]
                                    theorem SimpleGraph.Walk.nil_reverse {V : Type u} {G : SimpleGraph V} {v w : V} {p : G.Walk v w} :
                                    theorem SimpleGraph.Walk.nil_iff_eq_nil {V : Type u} {G : SimpleGraph V} {v : V} {p : G.Walk v v} :
                                    p.Nil p = nil

                                    A walk with its endpoints defeq is Nil if and only if it is equal to nil.

                                    theorem SimpleGraph.Walk.Nil.eq_nil {V : Type u} {G : SimpleGraph V} {v : V} {p : G.Walk v v} :
                                    p.Nilp = Walk.nil

                                    Alias of the forward direction of SimpleGraph.Walk.nil_iff_eq_nil.


                                    A walk with its endpoints defeq is Nil if and only if it is equal to nil.

                                    def SimpleGraph.Walk.notNilRec {V : Type u} {G : SimpleGraph V} {u w : V} {motive : {u w : V} → (p : G.Walk u w) → ¬p.NilSort u_1} (cons : {u v w : V} → (h : G.Adj u v) → (q : G.Walk v w) → motive (cons h q) ) (p : G.Walk u w) (hp : ¬p.Nil) :
                                    motive p hp

                                    The recursion principle for nonempty walks

                                    Equations
                                    Instances For
                                      @[simp]
                                      theorem SimpleGraph.Walk.notNilRec_cons {V : Type u} {G : SimpleGraph V} {u v w : V} {motive : {u w : V} → (p : G.Walk u w) → ¬p.NilSort u_1} (cons : {u v w : V} → (h : G.Adj u v) → (q : G.Walk v w) → motive (cons h q) ) (h' : G.Adj u v) (q' : G.Walk v w) :
                                      notNilRec (fun {u v w : V} => cons) (SimpleGraph.Walk.cons h' q') = cons h' q'
                                      theorem SimpleGraph.Walk.end_mem_tail_support {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v} (h : ¬p.Nil) :
                                      def SimpleGraph.Walk.drop {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) (n : ) :
                                      G.Walk (p.getVert n) v

                                      The walk obtained by removing the first n darts of a walk.

                                      Equations
                                      Instances For
                                        @[reducible, inline]
                                        abbrev SimpleGraph.Walk.snd {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                        V

                                        The second vertex of a walk, or the only vertex in a nil walk.

                                        Equations
                                        Instances For
                                          @[simp]
                                          theorem SimpleGraph.Walk.adj_snd {V : Type u} {G : SimpleGraph V} {v w : V} {p : G.Walk v w} (hp : ¬p.Nil) :
                                          G.Adj v p.snd
                                          theorem SimpleGraph.Walk.snd_cons {V : Type u} {G : SimpleGraph V} {u v w : V} (q : G.Walk v w) (hadj : G.Adj u v) :
                                          (cons hadj q).snd = v
                                          def SimpleGraph.Walk.take {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) (n : ) :
                                          G.Walk u (p.getVert n)

                                          The walk obtained by taking the first n darts of a walk.

                                          Equations
                                          Instances For
                                            @[reducible, inline]
                                            abbrev SimpleGraph.Walk.penultimate {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                            V

                                            The penultimate vertex of a walk, or the only vertex in a nil walk.

                                            Equations
                                            Instances For
                                              @[simp]
                                              @[simp]
                                              theorem SimpleGraph.Walk.penultimate_cons_nil {V : Type u} {G : SimpleGraph V} {u v : V} (h : G.Adj u v) :
                                              @[simp]
                                              theorem SimpleGraph.Walk.penultimate_cons_cons {V : Type u} {G : SimpleGraph V} {u v w w' : V} (h : G.Adj u v) (h₂ : G.Adj v w) (p : G.Walk w w') :
                                              (cons h (cons h₂ p)).penultimate = (cons h₂ p).penultimate
                                              theorem SimpleGraph.Walk.penultimate_cons_of_not_nil {V : Type u} {G : SimpleGraph V} {u v w : V} (h : G.Adj u v) (p : G.Walk v w) (hp : ¬p.Nil) :
                                              @[simp]
                                              theorem SimpleGraph.Walk.penultimate_concat {V : Type u} {G : SimpleGraph V} {t u v : V} (p : G.Walk u v) (h : G.Adj v t) :
                                              @[simp]
                                              theorem SimpleGraph.Walk.adj_penultimate {V : Type u} {G : SimpleGraph V} {v w : V} {p : G.Walk v w} (hp : ¬p.Nil) :
                                              @[simp]
                                              theorem SimpleGraph.Walk.snd_reverse {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                              @[simp]
                                              theorem SimpleGraph.Walk.penultimate_reverse {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                              def SimpleGraph.Walk.tail {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                              G.Walk p.snd v

                                              The walk obtained by removing the first dart of a walk. A nil walk stays nil.

                                              Equations
                                              Instances For
                                                def SimpleGraph.Walk.dropLast {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :

                                                The walk obtained by removing the last dart of a walk. A nil walk stays nil.

                                                Equations
                                                Instances For
                                                  @[simp]
                                                  theorem SimpleGraph.Walk.tail_nil {V : Type u} {G : SimpleGraph V} {v : V} :
                                                  @[simp]
                                                  theorem SimpleGraph.Walk.tail_cons_nil {V : Type u} {G : SimpleGraph V} {u v : V} (h : G.Adj u v) :
                                                  theorem SimpleGraph.Walk.tail_cons_eq {V : Type u} {G : SimpleGraph V} {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
                                                  (cons h p).tail = p.copy
                                                  @[simp]
                                                  @[simp]
                                                  theorem SimpleGraph.Walk.dropLast_cons_nil {V : Type u} {G : SimpleGraph V} {u v : V} (h : G.Adj u v) :
                                                  @[simp]
                                                  theorem SimpleGraph.Walk.dropLast_cons_cons {V : Type u} {G : SimpleGraph V} {u v w w' : V} (h : G.Adj u v) (h₂ : G.Adj v w) (p : G.Walk w w') :
                                                  (cons h (cons h₂ p)).dropLast = cons h (cons h₂ p).dropLast
                                                  theorem SimpleGraph.Walk.dropLast_cons_of_not_nil {V : Type u} {G : SimpleGraph V} {u v w : V} (h : G.Adj u v) (p : G.Walk v w) (hp : ¬p.Nil) :
                                                  (cons h p).dropLast = cons h (p.dropLast.copy )
                                                  @[simp]
                                                  theorem SimpleGraph.Walk.dropLast_concat {V : Type u} {G : SimpleGraph V} {t u v : V} (p : G.Walk u v) (h : G.Adj v t) :
                                                  (p.concat h).dropLast = p.copy
                                                  def SimpleGraph.Walk.firstDart {V : Type u} {G : SimpleGraph V} {v w : V} (p : G.Walk v w) (hp : ¬p.Nil) :

                                                  The first dart of a walk.

                                                  Equations
                                                  Instances For
                                                    @[simp]
                                                    theorem SimpleGraph.Walk.firstDart_toProd {V : Type u} {G : SimpleGraph V} {v w : V} (p : G.Walk v w) (hp : ¬p.Nil) :
                                                    def SimpleGraph.Walk.lastDart {V : Type u} {G : SimpleGraph V} {v w : V} (p : G.Walk v w) (hp : ¬p.Nil) :

                                                    The last dart of a walk.

                                                    Equations
                                                    Instances For
                                                      @[simp]
                                                      theorem SimpleGraph.Walk.lastDart_toProd {V : Type u} {G : SimpleGraph V} {v w : V} (p : G.Walk v w) (hp : ¬p.Nil) :
                                                      theorem SimpleGraph.Walk.edge_firstDart {V : Type u} {G : SimpleGraph V} {v w : V} (p : G.Walk v w) (hp : ¬p.Nil) :
                                                      (p.firstDart hp).edge = s(v, p.snd)
                                                      theorem SimpleGraph.Walk.edge_lastDart {V : Type u} {G : SimpleGraph V} {v w : V} (p : G.Walk v w) (hp : ¬p.Nil) :
                                                      theorem SimpleGraph.Walk.cons_tail_eq {V : Type u} {G : SimpleGraph V} {x y : V} (p : G.Walk x y) (hp : ¬p.Nil) :
                                                      cons p.tail = p
                                                      @[simp]
                                                      theorem SimpleGraph.Walk.concat_dropLast {V : Type u} {G : SimpleGraph V} {x y : V} (p : G.Walk x y) (hp : G.Adj p.penultimate y) :
                                                      @[simp]
                                                      theorem SimpleGraph.Walk.cons_support_tail {V : Type u} {G : SimpleGraph V} {x y : V} (p : G.Walk x y) (hp : ¬p.Nil) :
                                                      @[simp]
                                                      theorem SimpleGraph.Walk.length_tail_add_one {V : Type u} {G : SimpleGraph V} {x y : V} {p : G.Walk x y} (hp : ¬p.Nil) :
                                                      theorem SimpleGraph.Walk.Nil.tail {V : Type u} {G : SimpleGraph V} {v w : V} {p : G.Walk v w} (hp : p.Nil) :
                                                      theorem SimpleGraph.Walk.not_nil_of_tail_not_nil {V : Type u} {G : SimpleGraph V} {v w : V} {p : G.Walk v w} (hp : ¬p.tail.Nil) :
                                                      @[simp]
                                                      theorem SimpleGraph.Walk.nil_copy {V : Type u} {G : SimpleGraph V} {x y x' y' : V} {p : G.Walk x y} (hx : x = x') (hy : y = y') :
                                                      (p.copy hx hy).Nil = p.Nil
                                                      @[simp]
                                                      theorem SimpleGraph.Walk.support_tail {V : Type u} {G : SimpleGraph V} {v : V} (p : G.Walk v v) (hp : ¬p.Nil) :
                                                      @[simp]
                                                      theorem SimpleGraph.Walk.tail_cons {V : Type u} {G : SimpleGraph V} {t u v : V} (p : G.Walk u v) (h : G.Adj t u) :
                                                      (cons h p).tail = p.copy
                                                      theorem SimpleGraph.Walk.support_tail_of_not_nil {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) (hnp : ¬p.Nil) :
                                                      theorem SimpleGraph.Walk.exists_boundary_dart {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) (S : Set V) (uS : u S) (vS : vS) :
                                                      dp.darts, d.toProd.1 S d.toProd.2S

                                                      Given a set S and a walk w from u to v such that u ∈ S but v ∉ S, there exists a dart in the walk whose start is in S but whose end is not.

                                                      @[simp]
                                                      theorem SimpleGraph.Walk.getVert_copy {V : Type u} {G : SimpleGraph V} {u v w x : V} (p : G.Walk u v) (i : ) (h : u = w) (h' : v = x) :
                                                      (p.copy h h').getVert i = p.getVert i
                                                      @[simp]
                                                      theorem SimpleGraph.Walk.getVert_tail {V : Type u} {G : SimpleGraph V} {u v : V} {n : } (p : G.Walk u v) :
                                                      p.tail.getVert n = p.getVert (n + 1)

                                                      Mapping walks #

                                                      def SimpleGraph.Walk.map {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} (f : G →g G') {u v : V} :
                                                      G.Walk u vG'.Walk (f u) (f v)

                                                      Given a graph homomorphism, map walks to walks.

                                                      Equations
                                                      Instances For
                                                        @[simp]
                                                        theorem SimpleGraph.Walk.map_nil {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} (f : G →g G') {u : V} :
                                                        @[simp]
                                                        theorem SimpleGraph.Walk.map_cons {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} (f : G →g G') {u v : V} (p : G.Walk u v) {w : V} (h : G.Adj w u) :
                                                        Walk.map f (cons h p) = cons (Walk.map f p)
                                                        @[simp]
                                                        theorem SimpleGraph.Walk.map_copy {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} (f : G →g G') {u v u' v' : V} (p : G.Walk u v) (hu : u = u') (hv : v = v') :
                                                        Walk.map f (p.copy hu hv) = (Walk.map f p).copy
                                                        @[simp]
                                                        theorem SimpleGraph.Walk.map_id {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                                        @[simp]
                                                        theorem SimpleGraph.Walk.map_map {V : Type u} {V' : Type v} {V'' : Type w} {G : SimpleGraph V} {G' : SimpleGraph V'} {G'' : SimpleGraph V''} (f : G →g G') (f' : G' →g G'') {u v : V} (p : G.Walk u v) :
                                                        Walk.map f' (Walk.map f p) = Walk.map (f'.comp f) p
                                                        theorem SimpleGraph.Walk.map_eq_of_eq {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} {u v : V} (p : G.Walk u v) {f : G →g G'} (f' : G →g G') (h : f = f') :
                                                        Walk.map f p = (Walk.map f' p).copy

                                                        Unlike categories, for graphs vertex equality is an important notion, so needing to be able to work with equality of graph homomorphisms is a necessary evil.

                                                        @[simp]
                                                        theorem SimpleGraph.Walk.map_eq_nil_iff {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} (f : G →g G') {u : V} {p : G.Walk u u} :
                                                        @[simp]
                                                        theorem SimpleGraph.Walk.length_map {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} (f : G →g G') {u v : V} (p : G.Walk u v) :
                                                        theorem SimpleGraph.Walk.map_append {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} (f : G →g G') {u v w : V} (p : G.Walk u v) (q : G.Walk v w) :
                                                        Walk.map f (p.append q) = (Walk.map f p).append (Walk.map f q)
                                                        @[simp]
                                                        theorem SimpleGraph.Walk.reverse_map {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} (f : G →g G') {u v : V} (p : G.Walk u v) :
                                                        @[simp]
                                                        theorem SimpleGraph.Walk.support_map {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} (f : G →g G') {u v : V} (p : G.Walk u v) :
                                                        @[simp]
                                                        theorem SimpleGraph.Walk.darts_map {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} (f : G →g G') {u v : V} (p : G.Walk u v) :
                                                        @[simp]
                                                        theorem SimpleGraph.Walk.edges_map {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} (f : G →g G') {u v : V} (p : G.Walk u v) :
                                                        theorem SimpleGraph.Walk.map_injective_of_injective {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
                                                        @[reducible, inline]
                                                        abbrev SimpleGraph.Walk.mapLe {V : Type u} {G G' : SimpleGraph V} (h : G G') {u v : V} (p : G.Walk u v) :
                                                        G'.Walk u v

                                                        The specialization of SimpleGraph.Walk.map for mapping walks to supergraphs.

                                                        Equations
                                                        Instances For

                                                          Transferring between graphs #

                                                          def SimpleGraph.Walk.transfer {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) (H : SimpleGraph V) (h : ep.edges, e H.edgeSet) :
                                                          H.Walk u v

                                                          The walk p transferred to lie in H, given that H contains its edges.

                                                          Equations
                                                          Instances For
                                                            theorem SimpleGraph.Walk.transfer_self {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) :
                                                            p.transfer G = p
                                                            theorem SimpleGraph.Walk.transfer_eq_map_of_le {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) {H : SimpleGraph V} (hp : ep.edges, e H.edgeSet) (GH : G H) :
                                                            @[simp]
                                                            theorem SimpleGraph.Walk.edges_transfer {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) {H : SimpleGraph V} (hp : ep.edges, e H.edgeSet) :
                                                            (p.transfer H hp).edges = p.edges
                                                            @[simp]
                                                            theorem SimpleGraph.Walk.support_transfer {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) {H : SimpleGraph V} (hp : ep.edges, e H.edgeSet) :
                                                            @[simp]
                                                            theorem SimpleGraph.Walk.length_transfer {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) {H : SimpleGraph V} (hp : ep.edges, e H.edgeSet) :
                                                            (p.transfer H hp).length = p.length
                                                            @[simp]
                                                            theorem SimpleGraph.Walk.transfer_transfer {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) {H : SimpleGraph V} (hp : ep.edges, e H.edgeSet) {K : SimpleGraph V} (hp' : e(p.transfer H hp).edges, e K.edgeSet) :
                                                            (p.transfer H hp).transfer K hp' = p.transfer K
                                                            @[simp]
                                                            theorem SimpleGraph.Walk.transfer_append {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) {H : SimpleGraph V} {w : V} (q : G.Walk v w) (hpq : e(p.append q).edges, e H.edgeSet) :
                                                            (p.append q).transfer H hpq = (p.transfer H ).append (q.transfer H )
                                                            @[simp]
                                                            theorem SimpleGraph.Walk.reverse_transfer {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) {H : SimpleGraph V} (hp : ep.edges, e H.edgeSet) :
                                                            (p.transfer H hp).reverse = p.reverse.transfer H

                                                            Deleting edges #

                                                            @[reducible, inline]
                                                            abbrev SimpleGraph.Walk.toDeleteEdges {V : Type u} {G : SimpleGraph V} (s : Set (Sym2 V)) {v w : V} (p : G.Walk v w) (hp : ep.edges, es) :
                                                            (G.deleteEdges s).Walk v w

                                                            Given a walk that avoids a set of edges, produce a walk in the graph with those edges deleted.

                                                            Equations
                                                            Instances For
                                                              @[simp]
                                                              theorem SimpleGraph.Walk.toDeleteEdges_nil {V : Type u} {G : SimpleGraph V} (s : Set (Sym2 V)) {v : V} (hp : enil.edges, es) :
                                                              @[simp]
                                                              theorem SimpleGraph.Walk.toDeleteEdges_cons {V : Type u} {G : SimpleGraph V} (s : Set (Sym2 V)) {u v w : V} (h : G.Adj u v) (p : G.Walk v w) (hp : e(cons h p).edges, es) :
                                                              toDeleteEdges s (cons h p) hp = cons (toDeleteEdges s p )
                                                              @[reducible, inline]
                                                              abbrev SimpleGraph.Walk.toDeleteEdge {V : Type u} {G : SimpleGraph V} {v w : V} (e : Sym2 V) (p : G.Walk v w) (hp : ep.edges) :

                                                              Given a walk that avoids an edge, create a walk in the subgraph with that edge deleted. This is an abbreviation for SimpleGraph.Walk.toDeleteEdges.

                                                              Equations
                                                              Instances For
                                                                @[simp]
                                                                theorem SimpleGraph.Walk.map_toDeleteEdges_eq {V : Type u} {G : SimpleGraph V} {v w : V} (s : Set (Sym2 V)) {p : G.Walk v w} (hp : ep.edges, es) :