@@ -95,6 +95,9 @@ theorem length_nil {u : V} : (nil : G.Walk u u).length = 0 := rfl
9595theorem length_cons {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
9696 (cons h p).length = p.length + 1 := rfl
9797
98+ theorem _root_.SimpleGraph.Adj.length_toWalk (h : G.Adj u v) : h.toWalk.length = 1 := by
99+ simp
100+
98101theorem eq_of_length_eq_zero {u v : V} : ∀ {p : G.Walk u v}, p.length = 0 → u = v
99102 | nil, _ => rfl
100103
@@ -135,6 +138,9 @@ theorem support_nil {u : V} : (nil : G.Walk u u).support = [u] := rfl
135138theorem support_cons {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
136139 (cons h p).support = u :: p.support := rfl
137140
141+ theorem _root_.SimpleGraph.Adj.support_toWalk (h : G.Adj u v) : h.toWalk.support = [u, v] :=
142+ rfl
143+
138144@[simp]
139145theorem support_ne_nil {u v : V} (p : G.Walk u v) : p.support ≠ [] := by cases p <;> simp
140146
@@ -225,6 +231,9 @@ theorem darts_nil {u : V} : (nil : G.Walk u u).darts = [] := rfl
225231theorem darts_cons {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
226232 (cons h p).darts = ⟨(u, v), h⟩ :: p.darts := rfl
227233
234+ theorem _root_.SimpleGraph.Adj.darts_toWalk (h : G.Adj u v) : h.toWalk.darts = [⟨(u, v), h⟩] :=
235+ rfl
236+
228237theorem cons_map_snd_darts {u v : V} (p : G.Walk u v) : (u :: p.darts.map (·.snd)) = p.support := by
229238 induction p <;> simp [*]
230239
@@ -245,6 +254,9 @@ theorem edges_nil {u : V} : (nil : G.Walk u u).edges = [] := rfl
245254theorem edges_cons {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
246255 (cons h p).edges = s(u, v) :: p.edges := rfl
247256
257+ theorem _root_.SimpleGraph.Adj.edges_toWalk (h : G.Adj u v) : h.toWalk.edges = [s(u, v)] :=
258+ rfl
259+
248260@ [simp, grind =]
249261theorem length_support {u v : V} (p : G.Walk u v) : p.support.length = p.length + 1 := by
250262 induction p <;> simp [*]
@@ -499,10 +511,11 @@ def ofDarts (l : List G.Dart) (hne : l ≠ []) (hchain : l.IsChain G.DartAdj) :
499511 | d₁ :: d₂ :: l =>
500512 .cons (hchain.rel ▸ d₁.adj) <| ofDarts (d₂ :: l) (l.cons_ne_nil d₂) hchain.of_cons
501513
502- variable (G) in
503514@[simp]
504- theorem ofDarts_singleton (d : G.Dart) :
505- ofDarts [d] ([].cons_ne_nil d) (.singleton d) = .cons d.adj .nil :=
515+ theorem ofDarts_singleton (d : G.Dart) : ofDarts [d] (by simp) (by simp) = .cons d.adj .nil :=
516+ rfl
517+
518+ theorem ofDarts_singleton' (d : G.Dart) : ofDarts [d] (by simp) (by simp) = d.adj.toWalk :=
506519 rfl
507520
508521@[simp]
0 commit comments