l3lab/ntp-mathlib huggingface dataset:
@[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
  | 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 (Walk.reverseAux nil q) = length nil + length q

Next tactic:
simp!
@[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
  | 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 v✝ w), length (Walk.reverseAux p✝ q) = length p✝ + length q
q : Walk G u✝ w
⊢ length (Walk.reverseAux (cons h✝ p✝) q) = length (cons h✝ p✝) + length q

Next tactic:
| 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
  | 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 v✝ w), length (Walk.reverseAux p✝ q) = length p✝ + length q
q : Walk G u✝ w
⊢ length (Walk.reverseAux (cons h✝ p✝) q) = length (cons h✝ p✝) + length q

Next tactic:
simp [ih, Nat.add_succ, Nat.succ_add]
@[simp]
theorem length_reverse {u v : V} (p : G.Walk u v) : p.reverse.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 : V
p : Walk G u v
⊢ length (reverse p) = length p

Next tactic:
simp [reverse]
@[simp]
theorem exists_length_eq_zero_iff {u v : V} : (∃ p : G.Walk u v, p.length = 0) ↔ u = v := 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, length p = 0) ↔ u = v

Next tactic:
constructor
@[simp]
theorem exists_length_eq_zero_iff {u v : V} : (∃ p : G.Walk u v, p.length = 0) ↔ u = v := by
  constructor
  · 

Proof state:
case mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
⊢ (∃ p, length p = 0) → u = v

Next tactic:
rintro ⟨p, hp⟩
@[simp]
theorem exists_length_eq_zero_iff {u v : V} : (∃ p : G.Walk u v, p.length = 0) ↔ u = v := by
  constructor
  · rintro ⟨p, hp⟩
    

Proof state:
case mp.intro
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
hp : length p = 0
⊢ u = v

Next tactic:
exact eq_of_length_eq_zero hp
@[simp]
theorem exists_length_eq_zero_iff {u v : V} : (∃ p : G.Walk u v, p.length = 0) ↔ u = v := by
  constructor
  · rintro ⟨p, hp⟩
    exact eq_of_length_eq_zero hp
  · 

Proof state:
case mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
⊢ u = v → ∃ p, length p = 0

Next tactic:
rintro rfl
@[simp]
theorem exists_length_eq_zero_iff {u v : V} : (∃ p : G.Walk u v, p.length = 0) ↔ u = v := by
  constructor
  · rintro ⟨p, hp⟩
    exact eq_of_length_eq_zero hp
  · rintro rfl
    

Proof state:
case mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
⊢ ∃ p, length p = 0

Next tactic:
exact ⟨nil, rfl⟩
@[simp]
theorem length_eq_zero_iff {u : V} {p : G.Walk u u} : p.length = 0 ↔ p = nil := by 

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
p : Walk G u u
⊢ length p = 0 ↔ p = nil

Next tactic:
cases p
@[simp]
theorem length_eq_zero_iff {u : V} {p : G.Walk u u} : p.length = 0 ↔ p = nil := by cases p <;> 

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
⊢ length nil = 0 ↔ nil = nil

Next tactic:
simp
@[simp]
theorem length_eq_zero_iff {u : V} {p : G.Walk u u} : p.length = 0 ↔ p = nil := by cases p <;> 

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

Next tactic:
simp
@[simp]
theorem concatRec_concat {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
    @concatRec _ _ motive @Hnil @Hconcat _ _ (p.concat h) =
      Hconcat p h (concatRec @Hnil @Hconcat p) := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ concatRec Hnil Hconcat (concat p h) = Hconcat p h (concatRec Hnil Hconcat p)

Next tactic:
simp only [concatRec]
@[simp]
theorem concatRec_concat {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
    @concatRec _ _ motive @Hnil @Hconcat _ _ (p.concat h) =
      Hconcat p h (concatRec @Hnil @Hconcat p) := by
  simp only [concatRec]
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ (_ : reverse (reverse (concat p h)) = concat p h) ▸ concatRecAux Hnil Hconcat (reverse (concat p h)) =
    Hconcat p h ((_ : reverse (reverse p) = p) ▸ concatRecAux Hnil Hconcat (reverse p))

Next tactic:
apply eq_of_heq
@[simp]
theorem concatRec_concat {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
    @concatRec _ _ motive @Hnil @Hconcat _ _ (p.concat h) =
      Hconcat p h (concatRec @Hnil @Hconcat p) := by
  simp only [concatRec]
  apply eq_of_heq
  

Proof state:
case h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ HEq ((_ : reverse (reverse (concat p h)) = concat p h) ▸ concatRecAux Hnil Hconcat (reverse (concat p h)))
    (Hconcat p h ((_ : reverse (reverse p) = p) ▸ concatRecAux Hnil Hconcat (reverse p)))

Next tactic:
apply rec_heq_of_heq
@[simp]
theorem concatRec_concat {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
    @concatRec _ _ motive @Hnil @Hconcat _ _ (p.concat h) =
      Hconcat p h (concatRec @Hnil @Hconcat p) := by
  simp only [concatRec]
  apply eq_of_heq
  apply rec_heq_of_heq
  

Proof state:
case h.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ HEq (concatRecAux Hnil Hconcat (reverse (concat p h)))
    (Hconcat p h ((_ : reverse (reverse p) = p) ▸ concatRecAux Hnil Hconcat (reverse p)))

Next tactic:
trans concatRecAux @Hnil @Hconcat (cons h.symm p.reverse)
@[simp]
theorem concatRec_concat {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
    @concatRec _ _ motive @Hnil @Hconcat _ _ (p.concat h) =
      Hconcat p h (concatRec @Hnil @Hconcat p) := by
  simp only [concatRec]
  apply eq_of_heq
  apply rec_heq_of_heq
  trans concatRecAux @Hnil @Hconcat (cons h.symm p.reverse)
  · 

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ HEq (concatRecAux Hnil Hconcat (reverse (concat p h))) (concatRecAux Hnil Hconcat (cons (_ : Adj G w v) (reverse p)))

Next tactic:
congr
@[simp]
theorem concatRec_concat {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
    @concatRec _ _ motive @Hnil @Hconcat _ _ (p.concat h) =
      Hconcat p h (concatRec @Hnil @Hconcat p) := by
  simp only [concatRec]
  apply eq_of_heq
  apply rec_heq_of_heq
  trans concatRecAux @Hnil @Hconcat (cons h.symm p.reverse)
  · congr
    

Proof state:
case e_8.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
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
@[simp]
theorem concatRec_concat {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
    @concatRec _ _ motive @Hnil @Hconcat _ _ (p.concat h) =
      Hconcat p h (concatRec @Hnil @Hconcat p) := by
  simp only [concatRec]
  apply eq_of_heq
  apply rec_heq_of_heq
  trans concatRecAux @Hnil @Hconcat (cons h.symm p.reverse)
  · congr
    simp
  · 

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ HEq (concatRecAux Hnil Hconcat (cons (_ : Adj G w v) (reverse p)))
    (Hconcat p h ((_ : reverse (reverse p) = p) ▸ concatRecAux Hnil Hconcat (reverse p)))

Next tactic:
rw [concatRecAux, rec_heq_iff_heq]
@[simp]
theorem concatRec_concat {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
    @concatRec _ _ motive @Hnil @Hconcat _ _ (p.concat h) =
      Hconcat p h (concatRec @Hnil @Hconcat p) := by
  simp only [concatRec]
  apply eq_of_heq
  apply rec_heq_of_heq
  trans concatRecAux @Hnil @Hconcat (cons h.symm p.reverse)
  · congr
    simp
  · rw [concatRecAux, rec_heq_iff_heq]
    

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ HEq (Hconcat (reverse (reverse p)) (_ : Adj G v w) (concatRecAux Hnil Hconcat (reverse p)))
    (Hconcat p h ((_ : reverse (reverse p) = p) ▸ concatRecAux Hnil Hconcat (reverse p)))

Next tactic:
congr
@[simp]
theorem concatRec_concat {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
    @concatRec _ _ motive @Hnil @Hconcat _ _ (p.concat h) =
      Hconcat p h (concatRec @Hnil @Hconcat p) := by
  simp only [concatRec]
  apply eq_of_heq
  apply rec_heq_of_heq
  trans concatRecAux @Hnil @Hconcat (cons h.symm p.reverse)
  · congr
    simp
  · rw [concatRecAux, rec_heq_iff_heq]
    congr <;> 

Proof state:
case e_4.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ reverse (reverse p) = p

Next tactic:
simp [heq_rec_iff_heq]
@[simp]
theorem concatRec_concat {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
    @concatRec _ _ motive @Hnil @Hconcat _ _ (p.concat h) =
      Hconcat p h (concatRec @Hnil @Hconcat p) := by
  simp only [concatRec]
  apply eq_of_heq
  apply rec_heq_of_heq
  trans concatRecAux @Hnil @Hconcat (cons h.symm p.reverse)
  · congr
    simp
  · rw [concatRecAux, rec_heq_iff_heq]
    congr <;> 

Proof state:
case e_6
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ HEq (concatRecAux Hnil Hconcat (reverse p)) ((_ : reverse (reverse p) = p) ▸ concatRecAux Hnil Hconcat (reverse p))

Next tactic:
simp [heq_rec_iff_heq]
theorem concat_ne_nil {u v : V} (p : G.Walk u v) (h : G.Adj v u) : p.concat 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 : V
p : Walk G u v
h : Adj G v u
⊢ concat p h ≠ nil

Next tactic:
cases p
theorem concat_ne_nil {u v : V} (p : G.Walk u v) (h : G.Adj v u) : p.concat h ≠ nil := by
  cases p <;> 

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
h : Adj G u u
⊢ concat nil h ≠ nil

Next tactic:
simp [concat]
theorem concat_ne_nil {u v : V} (p : G.Walk u v) (h : G.Adj v u) : p.concat h ≠ nil := by
  cases p <;> 

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

Next tactic:
simp [concat]
theorem concat_inj {u v v' w : V} {p : G.Walk u v} {h : G.Adj v w} {p' : G.Walk u v'}
    {h' : G.Adj v' w} (he : p.concat h = p'.concat h') : ∃ hv : v = v', p.copy rfl hv = 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' w : V
p : Walk G u v
h : Adj G v w
p' : Walk G u v'
h' : Adj G v' w
he : concat p h = concat p' h'
⊢ ∃ (hv : v = v'), Walk.copy p (_ : u = u) hv = p'

Next tactic:
induction p with
  | nil =>
    cases p'
    · exact ⟨rfl, rfl⟩
    · exfalso
      simp only [concat_nil, concat_cons, cons.injEq] at he
      obtain ⟨rfl, he⟩ := he
      simp only [heq_iff_eq] at he
      exact concat_ne_nil _ _ he.symm
  | cons _ _ ih =>
    rw [concat_cons] at he
    cases p'
    · exfalso
      simp only [concat_nil, cons.injEq] at he
      obtain ⟨rfl, he⟩ := he
      rw [heq_iff_eq] at he
      exact concat_ne_nil _ _ he
    · rw [concat_cons, cons.injEq] at he
      obtain ⟨rfl, he⟩ := he
      rw [heq_iff_eq] at he
      obtain ⟨rfl, rfl⟩ := ih he
      exact ⟨rfl, rfl⟩
theorem concat_inj {u v v' w : V} {p : G.Walk u v} {h : G.Adj v w} {p' : G.Walk u v'}
    {h' : G.Adj v' w} (he : p.concat h = p'.concat h') : ∃ hv : v = v', p.copy rfl hv = 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 v' w : V
h' : Adj G v' w
u✝ : V
h : Adj G u✝ w
p' : Walk G u✝ v'
he : concat nil h = concat p' h'
⊢ ∃ (hv : u✝ = v'), Walk.copy nil (_ : u✝ = u✝) hv = p'

Next tactic:
| nil =>
    cases p'
    · exact ⟨rfl, rfl⟩
    · exfalso
      simp only [concat_nil, concat_cons, cons.injEq] at he
      obtain ⟨rfl, he⟩ := he
      simp only [heq_iff_eq] at he
      exact concat_ne_nil _ _ he.symm
theorem concat_inj {u v v' w : V} {p : G.Walk u v} {h : G.Adj v w} {p' : G.Walk u v'}
    {h' : G.Adj v' w} (he : p.concat h = p'.concat h') : ∃ hv : v = v', p.copy rfl hv = 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 v' w : V
h' : Adj G v' w
u✝ : V
h : Adj G u✝ w
p' : Walk G u✝ v'
he : concat nil h = concat p' h'
⊢ ∃ (hv : u✝ = v'), Walk.copy nil (_ : u✝ = u✝) hv = p'

Next tactic:
cases p'
theorem concat_inj {u v v' w : V} {p : G.Walk u v} {h : G.Adj v w} {p' : G.Walk u v'}
    {h' : G.Adj v' w} (he : p.concat h = p'.concat h') : ∃ hv : v = v', p.copy rfl hv = p' := by
  induction p with
  | nil =>
    cases p'
    · 

Proof state:
case nil.nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' h : Adj G v' w
he : concat nil h = concat nil h'
⊢ ∃ (hv : v' = v'), Walk.copy nil (_ : v' = v') hv = nil

Next tactic:
exact ⟨rfl, rfl⟩
theorem concat_inj {u v v' w : V} {p : G.Walk u v} {h : G.Adj v w} {p' : G.Walk u v'}
    {h' : G.Adj v' w} (he : p.concat h = p'.concat h') : ∃ hv : v = v', p.copy rfl hv = p' := by
  induction p with
  | nil =>
    cases p'
    · exact ⟨rfl, rfl⟩
    · 

Proof state:
case nil.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ : V
h : Adj G u✝ w
v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ v'
he : concat nil h = concat (cons h✝ p✝) h'
⊢ ∃ (hv : u✝ = v'), Walk.copy nil (_ : u✝ = u✝) hv = cons h✝ p✝

Next tactic:
exfalso
theorem concat_inj {u v v' w : V} {p : G.Walk u v} {h : G.Adj v w} {p' : G.Walk u v'}
    {h' : G.Adj v' w} (he : p.concat h = p'.concat h') : ∃ hv : v = v', p.copy rfl hv = p' := by
  induction p with
  | nil =>
    cases p'
    · exact ⟨rfl, rfl⟩
    · exfalso
      

Proof state:
case nil.cons.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ : V
h : Adj G u✝ w
v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ v'
he : concat nil h = concat (cons h✝ p✝) h'
⊢ False

Next tactic:
simp only [concat_nil, concat_cons, cons.injEq] at he
theorem concat_inj {u v v' w : V} {p : G.Walk u v} {h : G.Adj v w} {p' : G.Walk u v'}
    {h' : G.Adj v' w} (he : p.concat h = p'.concat h') : ∃ hv : v = v', p.copy rfl hv = p' := by
  induction p with
  | nil =>
    cases p'
    · exact ⟨rfl, rfl⟩
    · exfalso
      simp only [concat_nil, concat_cons, cons.injEq] at he
      

Proof state:
case nil.cons.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ : V
h : Adj G u✝ w
v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ v'
he : w = v✝ ∧ HEq nil (concat p✝ h')
⊢ False

Next tactic:
obtain ⟨rfl, he⟩ := he
theorem concat_inj {u v v' w : V} {p : G.Walk u v} {h : G.Adj v w} {p' : G.Walk u v'}
    {h' : G.Adj v' w} (he : p.concat h = p'.concat h') : ∃ hv : v = v', p.copy rfl hv = p' := by
  induction p with
  | nil =>
    cases p'
    · exact ⟨rfl, rfl⟩
    · exfalso
      simp only [concat_nil, concat_cons, cons.injEq] at he
      obtain ⟨rfl, he⟩ := he
      

Proof state:
case nil.cons.h.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ : V
h h✝ : Adj G u✝ w
p✝ : Walk G w v'
he : HEq nil (concat p✝ h')
⊢ False

Next tactic:
simp only [heq_iff_eq] at he
theorem concat_inj {u v v' w : V} {p : G.Walk u v} {h : G.Adj v w} {p' : G.Walk u v'}
    {h' : G.Adj v' w} (he : p.concat h = p'.concat h') : ∃ hv : v = v', p.copy rfl hv = p' := by
  induction p with
  | nil =>
    cases p'
    · exact ⟨rfl, rfl⟩
    · exfalso
      simp only [concat_nil, concat_cons, cons.injEq] at he
      obtain ⟨rfl, he⟩ := he
      simp only [heq_iff_eq] at he
      

Proof state:
case nil.cons.h.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ : V
h h✝ : Adj G u✝ w
p✝ : Walk G w v'
he : nil = concat p✝ h'
⊢ False

Next tactic:
exact concat_ne_nil _ _ he.symm
theorem concat_inj {u v v' w : V} {p : G.Walk u v} {h : G.Adj v w} {p' : G.Walk u v'}
    {h' : G.Adj v' w} (he : p.concat h = p'.concat h') : ∃ hv : v = v', p.copy rfl hv = p' := by
  induction p with
  | nil =>
    cases p'
    · exact ⟨rfl, rfl⟩
    · exfalso
      simp only [concat_nil, concat_cons, cons.injEq] at he
      obtain ⟨rfl, he⟩ := he
      simp only [heq_iff_eq] at he
      exact concat_ne_nil _ _ he.symm
  

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih :
  ∀ {h : Adj G w✝ w} {p' : Walk G v✝ v'},
    concat p✝ h = concat p' h' → ∃ (hv : w✝ = v'), Walk.copy p✝ (_ : v✝ = v✝) hv = p'
h : Adj G w✝ w
p' : Walk G u✝ v'
he : concat (cons h✝ p✝) h = concat p' h'
⊢ ∃ (hv : w✝ = v'), Walk.copy (cons h✝ p✝) (_ : u✝ = u✝) hv = p'

Next tactic:
| cons _ _ ih =>
    rw [concat_cons] at he
    cases p'
    · exfalso
      simp only [concat_nil, cons.injEq] at he
      obtain ⟨rfl, he⟩ := he
      rw [heq_iff_eq] at he
      exact concat_ne_nil _ _ he
    · rw [concat_cons, cons.injEq] at he
      obtain ⟨rfl, he⟩ := he
      rw [heq_iff_eq] at he
      obtain ⟨rfl, rfl⟩ := ih he
      exact ⟨rfl, rfl⟩
theorem concat_inj {u v v' w : V} {p : G.Walk u v} {h : G.Adj v w} {p' : G.Walk u v'}
    {h' : G.Adj v' w} (he : p.concat h = p'.concat h') : ∃ hv : v = v', p.copy rfl hv = p' := by
  induction p with
  | nil =>
    cases p'
    · exact ⟨rfl, rfl⟩
    · exfalso
      simp only [concat_nil, concat_cons, cons.injEq] at he
      obtain ⟨rfl, he⟩ := he
      simp only [heq_iff_eq] at he
      exact concat_ne_nil _ _ he.symm
  | 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 v' w : V
h' : Adj G v' w
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih :
  ∀ {h : Adj G w✝ w} {p' : Walk G v✝ v'},
    concat p✝ h = concat p' h' → ∃ (hv : w✝ = v'), Walk.copy p✝ (_ : v✝ = v✝) hv = p'
h : Adj G w✝ w
p' : Walk G u✝ v'
he : concat (cons h✝ p✝) h = concat p' h'
⊢ ∃ (hv : w✝ = v'), Walk.copy (cons h✝ p✝) (_ : u✝ = u✝) hv = p'

Next tactic:
rw [concat_cons] at he
theorem concat_inj {u v v' w : V} {p : G.Walk u v} {h : G.Adj v w} {p' : G.Walk u v'}
    {h' : G.Adj v' w} (he : p.concat h = p'.concat h') : ∃ hv : v = v', p.copy rfl hv = p' := by
  induction p with
  | nil =>
    cases p'
    · exact ⟨rfl, rfl⟩
    · exfalso
      simp only [concat_nil, concat_cons, cons.injEq] at he
      obtain ⟨rfl, he⟩ := he
      simp only [heq_iff_eq] at he
      exact concat_ne_nil _ _ he.symm
  | cons _ _ ih =>
    rw [concat_cons] at he
    

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih :
  ∀ {h : Adj G w✝ w} {p' : Walk G v✝ v'},
    concat p✝ h = concat p' h' → ∃ (hv : w✝ = v'), Walk.copy p✝ (_ : v✝ = v✝) hv = p'
h : Adj G w✝ w
p' : Walk G u✝ v'
he : cons h✝ (concat p✝ h) = concat p' h'
⊢ ∃ (hv : w✝ = v'), Walk.copy (cons h✝ p✝) (_ : u✝ = u✝) hv = p'

Next tactic:
cases p'
theorem concat_inj {u v v' w : V} {p : G.Walk u v} {h : G.Adj v w} {p' : G.Walk u v'}
    {h' : G.Adj v' w} (he : p.concat h = p'.concat h') : ∃ hv : v = v', p.copy rfl hv = p' := by
  induction p with
  | nil =>
    cases p'
    · exact ⟨rfl, rfl⟩
    · exfalso
      simp only [concat_nil, concat_cons, cons.injEq] at he
      obtain ⟨rfl, he⟩ := he
      simp only [heq_iff_eq] at he
      exact concat_ne_nil _ _ he.symm
  | cons _ _ ih =>
    rw [concat_cons] at he
    cases p'
    · 

Proof state:
case cons.nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
v✝ w✝ : V
p✝ : Walk G v✝ w✝
ih :
  ∀ {h : Adj G w✝ w} {p' : Walk G v✝ v'},
    concat p✝ h = concat p' h' → ∃ (hv : w✝ = v'), Walk.copy p✝ (_ : v✝ = v✝) hv = p'
h : Adj G w✝ w
h✝ : Adj G v' v✝
he : cons h✝ (concat p✝ h) = concat nil h'
⊢ ∃ (hv : w✝ = v'), Walk.copy (cons h✝ p✝) (_ : v' = v') hv = nil

Next tactic:
exfalso
theorem concat_inj {u v v' w : V} {p : G.Walk u v} {h : G.Adj v w} {p' : G.Walk u v'}
    {h' : G.Adj v' w} (he : p.concat h = p'.concat h') : ∃ hv : v = v', p.copy rfl hv = p' := by
  induction p with
  | nil =>
    cases p'
    · exact ⟨rfl, rfl⟩
    · exfalso
      simp only [concat_nil, concat_cons, cons.injEq] at he
      obtain ⟨rfl, he⟩ := he
      simp only [heq_iff_eq] at he
      exact concat_ne_nil _ _ he.symm
  | cons _ _ ih =>
    rw [concat_cons] at he
    cases p'
    · exfalso
      

Proof state:
case cons.nil.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
v✝ w✝ : V
p✝ : Walk G v✝ w✝
ih :
  ∀ {h : Adj G w✝ w} {p' : Walk G v✝ v'},
    concat p✝ h = concat p' h' → ∃ (hv : w✝ = v'), Walk.copy p✝ (_ : v✝ = v✝) hv = p'
h : Adj G w✝ w
h✝ : Adj G v' v✝
he : cons h✝ (concat p✝ h) = concat nil h'
⊢ False

Next tactic:
simp only [concat_nil, cons.injEq] at he