Documentation

Mathlib.Combinatorics.SimpleGraph.Operations

Local graph operations #

This file defines some single-graph operations that modify a finite number of vertices and proves basic theorems about them. When the graph itself has a finite number of vertices we also prove theorems about the number of edges in the modified graphs.

Main definitions #

theorem SimpleGraph.Iso.card_edgeFinset_eq {V : Type u_1} {G : SimpleGraph V} {W : Type u_2} {G' : SimpleGraph W} (f : G ≃g G') [Fintype G.edgeSet] [Fintype G'.edgeSet] :
def SimpleGraph.replaceVertex {V : Type u_1} (G : SimpleGraph V) (s t : V) [DecidableEq V] :

The graph formed by forgetting t's neighbours and instead giving it those of s. The s-t edge is removed if present.

Equations
Instances For
    theorem SimpleGraph.not_adj_replaceVertex_same {V : Type u_1} (G : SimpleGraph V) (s t : V) [DecidableEq V] :
    ¬(G.replaceVertex s t).Adj s t

    There is never an s-t edge in G.replaceVertex s t.

    @[simp]
    theorem SimpleGraph.replaceVertex_self {V : Type u_1} (G : SimpleGraph V) (s : V) [DecidableEq V] :
    theorem SimpleGraph.adj_replaceVertex_iff_of_ne_left {V : Type u_1} (G : SimpleGraph V) (s : V) {t : V} [DecidableEq V] {w : V} (hw : w t) :
    (G.replaceVertex s t).Adj s w G.Adj s w

    Except possibly for t, the neighbours of s in G.replaceVertex s t are its neighbours in G.

    theorem SimpleGraph.adj_replaceVertex_iff_of_ne_right {V : Type u_1} (G : SimpleGraph V) (s : V) {t : V} [DecidableEq V] {w : V} (hw : w t) :
    (G.replaceVertex s t).Adj t w G.Adj s w

    Except possibly for itself, the neighbours of t in G.replaceVertex s t are the neighbours of s in G.

    theorem SimpleGraph.adj_replaceVertex_iff_of_ne {V : Type u_1} (G : SimpleGraph V) (s : V) {t : V} [DecidableEq V] {v w : V} (hv : v t) (hw : w t) :
    (G.replaceVertex s t).Adj v w G.Adj v w

    Adjacency in G.replaceVertex s t which does not involve t is the same as that of G.

    theorem SimpleGraph.edgeSet_replaceVertex_of_not_adj {V : Type u_1} (G : SimpleGraph V) {s t : V} [DecidableEq V] (hn : ¬G.Adj s t) :
    (G.replaceVertex s t).edgeSet = G.edgeSet \ G.incidenceSet t (fun (x : V) => s(x, t)) '' G.neighborSet s
    theorem SimpleGraph.edgeSet_replaceVertex_of_adj {V : Type u_1} (G : SimpleGraph V) {s t : V} [DecidableEq V] (ha : G.Adj s t) :
    (G.replaceVertex s t).edgeSet = (G.edgeSet \ G.incidenceSet t (fun (x : V) => s(x, t)) '' G.neighborSet s) \ {s(t, t)}
    def SimpleGraph.edge {V : Type u_1} (s t : V) :

    The graph with a single s-t edge. It is empty iff s = t.

    Equations
    Instances For
      theorem SimpleGraph.edge_adj {V : Type u_1} (s t v w : V) :
      (edge s t).Adj v w (v = s w = t v = t w = s) v w
      theorem SimpleGraph.adj_edge {V : Type u_1} (s t : V) {v w : V} :
      (edge s t).Adj v w s(s, t) = s(v, w) v w
      theorem SimpleGraph.edge_comm {V : Type u_1} (s t : V) :
      edge s t = edge t s
      theorem SimpleGraph.edge_self_eq_bot {V : Type u_1} (s : V) :
      edge s s =
      @[simp]
      theorem SimpleGraph.sup_edge_self {V : Type u_1} (G : SimpleGraph V) (s : V) :
      G edge s s = G
      theorem SimpleGraph.lt_sup_edge {V : Type u_1} (G : SimpleGraph V) (s t : V) (hne : s t) (hn : ¬G.Adj s t) :
      G < G edge s t
      theorem SimpleGraph.edge_edgeSet_of_ne {V : Type u_1} {s t : V} (h : s t) :
      (edge s t).edgeSet = {s(s, t)}
      theorem SimpleGraph.sup_edge_of_adj {V : Type u_1} (G : SimpleGraph V) {s t : V} (h : G.Adj s t) :
      G edge s t = G
      theorem SimpleGraph.disjoint_edge {V : Type u_1} (G : SimpleGraph V) {u v : V} :
      Disjoint G (edge u v) ¬G.Adj u v
      theorem SimpleGraph.sdiff_edge {V : Type u_1} (G : SimpleGraph V) {u v : V} (h : ¬G.Adj u v) :
      G \ edge u v = G
      theorem SimpleGraph.Subgraph.spanningCoe_sup_edge_le {V : Type u_1} (G : SimpleGraph V) {s t : V} {H : (G edge s t).Subgraph} (h : ¬H.Adj s t) :
      theorem SimpleGraph.edgeFinset_sup_edge {V : Type u_1} (G : SimpleGraph V) {s t : V} [Fintype V] [DecidableRel G.Adj] [Fintype (G edge s t).edgeSet] (hn : ¬G.Adj s t) (h : s t) :
      theorem SimpleGraph.card_edgeFinset_sup_edge {V : Type u_1} (G : SimpleGraph V) {s t : V} [Fintype V] [DecidableRel G.Adj] [Fintype (G edge s t).edgeSet] (hn : ¬G.Adj s t) (h : s t) :