l3lab/ntp-mathlib huggingface dataset:
@[ext]
theorem supp_injective :
    Function.Injective (ConnectedComponent.supp : G.ConnectedComponent → Set V) := by
  refine' ConnectedComponent.ind₂ _
  intro v w
  simp only [ConnectedComponent.supp, Set.ext_iff, ConnectedComponent.eq, Set.mem_setOf_eq]
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ (∀ (x : V), Reachable G x v ↔ Reachable G x w) → Reachable G v w

Next tactic:
intro h
@[ext]
theorem supp_injective :
    Function.Injective (ConnectedComponent.supp : G.ConnectedComponent → Set V) := by
  refine' ConnectedComponent.ind₂ _
  intro v w
  simp only [ConnectedComponent.supp, Set.ext_iff, ConnectedComponent.eq, Set.mem_setOf_eq]
  intro h
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
h : ∀ (x : V), Reachable G x v ↔ Reachable G x w
⊢ Reachable G v w

Next tactic:
rw [reachable_comm, h]
theorem Preconnected.set_univ_walk_nonempty (hconn : G.Preconnected) (u v : V) :
    (Set.univ : Set (G.Walk u v)).Nonempty := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
hconn : Preconnected G
u v : V
⊢ Set.Nonempty Set.univ

Next tactic:
rw [← Set.nonempty_iff_univ_nonempty]
theorem Preconnected.set_univ_walk_nonempty (hconn : G.Preconnected) (u v : V) :
    (Set.univ : Set (G.Walk u v)).Nonempty := by
  rw [← Set.nonempty_iff_univ_nonempty]
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
hconn : Preconnected G
u v : V
⊢ Nonempty (Walk G u v)

Next tactic:
exact hconn u v
theorem toSubgraph_cons_nil_eq_subgraphOfAdj (h : G.Adj u v) :
    (cons h nil).toSubgraph = G.subgraphOfAdj 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
⊢ Walk.toSubgraph (cons h nil) = subgraphOfAdj G h

Next tactic:
simp
theorem mem_verts_toSubgraph (p : G.Walk u v) : w ∈ p.toSubgraph.verts ↔ w ∈ p.support := 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
⊢ w ∈ (Walk.toSubgraph p).verts ↔ w ∈ support p

Next tactic:
induction' p with _ x y z h p' ih
theorem mem_verts_toSubgraph (p : G.Walk u v) : w ∈ p.toSubgraph.verts ↔ w ∈ p.support := by
  induction' p with _ x y z h p' ih
  · 

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
⊢ w ∈ (Walk.toSubgraph nil).verts ↔ w ∈ support nil

Next tactic:
simp
theorem mem_verts_toSubgraph (p : G.Walk u v) : w ∈ p.toSubgraph.verts ↔ w ∈ p.support := by
  induction' p with _ x y z h p' ih
  · 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 x y z : V
h : Adj G x y
p' : Walk G y z
ih : w ∈ (Walk.toSubgraph p').verts ↔ w ∈ support p'
⊢ w ∈ (Walk.toSubgraph (cons h p')).verts ↔ w ∈ support (cons h p')

Next tactic:
have : w = y ∨ w ∈ p'.support ↔ w ∈ p'.support :=
      ⟨by rintro (rfl | h) <;> simp [*], by simp (config := { contextual := true })⟩
theorem mem_verts_toSubgraph (p : G.Walk u v) : w ∈ p.toSubgraph.verts ↔ w ∈ p.support := by
  induction' p with _ x y z h p' ih
  · simp
  · have : w = y ∨ w ∈ p'.support ↔ w ∈ p'.support :=
      ⟨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 y z : V
h : Adj G x y
p' : Walk G y z
ih : w ∈ (Walk.toSubgraph p').verts ↔ w ∈ support p'
⊢ w = y ∨ w ∈ support p' → w ∈ support p'

Next tactic:
rintro (rfl | h)
theorem mem_verts_toSubgraph (p : G.Walk u v) : w ∈ p.toSubgraph.verts ↔ w ∈ p.support := by
  induction' p with _ x y z h p' ih
  · simp
  · have : w = y ∨ w ∈ p'.support ↔ w ∈ p'.support :=
      ⟨by rintro (rfl | h) <;> 

Proof state:
case inl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x z : V
h : Adj G x w
p' : Walk G w z
ih : w ∈ (Walk.toSubgraph p').verts ↔ w ∈ support p'
⊢ w ∈ support p'

Next tactic:
simp [*]
theorem mem_verts_toSubgraph (p : G.Walk u v) : w ∈ p.toSubgraph.verts ↔ w ∈ p.support := by
  induction' p with _ x y z h p' ih
  · simp
  · have : w = y ∨ w ∈ p'.support ↔ w ∈ p'.support :=
      ⟨by rintro (rfl | h) <;> 

Proof state:
case inr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x y z : V
h✝ : Adj G x y
p' : Walk G y z
ih : w ∈ (Walk.toSubgraph p').verts ↔ w ∈ support p'
h : w ∈ support p'
⊢ w ∈ support p'

Next tactic:
simp [*]
theorem mem_verts_toSubgraph (p : G.Walk u v) : w ∈ p.toSubgraph.verts ↔ w ∈ p.support := by
  induction' p with _ x y z h p' ih
  · simp
  · have : w = y ∨ w ∈ p'.support ↔ w ∈ p'.support :=
      ⟨by rintro (rfl | h) <;> simp [*], 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 y z : V
h : Adj G x y
p' : Walk G y z
ih : w ∈ (Walk.toSubgraph p').verts ↔ w ∈ support p'
⊢ w ∈ support p' → w = y ∨ w ∈ support p'

Next tactic:
simp (config := { contextual := true })
theorem mem_verts_toSubgraph (p : G.Walk u v) : w ∈ p.toSubgraph.verts ↔ w ∈ p.support := by
  induction' p with _ x y z h p' ih
  · simp
  · have : w = y ∨ w ∈ p'.support ↔ w ∈ p'.support :=
      ⟨by rintro (rfl | h) <;> simp [*], by simp (config := { contextual := true })⟩
    

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 y z : V
h : Adj G x y
p' : Walk G y z
ih : w ∈ (Walk.toSubgraph p').verts ↔ w ∈ support p'
this : w = y ∨ w ∈ support p' ↔ w ∈ support p'
⊢ w ∈ (Walk.toSubgraph (cons h p')).verts ↔ w ∈ support (cons h p')

Next tactic:
simp [ih, or_assoc, this]
lemma start_mem_verts_toSubgraph (p : G.Walk u v) : u ∈ p.toSubgraph.verts := 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
⊢ u ∈ (Walk.toSubgraph p).verts

Next tactic:
simp [mem_verts_toSubgraph]
lemma end_mem_verts_toSubgraph (p : G.Walk u v) : v ∈ p.toSubgraph.verts := 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
⊢ v ∈ (Walk.toSubgraph p).verts

Next tactic:
simp [mem_verts_toSubgraph]
theorem mem_edges_toSubgraph (p : G.Walk u v) {e : Sym2 V} :
    e ∈ p.toSubgraph.edgeSet ↔ e ∈ 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 w : V
p : Walk G u v
e : Sym2 V
⊢ e ∈ Subgraph.edgeSet (Walk.toSubgraph p) ↔ e ∈ edges p

Next tactic:
induction p
theorem mem_edges_toSubgraph (p : G.Walk u v) {e : Sym2 V} :
    e ∈ p.toSubgraph.edgeSet ↔ e ∈ 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 w : V
e : Sym2 V
u✝ : V
⊢ e ∈ Subgraph.edgeSet (Walk.toSubgraph nil) ↔ e ∈ edges nil

Next tactic:
simp [*]
theorem mem_edges_toSubgraph (p : G.Walk u v) {e : Sym2 V} :
    e ∈ p.toSubgraph.edgeSet ↔ e ∈ 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 w : V
e : Sym2 V
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : e ∈ Subgraph.edgeSet (Walk.toSubgraph p✝) ↔ e ∈ edges p✝
⊢ e ∈ Subgraph.edgeSet (Walk.toSubgraph (cons h✝ p✝)) ↔ e ∈ edges (cons h✝ p✝)

Next tactic:
simp [*]
@[simp]
theorem toSubgraph_append (p : G.Walk u v) (q : G.Walk v w) :
    (p.append q).toSubgraph = p.toSubgraph ⊔ q.toSubgraph := 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
⊢ Walk.toSubgraph (append p q) = Walk.toSubgraph p ⊔ Walk.toSubgraph q

Next tactic:
induction p
@[simp]
theorem toSubgraph_append (p : G.Walk u v) (q : G.Walk v w) :
    (p.append q).toSubgraph = p.toSubgraph ⊔ q.toSubgraph := 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 w u✝ : V
q : Walk G u✝ w
⊢ Walk.toSubgraph (append nil q) = Walk.toSubgraph nil ⊔ Walk.toSubgraph q

Next tactic:
simp [*, sup_assoc]
@[simp]
theorem toSubgraph_append (p : G.Walk u v) (q : G.Walk v w) :
    (p.append q).toSubgraph = p.toSubgraph ⊔ q.toSubgraph := 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 w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (q : Walk G w✝ w), Walk.toSubgraph (append p✝ q) = Walk.toSubgraph p✝ ⊔ Walk.toSubgraph q
q : Walk G w✝ w
⊢ Walk.toSubgraph (append (cons h✝ p✝) q) = Walk.toSubgraph (cons h✝ p✝) ⊔ Walk.toSubgraph q

Next tactic:
simp [*, sup_assoc]
@[simp]
theorem toSubgraph_reverse (p : G.Walk u v) : p.reverse.toSubgraph = p.toSubgraph := 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
⊢ Walk.toSubgraph (reverse p) = Walk.toSubgraph p

Next tactic:
induction p with
  | nil => simp
  | cons _ _ _ =>
    simp only [*, Walk.toSubgraph, reverse_cons, toSubgraph_append, subgraphOfAdj_symm]
    rw [sup_comm]
    congr
    ext <;> simp [-Set.bot_eq_empty]
@[simp]
theorem toSubgraph_reverse (p : G.Walk u v) : p.reverse.toSubgraph = p.toSubgraph := 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
⊢ Walk.toSubgraph (reverse nil) = Walk.toSubgraph nil

Next tactic:
| nil => simp
@[simp]
theorem toSubgraph_reverse (p : G.Walk u v) : p.reverse.toSubgraph = p.toSubgraph := 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
⊢ Walk.toSubgraph (reverse nil) = Walk.toSubgraph nil

Next tactic:
simp
@[simp]
theorem toSubgraph_reverse (p : G.Walk u v) : p.reverse.toSubgraph = p.toSubgraph := 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✝
p_ih✝ : Walk.toSubgraph (reverse p✝) = Walk.toSubgraph p✝
⊢ Walk.toSubgraph (reverse (cons h✝ p✝)) = Walk.toSubgraph (cons h✝ p✝)

Next tactic:
| cons _ _ _ =>
    simp only [*, Walk.toSubgraph, reverse_cons, toSubgraph_append, subgraphOfAdj_symm]
    rw [sup_comm]
    congr
    ext <;> simp [-Set.bot_eq_empty]
@[simp]
theorem toSubgraph_reverse (p : G.Walk u v) : p.reverse.toSubgraph = p.toSubgraph := by
  induction p with
  | nil => simp
  | cons _ _ _ =>
    

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✝
p_ih✝ : Walk.toSubgraph (reverse p✝) = Walk.toSubgraph p✝
⊢ Walk.toSubgraph (reverse (cons h✝ p✝)) = Walk.toSubgraph (cons h✝ p✝)

Next tactic:
simp only [*, Walk.toSubgraph, reverse_cons, toSubgraph_append, subgraphOfAdj_symm]
@[simp]
theorem toSubgraph_reverse (p : G.Walk u v) : p.reverse.toSubgraph = p.toSubgraph := by
  induction p with
  | nil => simp
  | cons _ _ _ =>
    simp only [*, Walk.toSubgraph, reverse_cons, toSubgraph_append, subgraphOfAdj_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 w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : Walk.toSubgraph (reverse p✝) = Walk.toSubgraph p✝
⊢ Walk.toSubgraph p✝ ⊔ (subgraphOfAdj G (_ : Adj G u✝ v✝) ⊔ SimpleGraph.singletonSubgraph G u✝) =
    subgraphOfAdj G h✝ ⊔ Walk.toSubgraph p✝

Next tactic:
rw [sup_comm]
@[simp]
theorem toSubgraph_reverse (p : G.Walk u v) : p.reverse.toSubgraph = p.toSubgraph := by
  induction p with
  | nil => simp
  | cons _ _ _ =>
    simp only [*, Walk.toSubgraph, reverse_cons, toSubgraph_append, subgraphOfAdj_symm]
    rw [sup_comm]
    

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✝
p_ih✝ : Walk.toSubgraph (reverse p✝) = Walk.toSubgraph p✝
⊢ subgraphOfAdj G (_ : Adj G u✝ v✝) ⊔ SimpleGraph.singletonSubgraph G u✝ ⊔ Walk.toSubgraph p✝ =
    subgraphOfAdj G h✝ ⊔ Walk.toSubgraph p✝

Next tactic:
congr
@[simp]
theorem toSubgraph_reverse (p : G.Walk u v) : p.reverse.toSubgraph = p.toSubgraph := by
  induction p with
  | nil => simp
  | cons _ _ _ =>
    simp only [*, Walk.toSubgraph, reverse_cons, toSubgraph_append, subgraphOfAdj_symm]
    rw [sup_comm]
    congr
    

Proof state:
case cons.e_a
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✝
p_ih✝ : Walk.toSubgraph (reverse p✝) = Walk.toSubgraph p✝
⊢ subgraphOfAdj G (_ : Adj G u✝ v✝) ⊔ SimpleGraph.singletonSubgraph G u✝ = subgraphOfAdj G h✝

Next tactic:
ext
@[simp]
theorem toSubgraph_reverse (p : G.Walk u v) : p.reverse.toSubgraph = p.toSubgraph := by
  induction p with
  | nil => simp
  | cons _ _ _ =>
    simp only [*, Walk.toSubgraph, reverse_cons, toSubgraph_append, subgraphOfAdj_symm]
    rw [sup_comm]
    congr
    ext <;> 

Proof state:
case cons.e_a.verts.h
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✝
p_ih✝ : Walk.toSubgraph (reverse p✝) = Walk.toSubgraph p✝
x✝ : V
⊢ x✝ ∈ (subgraphOfAdj G (_ : Adj G u✝ v✝) ⊔ SimpleGraph.singletonSubgraph G u✝).verts ↔ x✝ ∈ (subgraphOfAdj G h✝).verts

Next tactic:
simp [-Set.bot_eq_empty]
@[simp]
theorem toSubgraph_reverse (p : G.Walk u v) : p.reverse.toSubgraph = p.toSubgraph := by
  induction p with
  | nil => simp
  | cons _ _ _ =>
    simp only [*, Walk.toSubgraph, reverse_cons, toSubgraph_append, subgraphOfAdj_symm]
    rw [sup_comm]
    congr
    ext <;> 

Proof state:
case cons.e_a.Adj.h.h.a
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✝
p_ih✝ : Walk.toSubgraph (reverse p✝) = Walk.toSubgraph p✝
x✝¹ x✝ : V
⊢ Subgraph.Adj (subgraphOfAdj G (_ : Adj G u✝ v✝) ⊔ SimpleGraph.singletonSubgraph G u✝) x✝¹ x✝ ↔
    Subgraph.Adj (subgraphOfAdj G h✝) x✝¹ x✝

Next tactic:
simp [-Set.bot_eq_empty]
@[simp]
theorem toSubgraph_rotate [DecidableEq V] (c : G.Walk v v) (h : u ∈ c.support) :
    (c.rotate h).toSubgraph = c.toSubgraph := 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
inst✝ : DecidableEq V
c : Walk G v v
h : u ∈ support c
⊢ Walk.toSubgraph (rotate c h) = Walk.toSubgraph c

Next tactic:
rw [rotate, toSubgraph_append, sup_comm, ← toSubgraph_append, take_spec]
@[simp]
theorem toSubgraph_map (f : G →g G') (p : G.Walk u v) : (p.map f).toSubgraph = p.toSubgraph.map f :=
  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
f : G →g G'
p : Walk G u v
⊢ Walk.toSubgraph (Walk.map f p) = Subgraph.map f (Walk.toSubgraph p)

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

Next tactic:
simp [*, Subgraph.map_sup]
@[simp]
theorem toSubgraph_map (f : G →g G') (p : G.Walk u v) : (p.map f).toSubgraph = p.toSubgraph.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''
u v w : V
f : G →g G'
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : Walk.toSubgraph (Walk.map f p✝) = Subgraph.map f (Walk.toSubgraph p✝)
⊢ Walk.toSubgraph (Walk.map f (cons h✝ p✝)) = Subgraph.map f (Walk.toSubgraph (cons h✝ p✝))

Next tactic:
simp [*, Subgraph.map_sup]
@[simp]
theorem finite_neighborSet_toSubgraph (p : G.Walk u v) : (p.toSubgraph.neighborSet w).Finite := 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
⊢ Set.Finite (Subgraph.neighborSet (Walk.toSubgraph p) w)

Next tactic:
induction p with
  | nil =>
    rw [Walk.toSubgraph, neighborSet_singletonSubgraph]
    apply Set.toFinite
  | cons ha _ ih =>
    rw [Walk.toSubgraph, Subgraph.neighborSet_sup]
    refine Set.Finite.union ?_ ih
    refine Set.Finite.subset ?_ (neighborSet_subgraphOfAdj_subset ha)
    apply Set.toFinite
@[simp]
theorem finite_neighborSet_toSubgraph (p : G.Walk u v) : (p.toSubgraph.neighborSet w).Finite := 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
⊢ Set.Finite (Subgraph.neighborSet (Walk.toSubgraph nil) w)

Next tactic:
| nil =>
    rw [Walk.toSubgraph, neighborSet_singletonSubgraph]
    apply Set.toFinite
@[simp]
theorem finite_neighborSet_toSubgraph (p : G.Walk u v) : (p.toSubgraph.neighborSet w).Finite := 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
⊢ Set.Finite (Subgraph.neighborSet (Walk.toSubgraph nil) w)

Next tactic:
rw [Walk.toSubgraph, neighborSet_singletonSubgraph]
@[simp]
theorem finite_neighborSet_toSubgraph (p : G.Walk u v) : (p.toSubgraph.neighborSet w).Finite := by
  induction p with
  | nil =>
    rw [Walk.toSubgraph, neighborSet_singletonSubgraph]
    

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
⊢ Set.Finite ∅

Next tactic:
apply Set.toFinite
@[simp]
theorem finite_neighborSet_toSubgraph (p : G.Walk u v) : (p.toSubgraph.neighborSet w).Finite := by
  induction p with
  | nil =>
    rw [Walk.toSubgraph, neighborSet_singletonSubgraph]
    apply Set.toFinite
  

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
ha : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : Set.Finite (Subgraph.neighborSet (Walk.toSubgraph p✝) w)
⊢ Set.Finite (Subgraph.neighborSet (Walk.toSubgraph (cons ha p✝)) w)

Next tactic:
| cons ha _ ih =>
    rw [Walk.toSubgraph, Subgraph.neighborSet_sup]
    refine Set.Finite.union ?_ ih
    refine Set.Finite.subset ?_ (neighborSet_subgraphOfAdj_subset ha)
    apply Set.toFinite
@[simp]
theorem finite_neighborSet_toSubgraph (p : G.Walk u v) : (p.toSubgraph.neighborSet w).Finite := by
  induction p with
  | nil =>
    rw [Walk.toSubgraph, neighborSet_singletonSubgraph]
    apply Set.toFinite
  | cons ha _ 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
ha : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : Set.Finite (Subgraph.neighborSet (Walk.toSubgraph p✝) w)
⊢ Set.Finite (Subgraph.neighborSet (Walk.toSubgraph (cons ha p✝)) w)

Next tactic:
rw [Walk.toSubgraph, Subgraph.neighborSet_sup]
@[simp]
theorem finite_neighborSet_toSubgraph (p : G.Walk u v) : (p.toSubgraph.neighborSet w).Finite := by
  induction p with
  | nil =>
    rw [Walk.toSubgraph, neighborSet_singletonSubgraph]
    apply Set.toFinite
  | cons ha _ ih =>
    rw [Walk.toSubgraph, Subgraph.neighborSet_sup]
    

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
ha : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : Set.Finite (Subgraph.neighborSet (Walk.toSubgraph p✝) w)
⊢ Set.Finite (Subgraph.neighborSet (subgraphOfAdj G ha) w ∪ Subgraph.neighborSet (Walk.toSubgraph p✝) w)

Next tactic:
refine Set.Finite.union ?_ ih
@[simp]
theorem finite_neighborSet_toSubgraph (p : G.Walk u v) : (p.toSubgraph.neighborSet w).Finite := by
  induction p with
  | nil =>
    rw [Walk.toSubgraph, neighborSet_singletonSubgraph]
    apply Set.toFinite
  | cons ha _ ih =>
    rw [Walk.toSubgraph, Subgraph.neighborSet_sup]
    refine Set.Finite.union ?_ 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
ha : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : Set.Finite (Subgraph.neighborSet (Walk.toSubgraph p✝) w)
⊢ Set.Finite (Subgraph.neighborSet (subgraphOfAdj G ha) w)

Next tactic:
refine Set.Finite.subset ?_ (neighborSet_subgraphOfAdj_subset ha)
@[simp]
theorem finite_neighborSet_toSubgraph (p : G.Walk u v) : (p.toSubgraph.neighborSet w).Finite := by
  induction p with
  | nil =>
    rw [Walk.toSubgraph, neighborSet_singletonSubgraph]
    apply Set.toFinite
  | cons ha _ ih =>
    rw [Walk.toSubgraph, Subgraph.neighborSet_sup]
    refine Set.Finite.union ?_ ih
    refine Set.Finite.subset ?_ (neighborSet_subgraphOfAdj_subset ha)
    

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
ha : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : Set.Finite (Subgraph.neighborSet (Walk.toSubgraph p✝) w)
⊢ Set.Finite {u✝, v✝}

Next tactic:
apply Set.toFinite
lemma toSubgraph_le_induce_support (p : G.Walk u v) :
    p.toSubgraph ≤ (⊤ : G.Subgraph).induce {v | v ∈ p.support} := 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
⊢ Walk.toSubgraph p ≤ Subgraph.induce ⊤ {v_1 | v_1 ∈ support p}

Next tactic:
convert Subgraph.le_induce_top_verts
lemma toSubgraph_le_induce_support (p : G.Walk u v) :
    p.toSubgraph ≤ (⊤ : G.Subgraph).induce {v | v ∈ p.support} := by
  convert Subgraph.le_induce_top_verts
  

Proof state:
case h.e'_4.h.e'_4
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
⊢ {v_1 | v_1 ∈ support p} = (Walk.toSubgraph p).verts

Next tactic:
exact p.verts_toSubgraph.symm
theorem set_walk_self_length_zero_eq (u : V) : {p : G.Walk u u | p.length = 0} = {Walk.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.length p = 0} = {Walk.nil}

Next tactic:
ext p
theorem set_walk_self_length_zero_eq (u : V) : {p : G.Walk u u | p.length = 0} = {Walk.nil} := by
  ext p
  

Proof state:
case h
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
⊢ p ∈ {p | Walk.length p = 0} ↔ p ∈ {Walk.nil}

Next tactic:
simp
theorem set_walk_length_zero_eq_of_ne {u v : V} (h : u ≠ v) :
    {p : G.Walk u v | p.length = 0} = ∅ := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
h : u ≠ v
⊢ {p | Walk.length p = 0} = ∅

Next tactic:
ext p
theorem set_walk_length_zero_eq_of_ne {u v : V} (h : u ≠ v) :
    {p : G.Walk u v | p.length = 0} = ∅ := by
  ext p
  

Proof state:
case h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
h : u ≠ v
p : Walk G u v
⊢ p ∈ {p | Walk.length p = 0} ↔ p ∈ ∅

Next tactic:
simp only [Set.mem_setOf_eq, Set.mem_empty_iff_false, iff_false_iff]
theorem set_walk_length_zero_eq_of_ne {u v : V} (h : u ≠ v) :
    {p : G.Walk u v | p.length = 0} = ∅ := by
  ext p
  simp only [Set.mem_setOf_eq, Set.mem_empty_iff_false, iff_false_iff]
  

Proof state:
case h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
h : u ≠ v
p : Walk G u v
⊢ ¬Walk.length p = 0

Next tactic:
exact fun h' => absurd (Walk.eq_of_length_eq_zero h') h