-- Mathlib/Combinatorics/SimpleGraph/Path.lean
theorem reachable_delete_edges_iff_exists_walk {v w v' w': V} :
    (G \ fromEdgeSet {s(v, w)}).Reachable v' w' ↔ ∃ p : G.Walk v' w', ¬s(v, w) ∈ p.edges

Proof state:
case h.intro.intro
V : Type u
G : SimpleGraph V
v w v' w' : V
p : (G \ fromEdgeSet {s(v, w)}).Walk v' w'
h : s(v, w) ∈ p.edges
⊢ False

Tactic:
simpa using p.edges_subset_edgeSet h

Result:
no goals

Proof state:
case mp.intro
V : Type u
G : SimpleGraph V
v w v' w' : V
p : (G \ fromEdgeSet {s(v, w)}).Walk v' w'
⊢ ∃ p, s(v, w) ∉ p.edges

Tactic:
use p.map (Hom.mapSpanningSubgraphs (by simp))

Result:
case h
V : Type u
G : SimpleGraph V
v w v' w' : V
p : (G \ fromEdgeSet {s(v, w)}).Walk v' w'
⊢ s(v, w) ∉ (Walk.map (Hom.mapSpanningSubgraphs ⋯) p).edges

Proof state:
V : Type u
G : SimpleGraph V
v w v' w' : V
p : (G \ fromEdgeSet {s(v, w)}).Walk v' w'
⊢ G \ fromEdgeSet {s(v, w)} ≤ G

Tactic:
simp

Result:
no goals

Proof state:
case mpr
V : Type u
G : SimpleGraph V
v w v' w' : V
⊢ (∃ p, s(v, w) ∉ p.edges) → (G \ fromEdgeSet {s(v, w)}).Reachable v' w'

Tactic:
rintro ⟨p, h⟩

Result:
case mpr.intro
V : Type u
G : SimpleGraph V
v w v' w' : V
p : G.Walk v' w'
h : s(v, w) ∉ p.edges
⊢ (G \ fromEdgeSet {s(v, w)}).Reachable v' w'

Proof state:
case mpr.intro
V : Type u
G : SimpleGraph V
v w v' w' : V
p : G.Walk v' w'
h : s(v, w) ∉ p.edges
e : Sym2 V
ep : e ∈ p.edges
⊢ e ∈ (G \ fromEdgeSet {s(v, w)}).edgeSet

Tactic:
simp only [edgeSet_sdiff, edgeSet_fromEdgeSet, edgeSet_sdiff_sdiff_isDiag, Set.mem_diff,
  Set.mem_singleton_iff]

Result:
case mpr.intro
V : Type u
G : SimpleGraph V
v w v' w' : V
p : G.Walk v' w'
h : s(v, w) ∉ p.edges
e : Sym2 V
ep : e ∈ p.edges
⊢ e ∈ G.edgeSet ∧ ¬e = s(v, w)

Proof state:
case mp
V : Type u
G : SimpleGraph V
v w v' w' : V
⊢ (G \ fromEdgeSet {s(v, w)}).Reachable v' w' → ∃ p, s(v, w) ∉ p.edges

Tactic:
rintro ⟨p⟩

Result:
case mp.intro
V : Type u
G : SimpleGraph V
v w v' w' : V
p : (G \ fromEdgeSet {s(v, w)}).Walk v' w'
⊢ ∃ p, s(v, w) ∉ p.edges

Proof state:
case h
V : Type u
G : SimpleGraph V
v w v' w' : V
p : (G \ fromEdgeSet {s(v, w)}).Walk v' w'
⊢ s(v, w) ∉ (Walk.map (Hom.mapSpanningSubgraphs ⋯) p).edges

Tactic:
simp_rw [Walk.edges_map, List.mem_map, Hom.mapSpanningSubgraphs_apply, Sym2.map_id', id]

Result:
case h
V : Type u
G : SimpleGraph V
v w v' w' : V
p : (G \ fromEdgeSet {s(v, w)}).Walk v' w'
⊢ ¬∃ a ∈ p.edges, a = s(v, w)

Proof state:
case mpr.intro
V : Type u
G : SimpleGraph V
v w v' w' : V
p : G.Walk v' w'
h : s(v, w) ∉ p.edges
e : Sym2 V
ep : e ∈ p.edges
⊢ e ∈ G.edgeSet ∧ ¬e = s(v, w)

Tactic:
exact ⟨p.edges_subset_edgeSet ep, fun h' => h (h' ▸ ep)⟩

Result:
no goals

Proof state:
case mpr.intro
V : Type u
G : SimpleGraph V
v w v' w' : V
p : G.Walk v' w'
h : s(v, w) ∉ p.edges
⊢ (G \ fromEdgeSet {s(v, w)}).Reachable v' w'

Tactic:
refine ⟨p.transfer _ fun e ep => ?_⟩

Result:
case mpr.intro
V : Type u
G : SimpleGraph V
v w v' w' : V
p : G.Walk v' w'
h : s(v, w) ∉ p.edges
e : Sym2 V
ep : e ∈ p.edges
⊢ e ∈ (G \ fromEdgeSet {s(v, w)}).edgeSet

Proof state:
V : Type u
G : SimpleGraph V
v w v' w' : V
⊢ (G \ fromEdgeSet {s(v, w)}).Reachable v' w' ↔ ∃ p, s(v, w) ∉ p.edges

Tactic:
constructor

Result:
case mp
V : Type u
G : SimpleGraph V
v w v' w' : V
⊢ (G \ fromEdgeSet {s(v, w)}).Reachable v' w' → ∃ p, s(v, w) ∉ p.edges

case mpr
V : Type u
G : SimpleGraph V
v w v' w' : V
⊢ (∃ p, s(v, w) ∉ p.edges) → (G \ fromEdgeSet {s(v, w)}).Reachable v' w'

Proof state:
case h
V : Type u
G : SimpleGraph V
v w v' w' : V
p : (G \ fromEdgeSet {s(v, w)}).Walk v' w'
⊢ ¬∃ a ∈ p.edges, a = s(v, w)

Tactic:
rintro ⟨e, h, rfl⟩

Result:
case h.intro.intro
V : Type u
G : SimpleGraph V
v w v' w' : V
p : (G \ fromEdgeSet {s(v, w)}).Walk v' w'
h : s(v, w) ∈ p.edges
⊢ False