Skip to content

Commit 40fb44f

Browse files
committed
feat(Combinatorics/SimpleGraph/Walk): a vertex of a walk is in its tail starting from the second vertex onwards (#31119)
Add helper theorems for #29309
1 parent 5efcabc commit 40fb44f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Mathlib/Combinatorics/SimpleGraph/Walk.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,9 @@ abbrev snd (p : G.Walk u v) : V := p.getVert 1
948948
lemma snd_cons {u v w} (q : G.Walk v w) (hadj : G.Adj u v) :
949949
(q.cons hadj).snd = v := by simp
950950

951+
lemma snd_mem_tail_support {u v : V} {p : G.Walk u v} (h : ¬p.Nil) : p.snd ∈ p.support.tail :=
952+
p.notNilRec (by simp) h
953+
951954
/-- The walk obtained by taking the first `n` darts of a walk. -/
952955
def take {u v : V} (p : G.Walk u v) (n : ℕ) : G.Walk u (p.getVert n) :=
953956
match p, n with
@@ -1141,6 +1144,12 @@ theorem exists_boundary_dart {u v : V} (p : G.Walk u v) (S : Set V) (uS : u ∈
11411144
p.tail.getVert n = p.getVert (n + 1) := by
11421145
cases p <;> simp
11431146

1147+
lemma getVert_mem_tail_support {u v : V} {p : G.Walk u v} (hp : ¬p.Nil) :
1148+
∀ {i : ℕ}, i ≠ 0 → p.getVert i ∈ p.support.tail
1149+
| i + 1, _ => by
1150+
rw [← getVert_tail, ← p.support_tail_of_not_nil hp]
1151+
exact getVert_mem_support ..
1152+
11441153
lemma ext_support {u v} {p q : G.Walk u v} (h : p.support = q.support) :
11451154
p = q := by
11461155
induction q with

0 commit comments

Comments
 (0)