l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem append_nil {u v : V} (p : G.Walk u v) : p.append nil = p := by
  induction p with
  

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
⊢ append nil nil = nil

Next tactic:
| nil => rfl
@[simp]
theorem append_nil {u v : V} (p : G.Walk u v) : p.append nil = p := by
  induction p with
  | nil => 

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
⊢ append nil nil = nil

Next tactic:
rfl
@[simp]
theorem append_nil {u v : V} (p : G.Walk u v) : p.append nil = p := by
  induction p with
  | nil => rfl
  

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : append p✝ nil = p✝
⊢ append (cons h✝ p✝) nil = cons h✝ p✝

Next tactic:
| cons _ _ ih => rw [cons_append, ih]
@[simp]
theorem append_nil {u v : V} (p : G.Walk u v) : p.append nil = p := by
  induction p with
  | nil => rfl
  | cons _ _ ih => 

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : append p✝ nil = p✝
⊢ append (cons h✝ p✝) nil = cons h✝ p✝

Next tactic:
rw [cons_append, ih]
theorem append_assoc {u v w x : V} (p : G.Walk u v) (q : G.Walk v w) (r : G.Walk w x) :
    p.append (q.append r) = (p.append q).append r := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
p : Walk G u v
q : Walk G v w
r : Walk G w x
⊢ append p (append q r) = append (append p q) r

Next tactic:
induction p with
  | nil => rfl
  | cons h p' ih =>
    dsimp only [append]
    rw [ih]
theorem append_assoc {u v w x : V} (p : G.Walk u v) (q : G.Walk v w) (r : G.Walk w x) :
    p.append (q.append r) = (p.append q).append r := by
  induction p with
  

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ : V
q : Walk G u✝ w
⊢ append nil (append q r) = append (append nil q) r

Next tactic:
| nil => rfl
theorem append_assoc {u v w x : V} (p : G.Walk u v) (q : G.Walk v w) (r : G.Walk w x) :
    p.append (q.append r) = (p.append q).append r := by
  induction p with
  | nil => 

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ : V
q : Walk G u✝ w
⊢ append nil (append q r) = append (append nil q) r

Next tactic:
rfl
theorem append_assoc {u v w x : V} (p : G.Walk u v) (q : G.Walk v w) (r : G.Walk w x) :
    p.append (q.append r) = (p.append q).append r := by
  induction p with
  | nil => rfl
  

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ v✝ w✝ : V
h : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : ∀ (q : Walk G w✝ w), append p' (append q r) = append (append p' q) r
q : Walk G w✝ w
⊢ append (cons h p') (append q r) = append (append (cons h p') q) r

Next tactic:
| cons h p' ih =>
    dsimp only [append]
    rw [ih]
theorem append_assoc {u v w x : V} (p : G.Walk u v) (q : G.Walk v w) (r : G.Walk w x) :
    p.append (q.append r) = (p.append q).append r := by
  induction p with
  | nil => rfl
  | cons h p' ih =>
    

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ v✝ w✝ : V
h : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : ∀ (q : Walk G w✝ w), append p' (append q r) = append (append p' q) r
q : Walk G w✝ w
⊢ append (cons h p') (append q r) = append (append (cons h p') q) r

Next tactic:
dsimp only [append]
theorem append_assoc {u v w x : V} (p : G.Walk u v) (q : G.Walk v w) (r : G.Walk w x) :
    p.append (q.append r) = (p.append q).append r := by
  induction p with
  | nil => rfl
  | cons h p' ih =>
    dsimp only [append]
    

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ v✝ w✝ : V
h : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : ∀ (q : Walk G w✝ w), append p' (append q r) = append (append p' q) r
q : Walk G w✝ w
⊢ cons h (append p' (append q r)) = cons h (append (append p' q) r)

Next tactic:
rw [ih]
@[simp]
theorem append_copy_copy {u v w u' v' w'} (p : G.Walk u v) (q : G.Walk v w)
    (hu : u = u') (hv : v = v') (hw : w = w') :
    (p.copy hu hv).append (q.copy hv hw) = (p.append q).copy hu hw := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u' v' w' : V
p : Walk G u v
q : Walk G v w
hu : u = u'
hv : v = v'
hw : w = w'
⊢ append (Walk.copy p hu hv) (Walk.copy q hv hw) = Walk.copy (append p q) hu hw

Next tactic:
subst_vars
@[simp]
theorem append_copy_copy {u v w u' v' w'} (p : G.Walk u v) (q : G.Walk v w)
    (hu : u = u') (hv : v = v') (hw : w = w') :
    (p.copy hu hv).append (q.copy hv hw) = (p.append q).copy hu hw := by
  subst_vars
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u' v' w' : V
p : Walk G u' v'
q : Walk G v' w'
⊢ append (Walk.copy p (_ : u' = u') (_ : v' = v')) (Walk.copy q (_ : v' = v') (_ : w' = w')) =
    Walk.copy (append p q) (_ : u' = u') (_ : w' = w')

Next tactic:
rfl
theorem concat_append {u v w x : V} (p : G.Walk u v) (h : G.Adj v w) (q : G.Walk w x) :
    (p.concat h).append q = p.append (cons h q) := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
p : Walk G u v
h : Adj G v w
q : Walk G w x
⊢ append (concat p h) q = append p (cons h q)

Next tactic:
rw [concat_eq_append, ← append_assoc, cons_nil_append]
/-- A non-trivial `cons` walk is representable as a `concat` walk. -/
theorem exists_cons_eq_concat {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
    ∃ (x : V) (q : G.Walk u x) (h' : G.Adj x w), cons h p = q.concat h' := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
h : Adj G u v
p : Walk G v w
⊢ ∃ x q, ∃ (h' : Adj G x w), cons h p = concat q h'

Next tactic:
induction p generalizing u with
  | nil => exact ⟨_, nil, h, rfl⟩
  | cons h' p ih =>
    obtain ⟨y, q, h'', hc⟩ := ih h'
    refine' ⟨y, cons h q, h'', _⟩
    rw [concat_cons, hc]
/-- A non-trivial `cons` walk is representable as a `concat` walk. -/
theorem exists_cons_eq_concat {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
    ∃ (x : V) (q : G.Walk u x) (h' : G.Adj x w), cons h p = q.concat h' := by
  induction p generalizing u with
  

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ u : V
h : Adj G u u✝
⊢ ∃ x q, ∃ (h' : Adj G x u✝), cons h nil = concat q h'

Next tactic:
| nil => exact ⟨_, nil, h, rfl⟩
/-- A non-trivial `cons` walk is representable as a `concat` walk. -/
theorem exists_cons_eq_concat {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
    ∃ (x : V) (q : G.Walk u x) (h' : G.Adj x w), cons h p = q.concat h' := by
  induction p generalizing u with
  | nil => 

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ u : V
h : Adj G u u✝
⊢ ∃ x q, ∃ (h' : Adj G x u✝), cons h nil = concat q h'

Next tactic:
exact ⟨_, nil, h, rfl⟩
/-- A non-trivial `cons` walk is representable as a `concat` walk. -/
theorem exists_cons_eq_concat {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
    ∃ (x : V) (q : G.Walk u x) (h' : G.Adj x w), cons h p = q.concat h' := by
  induction p generalizing u with
  | nil => exact ⟨_, nil, h, rfl⟩
  

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ v✝ w✝ : V
h' : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : ∀ {u : V} (h : Adj G u v✝), ∃ x q, ∃ (h' : Adj G x w✝), cons h p = concat q h'
u : V
h : Adj G u u✝
⊢ ∃ x q, ∃ (h'_1 : Adj G x w✝), cons h (cons h' p) = concat q h'_1

Next tactic:
| cons h' p ih =>
    obtain ⟨y, q, h'', hc⟩ := ih h'
    refine' ⟨y, cons h q, h'', _⟩
    rw [concat_cons, hc]
/-- A non-trivial `cons` walk is representable as a `concat` walk. -/
theorem exists_cons_eq_concat {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
    ∃ (x : V) (q : G.Walk u x) (h' : G.Adj x w), cons h p = q.concat h' := by
  induction p generalizing u with
  | nil => exact ⟨_, nil, h, rfl⟩
  | cons h' p ih =>
    

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ v✝ w✝ : V
h' : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : ∀ {u : V} (h : Adj G u v✝), ∃ x q, ∃ (h' : Adj G x w✝), cons h p = concat q h'
u : V
h : Adj G u u✝
⊢ ∃ x q, ∃ (h'_1 : Adj G x w✝), cons h (cons h' p) = concat q h'_1

Next tactic:
obtain ⟨y, q, h'', hc⟩ := ih h'
/-- A non-trivial `cons` walk is representable as a `concat` walk. -/
theorem exists_cons_eq_concat {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
    ∃ (x : V) (q : G.Walk u x) (h' : G.Adj x w), cons h p = q.concat h' := by
  induction p generalizing u with
  | nil => exact ⟨_, nil, h, rfl⟩
  | cons h' p ih =>
    obtain ⟨y, q, h'', hc⟩ := ih h'
    

Proof state:
case cons.intro.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ v✝ w✝ : V
h' : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : ∀ {u : V} (h : Adj G u v✝), ∃ x q, ∃ (h' : Adj G x w✝), cons h p = concat q h'
u : V
h : Adj G u u✝
y : V
q : Walk G u✝ y
h'' : Adj G y w✝
hc : cons h' p = concat q h''
⊢ ∃ x q, ∃ (h'_1 : Adj G x w✝), cons h (cons h' p) = concat q h'_1

Next tactic:
refine' ⟨y, cons h q, h'', _⟩
/-- A non-trivial `cons` walk is representable as a `concat` walk. -/
theorem exists_cons_eq_concat {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
    ∃ (x : V) (q : G.Walk u x) (h' : G.Adj x w), cons h p = q.concat h' := by
  induction p generalizing u with
  | nil => exact ⟨_, nil, h, rfl⟩
  | cons h' p ih =>
    obtain ⟨y, q, h'', hc⟩ := ih h'
    refine' ⟨y, cons h q, h'', _⟩
    

Proof state:
case cons.intro.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ v✝ w✝ : V
h' : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : ∀ {u : V} (h : Adj G u v✝), ∃ x q, ∃ (h' : Adj G x w✝), cons h p = concat q h'
u : V
h : Adj G u u✝
y : V
q : Walk G u✝ y
h'' : Adj G y w✝
hc : cons h' p = concat q h''
⊢ cons h (cons h' p) = concat (cons h q) h''

Next tactic:
rw [concat_cons, hc]
@[simp]
protected theorem append_reverseAux {u v w x : V}
    (p : G.Walk u v) (q : G.Walk v w) (r : G.Walk u x) :
    (p.append q).reverseAux r = q.reverseAux (p.reverseAux r) := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
p : Walk G u v
q : Walk G v w
r : Walk G u x
⊢ Walk.reverseAux (append p q) r = Walk.reverseAux q (Walk.reverseAux p r)

Next tactic:
induction p with
  | nil => rfl
  | cons h _ ih => exact ih q (cons (G.symm h) r)
@[simp]
protected theorem append_reverseAux {u v w x : V}
    (p : G.Walk u v) (q : G.Walk v w) (r : G.Walk u x) :
    (p.append q).reverseAux r = q.reverseAux (p.reverseAux r) := by
  induction p with
  

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x u✝ : V
q : Walk G u✝ w
r : Walk G u✝ x
⊢ Walk.reverseAux (append nil q) r = Walk.reverseAux q (Walk.reverseAux nil r)

Next tactic:
| nil => rfl
@[simp]
protected theorem append_reverseAux {u v w x : V}
    (p : G.Walk u v) (q : G.Walk v w) (r : G.Walk u x) :
    (p.append q).reverseAux r = q.reverseAux (p.reverseAux r) := by
  induction p with
  | nil => 

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x u✝ : V
q : Walk G u✝ w
r : Walk G u✝ x
⊢ Walk.reverseAux (append nil q) r = Walk.reverseAux q (Walk.reverseAux nil r)

Next tactic:
rfl
@[simp]
protected theorem append_reverseAux {u v w x : V}
    (p : G.Walk u v) (q : G.Walk v w) (r : G.Walk u x) :
    (p.append q).reverseAux r = q.reverseAux (p.reverseAux r) := by
  induction p with
  | nil => rfl
  

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x u✝ v✝ w✝ : V
h : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (q : Walk G w✝ w) (r : Walk G v✝ x), Walk.reverseAux (append p✝ q) r = Walk.reverseAux q (Walk.reverseAux p✝ r)
q : Walk G w✝ w
r : Walk G u✝ x
⊢ Walk.reverseAux (append (cons h p✝) q) r = Walk.reverseAux q (Walk.reverseAux (cons h p✝) r)

Next tactic:
| cons h _ ih => exact ih q (cons (G.symm h) r)
@[simp]
protected theorem append_reverseAux {u v w x : V}
    (p : G.Walk u v) (q : G.Walk v w) (r : G.Walk u x) :
    (p.append q).reverseAux r = q.reverseAux (p.reverseAux r) := by
  induction p with
  | nil => rfl
  | cons h _ ih => 

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x u✝ v✝ w✝ : V
h : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (q : Walk G w✝ w) (r : Walk G v✝ x), Walk.reverseAux (append p✝ q) r = Walk.reverseAux q (Walk.reverseAux p✝ r)
q : Walk G w✝ w
r : Walk G u✝ x
⊢ Walk.reverseAux (append (cons h p✝) q) r = Walk.reverseAux q (Walk.reverseAux (cons h p✝) r)

Next tactic:
exact ih q (cons (G.symm h) r)
@[simp]
protected theorem reverseAux_append {u v w x : V}
    (p : G.Walk u v) (q : G.Walk u w) (r : G.Walk w x) :
    (p.reverseAux q).append r = p.reverseAux (q.append r) := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
p : Walk G u v
q : Walk G u w
r : Walk G w x
⊢ append (Walk.reverseAux p q) r = Walk.reverseAux p (append q r)

Next tactic:
induction p with
  | nil => rfl
  | cons h _ ih => simp [ih (cons (G.symm h) q)]
@[simp]
protected theorem reverseAux_append {u v w x : V}
    (p : G.Walk u v) (q : G.Walk u w) (r : G.Walk w x) :
    (p.reverseAux q).append r = p.reverseAux (q.append r) := by
  induction p with
  

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ : V
q : Walk G u✝ w
⊢ append (Walk.reverseAux nil q) r = Walk.reverseAux nil (append q r)

Next tactic:
| nil => rfl
@[simp]
protected theorem reverseAux_append {u v w x : V}
    (p : G.Walk u v) (q : G.Walk u w) (r : G.Walk w x) :
    (p.reverseAux q).append r = p.reverseAux (q.append r) := by
  induction p with
  | nil => 

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ : V
q : Walk G u✝ w
⊢ append (Walk.reverseAux nil q) r = Walk.reverseAux nil (append q r)

Next tactic:
rfl
@[simp]
protected theorem reverseAux_append {u v w x : V}
    (p : G.Walk u v) (q : G.Walk u w) (r : G.Walk w x) :
    (p.reverseAux q).append r = p.reverseAux (q.append r) := by
  induction p with
  | nil => rfl
  

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ v✝ w✝ : V
h : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (q : Walk G v✝ w), append (Walk.reverseAux p✝ q) r = Walk.reverseAux p✝ (append q r)
q : Walk G u✝ w
⊢ append (Walk.reverseAux (cons h p✝) q) r = Walk.reverseAux (cons h p✝) (append q r)

Next tactic:
| cons h _ ih => simp [ih (cons (G.symm h) q)]
@[simp]
protected theorem reverseAux_append {u v w x : V}
    (p : G.Walk u v) (q : G.Walk u w) (r : G.Walk w x) :
    (p.reverseAux q).append r = p.reverseAux (q.append r) := by
  induction p with
  | nil => rfl
  | cons h _ ih => 

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ v✝ w✝ : V
h : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (q : Walk G v✝ w), append (Walk.reverseAux p✝ q) r = Walk.reverseAux p✝ (append q r)
q : Walk G u✝ w
⊢ append (Walk.reverseAux (cons h p✝) q) r = Walk.reverseAux (cons h p✝) (append q r)

Next tactic:
simp [ih (cons (G.symm h) q)]
protected theorem reverseAux_eq_reverse_append {u v w : V} (p : G.Walk u v) (q : G.Walk u w) :
    p.reverseAux q = p.reverse.append q := by 

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G u w
⊢ Walk.reverseAux p q = append (reverse p) q

Next tactic:
simp [reverse]
@[simp]
theorem reverse_cons {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
    (cons h p).reverse = p.reverse.append (cons (G.symm h) nil) := by 

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
h : Adj G u v
p : Walk G v w
⊢ reverse (cons h p) = append (reverse p) (cons (_ : Adj G v u) nil)

Next tactic:
simp [reverse]
@[simp]
theorem reverse_copy {u v u' v'} (p : G.Walk u v) (hu : u = u') (hv : v = v') :
    (p.copy hu hv).reverse = p.reverse.copy hv hu := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u' v' : V
p : Walk G u v
hu : u = u'
hv : v = v'
⊢ reverse (Walk.copy p hu hv) = Walk.copy (reverse p) hv hu

Next tactic:
subst_vars
@[simp]
theorem reverse_copy {u v u' v'} (p : G.Walk u v) (hu : u = u') (hv : v = v') :
    (p.copy hu hv).reverse = p.reverse.copy hv hu := by
  subst_vars
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u' v' : V
p : Walk G u' v'
⊢ reverse (Walk.copy p (_ : u' = u') (_ : v' = v')) = Walk.copy (reverse p) (_ : v' = v') (_ : u' = u')

Next tactic:
rfl
@[simp]
theorem reverse_append {u v w : V} (p : G.Walk u v) (q : G.Walk v w) :
    (p.append q).reverse = q.reverse.append p.reverse := by 

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G v w
⊢ reverse (append p q) = append (reverse q) (reverse p)

Next tactic:
simp [reverse]
@[simp]
theorem reverse_concat {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
    (p.concat h).reverse = cons (G.symm h) p.reverse := by 

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
h : Adj G v w
⊢ reverse (concat p h) = cons (_ : Adj G w v) (reverse p)

Next tactic:
simp [concat_eq_append]
@[simp]
theorem reverse_reverse {u v : V} (p : G.Walk u v) : p.reverse.reverse = p := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ reverse (reverse p) = p

Next tactic:
induction p with
  | nil => rfl
  | cons _ _ ih => simp [ih]
@[simp]
theorem reverse_reverse {u v : V} (p : G.Walk u v) : p.reverse.reverse = p := by
  induction p with
  

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
⊢ reverse (reverse nil) = nil

Next tactic:
| nil => rfl
@[simp]
theorem reverse_reverse {u v : V} (p : G.Walk u v) : p.reverse.reverse = p := by
  induction p with
  | nil => 

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
⊢ reverse (reverse nil) = nil

Next tactic:
rfl
@[simp]
theorem reverse_reverse {u v : V} (p : G.Walk u v) : p.reverse.reverse = p := by
  induction p with
  | nil => rfl
  

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : reverse (reverse p✝) = p✝
⊢ reverse (reverse (cons h✝ p✝)) = cons h✝ p✝

Next tactic:
| cons _ _ ih => simp [ih]
@[simp]
theorem reverse_reverse {u v : V} (p : G.Walk u v) : p.reverse.reverse = p := by
  induction p with
  | nil => rfl
  | cons _ _ ih => 

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : reverse (reverse p✝) = p✝
⊢ reverse (reverse (cons h✝ p✝)) = cons h✝ p✝

Next tactic:
simp [ih]
@[simp]
theorem length_copy {u v u' v'} (p : G.Walk u v) (hu : u = u') (hv : v = v') :
    (p.copy hu hv).length = p.length := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u' v' : V
p : Walk G u v
hu : u = u'
hv : v = v'
⊢ length (Walk.copy p hu hv) = length p

Next tactic:
subst_vars
@[simp]
theorem length_copy {u v u' v'} (p : G.Walk u v) (hu : u = u') (hv : v = v') :
    (p.copy hu hv).length = p.length := by
  subst_vars
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u' v' : V
p : Walk G u' v'
⊢ length (Walk.copy p (_ : u' = u') (_ : v' = v')) = length p

Next tactic:
rfl
@[simp]
theorem length_append {u v w : V} (p : G.Walk u v) (q : G.Walk v w) :
    (p.append q).length = p.length + q.length := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G v w
⊢ length (append p q) = length p + length q

Next tactic:
induction p with
  | nil => simp
  | cons _ _ ih => simp [ih, add_comm, add_left_comm, add_assoc]
@[simp]
theorem length_append {u v w : V} (p : G.Walk u v) (q : G.Walk v w) :
    (p.append q).length = p.length + q.length := by
  induction p with
  

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
q : Walk G u✝ w
⊢ length (append nil q) = length nil + length q

Next tactic:
| nil => simp
@[simp]
theorem length_append {u v w : V} (p : G.Walk u v) (q : G.Walk v w) :
    (p.append q).length = p.length + q.length := by
  induction p with
  | nil => 

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
q : Walk G u✝ w
⊢ length (append nil q) = length nil + length q

Next tactic:
simp
@[simp]
theorem length_append {u v w : V} (p : G.Walk u v) (q : G.Walk v w) :
    (p.append q).length = p.length + q.length := by
  induction p with
  | nil => simp
  

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (q : Walk G w✝ w), length (append p✝ q) = length p✝ + length q
q : Walk G w✝ w
⊢ length (append (cons h✝ p✝) q) = length (cons h✝ p✝) + length q

Next tactic:
| cons _ _ ih => simp [ih, add_comm, add_left_comm, add_assoc]
@[simp]
theorem length_append {u v w : V} (p : G.Walk u v) (q : G.Walk v w) :
    (p.append q).length = p.length + q.length := by
  induction p with
  | nil => simp
  | cons _ _ ih => 

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (q : Walk G w✝ w), length (append p✝ q) = length p✝ + length q
q : Walk G w✝ w
⊢ length (append (cons h✝ p✝) q) = length (cons h✝ p✝) + length q

Next tactic:
simp [ih, add_comm, add_left_comm, add_assoc]
@[simp]
protected theorem length_reverseAux {u v w : V} (p : G.Walk u v) (q : G.Walk u w) :
    (p.reverseAux q).length = p.length + q.length := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G u w
⊢ length (Walk.reverseAux p q) = length p + length q

Next tactic:
induction p with
  | nil => simp!
  | cons _ _ ih => simp [ih, Nat.add_succ, Nat.succ_add]
@[simp]
protected theorem length_reverseAux {u v w : V} (p : G.Walk u v) (q : G.Walk u w) :
    (p.reverseAux q).length = p.length + q.length := by
  induction p with
  

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
q : Walk G u✝ w
⊢ length (Walk.reverseAux nil q) = length nil + length q

Next tactic:
| nil => simp!