Theorem: SimpleGraph.edgeSet_replaceVertex_of_not_adj
File: Mathlib/Combinatorics/SimpleGraph/Operations.lean

tactic: ext e
state_before: V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
⊢ (G.replaceVertex s t).edgeSet = G.edgeSet \ G.incidenceSet t ∪ (fun x => s(x, t)) '' G.neighborSet s
state_after: case h
V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
⊢ e ∈ (G.replaceVertex s t).edgeSet ↔ e ∈ G.edgeSet \ G.incidenceSet t ∪ (fun x => s(x, t)) '' G.neighborSet s

tactic: refine e.inductionOn ?_
state_before: case h
V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
⊢ e ∈ (G.replaceVertex s t).edgeSet ↔ e ∈ G.edgeSet \ G.incidenceSet t ∪ (fun x => s(x, t)) '' G.neighborSet s
state_after: case h
V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
⊢ ∀ (x y : V),
    s(x, y) ∈ (G.replaceVertex s t).edgeSet ↔
      s(x, y) ∈ G.edgeSet \ G.incidenceSet t ∪ (fun x => s(x, t)) '' G.neighborSet s

tactic: simp only [replaceVertex, mem_edgeSet, Set.mem_union, Set.mem_diff, mk'_mem_incidenceSet_iff]
state_before: case h
V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
⊢ ∀ (x y : V),
    s(x, y) ∈ (G.replaceVertex s t).edgeSet ↔
      s(x, y) ∈ G.edgeSet \ G.incidenceSet t ∪ (fun x => s(x, t)) '' G.neighborSet s
state_after: case h
V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
⊢ ∀ (x y : V),
    (if x = t then if y = t then False else G.Adj s y else if y = t then G.Adj x s else G.Adj x y) ↔
      G.Adj x y ∧ ¬(G.Adj x y ∧ (t = x ∨ t = y)) ∨ s(x, y) ∈ (fun x => s(x, t)) '' G.neighborSet s

tactic: intros
state_before: case h
V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
⊢ ∀ (x y : V),
    (if x = t then if y = t then False else G.Adj s y else if y = t then G.Adj x s else G.Adj x y) ↔
      G.Adj x y ∧ ¬(G.Adj x y ∧ (t = x ∨ t = y)) ∨ s(x, y) ∈ (fun x => s(x, t)) '' G.neighborSet s
state_after: case h
V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
x✝ y✝ : V
⊢ (if x✝ = t then if y✝ = t then False else G.Adj s y✝ else if y✝ = t then G.Adj x✝ s else G.Adj x✝ y✝) ↔
    G.Adj x✝ y✝ ∧ ¬(G.Adj x✝ y✝ ∧ (t = x✝ ∨ t = y✝)) ∨ s(x✝, y✝) ∈ (fun x => s(x, t)) '' G.neighborSet s

tactic: split_ifs
state_before: case h
V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
x✝ y✝ : V
⊢ (if x✝ = t then if y✝ = t then False else G.Adj s y✝ else if y✝ = t then G.Adj x✝ s else G.Adj x✝ y✝) ↔
    G.Adj x✝ y✝ ∧ ¬(G.Adj x✝ y✝ ∧ (t = x✝ ∨ t = y✝)) ∨ s(x✝, y✝) ∈ (fun x => s(x, t)) '' G.neighborSet s
state_after: case pos
V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
x✝ y✝ : V
h✝¹ : x✝ = t
h✝ : y✝ = t
⊢ False ↔ G.Adj x✝ y✝ ∧ ¬(G.Adj x✝ y✝ ∧ (t = x✝ ∨ t = y✝)) ∨ s(x✝, y✝) ∈ (fun x => s(x, t)) '' G.neighborSet s

case neg
V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
x✝ y✝ : V
h✝¹ : x✝ = t
h✝ : ¬y✝ = t
⊢ G.Adj s y✝ ↔ G.Adj x✝ y✝ ∧ ¬(G.Adj x✝ y✝ ∧ (t = x✝ ∨ t = y✝)) ∨ s(x✝, y✝) ∈ (fun x => s(x, t)) '' G.neighborSet s

case pos
V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
x✝ y✝ : V
h✝¹ : ¬x✝ = t
h✝ : y✝ = t
⊢ G.Adj x✝ s ↔ G.Adj x✝ y✝ ∧ ¬(G.Adj x✝ y✝ ∧ (t = x✝ ∨ t = y✝)) ∨ s(x✝, y✝) ∈ (fun x => s(x, t)) '' G.neighborSet s

case neg
V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
x✝ y✝ : V
h✝¹ : ¬x✝ = t
h✝ : ¬y✝ = t
⊢ G.Adj x✝ y✝ ↔ G.Adj x✝ y✝ ∧ ¬(G.Adj x✝ y✝ ∧ (t = x✝ ∨ t = y✝)) ∨ s(x✝, y✝) ∈ (fun x => s(x, t)) '' G.neighborSet s

tactic: exacts [by simp_all, by aesop, by rw [adj_comm]; aesop, by aesop]
state_before: case pos
V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
x✝ y✝ : V
h✝¹ : x✝ = t
h✝ : y✝ = t
⊢ False ↔ G.Adj x✝ y✝ ∧ ¬(G.Adj x✝ y✝ ∧ (t = x✝ ∨ t = y✝)) ∨ s(x✝, y✝) ∈ (fun x => s(x, t)) '' G.neighborSet s

case neg
V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
x✝ y✝ : V
h✝¹ : x✝ = t
h✝ : ¬y✝ = t
⊢ G.Adj s y✝ ↔ G.Adj x✝ y✝ ∧ ¬(G.Adj x✝ y✝ ∧ (t = x✝ ∨ t = y✝)) ∨ s(x✝, y✝) ∈ (fun x => s(x, t)) '' G.neighborSet s

case pos
V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
x✝ y✝ : V
h✝¹ : ¬x✝ = t
h✝ : y✝ = t
⊢ G.Adj x✝ s ↔ G.Adj x✝ y✝ ∧ ¬(G.Adj x✝ y✝ ∧ (t = x✝ ∨ t = y✝)) ∨ s(x✝, y✝) ∈ (fun x => s(x, t)) '' G.neighborSet s

case neg
V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
x✝ y✝ : V
h✝¹ : ¬x✝ = t
h✝ : ¬y✝ = t
⊢ G.Adj x✝ y✝ ↔ G.Adj x✝ y✝ ∧ ¬(G.Adj x✝ y✝ ∧ (t = x✝ ∨ t = y✝)) ∨ s(x✝, y✝) ∈ (fun x => s(x, t)) '' G.neighborSet s
state_after: no goals

tactic: simp_all
state_before: V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
x✝ y✝ : V
h✝¹ : x✝ = t
h✝ : y✝ = t
⊢ False ↔ G.Adj x✝ y✝ ∧ ¬(G.Adj x✝ y✝ ∧ (t = x✝ ∨ t = y✝)) ∨ s(x✝, y✝) ∈ (fun x => s(x, t)) '' G.neighborSet s
state_after: no goals

tactic: aesop
state_before: V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
x✝ y✝ : V
h✝¹ : x✝ = t
h✝ : ¬y✝ = t
⊢ G.Adj s y✝ ↔ G.Adj x✝ y✝ ∧ ¬(G.Adj x✝ y✝ ∧ (t = x✝ ∨ t = y✝)) ∨ s(x✝, y✝) ∈ (fun x => s(x, t)) '' G.neighborSet s
state_after: no goals

tactic: rw [adj_comm]
state_before: V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
x✝ y✝ : V
h✝¹ : ¬x✝ = t
h✝ : y✝ = t
⊢ G.Adj x✝ s ↔ G.Adj x✝ y✝ ∧ ¬(G.Adj x✝ y✝ ∧ (t = x✝ ∨ t = y✝)) ∨ s(x✝, y✝) ∈ (fun x => s(x, t)) '' G.neighborSet s
state_after: V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
x✝ y✝ : V
h✝¹ : ¬x✝ = t
h✝ : y✝ = t
⊢ G.Adj s x✝ ↔ G.Adj x✝ y✝ ∧ ¬(G.Adj x✝ y✝ ∧ (t = x✝ ∨ t = y✝)) ∨ s(x✝, y✝) ∈ (fun x => s(x, t)) '' G.neighborSet s

tactic: aesop
state_before: V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
x✝ y✝ : V
h✝¹ : ¬x✝ = t
h✝ : y✝ = t
⊢ G.Adj s x✝ ↔ G.Adj x✝ y✝ ∧ ¬(G.Adj x✝ y✝ ∧ (t = x✝ ∨ t = y✝)) ∨ s(x✝, y✝) ∈ (fun x => s(x, t)) '' G.neighborSet s
state_after: no goals

tactic: aesop
state_before: V : Type u_1
inst✝ : DecidableEq V
G : SimpleGraph V
s t : V
hn : ¬G.Adj s t
e : Sym2 V
x✝ y✝ : V
h✝¹ : ¬x✝ = t
h✝ : ¬y✝ = t
⊢ G.Adj x✝ y✝ ↔ G.Adj x✝ y✝ ∧ ¬(G.Adj x✝ y✝ ∧ (t = x✝ ∨ t = y✝)) ∨ s(x✝, y✝) ∈ (fun x => s(x, t)) '' G.neighborSet s
state_after: no goals