l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem map_id (p : G.Walk u v) : p.map Hom.id = 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''
f : G →g G'
f' : G' →g G''
u v u' v' u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : Walk G v✝ w✝ → Walk.map Hom.id p' = p'
p : Walk G u✝ w✝
⊢ Walk.map Hom.id (cons h✝ p') = cons h✝ p'

Next tactic:
| cons _ p' ih => simp [ih p']
@[simp]
theorem map_id (p : G.Walk u v) : p.map Hom.id = p := by
  induction p with
  | nil => rfl
  | cons _ p' 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' u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : Walk G v✝ w✝ → Walk.map Hom.id p' = p'
p : Walk G u✝ w✝
⊢ Walk.map Hom.id (cons h✝ p') = cons h✝ p'

Next tactic:
simp [ih p']
@[simp]
theorem map_map : (p.map f).map f' = p.map (f'.comp f) := 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
⊢ Walk.map f' (Walk.map f p) = Walk.map (Hom.comp f' f) p

Next tactic:
induction p with
  | nil => rfl
  | cons _ _ ih => simp [ih]
@[simp]
theorem map_map : (p.map f).map f' = p.map (f'.comp f) := 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
u✝ : V
⊢ Walk.map f' (Walk.map f nil) = Walk.map (Hom.comp f' f) nil

Next tactic:
| nil => rfl
@[simp]
theorem map_map : (p.map f).map f' = p.map (f'.comp f) := 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
u✝ : V
⊢ Walk.map f' (Walk.map f nil) = Walk.map (Hom.comp f' f) nil

Next tactic:
rfl
@[simp]
theorem map_map : (p.map f).map f' = p.map (f'.comp f) := 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''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : Walk.map f' (Walk.map f p✝) = Walk.map (Hom.comp f' f) p✝
⊢ Walk.map f' (Walk.map f (cons h✝ p✝)) = Walk.map (Hom.comp f' f) (cons h✝ p✝)

Next tactic:
| cons _ _ ih => simp [ih]
@[simp]
theorem map_map : (p.map f).map f' = p.map (f'.comp f) := 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''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : Walk.map f' (Walk.map f p✝) = Walk.map (Hom.comp f' f) p✝
⊢ Walk.map f' (Walk.map f (cons h✝ p✝)) = Walk.map (Hom.comp f' f) (cons h✝ p✝)

Next tactic:
simp [ih]
/-- Unlike categories, for graphs vertex equality is an important notion, so needing to be able to
work with equality of graph homomorphisms is a necessary evil. -/
theorem map_eq_of_eq {f : G →g G'} (f' : G →g G') (h : f = f') :
    p.map f = (p.map f').copy (h ▸ rfl) (h ▸ rfl) := 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 f' : G →g G'
h : f = f'
⊢ Walk.map f p = Walk.copy (Walk.map f' p) (_ : f' u = f u) (_ : f' v = f v)

Next tactic:
subst_vars
/-- Unlike categories, for graphs vertex equality is an important notion, so needing to be able to
work with equality of graph homomorphisms is a necessary evil. -/
theorem map_eq_of_eq {f : G →g G'} (f' : G →g G') (h : f = f') :
    p.map f = (p.map f').copy (h ▸ rfl) (h ▸ rfl) := by
  subst_vars
  

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'
⊢ Walk.map f' p = Walk.copy (Walk.map f' p) (_ : f' u = f' u) (_ : f' v = f' v)

Next tactic:
rfl
@[simp]
theorem map_eq_nil_iff {p : G.Walk u u} : p.map f = nil ↔ p = nil := 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
⊢ Walk.map f p = nil ↔ p = nil

Next tactic:
cases p
@[simp]
theorem map_eq_nil_iff {p : G.Walk u u} : p.map f = nil ↔ 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''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
⊢ Walk.map f nil = nil ↔ nil = nil

Next tactic:
simp
@[simp]
theorem map_eq_nil_iff {p : G.Walk u u} : p.map f = nil ↔ 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''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
v✝ : V
h✝ : Adj G u v✝
p✝ : Walk G v✝ u
⊢ Walk.map f (cons h✝ p✝) = nil ↔ cons h✝ p✝ = nil

Next tactic:
simp
@[simp]
theorem length_map : (p.map f).length = p.length := 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
⊢ length (Walk.map f p) = length p

Next tactic:
induction p
@[simp]
theorem length_map : (p.map f).length = p.length := 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''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ : V
⊢ length (Walk.map f nil) = length nil

Next tactic:
simp [*]
@[simp]
theorem length_map : (p.map f).length = p.length := 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''
f : G →g G'
f' : G' →g G''
u 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✝ : length (Walk.map f p✝) = length p✝
⊢ length (Walk.map f (cons h✝ p✝)) = length (cons h✝ p✝)

Next tactic:
simp [*]
theorem map_append {u v w : V} (p : G.Walk u v) (q : G.Walk v w) :
    (p.append q).map f = (p.map f).append (q.map f) := 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✝
u v w : V
p : Walk G u v
q : Walk G v w
⊢ Walk.map f (append p q) = append (Walk.map f p) (Walk.map f q)

Next tactic:
induction p
theorem map_append {u v w : V} (p : G.Walk u v) (q : G.Walk v w) :
    (p.append q).map f = (p.map f).append (q.map f) := 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''
f : G →g G'
f' : G' →g G''
u✝¹ v✝ u' v' : V
p : Walk G u✝¹ v✝
u v w u✝ : V
q : Walk G u✝ w
⊢ Walk.map f (append nil q) = append (Walk.map f nil) (Walk.map f q)

Next tactic:
simp [*]
theorem map_append {u v w : V} (p : G.Walk u v) (q : G.Walk v w) :
    (p.append q).map f = (p.map f).append (q.map f) := 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''
f : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (q : Walk G w✝ w), Walk.map f (append p✝ q) = append (Walk.map f p✝) (Walk.map f q)
q : Walk G w✝ w
⊢ Walk.map f (append (cons h✝ p✝) q) = append (Walk.map f (cons h✝ p✝)) (Walk.map f q)

Next tactic:
simp [*]
@[simp]
theorem reverse_map : (p.map f).reverse = p.reverse.map f := 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
⊢ reverse (Walk.map f p) = Walk.map f (reverse p)

Next tactic:
induction p
@[simp]
theorem reverse_map : (p.map f).reverse = p.reverse.map f := 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''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ : V
⊢ reverse (Walk.map f nil) = Walk.map f (reverse nil)

Next tactic:
simp [map_append, *]
@[simp]
theorem reverse_map : (p.map f).reverse = p.reverse.map f := 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''
f : G →g G'
f' : G' →g G''
u 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✝ : reverse (Walk.map f p✝) = Walk.map f (reverse p✝)
⊢ reverse (Walk.map f (cons h✝ p✝)) = Walk.map f (reverse (cons h✝ p✝))

Next tactic:
simp [map_append, *]
@[simp]
theorem support_map : (p.map f).support = p.support.map f := 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
⊢ support (Walk.map f p) = List.map (⇑f) (support p)

Next tactic:
induction p
@[simp]
theorem support_map : (p.map f).support = p.support.map f := 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''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ : V
⊢ support (Walk.map f nil) = List.map (⇑f) (support nil)

Next tactic:
simp [*]
@[simp]
theorem support_map : (p.map f).support = p.support.map f := 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''
f : G →g G'
f' : G' →g G''
u 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✝ : support (Walk.map f p✝) = List.map (⇑f) (support p✝)
⊢ support (Walk.map f (cons h✝ p✝)) = List.map (⇑f) (support (cons h✝ p✝))

Next tactic:
simp [*]
@[simp]
theorem darts_map : (p.map f).darts = p.darts.map f.mapDart := 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
⊢ darts (Walk.map f p) = List.map (Hom.mapDart f) (darts p)

Next tactic:
induction p
@[simp]
theorem darts_map : (p.map f).darts = p.darts.map f.mapDart := 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''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ : V
⊢ darts (Walk.map f nil) = List.map (Hom.mapDart f) (darts nil)

Next tactic:
simp [*]
@[simp]
theorem darts_map : (p.map f).darts = p.darts.map f.mapDart := 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''
f : G →g G'
f' : G' →g G''
u 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✝ : darts (Walk.map f p✝) = List.map (Hom.mapDart f) (darts p✝)
⊢ darts (Walk.map f (cons h✝ p✝)) = List.map (Hom.mapDart f) (darts (cons h✝ p✝))

Next tactic:
simp [*]
@[simp]
theorem edges_map : (p.map f).edges = p.edges.map (Sym2.map f) := 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
⊢ edges (Walk.map f p) = List.map (Sym2.map ⇑f) (edges p)

Next tactic:
induction p with
  | nil => rfl
  | cons _ _ ih =>
    simp only [Walk.map_cons, edges_cons, List.map_cons, Sym2.map_pair_eq, List.cons.injEq,
      true_and, ih]
@[simp]
theorem edges_map : (p.map f).edges = p.edges.map (Sym2.map f) := 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
u✝ : V
⊢ edges (Walk.map f nil) = List.map (Sym2.map ⇑f) (edges nil)

Next tactic:
| nil => rfl
@[simp]
theorem edges_map : (p.map f).edges = p.edges.map (Sym2.map f) := 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
u✝ : V
⊢ edges (Walk.map f nil) = List.map (Sym2.map ⇑f) (edges nil)

Next tactic:
rfl
@[simp]
theorem edges_map : (p.map f).edges = p.edges.map (Sym2.map f) := 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''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : edges (Walk.map f p✝) = List.map (Sym2.map ⇑f) (edges p✝)
⊢ edges (Walk.map f (cons h✝ p✝)) = List.map (Sym2.map ⇑f) (edges (cons h✝ p✝))

Next tactic:
| cons _ _ ih =>
    simp only [Walk.map_cons, edges_cons, List.map_cons, Sym2.map_pair_eq, List.cons.injEq,
      true_and, ih]
@[simp]
theorem edges_map : (p.map f).edges = p.edges.map (Sym2.map f) := 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''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : edges (Walk.map f p✝) = List.map (Sym2.map ⇑f) (edges p✝)
⊢ edges (Walk.map f (cons h✝ p✝)) = List.map (Sym2.map ⇑f) (edges (cons h✝ p✝))

Next tactic:
simp only [Walk.map_cons, edges_cons, List.map_cons, Sym2.map_pair_eq, List.cons.injEq,
      true_and, ih]
theorem map_isPath_of_injective (hinj : Function.Injective f) (hp : p.IsPath) :
    (p.map f).IsPath := 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
hp : IsPath p
⊢ IsPath (Walk.map f p)

Next tactic:
induction p with
  | nil => simp
  | cons _ _ ih =>
    rw [Walk.cons_isPath_iff] at hp
    simp only [map_cons, cons_isPath_iff, ih hp.1, support_map, List.mem_map, not_exists, not_and,
      true_and]
    intro x hx hf
    cases hinj hf
    exact hp.2 hx
theorem map_isPath_of_injective (hinj : Function.Injective f) (hp : p.IsPath) :
    (p.map f).IsPath := 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
hp : IsPath nil
⊢ IsPath (Walk.map f nil)

Next tactic:
| nil => simp
theorem map_isPath_of_injective (hinj : Function.Injective f) (hp : p.IsPath) :
    (p.map f).IsPath := 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
hp : IsPath nil
⊢ IsPath (Walk.map f nil)

Next tactic:
simp
theorem map_isPath_of_injective (hinj : Function.Injective f) (hp : p.IsPath) :
    (p.map f).IsPath := 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 : IsPath p✝ → IsPath (Walk.map f p✝)
hp : IsPath (cons h✝ p✝)
⊢ IsPath (Walk.map f (cons h✝ p✝))

Next tactic:
| cons _ _ ih =>
    rw [Walk.cons_isPath_iff] at hp
    simp only [map_cons, cons_isPath_iff, ih hp.1, support_map, List.mem_map, not_exists, not_and,
      true_and]
    intro x hx hf
    cases hinj hf
    exact hp.2 hx
theorem map_isPath_of_injective (hinj : Function.Injective f) (hp : p.IsPath) :
    (p.map f).IsPath := 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 : IsPath p✝ → IsPath (Walk.map f p✝)
hp : IsPath (cons h✝ p✝)
⊢ IsPath (Walk.map f (cons h✝ p✝))

Next tactic:
rw [Walk.cons_isPath_iff] at hp
theorem map_isPath_of_injective (hinj : Function.Injective f) (hp : p.IsPath) :
    (p.map f).IsPath := by
  induction p with
  | nil => simp
  | cons _ _ ih =>
    rw [Walk.cons_isPath_iff] at hp
    

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 : IsPath p✝ → IsPath (Walk.map f p✝)
hp : IsPath p✝ ∧ u✝ ∉ support p✝
⊢ IsPath (Walk.map f (cons h✝ p✝))

Next tactic:
simp only [map_cons, cons_isPath_iff, ih hp.1, support_map, List.mem_map, not_exists, not_and,
      true_and]
theorem map_isPath_of_injective (hinj : Function.Injective f) (hp : p.IsPath) :
    (p.map f).IsPath := by
  induction p with
  | nil => simp
  | cons _ _ ih =>
    rw [Walk.cons_isPath_iff] at hp
    simp only [map_cons, cons_isPath_iff, ih hp.1, support_map, List.mem_map, not_exists, not_and,
      true_and]
    

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 : IsPath p✝ → IsPath (Walk.map f p✝)
hp : IsPath p✝ ∧ u✝ ∉ support p✝
⊢ ∀ x ∈ support p✝, ¬f x = f u✝

Next tactic:
intro x hx hf
theorem map_isPath_of_injective (hinj : Function.Injective f) (hp : p.IsPath) :
    (p.map f).IsPath := by
  induction p with
  | nil => simp
  | cons _ _ ih =>
    rw [Walk.cons_isPath_iff] at hp
    simp only [map_cons, cons_isPath_iff, ih hp.1, support_map, List.mem_map, not_exists, not_and,
      true_and]
    intro x hx hf
    

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 : IsPath p✝ → IsPath (Walk.map f p✝)
hp : IsPath p✝ ∧ u✝ ∉ support p✝
x : V
hx : x ∈ support p✝
hf : f x = f u✝
⊢ False

Next tactic:
cases hinj hf
theorem map_isPath_of_injective (hinj : Function.Injective f) (hp : p.IsPath) :
    (p.map f).IsPath := by
  induction p with
  | nil => simp
  | cons _ _ ih =>
    rw [Walk.cons_isPath_iff] at hp
    simp only [map_cons, cons_isPath_iff, ih hp.1, support_map, List.mem_map, not_exists, not_and,
      true_and]
    intro x hx hf
    cases hinj hf
    

Proof state:
case 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
hinj : Injective ⇑f
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsPath p✝ → IsPath (Walk.map f p✝)
hp : IsPath p✝ ∧ u✝ ∉ support p✝
hx : u✝ ∈ support p✝
hf : f u✝ = f u✝
⊢ False

Next tactic:
exact hp.2 hx
protected theorem IsPath.of_map {f : G →g G'} (hp : (p.map f).IsPath) : p.IsPath := 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'
hp : IsPath (Walk.map f p)
⊢ IsPath p

Next tactic:
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
    exact List.mem_map_of_mem f hp2
protected theorem IsPath.of_map {f : G →g G'} (hp : (p.map f).IsPath) : p.IsPath := 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
f : G →g G'
u✝ : V
hp : IsPath (Walk.map f Walk.nil)
⊢ IsPath Walk.nil

Next tactic:
| nil => simp
protected theorem IsPath.of_map {f : G →g G'} (hp : (p.map f).IsPath) : p.IsPath := 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
f : G →g G'
u✝ : V
hp : IsPath (Walk.map f Walk.nil)
⊢ IsPath Walk.nil

Next tactic:
simp
protected theorem IsPath.of_map {f : G →g G'} (hp : (p.map f).IsPath) : p.IsPath := 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
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✝
hp : IsPath (Walk.map f (cons h✝ p✝))
⊢ IsPath (cons h✝ p✝)

Next tactic:
| 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
    exact List.mem_map_of_mem f hp2
protected theorem IsPath.of_map {f : G →g G'} (hp : (p.map f).IsPath) : p.IsPath := 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
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✝
hp : IsPath (Walk.map f (cons h✝ p✝))
⊢ IsPath (cons h✝ p✝)

Next tactic:
rw [map_cons, Walk.cons_isPath_iff, support_map] at hp
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
    

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'
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsPath (Walk.map f p✝) → IsPath p✝
hp : IsPath (Walk.map f p✝) ∧ f u✝ ∉ List.map (⇑f) (support p✝)
⊢ IsPath (cons h✝ p✝)

Next tactic:
rw [Walk.cons_isPath_iff]
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]
    

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'
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsPath (Walk.map f p✝) → IsPath p✝
hp : IsPath (Walk.map f p✝) ∧ f u✝ ∉ List.map (⇑f) (support p✝)
⊢ IsPath p✝ ∧ u✝ ∉ support p✝

Next tactic:
cases' hp with hp1 hp2
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
    

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 : f u✝ ∉ List.map (⇑f) (support p✝)
⊢ IsPath p✝ ∧ u✝ ∉ support p✝

Next tactic:
refine' ⟨ih hp1, _⟩
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, _⟩
    

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 : f u✝ ∉ List.map (⇑f) (support p✝)
⊢ u✝ ∉ support p✝

Next tactic:
contrapose! hp2