Theorem: SimpleGraph.reachable_delete_edges_iff_exists_walk
File: Mathlib/Combinatorics/SimpleGraph/Connectivity.lean

tactic: constructor
state_before: V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ Reachable (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w ↔
    ∃ p, ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p

tactic: rintro ⟨p⟩
state_before: case mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ Reachable (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w →
    ∃ p, ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p

tactic: use p.map (Hom.mapSpanningSubgraphs (by simp))
state_before: case mp.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w
⊢ ∃ p, ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p

tactic: simp_rw [Walk.edges_map, List.mem_map, Hom.mapSpanningSubgraphs_apply, Sym2.map_id', id.def]
state_before: case mp.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w
⊢ ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈
      Walk.edges
        (Walk.map (Hom.mapSpanningSubgraphs (_ : G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)} ≤ G)) p)

tactic: rintro ⟨e, h, rfl⟩
state_before: case mp.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w
⊢ ¬∃ a, a ∈ Walk.edges p ∧ a = Quotient.mk (Sym2.Rel.setoid V) (v, w)

tactic: simpa using p.edges_subset_edgeSet h
state_before: case mp.intro.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w
h : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
⊢ False

tactic: simp
state_before: V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w
⊢ G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)} ≤ G

tactic: rintro ⟨p, h⟩
state_before: case mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ (∃ p, ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p) →
    Reachable (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w

tactic: refine ⟨p.transfer _ fun e ep => ?_⟩
state_before: case mpr.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk G v w
h : ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
⊢ Reachable (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w

tactic: simp only [edgeSet_sdiff, edgeSet_fromEdgeSet, edgeSet_sdiff_sdiff_isDiag, Set.mem_diff,
  Set.mem_singleton_iff]
state_before: case mpr.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk G v w
h : ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
e : Sym2 V
ep : e ∈ Walk.edges p
⊢ e ∈ edgeSet (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)})

tactic: exact ⟨p.edges_subset_edgeSet ep, fun h' => h (h' ▸ ep)⟩
state_before: case mpr.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk G v w
h : ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
e : Sym2 V
ep : e ∈ Walk.edges p
⊢ e ∈ edgeSet G ∧ ¬e = Quotient.mk (Sym2.Rel.setoid V) (v, w)