File: Mathlib/Combinatorics/SimpleGraph/Operations.lean

full_name: SimpleGraph.Iso.card_edgeFinset_eq
code: theorem card_edgeFinset_eq [Fintype G.edgeSet] [Fintype G'.edgeSet] :
    G.edgeFinset.card = G'.edgeFinset.card 
goal: G.edgeFinset.card = G'.edgeFinset.card

full_name: SimpleGraph.replaceVertex
code: /-- The graph formed by forgetting `t`'s neighbours and instead giving it those of `s`. The `s-t`
edge is removed if present. -/
def replaceVertex : SimpleGraph V 
goal: SimpleGraph V

full_name: SimpleGraph.not_adj_replaceVertex_same
code: /-- There is never an `s-t` edge in `G.replaceVertex s t`. -/
lemma not_adj_replaceVertex_same : ¬(G.replaceVertex s t).Adj s t 
goal: ¬(G.replaceVertex s t).Adj s t

full_name: SimpleGraph.replaceVertex_self
code: @[simp] lemma replaceVertex_self : G.replaceVertex s s = G 
goal: G.replaceVertex s s = G

full_name: SimpleGraph.adj_replaceVertex_iff_of_ne_left
code: /-- Except possibly for `t`, the neighbours of `s` in `G.replaceVertex s t` are its neighbours in
`G`. -/
lemma adj_replaceVertex_iff_of_ne_left {w : V} (hw : w ≠ t) :
    (G.replaceVertex s t).Adj s w ↔ G.Adj s w 
goal: (G.replaceVertex s t).Adj s w ↔ G.Adj s w

full_name: SimpleGraph.adj_replaceVertex_iff_of_ne_right
code: /-- Except possibly for itself, the neighbours of `t` in `G.replaceVertex s t` are the neighbours of
`s` in `G`. -/
lemma adj_replaceVertex_iff_of_ne_right {w : V} (hw : w ≠ t) :
    (G.replaceVertex s t).Adj t w ↔ G.Adj s w 
goal: (G.replaceVertex s t).Adj t w ↔ G.Adj s w

full_name: SimpleGraph.adj_replaceVertex_iff_of_ne
code: /-- Adjacency in `G.replaceVertex s t` which does not involve `t` is the same as that of `G`. -/
lemma adj_replaceVertex_iff_of_ne {v w : V} (hv : v ≠ t) (hw : w ≠ t) :
    (G.replaceVertex s t).Adj v w ↔ G.Adj v w 
goal: (G.replaceVertex s t).Adj v w ↔ G.Adj v w

full_name: SimpleGraph.edgeSet_replaceVertex_of_not_adj
code: theorem edgeSet_replaceVertex_of_not_adj (hn : ¬G.Adj s t) : (G.replaceVertex s t).edgeSet =
    G.edgeSet \ G.incidenceSet t ∪ (s(·, t)) '' (G.neighborSet s) 
goal: (G.replaceVertex s t).edgeSet = G.edgeSet \ G.incidenceSet t ∪ (fun x => s(x, t)) '' G.neighborSet s

full_name: SimpleGraph.edgeSet_replaceVertex_of_adj
code: theorem edgeSet_replaceVertex_of_adj (ha : G.Adj s t) : (G.replaceVertex s t).edgeSet =
    (G.edgeSet \ G.incidenceSet t ∪ (s(·, t)) '' (G.neighborSet s)) \ {s(t, t)} 
goal: (G.replaceVertex s t).edgeSet = (G.edgeSet \ G.incidenceSet t ∪ (fun x => s(x, t)) '' G.neighborSet s) \ {s(t, t)}

full_name: SimpleGraph.instDecidableRelAdjReplaceVertex
code: instance : DecidableRel (G.replaceVertex s t).Adj 
goal: DecidableRel (G.replaceVertex s t).Adj

full_name: SimpleGraph.edgeFinset_replaceVertex_of_not_adj
code: theorem edgeFinset_replaceVertex_of_not_adj (hn : ¬G.Adj s t) : (G.replaceVertex s t).edgeFinset =
    G.edgeFinset \ G.incidenceFinset t ∪ (G.neighborFinset s).image (s(·, t)) 
goal: (G.replaceVertex s t).edgeFinset =
  G.edgeFinset \ G.incidenceFinset t ∪ Finset.image (fun x => s(x, t)) (G.neighborFinset s)

full_name: SimpleGraph.edgeFinset_replaceVertex_of_adj
code: theorem edgeFinset_replaceVertex_of_adj (ha : G.Adj s t) : (G.replaceVertex s t).edgeFinset =
    (G.edgeFinset \ G.incidenceFinset t ∪ (G.neighborFinset s).image (s(·, t))) \ {s(t, t)} 
goal: (G.replaceVertex s t).edgeFinset =
  (G.edgeFinset \ G.incidenceFinset t ∪ Finset.image (fun x => s(x, t)) (G.neighborFinset s)) \ {s(t, t)}

full_name: SimpleGraph.disjoint_sdiff_neighborFinset_image
code: lemma disjoint_sdiff_neighborFinset_image :
    Disjoint (G.edgeFinset \ G.incidenceFinset t) ((G.neighborFinset s).image (s(·, t))) 
goal: Disjoint (G.edgeFinset \ G.incidenceFinset t) (Finset.image (fun x => s(x, t)) (G.neighborFinset s))

full_name: SimpleGraph.card_edgeFinset_replaceVertex_of_not_adj
code: theorem card_edgeFinset_replaceVertex_of_not_adj (hn : ¬G.Adj s t) :
    (G.replaceVertex s t).edgeFinset.card = G.edgeFinset.card + G.degree s - G.degree t 
goal: (G.replaceVertex s t).edgeFinset.card = G.edgeFinset.card + G.degree s - G.degree t

full_name: SimpleGraph.card_edgeFinset_replaceVertex_of_adj
code: theorem card_edgeFinset_replaceVertex_of_adj (ha : G.Adj s t) :
    (G.replaceVertex s t).edgeFinset.card = G.edgeFinset.card + G.degree s - G.degree t - 1 
goal: (G.replaceVertex s t).edgeFinset.card = G.edgeFinset.card + G.degree s - G.degree t - 1

full_name: SimpleGraph.edge
code: /-- The graph with a single `s-t` edge. It is empty iff `s = t`. -/
def edge : SimpleGraph V 
goal: SimpleGraph V

full_name: SimpleGraph.edge_adj
code: lemma edge_adj (v w : V) : (edge s t).Adj v w ↔ (v = s ∧ w = t ∨ v = t ∧ w = s) ∧ v ≠ w 
goal: (SimpleGraph.edge s t).Adj v w ↔ (v = s ∧ w = t ∨ v = t ∧ w = s) ∧ v ≠ w

full_name: SimpleGraph.instDecidableRelAdjEdge
code: instance : DecidableRel (edge s t).Adj 
goal: DecidableRel (SimpleGraph.edge s t).Adj

full_name: SimpleGraph.edge_self_eq_bot
code: lemma edge_self_eq_bot : edge s s = ⊥ 
goal: SimpleGraph.edge s s = ⊥

full_name: SimpleGraph.sup_edge_self
code: @[simp]
lemma sup_edge_self : G ⊔ edge s s = G 
goal: G ⊔ SimpleGraph.edge s s = G

full_name: SimpleGraph.edge_edgeSet_of_ne
code: lemma edge_edgeSet_of_ne (h : s ≠ t) : (edge s t).edgeSet = {s(s, t)} 
goal: (SimpleGraph.edge s t).edgeSet = {s(s, t)}

full_name: SimpleGraph.sup_edge_of_adj
code: lemma sup_edge_of_adj (h : G.Adj s t) : G ⊔ edge s t = G 
goal: G ⊔ SimpleGraph.edge s t = G

full_name: SimpleGraph.instFintypeElemSym2EdgeSetEdge
code: instance : Fintype (edge s t).edgeSet 
goal: Fintype ↑(SimpleGraph.edge s t).edgeSet

full_name: SimpleGraph.edgeFinset_sup_edge
code: theorem edgeFinset_sup_edge [Fintype (edgeSet (G ⊔ edge s t))] (hn : ¬G.Adj s t) (h : s ≠ t) :
    (G ⊔ edge s t).edgeFinset = G.edgeFinset.cons s(s, t) (by simp_all) 
goal: (G ⊔ SimpleGraph.edge s t).edgeFinset = Finset.cons s(s, t) G.edgeFinset ⋯

full_name: SimpleGraph.card_edgeFinset_sup_edge
code: theorem card_edgeFinset_sup_edge [Fintype (edgeSet (G ⊔ edge s t))] (hn : ¬G.Adj s t) (h : s ≠ t) :
    (G ⊔ edge s t).edgeFinset.card = G.edgeFinset.card + 1 
goal: (G ⊔ SimpleGraph.edge s t).edgeFinset.card = G.edgeFinset.card + 1