@@ -824,6 +824,23 @@ theorem nodup_tail_support_reverse {u : V} {p : G.Walk u u} :
824824 ← getVert_eq_support_getElem? _ (by rw [Walk.length_support]; cutsat)]
825825 aesop
826826
827+ theorem edges_eq_zipWith_support {u v : V} {p : G.Walk u v} :
828+ p.edges = List.zipWith (s(·, ·)) p.support p.support.tail := by
829+ induction p with
830+ | nil => simp
831+ | cons _ p' ih => cases p' <;> simp [edges_cons, ih]
832+
833+ theorem darts_getElem_eq_getVert {u v : V} {p : G.Walk u v} (n : ℕ) (h : n < p.darts.length) :
834+ p.darts[n] = ⟨⟨p.getVert n, p.getVert (n + 1 )⟩, p.adj_getVert_succ (p.length_darts ▸ h)⟩ := by
835+ rw [p.length_darts] at h
836+ ext
837+ · simp only [p.getVert_eq_support_getElem (le_of_lt h)]
838+ by_cases h' : n = 0
839+ · simp [h', List.getElem_zero]
840+ · have := p.isChain_dartAdj_darts.getElem (n - 1 ) (by grind)
841+ grind [DartAdj, =_ cons_map_snd_darts]
842+ · simp [p.getVert_eq_support_getElem h, ← p.cons_map_snd_darts]
843+
827844theorem edges_injective {u v : V} : Function.Injective (Walk.edges : G.Walk u v → List (Sym2 V))
828845 | .nil, .nil, _ => rfl
829846 | .nil, .cons _ _, h => by simp at h
@@ -1103,6 +1120,15 @@ lemma edge_firstDart (p : G.Walk v w) (hp : ¬ p.Nil) :
11031120lemma edge_lastDart (p : G.Walk v w) (hp : ¬ p.Nil) :
11041121 (p.lastDart hp).edge = s(p.penultimate, w) := rfl
11051122
1123+ theorem firstDart_eq {p : G.Walk v w} (h₁ : ¬ p.Nil) (h₂ : 0 < p.darts.length) :
1124+ p.firstDart h₁ = p.darts[0 ] := by
1125+ simp [Dart.ext_iff, firstDart_toProd, darts_getElem_eq_getVert]
1126+
1127+ theorem lastDart_eq {p : G.Walk v w} (h₁ : ¬ p.Nil) (h₂ : 0 < p.darts.length) :
1128+ p.lastDart h₁ = p.darts[p.darts.length - 1 ] := by
1129+ simp (disch := grind) [Dart.ext_iff, lastDart_toProd, darts_getElem_eq_getVert,
1130+ p.getVert_of_length_le]
1131+
11061132lemma cons_tail_eq (p : G.Walk u v) (hp : ¬ p.Nil) :
11071133 cons (p.adj_snd hp) p.tail = p := by
11081134 cases p with
@@ -1556,3 +1582,5 @@ lemma isSubwalk_antisymm {u v} {p₁ p₂ : G.Walk u v} (h₁ : p₁.IsSubwalk p
15561582end Walk
15571583
15581584end SimpleGraph
1585+
1586+ set_option linter.style.longFile 1700
0 commit comments