Skip to content

Commit 0ad288b

Browse files
committed
chore(SimpleGraph/Walk): clean-up outlier variable block (#29394)
This file uses `u`, `v` as the variable name for vertices almost everywhere. Get rid of this variable block and clean-up the few lemmas using it.
1 parent 81344ed commit 0ad288b

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

Mathlib/Combinatorics/SimpleGraph/Walk.lean

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,17 +1071,15 @@ lemma edge_firstDart (p : G.Walk v w) (hp : ¬ p.Nil) :
10711071
lemma edge_lastDart (p : G.Walk v w) (hp : ¬ p.Nil) :
10721072
(p.lastDart hp).edge = s(p.penultimate, w) := rfl
10731073

1074-
variable {x y : V} -- TODO: rename to u, v, w instead?
1075-
1076-
lemma cons_tail_eq (p : G.Walk x y) (hp : ¬ p.Nil) :
1074+
lemma cons_tail_eq (p : G.Walk u v) (hp : ¬ p.Nil) :
10771075
cons (p.adj_snd hp) p.tail = p := by
10781076
cases p with
10791077
| nil => simp at hp
10801078
| cons h q =>
10811079
simp only [getVert_cons_succ, tail_cons, cons_copy, copy_rfl_rfl]
10821080

10831081
@[simp]
1084-
lemma concat_dropLast (p : G.Walk x y) (hp : G.Adj p.penultimate y) :
1082+
lemma concat_dropLast (p : G.Walk u v) (hp : G.Adj p.penultimate v) :
10851083
p.dropLast.concat hp = p := by
10861084
induction p with
10871085
| nil => simp at hp
@@ -1090,23 +1088,23 @@ lemma concat_dropLast (p : G.Walk x y) (hp : G.Adj p.penultimate y) :
10901088
| nil => rfl
10911089
| _ => simp [hind]
10921090

1093-
@[simp] lemma cons_support_tail (p : G.Walk x y) (hp : ¬p.Nil) :
1094-
x :: p.tail.support = p.support := by
1091+
@[simp] lemma cons_support_tail (p : G.Walk u v) (hp : ¬p.Nil) :
1092+
u :: p.tail.support = p.support := by
10951093
rw [← support_cons, cons_tail_eq _ hp]
10961094

1097-
@[simp] lemma length_tail_add_one {p : G.Walk x y} (hp : ¬ p.Nil) :
1095+
@[simp] lemma length_tail_add_one {p : G.Walk u v} (hp : ¬ p.Nil) :
10981096
p.tail.length + 1 = p.length := by
10991097
rw [← length_cons, cons_tail_eq _ hp]
11001098

11011099
protected lemma Nil.tail {p : G.Walk v w} (hp : p.Nil) : p.tail.Nil := by cases p <;> aesop
11021100

11031101
lemma not_nil_of_tail_not_nil {p : G.Walk v w} (hp : ¬ p.tail.Nil) : ¬ p.Nil := mt Nil.tail hp
11041102

1105-
@[simp] lemma nil_copy {x' y' : V} {p : G.Walk x y} (hx : x = x') (hy : y = y') :
1106-
(p.copy hx hy).Nil = p.Nil := by
1103+
@[simp] lemma nil_copy {u' v' : V} {p : G.Walk u v} (hu : u = u') (hv : v = v') :
1104+
(p.copy hu hv).Nil = p.Nil := by
11071105
subst_vars; rfl
11081106

1109-
@[simp] lemma support_tail (p : G.Walk v v) (hp : ¬ p.Nil) :
1107+
@[simp] lemma support_tail (p : G.Walk u u) (hp : ¬ p.Nil) :
11101108
p.tail.support = p.support.tail := by
11111109
rw [← cons_support_tail p hp, List.tail_cons]
11121110

0 commit comments

Comments
 (0)