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.Paths

254 declarations and 21 deprecated aliases. Mathlib docs · Source

Trail, Path, and Cycle

In a simple graph,

  • A trail is a walk whose edges each appear no more than once.

  • A circuit is a nonempty trail whose first and last vertices are the same.

  • A path is a trail whose vertices appear no more than once.

  • A cycle is a nonempty trail whose first and last vertices are the same and whose vertices except for the first appear no more than once.

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

  • SimpleGraph.Walk.IsTrail, SimpleGraph.Walk.IsPath, and SimpleGraph.Walk.IsCycle.

  • SimpleGraph.Path

  • SimpleGraph.Path.map for the induced map on paths, given an (injective) graph homomorphism.

Tags

trails, paths, circuits, cycles

Trails, paths, circuits, cycles

About paths

About cycles

Walk decompositions

Type of paths

Walks to paths

Mapping paths

Transferring between graphs

Inducing

Deleting edges

theorem SimpleGraph.Walk.IsSubwalk.hcongr_8 E1 #

∀ (V V' : Type u_1),
  V = V' →
    ∀ (G : SimpleGraph V) (G' : SimpleGraph V'),
      G ≍ G' →
        ∀ (u₁ : V) (u₁' : V'),
          u₁ ≍ u₁' →
            ∀ (v₁ : V) (v₁' : V'),
              v₁ ≍ v₁' →
                ∀ (u₂ : V) (u₂' : V'),
                  u₂ ≍ u₂' →
                    ∀ (v₂ : V) (v₂' : V'),
                      v₂ ≍ v₂' →
                        ∀ (p : G.Walk u₁ v₁) (p' : G'.Walk u₁' v₁'),
                          p ≍ p' → ∀ (q : G.Walk u₂ v₂) (q' : G'.Walk u₂' v₂'), q ≍ q' → p.IsSubwalk q ≍ p'.IsSubwalk q'

theorem SimpleGraph.Walk.cycleBypass.match_1.congr_eq_1 E1 #

∀ {V : Type u_1} {G : SimpleGraph V} {v : V} (motive : G.Walk v v → Sort u_2) (x : G.Walk v v)
  (h_1 : Unit → motive SimpleGraph.Walk.nil)
  (h_2 : (v_1 : V) → (hvv' : G.Adj v v_1) → (w : G.Walk v_1 v) → motive (SimpleGraph.Walk.cons hvv' w)),
  x = SimpleGraph.Walk.nil →
    (match x with
      | SimpleGraph.Walk.nil => h_1 ()
      | SimpleGraph.Walk.cons hvv' w => h_2 v_1 hvv' w) ≍
      h_1 ()

theorem SimpleGraph.Walk.IsTrail.hcongr_5 E1 #

∀ (V V' : Type u),
  V = V' →
    ∀ (G : SimpleGraph V) (G' : SimpleGraph V'),
      G ≍ G' →
        ∀ (u : V) (u' : V'),
          u ≍ u' →
            ∀ (v : V) (v' : V'), v ≍ v' → ∀ (p : G.Walk u v) (p' : G'.Walk u' v'), p ≍ p' → p.IsTrail ≍ p'.IsTrail

theorem SimpleGraph.Walk.bypass.match_1.congr_eq_1 E1 #

∀ {V : Type u_1} {G : SimpleGraph V} {u : V} (motive : (v : V) → G.Walk u v → Sort u_2) (v : V) (x : G.Walk u v)
  (h_1 : Unit → motive u SimpleGraph.Walk.nil)
  (h_2 : (v v_1 : V) → (ha : G.Adj u v_1) → (p : G.Walk v_1 v) → motive v (SimpleGraph.Walk.cons ha p)),
  v = u →
    x ≍ SimpleGraph.Walk.nil →
      (match v, x with
        | .(u), SimpleGraph.Walk.nil => h_1 ()
        | v, SimpleGraph.Walk.cons ha p => h_2 v v_1 ha p) ≍
        h_1 ()

theorem SimpleGraph.Walk.edges.hcongr_5 E1 #

∀ (V V' : Type u),
  V = V' →
    ∀ (G : SimpleGraph V) (G' : SimpleGraph V'),
      G ≍ G' →
        ∀ (u : V) (u' : V'),
          u ≍ u' → ∀ (v : V) (v' : V'), v ≍ v' → ∀ (p : G.Walk u v) (p' : G'.Walk u' v'), p ≍ p' → p.edges ≍ p'.edges

theorem SimpleGraph.Walk.cycleBypass.match_1.congr_eq_2 E1 #

∀ {V : Type u_1} {G : SimpleGraph V} {v : V} (motive : G.Walk v v → Sort u_2) (x : G.Walk v v)
  (h_1 : Unit → motive SimpleGraph.Walk.nil)
  (h_2 : (v_1 : V) → (hvv' : G.Adj v v_1) → (w : G.Walk v_1 v) → motive (SimpleGraph.Walk.cons hvv' w)) (v_1 : V)
  (hvv' : G.Adj v v_1) (w : G.Walk v_1 v),
  x = SimpleGraph.Walk.cons hvv' w →
    (match x with
      | SimpleGraph.Walk.nil => h_1 ()
      | SimpleGraph.Walk.cons hvv' w => h_2 v_2 hvv' w) ≍
      h_2 v_1 hvv' w

theorem SimpleGraph.Walk.bypass.match_1.congr_eq_2 E1 #

∀ {V : Type u_1} {G : SimpleGraph V} {u : V} (motive : (v : V) → G.Walk u v → Sort u_2) (v : V) (x : G.Walk u v)
  (h_1 : Unit → motive u SimpleGraph.Walk.nil)
  (h_2 : (v v_1 : V) → (ha : G.Adj u v_1) → (p : G.Walk v_1 v) → motive v (SimpleGraph.Walk.cons ha p)) (v_1 v_2 : V)
  (ha : G.Adj u v_2) (p : G.Walk v_2 v_1),
  v = v_1 →
    x ≍ SimpleGraph.Walk.cons ha p →
      (match v, x with
        | .(u), SimpleGraph.Walk.nil => h_1 ()
        | v, SimpleGraph.Walk.cons ha p => h_2 v v_3 ha p) ≍
        h_2 v_1 v_2 ha p

structure SimpleGraph.Walk.IsTrail E3 #

{V : Type u} → {G : SimpleGraph V} → {u v : V} → G.Walk u v → Prop

A trail is a walk with no repeating edges.

theorem SimpleGraph.Walk.isTrail_def E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v), p.IsTrail ↔ p.edges.Nodup

ctor SimpleGraph.Walk.IsTrail.mk E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.edges.Nodup → p.IsTrail

theorem SimpleGraph.Walk.IsTrail.edges_nodup E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsTrail → p.edges.Nodup

structure SimpleGraph.Walk.IsPath E3 #

{V : Type u} → {G : SimpleGraph V} → {u v : V} → G.Walk u v → Prop

A path is a walk with no repeating vertices. Use SimpleGraph.Walk.IsPath.mk' for a simpler constructor.

theorem SimpleGraph.Walk.IsPath.isTrail E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsPath → p.IsTrail

ctor SimpleGraph.Walk.IsPath.mk E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsTrail → p.support.Nodup → p.IsPath

theorem SimpleGraph.Walk.IsPath.support_nodup E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsPath → p.support.Nodup

structure SimpleGraph.Walk.IsCircuit E1 #

{V : Type u} → {G : SimpleGraph V} → {u : V} → G.Walk u u → Prop

A circuit at u : V is a nonempty trail beginning and ending at u.

theorem SimpleGraph.Walk.isCircuit_def E0 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} (p : G.Walk u u), p.IsCircuit ↔ p.IsTrail ∧ p ≠ SimpleGraph.Walk.nil

ctor SimpleGraph.Walk.IsCircuit.mk E0 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.IsTrail → p ≠ SimpleGraph.Walk.nil → p.IsCircuit

theorem SimpleGraph.Walk.IsCircuit.isTrail E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.IsCircuit → p.IsTrail

theorem SimpleGraph.Walk.IsCircuit.ne_nil E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.IsCircuit → p ≠ SimpleGraph.Walk.nil

structure SimpleGraph.Walk.IsCycle E3 #

{V : Type u} → {G : SimpleGraph V} → {u : V} → G.Walk u u → Prop

A cycle at u : V is a circuit at u whose only repeating vertex is u (which appears exactly twice).

theorem SimpleGraph.Walk.IsCycle.isCircuit E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.IsCycle → p.IsCircuit

ctor SimpleGraph.Walk.IsCycle.mk E0 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.IsCircuit → p.support.tail.Nodup → p.IsCycle

theorem SimpleGraph.Walk.IsCycle.support_nodup E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.IsCycle → p.support.tail.Nodup

theorem SimpleGraph.Walk.isTrail_copy E0 #

∀ {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).IsTrail ↔ p.IsTrail

theorem SimpleGraph.Walk.IsPath.mk' E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.support.Nodup → p.IsPath

theorem SimpleGraph.Walk.isPath_def E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v), p.IsPath ↔ p.support.Nodup

theorem SimpleGraph.Walk.isPath_iff_injective_get_support E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v), p.IsPath ↔ Function.Injective fun x ↦ p.support.get x

theorem SimpleGraph.Walk.isPath_copy E0 #

∀ {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).IsPath ↔ p.IsPath

theorem SimpleGraph.Walk.isCircuit_copy E0 #

∀ {V : Type u} {G : SimpleGraph V} {u u' : V} (p : G.Walk u u) (hu : u = u'), (p.copy hu hu).IsCircuit ↔ p.IsCircuit

theorem SimpleGraph.Walk.IsCircuit.not_nil E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} {p : G.Walk v v}, p.IsCircuit → ¬p.Nil

theorem SimpleGraph.Walk.isCycle_def E0 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} (p : G.Walk u u),
  p.IsCycle ↔ p.IsTrail ∧ p ≠ SimpleGraph.Walk.nil ∧ p.support.tail.Nodup

theorem SimpleGraph.Walk.isCycle_copy E0 #

∀ {V : Type u} {G : SimpleGraph V} {u u' : V} (p : G.Walk u u) (hu : u = u'), (p.copy hu hu).IsCycle ↔ p.IsCycle

theorem SimpleGraph.Walk.IsCycle.not_nil E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} {p : G.Walk v v}, p.IsCycle → ¬p.Nil

theorem SimpleGraph.Walk.IsTrail.nil E0 #

∀ {V : Type u} {G : SimpleGraph V} {u : V}, SimpleGraph.Walk.nil.IsTrail

theorem SimpleGraph.Walk.IsTrail.of_cons E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} {h : G.Adj u v} {p : G.Walk v w},
  (SimpleGraph.Walk.cons h p).IsTrail → p.IsTrail

theorem SimpleGraph.Walk.isTrail_cons E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} (h : G.Adj u v) (p : G.Walk v w),
  (SimpleGraph.Walk.cons h p).IsTrail ↔ p.IsTrail ∧ s(u, v) ∉ p.edges

theorem SimpleGraph.Walk.IsTrail.cons E1 #

∀ {V : Type u} {G : SimpleGraph V} {u u' v : V} {w : G.Walk u' v},
  w.IsTrail → ∀ (hu : G.Adj u u'), s(u, u') ∉ w.edges → (SimpleGraph.Walk.cons hu w).IsTrail

theorem SimpleGraph.Walk.IsTrail.length_ne_two E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} {p : G.Walk v v}, p.IsTrail → p.length ≠ 2

theorem SimpleGraph.Walk.IsTrail.nil_of_length_le_two E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} {p : G.Walk v v}, p.IsTrail → p.length ≤ 2 → p.Nil

theorem SimpleGraph.Walk.isTrail_concat E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} {p : G.Walk u v} (hadj : G.Adj v w),
  (p.concat hadj).IsTrail ↔ p.IsTrail ∧ s(v, w) ∉ p.edges

theorem SimpleGraph.Walk.IsTrail.concat E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} {p : G.Walk u v},
  p.IsTrail → ∀ (hadj : G.Adj v w), s(v, w) ∉ p.edges → (p.concat hadj).IsTrail

theorem SimpleGraph.Walk.IsTrail.reverse E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v), p.IsTrail → p.reverse.IsTrail

theorem SimpleGraph.Walk.reverse_isTrail_iff E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v), p.reverse.IsTrail ↔ p.IsTrail

theorem SimpleGraph.Walk.isTrail_append E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (q : G.Walk v w),
  (p.append q).IsTrail ↔ p.IsTrail ∧ q.IsTrail ∧ p.edges.Disjoint q.edges

theorem SimpleGraph.Walk.IsTrail.of_append_left E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} {p : G.Walk u v} {q : G.Walk v w}, (p.append q).IsTrail → p.IsTrail

theorem SimpleGraph.Walk.IsTrail.of_append_right E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} {p : G.Walk u v} {q : G.Walk v w}, (p.append q).IsTrail → q.IsTrail

theorem SimpleGraph.Walk.isPath_append E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (q : G.Walk v w),
  (p.append q).IsPath ↔ p.IsPath ∧ q.tail.IsPath ∧ p.support.Disjoint q.support.tail

theorem SimpleGraph.Walk.isPath_append' E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (q : G.Walk v w),
  (p.append q).IsPath ↔ p.dropLast.IsPath ∧ q.IsPath ∧ p.support.dropLast.Disjoint q.support

theorem SimpleGraph.Walk.IsTrail.count_edges_le_one E1 #

∀ {V : Type u} {G : SimpleGraph V} [inst : DecidableEq V] {u v : V} {p : G.Walk u v},
  p.IsTrail → ∀ (e : Sym2 V), List.count e p.edges ≤ 1

theorem SimpleGraph.Walk.IsTrail.count_edges_eq_one E1 #

∀ {V : Type u} {G : SimpleGraph V} [inst : DecidableEq V] {u v : V} {p : G.Walk u v},
  p.IsTrail → ∀ {e : Sym2 V}, e ∈ p.edges → List.count e p.edges = 1

theorem SimpleGraph.Walk.IsTrail.length_le_encard_edgeSet E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsTrail → ↑p.length ≤ G.edgeSet.encard

theorem SimpleGraph.Walk.IsTrail.length_le_ncard_edgeSet E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v} [Finite ↑G.edgeSet],
  p.IsTrail → p.length ≤ G.edgeSet.ncard

theorem SimpleGraph.Walk.IsPath.length_lt_enatCard E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsPath → ↑p.length < ENat.card V

theorem SimpleGraph.Walk.IsPath.length_lt_natCard E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v} [Finite V], p.IsPath → p.length < Nat.card V

theorem SimpleGraph.Walk.IsCycle.length_le_enatCard E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} {p : G.Walk v v}, p.IsCycle → ↑p.length ≤ ENat.card V

theorem SimpleGraph.Walk.IsCycle.length_le_natCard E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [Finite V] {p : G.Walk v v}, p.IsCycle → p.length ≤ Nat.card V

theorem SimpleGraph.Walk.IsTrail.length_le_card_edgeFinset E1 #

∀ {V : Type u} {G : SimpleGraph V} [inst : Fintype ↑G.edgeSet] {u v : V} {w : G.Walk u v},
  w.IsTrail → w.length ≤ G.edgeFinset.card

theorem SimpleGraph.Walk.isTrail_iff_ncard_edgeSet_eq_length E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsTrail ↔ p.edgeSet.ncard = p.length

theorem SimpleGraph.Walk.IsTrail.ncard_edgeSet E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsTrail → p.edgeSet.ncard = p.length

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

theorem SimpleGraph.Walk.isTrail_iff_encard_edgeSet_eq_length E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsTrail ↔ p.edgeSet.encard = ↑p.length

theorem SimpleGraph.Walk.IsTrail.encard_edgeSet E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsTrail → p.edgeSet.encard = ↑p.length

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

theorem SimpleGraph.Walk.IsPath.nil E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V}, SimpleGraph.Walk.nil.IsPath

theorem SimpleGraph.Walk.IsPath.of_cons E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} {h : G.Adj u v} {p : G.Walk v w},
  (SimpleGraph.Walk.cons h p).IsPath → p.IsPath

theorem SimpleGraph.Walk.cons_isPath_iff E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} (h : G.Adj u v) (p : G.Walk v w),
  (SimpleGraph.Walk.cons h p).IsPath ↔ p.IsPath ∧ u ∉ p.support

theorem SimpleGraph.Walk.IsPath.cons E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} {p : G.Walk v w},
  p.IsPath → u ∉ p.support → ∀ {h : G.Adj u v}, (SimpleGraph.Walk.cons h p).IsPath

theorem SimpleGraph.Walk.isPath_iff_nil E0 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.IsPath ↔ p.Nil

theorem SimpleGraph.Walk.IsPath.nil_iff_eq E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsPath → (p.Nil ↔ u = v)

theorem SimpleGraph.Adj.isPath_toWalk E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} (h : G.Adj u v), h.toWalk.IsPath

theorem SimpleGraph.Walk.IsPath.reverse E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsPath → p.reverse.IsPath

theorem SimpleGraph.Walk.isPath_reverse_iff E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v), p.reverse.IsPath ↔ p.IsPath

theorem SimpleGraph.Walk.IsPath.of_append_left E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} {p : G.Walk u v} {q : G.Walk v w}, (p.append q).IsPath → p.IsPath

theorem SimpleGraph.Walk.IsPath.of_append_right E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} {p : G.Walk u v} {q : G.Walk v w}, (p.append q).IsPath → q.IsPath

theorem SimpleGraph.Walk.isTrail_of_isSubwalk E1 #

∀ {V : Type u} {G : SimpleGraph V} {v w v' w' : V} {p₁ : G.Walk v w} {p₂ : G.Walk v' w'},
  p₁.IsSubwalk p₂ → p₂.IsTrail → p₁.IsTrail

theorem SimpleGraph.Walk.isPath_of_isSubwalk E1 #

∀ {V : Type u} {G : SimpleGraph V} {v w v' w' : V} {p₁ : G.Walk v w} {p₂ : G.Walk v' w'},
  p₁.IsSubwalk p₂ → p₂.IsPath → p₁.IsPath

theorem SimpleGraph.Walk.IsPath.of_adj E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} (h : G.Adj u v), h.toWalk.IsPath

theorem SimpleGraph.Walk.isPath_concat E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} {p : G.Walk u v} (h : G.Adj v w),
  (p.concat h).IsPath ↔ p.IsPath ∧ w ∉ p.support

theorem SimpleGraph.Walk.IsPath.concat E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} {p : G.Walk u v},
  p.IsPath → w ∉ p.support → ∀ (h : G.Adj v w), (p.concat h).IsPath

theorem SimpleGraph.Walk.IsPath.take_of_take E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {n k : ℕ} {p : G.Walk u v}, (p.take k).IsPath → n ≤ k → (p.take n).IsPath

theorem SimpleGraph.Walk.IsPath.drop_of_drop E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {n k : ℕ} {p : G.Walk u v}, (p.drop k).IsPath → k ≤ n → (p.drop n).IsPath

theorem SimpleGraph.Walk.IsTrail.take E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsTrail → ∀ (n : ℕ), (p.take n).IsTrail

theorem SimpleGraph.Walk.IsTrail.drop E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsTrail → ∀ (n : ℕ), (p.drop n).IsTrail

theorem SimpleGraph.Walk.IsPath.take E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsPath → ∀ (n : ℕ), (p.take n).IsPath

theorem SimpleGraph.Walk.IsPath.drop E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsPath → ∀ (n : ℕ), (p.drop n).IsPath

theorem SimpleGraph.Walk.IsPath.mem_support_iff_exists_append E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} {p : G.Walk u v},
  p.IsPath → (w ∈ p.support ↔ ∃ q r, q.IsPath ∧ r.IsPath ∧ p = q.append r)

theorem SimpleGraph.Walk.IsPath.disjoint_support_of_append E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} {p : G.Walk u v} {q : G.Walk v w},
  (p.append q).IsPath → ¬q.Nil → p.support.Disjoint q.tail.support

theorem SimpleGraph.Walk.IsPath.ne_of_mem_support_of_append E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} {p : G.Walk u v} {q : G.Walk v w},
  (p.append q).IsPath → ∀ {x y : V}, y ≠ v → x ∈ p.support → y ∈ q.support → x ≠ y

theorem SimpleGraph.Walk.not_isCircuit_nil E0 #

∀ {V : Type u} {G : SimpleGraph V} {u : V}, ¬SimpleGraph.Walk.nil.IsCircuit

theorem SimpleGraph.Walk.not_isCycle_nil E0 #

∀ {V : Type u} {G : SimpleGraph V} {u : V}, ¬SimpleGraph.Walk.nil.IsCycle

theorem SimpleGraph.Walk.IsCircuit.ne_bot E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.IsCircuit → G ≠ ⊥

theorem SimpleGraph.Walk.IsCircuit.three_le_length E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} {p : G.Walk v v}, p.IsCircuit → 3 ≤ p.length

theorem SimpleGraph.Walk.not_nil_of_isCycle_cons E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v} {h : G.Adj v u},
  (SimpleGraph.Walk.cons h p).IsCycle → ¬p.Nil

theorem SimpleGraph.Walk.cons_isCycle_iff E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk v u) (h : G.Adj u v),
  (SimpleGraph.Walk.cons h p).IsCycle ↔ p.IsPath ∧ s(u, v) ∉ p.edges

theorem SimpleGraph.Walk.IsCycle.nodup_dropLast_support E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.IsCycle → p.support.dropLast.Nodup

theorem SimpleGraph.Walk.IsCircuit.reverse E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.IsCircuit → p.reverse.IsCircuit

theorem SimpleGraph.Walk.isCircuit_reverse E0 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.reverse.IsCircuit ↔ p.IsCircuit

theorem SimpleGraph.Walk.IsCycle.reverse E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.IsCycle → p.reverse.IsCycle

theorem SimpleGraph.Walk.isCycle_reverse E0 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.reverse.IsCycle ↔ p.IsCycle

theorem SimpleGraph.Walk.IsCycle.isPath_of_append_right E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v} {q : G.Walk v u}, ¬p.Nil → (p.append q).IsCycle → q.IsPath

theorem SimpleGraph.Walk.IsCycle.isPath_of_append_left E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v} {q : G.Walk v u}, ¬q.Nil → (p.append q).IsCycle → p.IsPath

theorem SimpleGraph.Walk.IsCycle.isPath_tail E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.IsCycle → p.tail.IsPath

theorem SimpleGraph.Walk.IsTrail.tail E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsTrail → p.tail.IsTrail

theorem SimpleGraph.Walk.IsPath.tail E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsPath → p.tail.IsPath

theorem SimpleGraph.Walk.IsTrail.dropLast E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsTrail → p.dropLast.IsTrail

theorem SimpleGraph.Walk.IsPath.dropLast E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsPath → p.dropLast.IsPath

theorem SimpleGraph.Walk.isPath_dropLast_iff_isPath_tail E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} {p : G.Walk v v}, p.dropLast.IsPath ↔ p.tail.IsPath

theorem SimpleGraph.Walk.IsCycle.isPath_dropLast E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.IsCycle → p.dropLast.IsPath

theorem SimpleGraph.Walk.IsCycle.isPath_drop E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {n : ℕ} {p : G.Walk u u}, p.IsCycle → 0 < n → (p.drop n).IsPath

theorem SimpleGraph.Walk.IsCycle.isPath_take E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {n : ℕ} {p : G.Walk u u}, p.IsCycle → n < p.length → (p.take n).IsPath

theorem SimpleGraph.Walk.exists_isTrail_forall_isTrail_length_le_length E1 #

∀ {V : Type u} (G : SimpleGraph V) [Nonempty V] [Finite ↑G.edgeSet],
  ∃ u v p, ∃ (_ : p.IsTrail), ∀ (u' v' : V) (p' : G.Walk u' v'), p'.IsTrail → p'.length ≤ p.length

There exists a trail of maximal length in a non-empty graph on finite edges.

theorem SimpleGraph.Walk.exists_isPath_forall_isPath_length_le_length E1 #

∀ {V : Type u} (G : SimpleGraph V) [Nonempty V] [Finite ↑G.edgeSet],
  ∃ u v p, ∃ (_ : p.IsPath), ∀ (u' v' : V) (p' : G.Walk u' v'), p'.IsPath → p'.length ≤ p.length

There exists a path of maximal length in a non-empty graph on finite edges.

instance SimpleGraph.Walk.instDecidableIsPathOfDecidableEq E0 #

{V : Type u} → {G : SimpleGraph V} → [DecidableEq V] → {u v : V} → (p : G.Walk u v) → Decidable p.IsPath

theorem SimpleGraph.Walk.IsPath.length_lt E1 #

∀ {V : Type u} {G : SimpleGraph V} [inst : Fintype V] {u v : V} {p : G.Walk u v}, p.IsPath → p.length < Fintype.card V

theorem SimpleGraph.Walk.IsPath.getVert_injOn E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsPath → Set.InjOn p.getVert (Set.Iic p.length)

theorem SimpleGraph.Walk.IsPath.getVert_eq_start_iff_of_not_nil E1 #

∀ {V : Type u} {G : SimpleGraph V} {u w : V} {i : ℕ} {p : G.Walk u w}, p.IsPath → ¬p.Nil → (p.getVert i = u ↔ i = 0)

theorem SimpleGraph.Walk.IsPath.getVert_eq_start_iff E0 #

∀ {V : Type u} {G : SimpleGraph V} {u w : V} {i : ℕ} {p : G.Walk u w},
  p.IsPath → i ≤ p.length → (p.getVert i = u ↔ i = 0)

theorem SimpleGraph.Walk.IsPath.getVert_eq_end_iff E0 #

∀ {V : Type u} {G : SimpleGraph V} {u w : V} {i : ℕ} {p : G.Walk u w},
  p.IsPath → i ≤ p.length → (p.getVert i = w ↔ i = p.length)

theorem SimpleGraph.Walk.IsPath.getVert_injOn_iff E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v), Set.InjOn p.getVert (Set.Iic p.length) ↔ p.IsPath

theorem SimpleGraph.Walk.IsPath.mk_start_mem_edges_iff E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} {p : G.Walk u v}, p.IsPath → (s(u, w) ∈ p.edges ↔ w = p.snd ∧ ¬p.Nil)

theorem SimpleGraph.Walk.IsPath.mk_end_mem_edges_iff E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} {p : G.Walk u v},
  p.IsPath → (s(v, w) ∈ p.edges ↔ w = p.penultimate ∧ ¬p.Nil)

theorem SimpleGraph.Walk.IsPath.penultimate_eq_of_mem_darts E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v},
  p.tail.IsPath → ∀ {d : G.Dart}, d ∈ p.darts → v = d.toProd.2 → p.penultimate = d.toProd.1

theorem SimpleGraph.Walk.IsPath.snd_eq_of_mem_darts E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v},
  p.dropLast.IsPath → ∀ {d : G.Dart}, d ∈ p.darts → u = d.toProd.1 → p.snd = d.toProd.2

theorem SimpleGraph.Walk.IsPath.injOn_support_of_isPath_map E1 #

∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} {u v : V} {p : G.Walk u v} {f : G →g G'},
  (SimpleGraph.Walk.map f p).IsPath → Set.InjOn ⇑f {w | w ∈ p.support}

theorem SimpleGraph.Walk.IsCycle.getVert_injOn E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.IsCycle → Set.InjOn p.getVert (Set.Ioc 0 p.length)

theorem SimpleGraph.Walk.IsCycle.getVert_injOn' E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.IsCycle → Set.InjOn p.getVert (Set.Iio p.length)

theorem SimpleGraph.Walk.IsCycle.snd_ne_penultimate E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.IsCycle → p.snd ≠ p.penultimate

theorem SimpleGraph.Walk.IsCycle.getVert_endpoint_iff E0 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {i : ℕ} {p : G.Walk u u},
  p.IsCycle → i ≤ p.length → (p.getVert i = u ↔ i = 0 ∨ i = p.length)

theorem SimpleGraph.Walk.IsCycle.getVert_sub_one_ne_getVert_add_one E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {i : ℕ} {p : G.Walk u u},
  p.IsCycle → i ≤ p.length → p.getVert (i - 1) ≠ p.getVert (i + 1)

theorem SimpleGraph.Walk.isCycle_iff_isPath_tail_and_le_length E1 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u}, p.IsCycle ↔ p.tail.IsPath ∧ 3 ≤ p.length

theorem SimpleGraph.Walk.isCycle_iff_isPath_dropLast_and_le_length E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} {p : G.Walk v v}, p.IsCycle ↔ p.dropLast.IsPath ∧ 3 ≤ p.length

theorem SimpleGraph.Walk.IsTrail.takeUntil E1 #

∀ {V : Type u} {G : SimpleGraph V} [inst : DecidableEq V] {u v w : V} {p : G.Walk v w},
  p.IsTrail → ∀ (h : u ∈ p.support), (p.takeUntil u h).IsTrail

theorem SimpleGraph.Walk.IsTrail.dropUntil E1 #

∀ {V : Type u} {G : SimpleGraph V} [inst : DecidableEq V] {u v w : V} {p : G.Walk v w},
  p.IsTrail → ∀ (h : u ∈ p.support), (p.dropUntil u h).IsTrail

theorem SimpleGraph.Walk.IsPath.takeUntil E1 #

∀ {V : Type u} {G : SimpleGraph V} [inst : DecidableEq V] {u v w : V} {p : G.Walk v w},
  p.IsPath → ∀ (h : u ∈ p.support), (p.takeUntil u h).IsPath

theorem SimpleGraph.Walk.IsPath.dropUntil E1 #

∀ {V : Type u} {G : SimpleGraph V} [inst : DecidableEq V] {u v w : V} {p : G.Walk v w},
  p.IsPath → ∀ (h : u ∈ p.support), (p.dropUntil u h).IsPath

theorem SimpleGraph.Walk.IsTrail.disjoint_edges_takeUntil_dropUntil E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] {x : V} {w : G.Walk u v},
  w.IsTrail → ∀ (hx : x ∈ w.support), (w.takeUntil x hx).edges.Disjoint (w.dropUntil x hx).edges

theorem SimpleGraph.Walk.isTrail_rotate E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] {c : G.Walk v v} (hu : u ∈ c.support),
  (c.rotate u hu).IsTrail ↔ c.IsTrail

theorem SimpleGraph.Walk.isCircuit_rotate E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] {c : G.Walk v v} (hu : u ∈ c.support),
  (c.rotate u hu).IsCircuit ↔ c.IsCircuit

theorem SimpleGraph.Walk.isCycle_rotate E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] {c : G.Walk v v} (hu : u ∈ c.support),
  (c.rotate u hu).IsCycle ↔ c.IsCycle

theorem SimpleGraph.Walk.IsTrail.of_rotate E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] {c : G.Walk v v} (hu : u ∈ c.support),
  (c.rotate u hu).IsTrail → c.IsTrail

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

theorem SimpleGraph.Walk.IsTrail.rotate E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] {c : G.Walk v v} (hu : u ∈ c.support),
  c.IsTrail → (c.rotate u hu).IsTrail

Alias of the reverse direction of SimpleGraph.Walk.isTrail_rotate.

theorem SimpleGraph.Walk.IsCircuit.of_rotate E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] {c : G.Walk v v} (hu : u ∈ c.support),
  (c.rotate u hu).IsCircuit → c.IsCircuit

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

theorem SimpleGraph.Walk.IsCircuit.rotate E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] {c : G.Walk v v} (hu : u ∈ c.support),
  c.IsCircuit → (c.rotate u hu).IsCircuit

Alias of the reverse direction of SimpleGraph.Walk.isCircuit_rotate.

theorem SimpleGraph.Walk.IsCycle.of_rotate E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] {c : G.Walk v v} (hu : u ∈ c.support),
  (c.rotate u hu).IsCycle → c.IsCycle

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

theorem SimpleGraph.Walk.IsCycle.rotate E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] {c : G.Walk v v} (hu : u ∈ c.support),
  c.IsCycle → (c.rotate u hu).IsCycle

Alias of the reverse direction of SimpleGraph.Walk.isCycle_rotate.

theorem SimpleGraph.Walk.IsCycle.isPath_takeUntil E1 #

∀ {V : Type u} {G : SimpleGraph V} {v w : V} [inst : DecidableEq V] {c : G.Walk v v},
  c.IsCycle → ∀ (h : w ∈ c.support), (c.takeUntil w h).IsPath

theorem SimpleGraph.Walk.IsCycle.count_support E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [inst : DecidableEq V] {c : G.Walk v v},
  c.IsCycle → List.count v c.support = 2

theorem SimpleGraph.Walk.IsCycle.count_support_of_mem E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] {c : G.Walk v v},
  c.IsCycle → u ∈ c.support → u ≠ v → List.count u c.support = 1

theorem SimpleGraph.Walk.endpoint_notMem_support_takeUntil E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v w : V} [inst : DecidableEq V] {p : G.Walk u v},
  p.IsPath → ∀ (hw : w ∈ p.support), v ≠ w → v ∉ (p.takeUntil w hw).support

Taking a strict initial segment of a path removes the end vertex from the support.

theorem SimpleGraph.Walk.isPath_iff_isSubwalk_imp_nil E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v},
  p.IsPath ↔ ∀ (v_1 : V) (w : G.Walk v_1 v_1), w.IsSubwalk p → w.Nil

theorem SimpleGraph.Walk.IsTrail.isPath_iff_isSubwalk_imp_not_isCycle E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v},
  p.IsTrail → (p.IsPath ↔ ∀ (v_1 : V) (w : G.Walk v_1 v_1), w.IsSubwalk p → ¬w.IsCycle)

abbrev SimpleGraph.Path E3 #

{V : Type u} → SimpleGraph V → V → V → Type (max 0 u)

The type for paths between two vertices.

theorem SimpleGraph.Path.isPath E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Path u v), (↑p).IsPath

theorem SimpleGraph.Path.isTrail E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Path u v), (↑p).IsTrail

def SimpleGraph.Path.nil E1 #

{V : Type u} → {G : SimpleGraph V} → {u : V} → G.Path u u

The length-0 path at a vertex.

theorem SimpleGraph.Path.nil_coe E0 #

∀ {V : Type u} {G : SimpleGraph V} {u : V}, ↑SimpleGraph.Path.nil = SimpleGraph.Walk.nil

def SimpleGraph.Path.singleton E1 #

{V : Type u} → {G : SimpleGraph V} → {u v : V} → G.Adj u v → G.Path u v

The length-1 path between a pair of adjacent vertices.

theorem SimpleGraph.Path.singleton_coe E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} (h : G.Adj u v),
  ↑(SimpleGraph.Path.singleton h) = SimpleGraph.Walk.cons h SimpleGraph.Walk.nil

theorem SimpleGraph.Path.mk'_mem_edges_singleton E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} (h : G.Adj u v), s(u, v) ∈ (↑(SimpleGraph.Path.singleton h)).edges

def SimpleGraph.Path.reverse E1 #

{V : Type u} → {G : SimpleGraph V} → {u v : V} → G.Path u v → G.Path v u

The reverse of a path is another path. See also SimpleGraph.Walk.reverse.

theorem SimpleGraph.Path.reverse_coe E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Path u v), ↑p.reverse = (↑p).reverse

theorem SimpleGraph.Path.count_support_eq_one E1 #

∀ {V : Type u} {G : SimpleGraph V} [inst : DecidableEq V] {u v w : V} {p : G.Path u v},
  w ∈ (↑p).support → List.count w (↑p).support = 1

theorem SimpleGraph.Path.count_edges_eq_one E1 #

∀ {V : Type u} {G : SimpleGraph V} [inst : DecidableEq V] {u v : V} {p : G.Path u v},
  ∀ e ∈ (↑p).edges, List.count e (↑p).edges = 1

theorem SimpleGraph.Path.nodup_support E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Path u v), (↑p).support.Nodup

theorem SimpleGraph.Path.loop_eq E0 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} (p : G.Path v v), p = SimpleGraph.Path.nil

theorem SimpleGraph.Path.notMem_edges_of_loop E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} {e : Sym2 V} {p : G.Path v v}, e ∉ (↑p).edges

theorem SimpleGraph.Path.cons_isCycle E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Path v u) (h : G.Adj u v),
  s(u, v) ∉ (↑p).edges → (SimpleGraph.Walk.cons h ↑p).IsCycle

theorem SimpleGraph.Walk.IsPath.length_eq_one_of_mem_edges E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsPath → s(u, v) ∈ p.edges → p.length = 1

theorem SimpleGraph.Walk.IsPath.disjoint_edges_of_disjoint_support E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v} {q : G.Walk v u},
  p.IsPath → p.support.tail.Disjoint q.support.tail → p.length ≠ 1 → p.edges.Disjoint q.edges

theorem SimpleGraph.Walk.IsPath.isCycle_append E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v} {q : G.Walk v u},
  p.IsPath → q.IsPath → p.support.tail.Disjoint q.support.tail → 1 < p.length ∨ 1 < q.length → (p.append q).IsCycle

theorem SimpleGraph.Walk.IsPath.exists_isCycle_of_ne E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p q : G.Walk u v},
  p.IsPath → q.IsPath → p ≠ q → ∃ u' v' p' q', p'.IsSubwalk p ∧ q'.IsSubwalk q ∧ (p'.append q'.reverse).IsCycle

Given two distinct paths with the same endpoints, we can extract a subwalk from each such that their concatenation, with one reversed, forms a cycle.

theorem SimpleGraph.Walk.IsPath.exists_isCycle_sublist_of_ne E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p q : G.Walk u v},
  p.IsPath →
    q.IsPath →
      p ≠ q → ∃ w ∈ p.support, w ∈ q.support ∧ ∃ c, c.IsCycle ∧ c.support.Sublist (p.support ++ q.support.reverse.tail)

Given two distinct paths, p and q, with same endpoints, we can extract a cycle whose support is a sublist of p.support ++ q.support.reverse.tail.

theorem SimpleGraph.Walk.IsPath.exists_isCycle_length_le_add_of_ne E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p q : G.Walk u v},
  p.IsPath → q.IsPath → p ≠ q → ∃ w ∈ p.support, w ∈ q.support ∧ ∃ c, c.IsCycle ∧ c.length ≤ p.length + q.length

Given two distinct paths with same endpoints, we can extract a cycle whose length is less than or equal to the sum of their lengths.

def SimpleGraph.Walk.bypass E1 #

{V : Type u} → {G : SimpleGraph V} → [DecidableEq V] → {u v : V} → G.Walk u v → G.Walk u v

Given a walk, produces a walk from it by bypassing subwalks between repeated vertices. The result is a path, as shown in SimpleGraph.Walk.bypass_isPath. This is packaged up in SimpleGraph.Walk.toPath.

theorem SimpleGraph.Walk.bypass_copy E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] {u' v' : V} (p : G.Walk u v) (hu : u = u')
  (hv : v = v'), (p.copy hu hv).bypass = p.bypass.copy hu hv

theorem SimpleGraph.Walk.bypass_isPath E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] (p : G.Walk u v), p.bypass.IsPath

def SimpleGraph.Walk.toPath E1 #

{V : Type u} → {G : SimpleGraph V} → {u v : V} → [DecidableEq V] → G.Walk u v → G.Path u v

Given a walk, produces a path with the same endpoints using SimpleGraph.Walk.bypass.

theorem SimpleGraph.Walk.support_bypass_sublist_support E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] (p : G.Walk u v), p.bypass.support.Sublist p.support

theorem SimpleGraph.Walk.support_bypass_subset_support E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] (p : G.Walk u v), p.bypass.support ⊆ p.support

theorem SimpleGraph.Walk.support_toPath_subset_support E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] (p : G.Walk u v), (↑p.toPath).support ⊆ p.support

theorem SimpleGraph.Walk.darts_bypass_sublist_darts E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] (p : G.Walk u v), p.bypass.darts.Sublist p.darts

theorem SimpleGraph.Walk.darts_bypass_subset_darts E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] (p : G.Walk u v), p.bypass.darts ⊆ p.darts

theorem SimpleGraph.Walk.edges_bypass_sublist_edges E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] (p : G.Walk u v), p.bypass.edges.Sublist p.edges

theorem SimpleGraph.Walk.edges_bypass_subset_edges E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] (p : G.Walk u v), p.bypass.edges ⊆ p.edges

theorem SimpleGraph.Walk.length_bypass_le_length E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] (p : G.Walk u v), p.bypass.length ≤ p.length

theorem SimpleGraph.Walk.length_le_bypass_length_iff E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] (p : G.Walk u v),
  p.length ≤ p.bypass.length ↔ p.bypass = p

theorem SimpleGraph.Walk.bypass_cons_nil E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] (hadj : G.Adj u v),
  (SimpleGraph.Walk.cons hadj SimpleGraph.Walk.nil).bypass = SimpleGraph.Walk.cons hadj SimpleGraph.Walk.nil

theorem SimpleGraph.Walk.nil_bypass E0 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} [inst : DecidableEq V] (p : G.Walk u u), p.bypass.Nil

theorem SimpleGraph.Walk.IsPath.bypass_eq_self E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] {p : G.Walk u v}, p.IsPath → p.bypass = p

theorem SimpleGraph.Walk.bypass_eq_self_iff_isPath E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] {p : G.Walk u v}, p.bypass = p ↔ p.IsPath

theorem SimpleGraph.Walk.darts_toPath_subset_darts E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] (p : G.Walk u v), (↑p.toPath).darts ⊆ p.darts

theorem SimpleGraph.Walk.edges_toPath_subset_edges E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] (p : G.Walk u v), (↑p.toPath).edges ⊆ p.edges

def SimpleGraph.Walk.cycleBypass E1 #

{V : Type u} → {G : SimpleGraph V} → {v : V} → [DecidableEq V] → G.Walk v v → G.Walk v v

Bypass repeated vertices like Walk.bypass, except the starting vertex.

This is intended to be used for closed walks, for which Walk.bypass unhelpfully returns the empty walk.

theorem SimpleGraph.Walk.cycleBypass_nil E0 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [inst : DecidableEq V],
  SimpleGraph.Walk.nil.cycleBypass = SimpleGraph.Walk.nil

theorem SimpleGraph.Walk.support_cycleBypass_sublist_support E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [inst : DecidableEq V] (w : G.Walk v v),
  w.cycleBypass.support.Sublist w.support

theorem SimpleGraph.Walk.darts_cycleBypass_sublist_darts E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [inst : DecidableEq V] (w : G.Walk v v), w.cycleBypass.darts.Sublist w.darts

theorem SimpleGraph.Walk.edges_cycleBypass_sublist_edges E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [inst : DecidableEq V] (w : G.Walk v v), w.cycleBypass.edges.Sublist w.edges

theorem SimpleGraph.Walk.edges_cycleBypass_subset_edges E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [inst : DecidableEq V] (w : G.Walk v v), w.cycleBypass.edges ⊆ w.edges

theorem SimpleGraph.Walk.length_cycleBypass_le_length E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [inst : DecidableEq V] (w : G.Walk v v), w.cycleBypass.length ≤ w.length

theorem SimpleGraph.Walk.IsCircuit.isCycle_cycleBypass E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [inst : DecidableEq V] {w : G.Walk v v}, w.IsCircuit → w.cycleBypass.IsCycle

theorem SimpleGraph.Walk.IsTrail.isCycle_cycleBypass E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [inst : DecidableEq V] {w : G.Walk v v},
  w ≠ SimpleGraph.Walk.nil → w.IsTrail → w.cycleBypass.IsCycle

theorem SimpleGraph.Walk.cycleBypass_eq_self_iff_length_le E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [inst : DecidableEq V] (w : G.Walk v v),
  w.cycleBypass = w ↔ w.length ≤ w.cycleBypass.length

theorem SimpleGraph.Walk.IsCycle.cycleBypass_eq_self E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [inst : DecidableEq V] {w : G.Walk v v}, w.IsCycle → w.cycleBypass = w

theorem SimpleGraph.Walk.IsTrail.cycleBypass_eq_self_iff_isCycle_or_nil E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [inst : DecidableEq V] {w : G.Walk v v},
  w.IsTrail → (w.cycleBypass = w ↔ w.IsCycle ∨ w.Nil)

theorem SimpleGraph.Walk.IsCircuit.cycleBypass_eq_self_iff_isCycle E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [inst : DecidableEq V] {w : G.Walk v v},
  w.IsCircuit → (w.cycleBypass = w ↔ w.IsCycle)

theorem SimpleGraph.Walk.IsTrail.length_cycleBypass_lt_iff_not_isCycle_and_not_nil E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [inst : DecidableEq V] {w : G.Walk v v},
  w.IsTrail → (w.cycleBypass.length < w.length ↔ ¬w.IsCycle ∧ ¬w.Nil)

theorem SimpleGraph.Walk.IsCircuit.length_cycleBypass_lt_iff_not_isCycle E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [inst : DecidableEq V] {w : G.Walk v v},
  w.IsCircuit → (w.cycleBypass.length < w.length ↔ ¬w.IsCycle)

theorem SimpleGraph.Walk.exists_minimalFor_isCircuit_length E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V},
  (∃ p, p.IsCircuit) → ∃ p, MinimalFor SimpleGraph.Walk.IsCircuit SimpleGraph.Walk.length p

theorem SimpleGraph.Walk.exists_minimalFor_isCycle_length E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V},
  (∃ p, p.IsCircuit) → ∃ p, MinimalFor SimpleGraph.Walk.IsCycle SimpleGraph.Walk.length p

theorem SimpleGraph.Walk.exists_isCycle_forall_isCircuit_length_le_length E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V},
  (∃ p, p.IsCircuit) → ∃ p, p.IsCycle ∧ ∀ (p' : G.Walk v v), p'.IsCircuit → p.length ≤ p'.length

For every vertex that lies on some circuit there exists a shortest cycle among circuits containing that vertex.

For circuits not fixed to a specific vertex use exists_girth_eq_length and IsCircuit.girth_le_length.

theorem SimpleGraph.Walk.IsTrail.of_map E1 #

∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} {f : G →g G'} {u v : V} {p : G.Walk u v},
  (SimpleGraph.Walk.map f p).IsTrail → p.IsTrail

theorem SimpleGraph.Walk.isTrail_map_iff_of_injective E1 #

∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} {f : G →g G'} {u v : V} {p : G.Walk u v},
  Function.Injective ⇑f → ((SimpleGraph.Walk.map f p).IsTrail ↔ p.IsTrail)

theorem SimpleGraph.Walk.IsTrail.map E1 #

∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} {f : G →g G'} {u v : V} {p : G.Walk u v},
  Function.Injective ⇑f → p.IsTrail → (SimpleGraph.Walk.map f p).IsTrail

Alias of the reverse direction of SimpleGraph.Walk.isTrail_map_iff_of_injective.

theorem SimpleGraph.Walk.IsPath.of_map E1 #

∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} {f : G →g G'} {u v : V} {p : G.Walk u v},
  (SimpleGraph.Walk.map f p).IsPath → p.IsPath

theorem SimpleGraph.Walk.isPath_map_iff_of_injective E1 #

∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} {f : G →g G'} {u v : V} {p : G.Walk u v},
  Function.Injective ⇑f → ((SimpleGraph.Walk.map f p).IsPath ↔ p.IsPath)

theorem SimpleGraph.Walk.IsPath.map E1 #

∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} {f : G →g G'} {u v : V} {p : G.Walk u v},
  Function.Injective ⇑f → p.IsPath → (SimpleGraph.Walk.map f p).IsPath

Alias of the reverse direction of SimpleGraph.Walk.isPath_map_iff_of_injective.

theorem SimpleGraph.Walk.IsCircuit.of_map E1 #

∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} {f : G →g G'} {u : V} {p : G.Walk u u},
  (SimpleGraph.Walk.map f p).IsCircuit → p.IsCircuit

theorem SimpleGraph.Walk.isCircuit_map_iff_of_injective E1 #

∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} {f : G →g G'} {u : V} {p : G.Walk u u},
  Function.Injective ⇑f → ((SimpleGraph.Walk.map f p).IsCircuit ↔ p.IsCircuit)

theorem SimpleGraph.Walk.IsCircuit.map E1 #

∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} {f : G →g G'} {u : V} {p : G.Walk u u},
  Function.Injective ⇑f → p.IsCircuit → (SimpleGraph.Walk.map f p).IsCircuit

Alias of the reverse direction of SimpleGraph.Walk.isCircuit_map_iff_of_injective.

theorem SimpleGraph.Walk.IsCycle.of_map E1 #

∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} {f : G →g G'} {u : V} {p : G.Walk u u},
  (SimpleGraph.Walk.map f p).IsCycle → p.IsCycle

theorem SimpleGraph.Walk.isCycle_map_iff_of_injective E1 #

∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} {f : G →g G'} {u : V} {p : G.Walk u u},
  Function.Injective ⇑f → ((SimpleGraph.Walk.map f p).IsCycle ↔ p.IsCycle)

theorem SimpleGraph.Walk.IsCycle.map E1 #

∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} {f : G →g G'} {u : V} {p : G.Walk u u},
  Function.Injective ⇑f → p.IsCycle → (SimpleGraph.Walk.map f p).IsCycle

Alias of the reverse direction of SimpleGraph.Walk.isCycle_map_iff_of_injective.

theorem SimpleGraph.Walk.isTrail_mapLe E0 #

∀ {V : Type u} {G G' : SimpleGraph V} (h : G ≤ G') {u v : V} {p : G.Walk u v},
  (SimpleGraph.Walk.mapLe h p).IsTrail ↔ p.IsTrail

theorem SimpleGraph.Walk.IsTrail.of_mapLe E1 #

∀ {V : Type u} {G G' : SimpleGraph V} (h : G ≤ G') {u v : V} {p : G.Walk u v},
  (SimpleGraph.Walk.mapLe h p).IsTrail → p.IsTrail

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

theorem SimpleGraph.Walk.IsTrail.mapLe E1 #

∀ {V : Type u} {G G' : SimpleGraph V} (h : G ≤ G') {u v : V} {p : G.Walk u v},
  p.IsTrail → (SimpleGraph.Walk.mapLe h p).IsTrail

Alias of the reverse direction of SimpleGraph.Walk.isTrail_mapLe.

theorem SimpleGraph.Walk.isPath_mapLe E0 #

∀ {V : Type u} {G G' : SimpleGraph V} (h : G ≤ G') {u v : V} {p : G.Walk u v},
  (SimpleGraph.Walk.mapLe h p).IsPath ↔ p.IsPath

theorem SimpleGraph.Walk.IsPath.of_mapLe E1 #

∀ {V : Type u} {G G' : SimpleGraph V} (h : G ≤ G') {u v : V} {p : G.Walk u v},
  (SimpleGraph.Walk.mapLe h p).IsPath → p.IsPath

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

theorem SimpleGraph.Walk.IsPath.mapLe E1 #

∀ {V : Type u} {G G' : SimpleGraph V} (h : G ≤ G') {u v : V} {p : G.Walk u v},
  p.IsPath → (SimpleGraph.Walk.mapLe h p).IsPath

Alias of the reverse direction of SimpleGraph.Walk.isPath_mapLe.

theorem SimpleGraph.Walk.isCircuit_mapLe E0 #

∀ {V : Type u} {G G' : SimpleGraph V} (h : G ≤ G') {u : V} {p : G.Walk u u},
  (SimpleGraph.Walk.mapLe h p).IsCircuit ↔ p.IsCircuit

theorem SimpleGraph.Walk.IsCircuit.mapLe E1 #

∀ {V : Type u} {G G' : SimpleGraph V} (h : G ≤ G') {u : V} {p : G.Walk u u},
  p.IsCircuit → (SimpleGraph.Walk.mapLe h p).IsCircuit

Alias of the reverse direction of SimpleGraph.Walk.isCircuit_mapLe.

theorem SimpleGraph.Walk.IsCircuit.of_mapLe E1 #

∀ {V : Type u} {G G' : SimpleGraph V} (h : G ≤ G') {u : V} {p : G.Walk u u},
  (SimpleGraph.Walk.mapLe h p).IsCircuit → p.IsCircuit

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

theorem SimpleGraph.Walk.isCycle_mapLe E0 #

∀ {V : Type u} {G G' : SimpleGraph V} (h : G ≤ G') {u : V} {p : G.Walk u u},
  (SimpleGraph.Walk.mapLe h p).IsCycle ↔ p.IsCycle

theorem SimpleGraph.Walk.IsCycle.of_mapLe E1 #

∀ {V : Type u} {G G' : SimpleGraph V} (h : G ≤ G') {u : V} {p : G.Walk u u},
  (SimpleGraph.Walk.mapLe h p).IsCycle → p.IsCycle

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

theorem SimpleGraph.Walk.IsCycle.mapLe E1 #

∀ {V : Type u} {G G' : SimpleGraph V} (h : G ≤ G') {u : V} {p : G.Walk u u},
  p.IsCycle → (SimpleGraph.Walk.mapLe h p).IsCycle

Alias of the reverse direction of SimpleGraph.Walk.isCycle_mapLe.

def SimpleGraph.Path.map E3 #

{V : Type u} →
  {V' : Type v} →
    {G : SimpleGraph V} →
      {G' : SimpleGraph V'} → (f : G →g G') → Function.Injective ⇑f → {u v : V} → G.Path u v → G'.Path (f u) (f v)

Given an injective graph homomorphism, map paths to paths.

theorem SimpleGraph.Path.map_coe E0 #

∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} (f : G →g G') (hinj : Function.Injective ⇑f)
  {u v : V} (p : G.Path u v), ↑(SimpleGraph.Path.map f hinj p) = SimpleGraph.Walk.map f ↑p

theorem SimpleGraph.Path.map_injective E0 #

∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} {f : G →g G'} (hinj : Function.Injective ⇑f)
  (u v : V), Function.Injective (SimpleGraph.Path.map f hinj)

def SimpleGraph.Path.mapEmbedding E1 #

{V : Type u} →
  {V' : Type v} →
    {G : SimpleGraph V} → {G' : SimpleGraph V'} → (f : G ↪g G') → {u v : V} → G.Path u v → G'.Path (f u) (f v)

Given a graph embedding, map paths to paths.

theorem SimpleGraph.Path.mapEmbedding_coe E0 #

∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} (f : G ↪g G') {u v : V} (p : G.Path u v),
  ↑(SimpleGraph.Path.mapEmbedding f p) = SimpleGraph.Walk.map f.toHom ↑p

theorem SimpleGraph.Path.mapEmbedding_injective E1 #

∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} (f : G ↪g G') (u v : V),
  Function.Injective (SimpleGraph.Path.mapEmbedding f)

theorem SimpleGraph.Walk.isTrail_transfer E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {H : SimpleGraph V} {p : G.Walk u v} (h : ∀ e ∈ p.edges, e ∈ H.edgeSet),
  (p.transfer H h).IsTrail ↔ p.IsTrail

theorem SimpleGraph.Walk.IsTrail.transfer E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {H : SimpleGraph V} {p : G.Walk u v} (h : ∀ e ∈ p.edges, e ∈ H.edgeSet),
  p.IsTrail → (p.transfer H h).IsTrail

Alias of the reverse direction of SimpleGraph.Walk.isTrail_transfer.

theorem SimpleGraph.Walk.isPath_transfer E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {H : SimpleGraph V} {p : G.Walk u v} (h : ∀ e ∈ p.edges, e ∈ H.edgeSet),
  (p.transfer H h).IsPath ↔ p.IsPath

theorem SimpleGraph.Walk.IsPath.transfer E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {H : SimpleGraph V} {p : G.Walk u v} (h : ∀ e ∈ p.edges, e ∈ H.edgeSet),
  p.IsPath → (p.transfer H h).IsPath

Alias of the reverse direction of SimpleGraph.Walk.isPath_transfer.

theorem SimpleGraph.Walk.isCircuit_transfer E0 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} {H : SimpleGraph V} {p : G.Walk v v} (h : ∀ e ∈ p.edges, e ∈ H.edgeSet),
  (p.transfer H h).IsCircuit ↔ p.IsCircuit

theorem SimpleGraph.Walk.IsCircuit.transfer E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} {H : SimpleGraph V} {p : G.Walk v v} (h : ∀ e ∈ p.edges, e ∈ H.edgeSet),
  p.IsCircuit → (p.transfer H h).IsCircuit

Alias of the reverse direction of SimpleGraph.Walk.isCircuit_transfer.

theorem SimpleGraph.Walk.isCycle_transfer E0 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} {H : SimpleGraph V} {p : G.Walk v v} (h : ∀ e ∈ p.edges, e ∈ H.edgeSet),
  (p.transfer H h).IsCycle ↔ p.IsCycle

theorem SimpleGraph.Walk.IsCycle.transfer E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} {H : SimpleGraph V} {p : G.Walk v v} (h : ∀ e ∈ p.edges, e ∈ H.edgeSet),
  p.IsCycle → (p.transfer H h).IsCycle

Alias of the reverse direction of SimpleGraph.Walk.isCycle_transfer.

theorem SimpleGraph.Walk.isTrail_induce E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {s : Set V} {p : G.Walk u v} {hp : ∀ x ∈ p.support, x ∈ s},
  (SimpleGraph.Walk.induce s p hp).IsTrail ↔ p.IsTrail

theorem SimpleGraph.Walk.isPath_induce E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V} {s : Set V} {p : G.Walk u v} {hp : ∀ x ∈ p.support, x ∈ s},
  (SimpleGraph.Walk.induce s p hp).IsPath ↔ p.IsPath

theorem SimpleGraph.Walk.isCircuit_induce E0 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {s : Set V} {c : G.Walk u u} {hc : ∀ x ∈ c.support, x ∈ s},
  (SimpleGraph.Walk.induce s c hc).IsCircuit ↔ c.IsCircuit

theorem SimpleGraph.Walk.isCycle_induce E0 #

∀ {V : Type u} {G : SimpleGraph V} {u : V} {s : Set V} {c : G.Walk u u} {hc : ∀ x ∈ c.support, x ∈ s},
  (SimpleGraph.Walk.induce s c hc).IsCycle ↔ c.IsCycle

theorem SimpleGraph.Walk.IsPath.toDeleteEdges E1 #

∀ {V : Type u} (G : SimpleGraph V) {v w : V} (s : Set (Sym2 V)) {p : G.Walk v w},
  p.IsPath → ∀ (hp : ∀ e ∈ p.edges, e ∉ s), (SimpleGraph.Walk.toDeleteEdges s p hp).IsPath

theorem SimpleGraph.Walk.IsCycle.toDeleteEdges E1 #

∀ {V : Type u} (G : SimpleGraph V) {v : V} (s : Set (Sym2 V)) {p : G.Walk v v},
  p.IsCycle → ∀ (hp : ∀ e ∈ p.edges, e ∉ s), (SimpleGraph.Walk.toDeleteEdges s p hp).IsCycle

theorem SimpleGraph.Walk.toDeleteEdges_copy E0 #

∀ {V : Type u} (G : SimpleGraph V) {v u u' v' : V} (s : Set (Sym2 V)) (p : G.Walk u v) (hu : u = u') (hv : v = v')
  (h : ∀ e ∈ (p.copy hu hv).edges, e ∉ s),
  SimpleGraph.Walk.toDeleteEdges s (p.copy hu hv) h = (SimpleGraph.Walk.toDeleteEdges s p ⋯).copy hu hv

Deprecated aliases

NameNew nameSince
SimpleGraph.Walk.IsCycle.not_of_nilSimpleGraph.Walk.not_isCycle_nil2026-06-16
SimpleGraph.Walk.bypass_eq_self_of_length_leSimpleGraph.Walk.length_le_bypass_length_iff2026-05-25
SimpleGraph.Walk.bypass_eq_self_of_length_le_length_bypassSimpleGraph.Walk.length_le_bypass_length_iff2026-06-18
SimpleGraph.Walk.concat_isPath_iffSimpleGraph.Walk.isPath_concat2026-07-15
SimpleGraph.Walk.darts_bypass_subsetSimpleGraph.Walk.darts_bypass_subset_darts2026-05-25
SimpleGraph.Walk.darts_toPath_subsetSimpleGraph.Walk.darts_toPath_subset_darts2026-05-25
SimpleGraph.Walk.edges_bypass_subsetSimpleGraph.Walk.edges_bypass_subset_edges2026-05-25
SimpleGraph.Walk.edges_cycleBypass_subsetSimpleGraph.Walk.edges_cycleBypass_subset_edges2026-05-25
SimpleGraph.Walk.edges_toPath_subsetSimpleGraph.Walk.edges_toPath_subset_edges2026-05-25
SimpleGraph.Walk.isPath_iff_eq_nilSimpleGraph.Walk.isPath_iff_nil2026-06-01
SimpleGraph.Walk.length_bypass_leSimpleGraph.Walk.length_bypass_le_length2026-05-25
SimpleGraph.Walk.mapLe_isCycleSimpleGraph.Walk.isCycle_mapLe2026-06-16
SimpleGraph.Walk.mapLe_isPathSimpleGraph.Walk.isPath_mapLe2026-06-16
SimpleGraph.Walk.mapLe_isTrailSimpleGraph.Walk.isTrail_mapLe2026-06-16
SimpleGraph.Walk.map_isCycle_iff_of_injectiveSimpleGraph.Walk.isCycle_map_iff_of_injective2026-06-16
SimpleGraph.Walk.map_isPath_iff_of_injectiveSimpleGraph.Walk.isPath_map_iff_of_injective2026-06-16
SimpleGraph.Walk.map_isPath_of_injectiveSimpleGraph.Walk.IsPath.map2026-06-16
SimpleGraph.Walk.map_isTrail_iff_of_injectiveSimpleGraph.Walk.isTrail_map_iff_of_injective2026-06-16
SimpleGraph.Walk.map_isTrail_of_injectiveSimpleGraph.Walk.IsTrail.map2026-06-16
SimpleGraph.Walk.support_bypass_subsetSimpleGraph.Walk.support_bypass_subset_support2026-05-25
SimpleGraph.Walk.support_toPath_subsetSimpleGraph.Walk.support_toPath_subset_support2026-05-25