l3lab/ntp-mathlib huggingface dataset:
protected theorem IsPath.of_map {f : G →g G'} (hp : (p.map f).IsPath) : p.IsPath := by
  induction p with
  | nil => simp
  | cons _ _ ih =>
    rw [map_cons, Walk.cons_isPath_iff, support_map] at hp
    rw [Walk.cons_isPath_iff]
    cases' hp with hp1 hp2
    refine' ⟨ih hp1, _⟩
    contrapose! hp2
    

Proof state:
case cons.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
f : G →g G'
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsPath (Walk.map f p✝) → IsPath p✝
hp1 : IsPath (Walk.map f p✝)
hp2 : u✝ ∈ support p✝
⊢ f u✝ ∈ List.map (⇑f) (support p✝)

Next tactic:
exact List.mem_map_of_mem f hp2
theorem map_isTrail_iff_of_injective (hinj : Function.Injective f) :
    (p.map f).IsTrail ↔ p.IsTrail := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ⇑f
⊢ IsTrail (Walk.map f p) ↔ IsTrail p

Next tactic:
induction p with
  | nil => simp
  | cons _ _ ih =>
    rw [map_cons, cons_isTrail_iff, ih, cons_isTrail_iff]
    apply and_congr_right'
    rw [← Sym2.map_pair_eq, edges_map, ← List.mem_map_of_injective (Sym2.map.injective hinj)]
theorem map_isTrail_iff_of_injective (hinj : Function.Injective f) :
    (p.map f).IsTrail ↔ p.IsTrail := 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''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ⇑f
u✝ : V
⊢ IsTrail (Walk.map f nil) ↔ IsTrail nil

Next tactic:
| nil => simp
theorem map_isTrail_iff_of_injective (hinj : Function.Injective f) :
    (p.map f).IsTrail ↔ p.IsTrail := 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''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ⇑f
u✝ : V
⊢ IsTrail (Walk.map f nil) ↔ IsTrail nil

Next tactic:
simp
theorem map_isTrail_iff_of_injective (hinj : Function.Injective f) :
    (p.map f).IsTrail ↔ p.IsTrail := 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''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ⇑f
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsTrail (Walk.map f p✝) ↔ IsTrail p✝
⊢ IsTrail (Walk.map f (cons h✝ p✝)) ↔ IsTrail (cons h✝ p✝)

Next tactic:
| cons _ _ ih =>
    rw [map_cons, cons_isTrail_iff, ih, cons_isTrail_iff]
    apply and_congr_right'
    rw [← Sym2.map_pair_eq, edges_map, ← List.mem_map_of_injective (Sym2.map.injective hinj)]
theorem map_isTrail_iff_of_injective (hinj : Function.Injective f) :
    (p.map f).IsTrail ↔ p.IsTrail := 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''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ⇑f
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsTrail (Walk.map f p✝) ↔ IsTrail p✝
⊢ IsTrail (Walk.map f (cons h✝ p✝)) ↔ IsTrail (cons h✝ p✝)

Next tactic:
rw [map_cons, cons_isTrail_iff, ih, cons_isTrail_iff]
theorem map_isTrail_iff_of_injective (hinj : Function.Injective f) :
    (p.map f).IsTrail ↔ p.IsTrail := by
  induction p with
  | nil => simp
  | cons _ _ ih =>
    rw [map_cons, cons_isTrail_iff, ih, cons_isTrail_iff]
    

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ⇑f
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsTrail (Walk.map f p✝) ↔ IsTrail p✝
⊢ IsTrail p✝ ∧ ⟦(f u✝, f v✝)⟧ ∉ edges (Walk.map f p✝) ↔ IsTrail p✝ ∧ ⟦(u✝, v✝)⟧ ∉ edges p✝

Next tactic:
apply and_congr_right'
theorem map_isTrail_iff_of_injective (hinj : Function.Injective f) :
    (p.map f).IsTrail ↔ p.IsTrail := by
  induction p with
  | nil => simp
  | cons _ _ ih =>
    rw [map_cons, cons_isTrail_iff, ih, cons_isTrail_iff]
    apply and_congr_right'
    

Proof state:
case cons.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ⇑f
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsTrail (Walk.map f p✝) ↔ IsTrail p✝
⊢ ⟦(f u✝, f v✝)⟧ ∉ edges (Walk.map f p✝) ↔ ⟦(u✝, v✝)⟧ ∉ edges p✝

Next tactic:
rw [← Sym2.map_pair_eq, edges_map, ← List.mem_map_of_injective (Sym2.map.injective hinj)]
theorem map_isCycle_iff_of_injective {p : G.Walk u u} (hinj : Function.Injective f) :
    (p.map f).IsCycle ↔ p.IsCycle := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p✝ : Walk G u v
p : Walk G u u
hinj : Injective ⇑f
⊢ IsCycle (Walk.map f p) ↔ IsCycle p

Next tactic:
rw [isCycle_def, isCycle_def, map_isTrail_iff_of_injective hinj, Ne.def, map_eq_nil_iff,
    support_map, ← List.map_tail, List.nodup_map_iff hinj]
theorem map_injective_of_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Walk.map f : G.Walk u v → G'.Walk (f u) (f v)) := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝ v✝ u' v' : V
p : Walk G u✝ v✝
f : G →g G'
hinj : Injective ⇑f
u v : V
⊢ Injective (Walk.map f)

Next tactic:
intro p p' h
theorem map_injective_of_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Walk.map f : G.Walk u v → G'.Walk (f u) (f v)) := by
  intro p p' h
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝ v✝ u' v' : V
p✝ : Walk G u✝ v✝
f : G →g G'
hinj : Injective ⇑f
u v : V
p p' : Walk G u v
h : Walk.map f p = Walk.map f p'
⊢ p = p'

Next tactic:
induction p with
  | nil =>
    cases p'
    · rfl
    · simp at h
  | cons _ _ ih =>
    cases p' with
    | nil => simp at h
    | cons _ _ =>
      simp only [map_cons, cons.injEq] at h
      cases hinj h.1
      simp only [cons.injEq, heq_iff_eq, true_and_iff]
      apply ih
      simpa using h.2
theorem map_injective_of_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Walk.map f : G.Walk u v → G'.Walk (f u) (f v)) := by
  intro p p' h
  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''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝ u' v' : V
p : Walk G u✝¹ v✝
f : G →g G'
hinj : Injective ⇑f
u v u✝ : V
p' : Walk G u✝ u✝
h : Walk.map f nil = Walk.map f p'
⊢ nil = p'

Next tactic:
| nil =>
    cases p'
    · rfl
    · simp at h
theorem map_injective_of_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Walk.map f : G.Walk u v → G'.Walk (f u) (f v)) := by
  intro p p' h
  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''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝ u' v' : V
p : Walk G u✝¹ v✝
f : G →g G'
hinj : Injective ⇑f
u v u✝ : V
p' : Walk G u✝ u✝
h : Walk.map f nil = Walk.map f p'
⊢ nil = p'

Next tactic:
cases p'
theorem map_injective_of_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Walk.map f : G.Walk u v → G'.Walk (f u) (f v)) := by
  intro p p' h
  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''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝ u' v' : V
p : Walk G u✝¹ v✝
f : G →g G'
hinj : Injective ⇑f
u v u✝ : V
h : Walk.map f nil = Walk.map f nil
⊢ nil = nil

Next tactic:
rfl
theorem map_injective_of_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Walk.map f : G.Walk u v → G'.Walk (f u) (f v)) := by
  intro p p' h
  induction p with
  | nil =>
    cases p'
    · rfl
    · 

Proof state:
case nil.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
f : G →g G'
hinj : Injective ⇑f
u v u✝ v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ u✝
h : Walk.map f nil = Walk.map f (cons h✝ p✝)
⊢ nil = cons h✝ p✝

Next tactic:
simp at h
theorem map_injective_of_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Walk.map f : G.Walk u v → G'.Walk (f u) (f v)) := by
  intro p p' h
  induction p with
  | nil =>
    cases p'
    · rfl
    · simp at h
  

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
f : G →g G'
hinj : Injective ⇑f
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ ⦃p' : Walk G v✝ w✝⦄, Walk.map f p✝ = Walk.map f p' → p✝ = p'
p' : Walk G u✝ w✝
h : Walk.map f (cons h✝ p✝) = Walk.map f p'
⊢ cons h✝ p✝ = p'

Next tactic:
| cons _ _ ih =>
    cases p' with
    | nil => simp at h
    | cons _ _ =>
      simp only [map_cons, cons.injEq] at h
      cases hinj h.1
      simp only [cons.injEq, heq_iff_eq, true_and_iff]
      apply ih
      simpa using h.2
theorem map_injective_of_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Walk.map f : G.Walk u v → G'.Walk (f u) (f v)) := by
  intro p p' h
  induction p with
  | nil =>
    cases p'
    · rfl
    · simp at h
  | cons _ _ ih =>
    

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
f : G →g G'
hinj : Injective ⇑f
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ ⦃p' : Walk G v✝ w✝⦄, Walk.map f p✝ = Walk.map f p' → p✝ = p'
p' : Walk G u✝ w✝
h : Walk.map f (cons h✝ p✝) = Walk.map f p'
⊢ cons h✝ p✝ = p'

Next tactic:
cases p' with
    | nil => simp at h
    | cons _ _ =>
      simp only [map_cons, cons.injEq] at h
      cases hinj h.1
      simp only [cons.injEq, heq_iff_eq, true_and_iff]
      apply ih
      simpa using h.2
theorem map_injective_of_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Walk.map f : G.Walk u v → G'.Walk (f u) (f v)) := by
  intro p p' h
  induction p with
  | nil =>
    cases p'
    · rfl
    · simp at h
  | cons _ _ ih =>
    cases p' with
    

Proof state:
case cons.nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
f : G →g G'
hinj : Injective ⇑f
u v u✝ v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ u✝
ih : ∀ ⦃p' : Walk G v✝ u✝⦄, Walk.map f p✝ = Walk.map f p' → p✝ = p'
h : Walk.map f (cons h✝ p✝) = Walk.map f nil
⊢ cons h✝ p✝ = nil

Next tactic:
| nil => simp at h
theorem map_injective_of_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Walk.map f : G.Walk u v → G'.Walk (f u) (f v)) := by
  intro p p' h
  induction p with
  | nil =>
    cases p'
    · rfl
    · simp at h
  | cons _ _ ih =>
    cases p' with
    | nil => 

Proof state:
case cons.nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
f : G →g G'
hinj : Injective ⇑f
u v u✝ v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ u✝
ih : ∀ ⦃p' : Walk G v✝ u✝⦄, Walk.map f p✝ = Walk.map f p' → p✝ = p'
h : Walk.map f (cons h✝ p✝) = Walk.map f nil
⊢ cons h✝ p✝ = nil

Next tactic:
simp at h
theorem map_injective_of_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Walk.map f : G.Walk u v → G'.Walk (f u) (f v)) := by
  intro p p' h
  induction p with
  | nil =>
    cases p'
    · rfl
    · simp at h
  | cons _ _ ih =>
    cases p' with
    | nil => simp at h
    

Proof state:
case cons.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝² u' v' : V
p : Walk G u✝¹ v✝²
f : G →g G'
hinj : Injective ⇑f
u v u✝ v✝¹ w✝ : V
h✝¹ : Adj G u✝ v✝¹
p✝¹ : Walk G v✝¹ w✝
ih : ∀ ⦃p' : Walk G v✝¹ w✝⦄, Walk.map f p✝¹ = Walk.map f p' → p✝¹ = p'
v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
h : Walk.map f (cons h✝¹ p✝¹) = Walk.map f (cons h✝ p✝)
⊢ cons h✝¹ p✝¹ = cons h✝ p✝

Next tactic:
| cons _ _ =>
      simp only [map_cons, cons.injEq] at h
      cases hinj h.1
      simp only [cons.injEq, heq_iff_eq, true_and_iff]
      apply ih
      simpa using h.2
theorem map_injective_of_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Walk.map f : G.Walk u v → G'.Walk (f u) (f v)) := by
  intro p p' h
  induction p with
  | nil =>
    cases p'
    · rfl
    · simp at h
  | cons _ _ ih =>
    cases p' with
    | nil => simp at h
    | cons _ _ =>
      

Proof state:
case cons.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝² u' v' : V
p : Walk G u✝¹ v✝²
f : G →g G'
hinj : Injective ⇑f
u v u✝ v✝¹ w✝ : V
h✝¹ : Adj G u✝ v✝¹
p✝¹ : Walk G v✝¹ w✝
ih : ∀ ⦃p' : Walk G v✝¹ w✝⦄, Walk.map f p✝¹ = Walk.map f p' → p✝¹ = p'
v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
h : Walk.map f (cons h✝¹ p✝¹) = Walk.map f (cons h✝ p✝)
⊢ cons h✝¹ p✝¹ = cons h✝ p✝

Next tactic:
simp only [map_cons, cons.injEq] at h
theorem map_injective_of_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Walk.map f : G.Walk u v → G'.Walk (f u) (f v)) := by
  intro p p' h
  induction p with
  | nil =>
    cases p'
    · rfl
    · simp at h
  | cons _ _ ih =>
    cases p' with
    | nil => simp at h
    | cons _ _ =>
      simp only [map_cons, cons.injEq] at h
      

Proof state:
case cons.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝² u' v' : V
p : Walk G u✝¹ v✝²
f : G →g G'
hinj : Injective ⇑f
u v u✝ v✝¹ w✝ : V
h✝¹ : Adj G u✝ v✝¹
p✝¹ : Walk G v✝¹ w✝
ih : ∀ ⦃p' : Walk G v✝¹ w✝⦄, Walk.map f p✝¹ = Walk.map f p' → p✝¹ = p'
v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
h : f v✝¹ = f v✝ ∧ HEq (Walk.map f p✝¹) (Walk.map f p✝)
⊢ cons h✝¹ p✝¹ = cons h✝ p✝

Next tactic:
cases hinj h.1
theorem map_injective_of_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Walk.map f : G.Walk u v → G'.Walk (f u) (f v)) := by
  intro p p' h
  induction p with
  | nil =>
    cases p'
    · rfl
    · simp at h
  | cons _ _ ih =>
    cases p' with
    | nil => simp at h
    | cons _ _ =>
      simp only [map_cons, cons.injEq] at h
      cases hinj h.1
      

Proof state:
case cons.cons.refl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
f : G →g G'
hinj : Injective ⇑f
u v u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝¹ : Walk G v✝ w✝
ih : ∀ ⦃p' : Walk G v✝ w✝⦄, Walk.map f p✝¹ = Walk.map f p' → p✝¹ = p'
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
h : f v✝ = f v✝ ∧ HEq (Walk.map f p✝¹) (Walk.map f p✝)
⊢ cons h✝¹ p✝¹ = cons h✝ p✝

Next tactic:
simp only [cons.injEq, heq_iff_eq, true_and_iff]
theorem map_injective_of_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Walk.map f : G.Walk u v → G'.Walk (f u) (f v)) := by
  intro p p' h
  induction p with
  | nil =>
    cases p'
    · rfl
    · simp at h
  | cons _ _ ih =>
    cases p' with
    | nil => simp at h
    | cons _ _ =>
      simp only [map_cons, cons.injEq] at h
      cases hinj h.1
      simp only [cons.injEq, heq_iff_eq, true_and_iff]
      

Proof state:
case cons.cons.refl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
f : G →g G'
hinj : Injective ⇑f
u v u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝¹ : Walk G v✝ w✝
ih : ∀ ⦃p' : Walk G v✝ w✝⦄, Walk.map f p✝¹ = Walk.map f p' → p✝¹ = p'
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
h : f v✝ = f v✝ ∧ HEq (Walk.map f p✝¹) (Walk.map f p✝)
⊢ p✝¹ = p✝

Next tactic:
apply ih
theorem map_injective_of_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Walk.map f : G.Walk u v → G'.Walk (f u) (f v)) := by
  intro p p' h
  induction p with
  | nil =>
    cases p'
    · rfl
    · simp at h
  | cons _ _ ih =>
    cases p' with
    | nil => simp at h
    | cons _ _ =>
      simp only [map_cons, cons.injEq] at h
      cases hinj h.1
      simp only [cons.injEq, heq_iff_eq, true_and_iff]
      apply ih
      

Proof state:
case cons.cons.refl.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
f : G →g G'
hinj : Injective ⇑f
u v u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝¹ : Walk G v✝ w✝
ih : ∀ ⦃p' : Walk G v✝ w✝⦄, Walk.map f p✝¹ = Walk.map f p' → p✝¹ = p'
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
h : f v✝ = f v✝ ∧ HEq (Walk.map f p✝¹) (Walk.map f p✝)
⊢ Walk.map f p✝¹ = Walk.map f p✝

Next tactic:
simpa using h.2
theorem map_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Path.map f hinj : G.Path u v → G'.Path (f u) (f v)) := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
hinj : Injective ⇑f
u v : V
⊢ Injective (Path.map f hinj)

Next tactic:
rintro ⟨p, hp⟩ ⟨p', hp'⟩ h
theorem map_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Path.map f hinj : G.Path u v → G'.Path (f u) (f v)) := by
  rintro ⟨p, hp⟩ ⟨p', hp'⟩ h
  

Proof state:
case mk.mk
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
hinj : Injective ⇑f
u v : V
p : Walk G u v
hp : Walk.IsPath p
p' : Walk G u v
hp' : Walk.IsPath p'
h : Path.map f hinj { val := p, property := hp } = Path.map f hinj { val := p', property := hp' }
⊢ { val := p, property := hp } = { val := p', property := hp' }

Next tactic:
simp only [Path.map, Subtype.coe_mk, Subtype.mk.injEq] at h
theorem map_injective {f : G →g G'} (hinj : Function.Injective f) (u v : V) :
    Function.Injective (Path.map f hinj : G.Path u v → G'.Path (f u) (f v)) := by
  rintro ⟨p, hp⟩ ⟨p', hp'⟩ h
  simp only [Path.map, Subtype.coe_mk, Subtype.mk.injEq] at h
  

Proof state:
case mk.mk
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
hinj : Injective ⇑f
u v : V
p : Walk G u v
hp : Walk.IsPath p
p' : Walk G u v
hp' : Walk.IsPath p'
h : Walk.map f p = Walk.map f p'
⊢ { val := p, property := hp } = { val := p', property := hp' }

Next tactic:
simp [Walk.map_injective_of_injective hinj u v h]
/-- The walk `p` transferred to lie in `H`, given that `H` contains its edges. -/
@[simp]
protected def transfer {u v : V} (p : G.Walk u v)
    (H : SimpleGraph V) (h : ∀ e, e ∈ p.edges → e ∈ H.edgeSet) : H.Walk u v :=
  match p with
  | nil => nil
  | cons' u v w a p =>
    cons (h ⟦(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✝ : Walk G u✝ v✝
H : SimpleGraph V
u w v : V
a : Adj G u v
p : Walk G v w
h : ∀ e ∈ edges (cons' u v w a p), e ∈ edgeSet H
⊢ ⟦(u, v)⟧ ∈ edges (cons' u v w a p)

Next tactic:
simp
/-- The walk `p` transferred to lie in `H`, given that `H` contains its edges. -/
@[simp]
protected def transfer {u v : V} (p : G.Walk u v)
    (H : SimpleGraph V) (h : ∀ e, e ∈ p.edges → e ∈ H.edgeSet) : H.Walk u v :=
  match p with
  | nil => nil
  | cons' u v w a p =>
    cons (h ⟦(u, v)⟧ (by simp)) (p.transfer H fun e he => h e (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 : SimpleGraph V
u w v : V
a : Adj G u v
p : Walk G v w
h : ∀ e ∈ edges (cons' u v w a p), e ∈ edgeSet H
e : Sym2 V
he : e ∈ edges p
⊢ e ∈ edges (cons' u v w a p)

Next tactic:
simp [he]
theorem transfer_self : p.transfer G p.edges_subset_edgeSet = 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
⊢ Walk.transfer p G (_ : ∀ ⦃e : Sym2 V⦄, e ∈ edges p → e ∈ edgeSet G) = p

Next tactic:
induction p
theorem transfer_self : p.transfer G p.edges_subset_edgeSet = p := by
  induction 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 : V
p : Walk G u v
u✝ : V
⊢ Walk.transfer nil G (_ : ∀ ⦃e : Sym2 V⦄, e ∈ edges nil → e ∈ edgeSet G) = nil

Next tactic:
simp [*]
theorem transfer_self : p.transfer G p.edges_subset_edgeSet = p := by
  induction 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
p : Walk G u v
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : Walk.transfer p✝ G (_ : ∀ ⦃e : Sym2 V⦄, e ∈ edges p✝ → e ∈ edgeSet G) = p✝
⊢ Walk.transfer (cons h✝ p✝) G (_ : ∀ ⦃e : Sym2 V⦄, e ∈ edges (cons h✝ p✝) → e ∈ edgeSet G) = cons h✝ p✝

Next tactic:
simp [*]
theorem transfer_eq_map_of_le (hp) (GH : G ≤ H) :
    p.transfer H hp = p.map (SimpleGraph.Hom.mapSpanningSubgraphs GH) := 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 : SimpleGraph V
hp : ∀ e ∈ edges p, e ∈ edgeSet H
GH : G ≤ H
⊢ Walk.transfer p H hp = Walk.map (Hom.mapSpanningSubgraphs GH) p

Next tactic:
induction p
theorem transfer_eq_map_of_le (hp) (GH : G ≤ H) :
    p.transfer H hp = p.map (SimpleGraph.Hom.mapSpanningSubgraphs GH) := by
  induction 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 : V
p : Walk G u v
H : SimpleGraph V
GH : G ≤ H
u✝ : V
hp : ∀ e ∈ edges nil, e ∈ edgeSet H
⊢ Walk.transfer nil H hp = Walk.map (Hom.mapSpanningSubgraphs GH) nil

Next tactic:
simp [*]
theorem transfer_eq_map_of_le (hp) (GH : G ≤ H) :
    p.transfer H hp = p.map (SimpleGraph.Hom.mapSpanningSubgraphs GH) := by
  induction 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
p : Walk G u v
H : SimpleGraph V
GH : G ≤ H
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (hp : ∀ e ∈ edges p✝, e ∈ edgeSet H), Walk.transfer p✝ H hp = Walk.map (Hom.mapSpanningSubgraphs GH) p✝
hp : ∀ e ∈ edges (cons h✝ p✝), e ∈ edgeSet H
⊢ Walk.transfer (cons h✝ p✝) H hp = Walk.map (Hom.mapSpanningSubgraphs GH) (cons h✝ p✝)

Next tactic:
simp [*]
@[simp]
theorem edges_transfer (hp) : (p.transfer H hp).edges = p.edges := 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 : SimpleGraph V
hp : ∀ e ∈ edges p, e ∈ edgeSet H
⊢ edges (Walk.transfer p H hp) = edges p

Next tactic:
induction p
@[simp]
theorem edges_transfer (hp) : (p.transfer H hp).edges = p.edges := by
  induction 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 : V
p : Walk G u v
H : SimpleGraph V
u✝ : V
hp : ∀ e ∈ edges nil, e ∈ edgeSet H
⊢ edges (Walk.transfer nil H hp) = edges nil

Next tactic:
simp [*]
@[simp]
theorem edges_transfer (hp) : (p.transfer H hp).edges = p.edges := by
  induction 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
p : Walk G u v
H : SimpleGraph V
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (hp : ∀ e ∈ edges p✝, e ∈ edgeSet H), edges (Walk.transfer p✝ H hp) = edges p✝
hp : ∀ e ∈ edges (cons h✝ p✝), e ∈ edgeSet H
⊢ edges (Walk.transfer (cons h✝ p✝) H hp) = edges (cons h✝ p✝)

Next tactic:
simp [*]