# mathlib3documentation

combinatorics.simple_graph.basic

# Simple graphs #

THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.

This module defines simple graphs on a vertex type `V` as an irreflexive symmetric relation.

There is a basic API for locally finite graphs and for graphs with finitely many vertices.

## Main definitions #

• `simple_graph` is a structure for symmetric, irreflexive relations

• `simple_graph.neighbor_set` is the `set` of vertices adjacent to a given vertex

• `simple_graph.common_neighbors` is the intersection of the neighbor sets of two given vertices

• `simple_graph.neighbor_finset` is the `finset` of vertices adjacent to a given vertex, if `neighbor_set` is finite

• `simple_graph.incidence_set` is the `set` of edges containing a given vertex

• `simple_graph.incidence_finset` is the `finset` of edges containing a given vertex, if `incidence_set` is finite

• `simple_graph.dart` is an ordered pair of adjacent vertices, thought of as being an orientated edge. These are also known as "half-edges" or "bonds."

• `simple_graph.hom`, `simple_graph.embedding`, and `simple_graph.iso` for graph homomorphisms, graph embeddings, and graph isomorphisms. Note that a graph embedding is a stronger notion than an injective graph homomorphism, since its image is an induced subgraph.

• `complete_boolean_algebra` instance: Under the subgraph relation, `simple_graph` forms a `complete_boolean_algebra`. In other words, this is the complete lattice of spanning subgraphs of the complete graph.

## Notations #

• `→g`, `↪g`, and `≃g` for graph homomorphisms, graph embeddings, and graph isomorphisms, respectively.

## Implementation notes #

• A locally finite graph is one with instances `Π v, fintype (G.neighbor_set v)`.

• Given instances `decidable_rel G.adj` and `fintype V`, then the graph is locally finite, too.

• Morphisms of graphs are abbreviations for `rel_hom`, `rel_embedding`, and `rel_iso`. To make use of pre-existing simp lemmas, definitions involving morphisms are abbreviations as well.

## Naming Conventions #

• If the vertex type of a graph is finite, we refer to its cardinality as `card_verts`.

## Todo #

• This is the simplest notion of an unoriented graph. This should eventually fit into a more complete combinatorics hierarchy which includes multigraphs and directed graphs. We begin with simple graphs in order to start learning what the combinatorics hierarchy should look like.
theorem simple_graph.ext {V : Type u} (x y : simple_graph V) (h : x.adj = y.adj) :
x = y
theorem simple_graph.ext_iff {V : Type u} (x y : simple_graph V) :
@[ext]
structure simple_graph (V : Type u) :

A simple graph is an irreflexive symmetric relation `adj` on a vertex type `V`. The relation describes which pairs of vertices are adjacent. There is exactly one edge for every pair of adjacent vertices; see `simple_graph.edge_set` for the corresponding edge set.

Instances for `simple_graph`
@[protected, instance]
noncomputable def simple_graph.fintype {V : Type u} [fintype V] :
Equations
def simple_graph.from_rel {V : Type u} (r : V V Prop) :

Construct the simple graph induced by the given relation. It symmetrizes the relation and makes it irreflexive.

Equations
@[simp]
theorem simple_graph.from_rel_adj {V : Type u} (r : V V Prop) (v w : V) :
v w v w (r v w r w v)
def complete_graph (V : Type u) :

The complete graph on a type `V` is the simple graph with all pairs of distinct vertices adjacent. In `mathlib`, this is usually referred to as `⊤`.

Equations
def empty_graph (V : Type u) :

The graph with no edges on a given vertex type `V`. `mathlib` prefers the notation `⊥`.

Equations
def complete_bipartite_graph (V : Type u_1) (W : Type u_2) :

Two vertices are adjacent in the complete bipartite graph on two vertex types if and only if they are not from the same side. Bipartite graphs in general may be regarded as being subgraphs of one of these.

TODO also introduce complete multi-partite graphs, where the vertex type is a sigma type of an indexed family of vertex types

Equations
@[simp]
theorem complete_bipartite_graph_adj (V : Type u_1) (W : Type u_2) (v w : V W) :
@[protected, simp]
theorem simple_graph.irrefl {V : Type u} (G : simple_graph V) {v : V} :
theorem simple_graph.adj_comm {V : Type u} (G : simple_graph V) (u v : V) :
@[symm]
theorem simple_graph.adj_symm {V : Type u} (G : simple_graph V) {u v : V} (h : G.adj u v) :
theorem simple_graph.adj.symm {V : Type u} {G : simple_graph V} {u v : V} (h : G.adj u v) :
theorem simple_graph.ne_of_adj {V : Type u} (G : simple_graph V) {a b : V} (h : G.adj a b) :
a b
@[protected]
theorem simple_graph.adj.ne {V : Type u} {G : simple_graph V} {a b : V} (h : G.adj a b) :
a b
@[protected]
theorem simple_graph.adj.ne' {V : Type u} {G : simple_graph V} {a b : V} (h : G.adj a b) :
b a
theorem simple_graph.ne_of_adj_of_not_adj {V : Type u} (G : simple_graph V) {v w x : V} (h : G.adj v x) (hn : ¬G.adj w x) :
v w
@[simp]
theorem simple_graph.adj_inj {V : Type u} {G H : simple_graph V} :
def simple_graph.is_subgraph {V : Type u} (x y : simple_graph V) :
Prop

The relation that one `simple_graph` is a subgraph of another. Note that this should be spelled `≤`.

Equations
@[protected, instance]
def simple_graph.has_le {V : Type u} :
Equations
@[simp]
@[protected, instance]
def simple_graph.has_sup {V : Type u} :

The supremum of two graphs `x ⊔ y` has edges where either `x` or `y` have edges.

Equations
@[simp]
theorem simple_graph.sup_adj {V : Type u} (x y : simple_graph V) (v w : V) :
@[protected, instance]
def simple_graph.has_inf {V : Type u} :

The infimum of two graphs `x ⊓ y` has edges where both `x` and `y` have edges.

Equations
@[simp]
theorem simple_graph.inf_adj {V : Type u} (x y : simple_graph V) (v w : V) :
@[protected, instance]
def simple_graph.has_compl {V : Type u} :

We define `Gᶜ` to be the `simple_graph V` such that no two adjacent vertices in `G` are adjacent in the complement, and every nonadjacent pair of vertices is adjacent (still ensuring that vertices are not adjacent to themselves).

Equations
@[simp]
theorem simple_graph.compl_adj {V : Type u} (G : simple_graph V) (v w : V) :
@[protected, instance]
def simple_graph.has_sdiff {V : Type u} :

The difference of two graphs `x \ y` has the edges of `x` with the edges of `y` removed.

Equations
@[simp]
theorem simple_graph.sdiff_adj {V : Type u} (x y : simple_graph V) (v w : V) :
@[protected, instance]
def simple_graph.has_Sup {V : Type u} :
Equations
@[protected, instance]
def simple_graph.has_Inf {V : Type u} :
Equations
@[simp]
theorem simple_graph.Sup_adj {V : Type u} {s : set (simple_graph V)} {a b : V} :
(has_Sup.Sup s).adj a b (G : (H : G s), G.adj a b
@[simp]
theorem simple_graph.Inf_adj {V : Type u} {a b : V} {s : set (simple_graph V)} :
(has_Inf.Inf s).adj a b ( (G : , G s G.adj a b) a b
@[simp]
theorem simple_graph.supr_adj {ι : Sort u_1} {V : Type u} {a b : V} {f : ι } :
( (i : ι), f i).adj a b (i : ι), (f i).adj a b
@[simp]
theorem simple_graph.infi_adj {ι : Sort u_1} {V : Type u} {a b : V} {f : ι } :
( (i : ι), f i).adj a b ( (i : ι), (f i).adj a b) a b
theorem simple_graph.Inf_adj_of_nonempty {V : Type u} {a b : V} {s : set (simple_graph V)} (hs : s.nonempty) :
(has_Inf.Inf s).adj a b (G : , G s G.adj a b
theorem simple_graph.infi_adj_of_nonempty {ι : Sort u_1} {V : Type u} {a b : V} [nonempty ι] {f : ι } :
( (i : ι), f i).adj a b (i : ι), (f i).adj a b
@[protected, instance]

For graphs `G`, `H`, `G ≤ H` iff `∀ a b, G.adj a b → H.adj a b`.

Equations
@[protected, instance]
Equations
@[simp]
theorem simple_graph.top_adj {V : Type u} (v w : V) :
@[simp]
theorem simple_graph.bot_adj {V : Type u} (v w : V) :
@[simp]
@[simp]
@[protected, instance]
def simple_graph.inhabited (V : Type u) :
Equations
@[simp]
@[protected, instance]
Equations
@[protected, instance]
@[protected, instance]
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations
def simple_graph.support {V : Type u} (G : simple_graph V) :
set V

`G.support` is the set of vertices that form edges in `G`.

Equations
theorem simple_graph.mem_support {V : Type u} (G : simple_graph V) {v : V} :
v G.support (w : V), G.adj v w
theorem simple_graph.support_mono {V : Type u} {G G' : simple_graph V} (h : G G') :
def simple_graph.neighbor_set {V : Type u} (G : simple_graph V) (v : V) :
set V

`G.neighbor_set v` is the set of vertices adjacent to `v` in `G`.

Equations
Instances for `↥simple_graph.neighbor_set`
@[protected, instance]
Equations
• = _.mpr (λ (a : V), (λ (a : V), G.adj v a))
def simple_graph.edge_set {V : Type u} :

The edges of G consist of the unordered pairs of vertices related by `G.adj`.

The way `edge_set` is defined is such that `mem_edge_set` is proved by `refl`. (That is, `⟦(v, w)⟧ ∈ G.edge_set` is definitionally equal to `G.adj v w`.)

Equations
@[simp]
theorem simple_graph.mem_edge_set {V : Type u} (G : simple_graph V) {v w : V} :
@[simp]
theorem simple_graph.edge_set_inj {V : Type u} {G₁ G₂ : simple_graph V} :
G₁ = G₂
@[simp]
theorem simple_graph.edge_set_subset_edge_set {V : Type u} {G₁ G₂ : simple_graph V} :
G₁ G₂
@[simp]
theorem simple_graph.edge_set_ssubset_edge_set {V : Type u} {G₁ G₂ : simple_graph V} :
G₁ < G₂
theorem simple_graph.edge_set_mono {V : Type u} {G₁ G₂ : simple_graph V} :
G₁ G₂

Alias of the reverse direction of `simple_graph.edge_set_subset_edge_set`.

theorem simple_graph.edge_set_strict_mono {V : Type u} {G₁ G₂ : simple_graph V} :
G₁ < G₂

Alias of the reverse direction of `simple_graph.edge_set_ssubset_edge_set`.

@[simp]
theorem simple_graph.edge_set_bot {V : Type u} :
@[simp]
theorem simple_graph.edge_set_sup {V : Type u} (G₁ G₂ : simple_graph V) :
@[simp]
theorem simple_graph.edge_set_inf {V : Type u} (G₁ G₂ : simple_graph V) :
@[simp]
theorem simple_graph.edge_set_sdiff {V : Type u} (G₁ G₂ : simple_graph V) :
@[simp]
theorem simple_graph.disjoint_edge_set {V : Type u} {G₁ G₂ : simple_graph V} :
disjoint G₁ G₂
@[simp]
theorem simple_graph.edge_set_eq_empty {V : Type u} {G : simple_graph V} :
G =
@[simp]
theorem simple_graph.edge_set_nonempty {V : Type u} {G : simple_graph V} :
@[simp]
theorem simple_graph.edge_set_sdiff_sdiff_is_diag {V : Type u} (G : simple_graph V) (s : set (sym2 V)) :
\ (s \ {e : sym2 V | e.is_diag}) =

This lemma, combined with `edge_set_sdiff` and `edge_set_from_edge_set`, allows proving `(G \ from_edge_set s).edge_set = G.edge_set \ s` by `simp`.

theorem simple_graph.adj_iff_exists_edge {V : Type u} {G : simple_graph V} {v w : V} :
G.adj v w v w (e : sym2 V) (H : , v e w e

Two vertices are adjacent iff there is an edge between them. The condition `v ≠ w` ensures they are different endpoints of the edge, which is necessary since when `v = w` the existential `∃ (e ∈ G.edge_set), v ∈ e ∧ w ∈ e` is satisfied by every edge incident to `v`.

theorem simple_graph.adj_iff_exists_edge_coe {V : Type u} {G : simple_graph V} {a b : V} :
G.adj a b (e : , e = (a, b)
theorem simple_graph.edge_other_ne {V : Type u} (G : simple_graph V) {e : sym2 V} (he : e ) {v : V} (h : v e) :
@[protected, instance]
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations
def simple_graph.from_edge_set {V : Type u} (s : set (sym2 V)) :

`from_edge_set` constructs a `simple_graph` from a set of edges, without loops.

Equations
@[simp]
theorem simple_graph.from_edge_set_adj {V : Type u} {v w : V} (s : set (sym2 V)) :
w (v, w) s v w
@[simp]
theorem simple_graph.edge_set_from_edge_set {V : Type u} (s : set (sym2 V)) :
= s \ {e : sym2 V | e.is_diag}
@[simp]
@[simp]
@[simp]
@[simp]
theorem simple_graph.from_edge_set_inf {V : Type u} (s t : set (sym2 V)) :
@[simp]
theorem simple_graph.from_edge_set_sup {V : Type u} (s t : set (sym2 V)) :
@[simp]
theorem simple_graph.from_edge_set_sdiff {V : Type u} (s t : set (sym2 V)) :
theorem simple_graph.from_edge_set_mono {V : Type u} {s t : set (sym2 V)} (h : s t) :
@[simp]
theorem simple_graph.disjoint_from_edge_set {V : Type u} (G : simple_graph V) (s : set (sym2 V)) :
@[simp]
theorem simple_graph.from_edge_set_disjoint {V : Type u} (G : simple_graph V) (s : set (sym2 V)) :
@[protected, instance]
Equations

## Darts #

theorem simple_graph.dart.ext_iff {V : Type u} {G : simple_graph V} (x y : G.dart) :
theorem simple_graph.dart.ext {V : Type u} {G : simple_graph V} (x y : G.dart) (h : x.to_prod = y.to_prod) :
x = y
@[ext]
structure simple_graph.dart {V : Type u} (G : simple_graph V) :

A `dart` is an oriented edge, implemented as an ordered pair of adjacent vertices. This terminology comes from combinatorial maps, and they are also known as "half-edges" or "bonds."

Instances for `simple_graph.dart`
@[protected, instance]
@[reducible]
def simple_graph.dart.fst {V : Type u} {G : simple_graph V} (d : G.dart) :
V

The first vertex for the dart.

@[reducible]
def simple_graph.dart.snd {V : Type u} {G : simple_graph V} (d : G.dart) :
V

The second vertex for the dart.

@[protected, instance]
Equations
def simple_graph.dart.edge {V : Type u} {G : simple_graph V} (d : G.dart) :

The edge associated to the dart.

Equations
@[simp]
theorem simple_graph.dart.edge_mk {V : Type u} {G : simple_graph V} {p : V × V} (h : G.adj p.fst p.snd) :
{to_prod := p, is_adj := h}.edge = p
@[simp]
theorem simple_graph.dart.edge_mem {V : Type u} {G : simple_graph V} (d : G.dart) :
@[simp]
theorem simple_graph.dart.symm_to_prod {V : Type u} {G : simple_graph V} (d : G.dart) :
def simple_graph.dart.symm {V : Type u} {G : simple_graph V} (d : G.dart) :

The dart with reversed orientation from a given dart.

Equations
@[simp]
theorem simple_graph.dart.symm_mk {V : Type u} {G : simple_graph V} {p : V × V} (h : G.adj p.fst p.snd) :
{to_prod := p, is_adj := h}.symm = {to_prod := p.swap, is_adj := _}
@[simp]
theorem simple_graph.dart.edge_symm {V : Type u} {G : simple_graph V} (d : G.dart) :
@[simp]
@[simp]
theorem simple_graph.dart.symm_symm {V : Type u} {G : simple_graph V} (d : G.dart) :
d.symm.symm = d
@[simp]
theorem simple_graph.dart.symm_ne {V : Type u} {G : simple_graph V} (d : G.dart) :
d.symm d
theorem simple_graph.dart_edge_eq_iff {V : Type u} {G : simple_graph V} (d₁ d₂ : G.dart) :
d₁.edge = d₂.edge d₁ = d₂ d₁ = d₂.symm
theorem simple_graph.dart_edge_eq_mk_iff {V : Type u} {G : simple_graph V} {d : G.dart} {p : V × V} :
theorem simple_graph.dart_edge_eq_mk_iff' {V : Type u} {G : simple_graph V} {d : G.dart} {u v : V} :
def simple_graph.dart_adj {V : Type u} (G : simple_graph V) (d d' : G.dart) :
Prop

Two darts are said to be adjacent if they could be consecutive darts in a walk -- that is, the first dart's second vertex is equal to the second dart's first vertex.

Equations
def simple_graph.dart_of_neighbor_set {V : Type u} (G : simple_graph V) (v : V) (w : (G.neighbor_set v)) :

For a given vertex `v`, this is the bijective map from the neighbor set at `v` to the darts `d` with `d.fst = v`.

Equations
@[simp]
theorem simple_graph.dart_of_neighbor_set_to_prod {V : Type u} (G : simple_graph V) (v : V) (w : (G.neighbor_set v)) :
w).to_prod = (v, w)
@[protected, instance]

### Incidence set #

def simple_graph.incidence_set {V : Type u} (G : simple_graph V) (v : V) :
set (sym2 V)

Set of edges incident to a given vertex, aka incidence set.

Equations
• = {e ∈ | v e}
Instances for `↥simple_graph.incidence_set`
theorem simple_graph.incidence_set_subset {V : Type u} (G : simple_graph V) (v : V) :
theorem simple_graph.mk_mem_incidence_set_iff {V : Type u} (G : simple_graph V) {a b c : V} :
(b, c) G.adj b c (a = b a = c)
theorem simple_graph.mk_mem_incidence_set_left_iff {V : Type u} (G : simple_graph V) {a b : V} :
theorem simple_graph.mk_mem_incidence_set_right_iff {V : Type u} (G : simple_graph V) {a b : V} :
theorem simple_graph.edge_mem_incidence_set_iff {V : Type u} (G : simple_graph V) {a : V} {e : } :
theorem simple_graph.incidence_set_inter_incidence_set_subset {V : Type u} (G : simple_graph V) {a b : V} (h : a b) :
{(a, b)}
theorem simple_graph.incidence_set_inter_incidence_set_of_adj {V : Type u} (G : simple_graph V) {a b : V} (h : G.adj a b) :
= {(a, b)}
theorem simple_graph.adj_of_mem_incidence_set {V : Type u} (G : simple_graph V) {a b : V} {e : sym2 V} (h : a b) (ha : e ) (hb : e ) :
theorem simple_graph.incidence_set_inter_incidence_set_of_not_adj {V : Type u} (G : simple_graph V) {a b : V} (h : ¬G.adj a b) (hn : a b) :
@[protected, instance]
Equations
@[reducible]
def simple_graph.edge_finset {V : Type u} (G : simple_graph V)  :

The `edge_set` of the graph as a `finset`.

Equations
@[simp, norm_cast]
theorem simple_graph.coe_edge_finset {V : Type u} (G : simple_graph V)  :
@[simp]
theorem simple_graph.mem_edge_finset {V : Type u} {G : simple_graph V} {e : sym2 V}  :
@[simp]
theorem simple_graph.edge_finset_inj {V : Type u} {G₁ G₂ : simple_graph V}  :
G₁.edge_finset = G₂.edge_finset G₁ = G₂
@[simp]
theorem simple_graph.edge_finset_subset_edge_finset {V : Type u} {G₁ G₂ : simple_graph V}  :
G₁.edge_finset G₂.edge_finset G₁ G₂
@[simp]
theorem simple_graph.edge_finset_ssubset_edge_finset {V : Type u} {G₁ G₂ : simple_graph V}  :
G₁.edge_finset G₂.edge_finset G₁ < G₂
theorem simple_graph.edge_finset_mono {V : Type u} {G₁ G₂ : simple_graph V}  :
G₁ G₂ G₁.edge_finset G₂.edge_finset

Alias of the reverse direction of `simple_graph.edge_finset_subset_edge_finset`.

theorem simple_graph.edge_finset_strict_mono {V : Type u} {G₁ G₂ : simple_graph V}  :
G₁ < G₂ G₁.edge_finset G₂.edge_finset

Alias of the reverse direction of `simple_graph.edge_finset_ssubset_edge_finset`.

@[simp]
theorem simple_graph.edge_finset_bot {V : Type u} :
@[simp]
theorem simple_graph.edge_finset_sup {V : Type u} {G₁ G₂ : simple_graph V} [decidable_eq V] :
(G₁ G₂).edge_finset = G₁.edge_finset G₂.edge_finset
@[simp]
theorem simple_graph.edge_finset_inf {V : Type u} {G₁ G₂ : simple_graph V} [decidable_eq V] :
(G₁ G₂).edge_finset = G₁.edge_finset G₂.edge_finset
@[simp]
theorem simple_graph.edge_finset_sdiff {V : Type u} {G₁ G₂ : simple_graph V} [decidable_eq V] :
(G₁ \ G₂).edge_finset = G₁.edge_finset \ G₂.edge_finset
@[simp]
theorem simple_graph.edge_set_univ_card {V : Type u} {G : simple_graph V}  :
@[simp]
theorem simple_graph.mem_neighbor_set {V : Type u} (G : simple_graph V) (v w : V) :
w G.neighbor_set v G.adj v w
@[simp]
theorem simple_graph.not_mem_neighbor_set_self {V : Type u} (G : simple_graph V) {a : V} :
@[simp]
theorem simple_graph.mem_incidence_set {V : Type u} (G : simple_graph V) (v w : V) :
theorem simple_graph.mem_incidence_iff_neighbor {V : Type u} (G : simple_graph V) {v w : V} :
theorem simple_graph.adj_incidence_set_inter {V : Type u} (G : simple_graph V) {v : V} {e : sym2 V} (he : e ) (h : v e) :
= {e}
theorem simple_graph.neighbor_set_compl {V : Type u} (G : simple_graph V) (v : V) :
= (G.neighbor_set v) \ {v}
def simple_graph.common_neighbors {V : Type u} (G : simple_graph V) (v w : V) :
set V

The set of common neighbors between two vertices `v` and `w` in a graph `G` is the intersection of the neighbor sets of `v` and `w`.

Equations
theorem simple_graph.common_neighbors_eq {V : Type u} (G : simple_graph V) (v w : V) :
theorem simple_graph.mem_common_neighbors {V : Type u} (G : simple_graph V) {u v w : V} :
theorem simple_graph.common_neighbors_symm {V : Type u} (G : simple_graph V) (v w : V) :
w = v
theorem simple_graph.not_mem_common_neighbors_left {V : Type u} (G : simple_graph V) (v w : V) :
v w
theorem simple_graph.not_mem_common_neighbors_right {V : Type u} (G : simple_graph V) (v w : V) :
w w
@[protected, instance]
Equations
theorem simple_graph.common_neighbors_top_eq {V : Type u} {v w : V} :
= set.univ \ {v, w}
def simple_graph.other_vertex_of_incident {V : Type u} (G : simple_graph V) [decidable_eq V] {v : V} {e : sym2 V} (h : e ) :
V

Given an edge incident to a particular vertex, get the other vertex on the edge.

Equations
theorem simple_graph.edge_other_incident_set {V : Type u} (G : simple_graph V) [decidable_eq V] {v : V} {e : sym2 V} (h : e ) :
e
theorem simple_graph.incidence_other_prop {V : Type u} (G : simple_graph V) [decidable_eq V] {v : V} {e : sym2 V} (h : e ) :
@[simp]
theorem simple_graph.incidence_other_neighbor_edge {V : Type u} (G : simple_graph V) [decidable_eq V] {v w : V} (h : w G.neighbor_set v) :

There is an equivalence between the set of edges incident to a given vertex and the set of vertices adjacent to the vertex.

Equations

## Edge deletion #

def simple_graph.delete_edges {V : Type u} (G : simple_graph V) (s : set (sym2 V)) :

Given a set of vertex pairs, remove all of the corresponding edges from the graph's edge set, if present.

See also: `simple_graph.subgraph.delete_edges`.

Equations
@[simp]
theorem simple_graph.delete_edges_adj {V : Type u} (G : simple_graph V) (s : set (sym2 V)) (v w : V) :
theorem simple_graph.sdiff_eq_delete_edges {V : Type u} (G G' : simple_graph V) :
G \ G' =
@[simp]
theorem simple_graph.delete_edges_eq {V : Type u} (G : simple_graph V) {s : set (sym2 V)} :
@[simp]
theorem simple_graph.delete_edges_delete_edges {V : Type u} (G : simple_graph V) (s s' : set (sym2 V)) :
@[simp]
theorem simple_graph.delete_edges_empty_eq {V : Type u} (G : simple_graph V) :
= G
@[simp]
theorem simple_graph.delete_edges_le {V : Type u} (G : simple_graph V) (s : set (sym2 V)) :
theorem simple_graph.delete_edges_le_of_le {V : Type u} (G : simple_graph V) {s s' : set (sym2 V)} (h : s s') :
theorem simple_graph.delete_edges_sdiff_eq_of_le {V : Type u} (G : simple_graph V) {H : simple_graph V} (h : H G) :
theorem simple_graph.edge_set_delete_edges {V : Type u} (G : simple_graph V) (s : set (sym2 V)) :
def simple_graph.delete_far {𝕜 : Type u_2} {V : Type u} (G : simple_graph V) [ordered_ring 𝕜] [fintype V] [decidable_eq V] [decidable_rel G.adj] (p : Prop) (r : 𝕜) :
Prop

A graph is `r`-delete-far from a property `p` if we must delete at least `r` edges from it to get a graph with the property `p`.

Equations
theorem simple_graph.delete_far_iff {𝕜 : Type u_2} {V : Type u} {G : simple_graph V} [ordered_ring 𝕜] [fintype V] [decidable_eq V] [decidable_rel G.adj] {p : Prop} {r : 𝕜} :
G.delete_far p r ⦃H : ⦄ [_inst_5 : , H G p H r (G.edge_finset.card) - (H.edge_finset.card)
theorem simple_graph.delete_far.le_card_sub_card {𝕜 : Type u_2} {V : Type u} {G : simple_graph V} [ordered_ring 𝕜] [fintype V] [decidable_eq V] [decidable_rel G.adj] {p : Prop} {r : 𝕜} :
G.delete_far p r ⦃H : ⦄ [_inst_5 : , H G p H r (G.edge_finset.card) - (H.edge_finset.card)

Alias of the forward direction of `simple_graph.delete_far_iff`.

theorem simple_graph.delete_far.mono {𝕜 : Type u_2} {V : Type u} {G : simple_graph V} [ordered_ring 𝕜] [fintype V] [decidable_eq V] [decidable_rel G.adj] {p : Prop} {r₁ r₂ : 𝕜} (h : G.delete_far p r₂) (hr : r₁ r₂) :
G.delete_far p r₁

## Map and comap #

@[protected]
def simple_graph.map {V : Type u} {W : Type v} (f : V W) (G : simple_graph V) :

Given an injective function, there is an covariant induced map on graphs by pushing forward the adjacency relation.

This is injective (see `simple_graph.map_injective`).

Equations
@[simp]
theorem simple_graph.map_adj {V : Type u} {W : Type v} (f : V W) (G : simple_graph V) (u v : W) :
G).adj u v (u' v' : V), G.adj u' v' f u' = u f v' = v
theorem simple_graph.map_adj_apply {V : Type u} {W : Type v} {G : simple_graph V} {f : V W} {a b : V} :
theorem simple_graph.map_monotone {V : Type u} {W : Type v} (f : V W) :
@[simp]
theorem simple_graph.map_id {V : Type u} (G : simple_graph V) :
@[simp]
theorem simple_graph.map_map {V : Type u} {W : Type v} {X : Type w} (G : simple_graph V) (f : V W) (g : W X) :
@[protected, instance]
def simple_graph.decidable_map {V : Type u} {W : Type v} (f : V W) (G : simple_graph V) [decidable_rel f f)] :
Equations
• = _inst_1
@[simp]
theorem simple_graph.comap_adj {V : Type u} {W : Type v} (f : V W) (G : simple_graph W) (u v : V) :
@[protected]
def simple_graph.comap {V : Type u} {W : Type v} (f : V W) (G : simple_graph W) :

Given a function, there is a contravariant induced map on graphs by pulling back the adjacency relation. This is one of the ways of creating induced graphs. See `simple_graph.induce` for a wrapper.

This is surjective when `f` is injective (see `simple_graph.comap_surjective`).

Equations
@[simp]
theorem simple_graph.comap_id {V : Type u} {G : simple_graph V} :
@[simp]
theorem simple_graph.comap_comap {V : Type u} {W : Type v} {X : Type w} {G : simple_graph X} (f : V W) (g : W X) :
@[protected, instance]
def simple_graph.decidable_comap {V : Type u} {W : Type v} (f : V W) (G : simple_graph W) [decidable_rel G.adj] :
Equations
• = λ (_x _x_1 : V), _inst_1 (f _x) (f _x_1)
theorem simple_graph.comap_symm {V : Type u} {W : Type v} (G : simple_graph V) (e : V W) :
theorem simple_graph.map_symm {V : Type u} {W : Type v} (G : simple_graph W) (e : V W) :
theorem simple_graph.comap_monotone {V : Type u} {W : Type v} (f : V W) :
@[simp]
theorem simple_graph.comap_map_eq {V : Type u} {W : Type v} (f : V W) (G : simple_graph V) :
= G
theorem simple_graph.left_inverse_comap_map {V : Type u} {W : Type v} (f : V W) :
theorem simple_graph.map_injective {V : Type u} {W : Type v} (f : V W) :
theorem simple_graph.comap_surjective {V : Type u} {W : Type v} (f : V W) :
theorem simple_graph.map_le_iff_le_comap {V : Type u} {W : Type v} (f : V W) (G : simple_graph V) (G' : simple_graph W) :
G' G
theorem simple_graph.map_comap_le {V : Type u} {W : Type v} (f : V W) (G : simple_graph W) :
G
@[simp]
theorem equiv.simple_graph_apply {V : Type u} {W : Type v} (e : V W) (G : simple_graph V) :
@[protected]
def equiv.simple_graph {V : Type u} {W : Type v} (e : V W) :

Equivalent types have equivalent simple graphs.

Equations
@[simp]
theorem equiv.simple_graph_refl {V : Type u} :
@[simp]
theorem equiv.simple_graph_trans {V : Type u} {W : Type v} {X : Type w} (e₁ : V W) (e₂ : W X) :
(e₁.trans e₂).simple_graph =
@[simp]
theorem equiv.symm_simple_graph {V : Type u} {W : Type v} (e : V W) :

## Induced graphs #

@[reducible]
def simple_graph.induce {V : Type u} (s : set V) (G : simple_graph V) :

Restrict a graph to the vertices in the set `s`, deleting all edges incident to vertices outside the set. This is a wrapper around `simple_graph.comap`.

Equations
@[reducible]
def simple_graph.spanning_coe {V : Type u} {s : set V} (G : simple_graph s) :

Given a graph on a set of vertices, we can make it be a `simple_graph V` by adding in the remaining vertices without adding in any additional edges. This is a wrapper around `simple_graph.map`.

Equations
theorem simple_graph.induce_spanning_coe {V : Type u} {s : set V} {G : simple_graph s} :
theorem simple_graph.spanning_coe_induce_le {V : Type u} (G : simple_graph V) (s : set V) :
G

## Finiteness at a vertex #

This section contains definitions and lemmas concerning vertices that have finitely many adjacent vertices. We denote this condition by `fintype (G.neighbor_set v)`.

We define `G.neighbor_finset v` to be the `finset` version of `G.neighbor_set v`. Use `neighbor_finset_eq_filter` to rewrite this definition as a `filter`.

def simple_graph.neighbor_finset {V : Type u} (G : simple_graph V) (v : V) [fintype (G.neighbor_set v)] :

`G.neighbors v` is the `finset` version of `G.adj v` in case `G` is locally finite at `v`.

Equations
@[simp]
theorem simple_graph.mem_neighbor_finset {V : Type u} (G : simple_graph V) (v : V) [fintype (G.neighbor_set v)] (w : V) :
@[simp]
def simple_graph.degree {V : Type u} (G : simple_graph V) (v : V) [fintype (G.neighbor_set v)] :

`G.degree v` is the number of vertices adjacent to `v`.

Equations
@[simp]
theorem simple_graph.degree_pos_iff_exists_adj {V : Type u} (G : simple_graph V) (v : V) [fintype (G.neighbor_set v)] :
0 < G.degree v (w : V), G.adj v w
@[protected, instance]
Equations

This is the `finset` version of `incidence_set`.

Equations
@[simp]
theorem simple_graph.mem_incidence_finset {V : Type u} (G : simple_graph V) (v : V) [fintype (G.neighbor_set v)] [decidable_eq V] (e : sym2 V) :
e e
@[reducible]

A graph is locally finite if every vertex has a finite neighbor set.

Equations
def simple_graph.is_regular_of_degree {V : Type u} (G : simple_graph V) [G.locally_finite] (d : ) :
Prop

A locally finite simple graph is regular of degree `d` if every vertex has degree `d`.

Equations
@[protected, instance]
Equations
@[simp]
theorem simple_graph.complete_graph_degree {V : Type u} [fintype V] [decidable_eq V] (v : V) :
theorem simple_graph.bot_degree {V : Type u} [fintype V] (v : V) :

The minimum degree of all vertices (and `0` if there are no vertices). The key properties of this are given in `exists_minimal_degree_vertex`, `min_degree_le_degree` and `le_min_degree_of_forall_le_degree`.

Equations

There exists a vertex of minimal degree. Note the assumption of being nonempty is necessary, as the lemma implies there exists a vertex.

The minimum degree in the graph is at most the degree of any particular vertex.

theorem simple_graph.le_min_degree_of_forall_le_degree {V : Type u} (G : simple_graph V) [fintype V] [decidable_rel G.adj] [nonempty V] (k : ) (h : (v : V), k G.degree v) :

In a nonempty graph, if `k` is at most the degree of every vertex, it is at most the minimum degree. Note the assumption that the graph is nonempty is necessary as long as `G.min_degree` is defined to be a natural.

The maximum degree of all vertices (and `0` if there are no vertices). The key properties of this are given in `exists_maximal_degree_vertex`, `degree_le_max_degree` and `max_degree_le_of_forall_degree_le`.

Equations

There exists a vertex of maximal degree. Note the assumption of being nonempty is necessary, as the lemma implies there exists a vertex.

The maximum degree in the graph is at least the degree of any particular vertex.

theorem simple_graph.max_degree_le_of_forall_degree_le {V : Type u} (G : simple_graph V) [fintype V] [decidable_rel G.adj] (k : ) (h : (v : V), G.degree v k) :

In a graph, if `k` is at least the degree of every vertex, then it is at least the maximum degree.

theorem simple_graph.degree_lt_card_verts {V : Type u} (G : simple_graph V) [fintype V] [decidable_rel G.adj] (v : V) :
G.degree v <

The maximum degree of a nonempty graph is less than the number of vertices. Note that the assumption that `V` is nonempty is necessary, as otherwise this would assert the existence of a natural number less than zero.

If the condition `G.adj v w` fails, then `card_common_neighbors_le_degree` is the best we can do in general.

theorem simple_graph.card_common_neighbors_top {V : Type u} [fintype V] [decidable_eq V] {v w : V} (h : v w) :
=
@[reducible]
def simple_graph.hom {V : Type u} {W : Type v} (G : simple_graph V) (G' : simple_graph W) :
Type (max u v)

A graph homomorphism is a map on vertex sets that respects adjacency relations.

The notation `G →g G'` represents the type of graph homomorphisms.

@[reducible]
def simple_graph.embedding {V : Type u} {W : Type v} (G : simple_graph V) (G' : simple_graph W) :
Type (max u v)

A graph embedding is an embedding `f` such that for vertices `v w : V`, `G.adj f(v) f(w) ↔ G.adj v w`. Its image is an induced subgraph of G'.

The notation `G ↪g G'` represents the type of graph embeddings.

@[reducible]
def simple_graph.iso {V : Type u} {W : Type v} (G : simple_graph V) (G' : simple_graph W) :
Type (max u v)

A graph isomorphism is an bijective map on vertex sets that respects adjacency relations.

The notation `G ≃g G'` represents the type of graph isomorphisms.

@[protected, reducible]
def simple_graph.hom.id {V : Type u} {G : simple_graph V} :
G →g G

The identity homomorphism from a graph to itself.

@[simp, norm_cast]
theorem simple_graph.hom.coe_id {V : Type u} {G : simple_graph V} :
@[protected, instance]
def simple_graph.hom.subsingleton {V : Type u} {W : Type v} {G : simple_graph V} {H : simple_graph W} [subsingleton (V W)] :
@[protected, instance]
def simple_graph.hom.unique {V : Type u} {W : Type v} {G : simple_graph V} {H : simple_graph W} [is_empty V] :
unique (G →g H)
Equations
@[protected, instance]
noncomputable def simple_graph.hom.fintype {V : Type u} {W : Type v} {G : simple_graph V} {H : simple_graph W} [fintype V] [fintype W] :
Equations
@[protected, instance]
def simple_graph.hom.finite {V : Type u} {W : Type v} {G : simple_graph V} {H : simple_graph W} [finite V] [finite W] :
finite (G →g H)
theorem simple_graph.hom.map_adj {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G →g G') {v w : V} (h : G.adj v w) :
theorem simple_graph.hom.map_mem_edge_set {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G →g G') {e : sym2 V} (h : e ) :
theorem simple_graph.hom.apply_mem_neighbor_set {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G →g G') {v w : V} (h : w G.neighbor_set v) :
f w G'.neighbor_set (f v)
def simple_graph.hom.map_edge_set {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G →g G') (e : ) :

The map between edge sets induced by a homomorphism. The underlying map on edges is given by `sym2.map`.

Equations
@[simp]
theorem simple_graph.hom.map_edge_set_coe {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G →g G') (e : ) :
@[simp]
theorem simple_graph.hom.map_neighbor_set_coe {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G →g G') (v : V) (w : (G.neighbor_set v)) :
def simple_graph.hom.map_neighbor_set {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G →g G') (v : V) (w : (G.neighbor_set v)) :

The map between neighbor sets induced by a homomorphism.

Equations
def simple_graph.hom.map_dart {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G →g G') (d : G.dart) :
G'.dart

The map between darts induced by a homomorphism.

Equations
@[simp]
theorem simple_graph.hom.map_dart_apply {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G →g G') (d : G.dart) :
f.map_dart d = {to_prod := f d.to_prod, is_adj := _}
def simple_graph.hom.map_spanning_subgraphs {V : Type u} {G G' : simple_graph V} (h : G G') :
G →g G'

The induced map for spanning subgraphs, which is the identity on vertices.

Equations
@[simp]
theorem simple_graph.hom.map_spanning_subgraphs_apply {V : Type u} {G G' : simple_graph V} (h : G G') (x : V) :
theorem simple_graph.hom.map_edge_set.injective {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G →g G') (hinj : function.injective f) :
theorem simple_graph.hom.injective_of_top_hom {V : Type u} {W : Type v} {G' : simple_graph W} (f : →g G') :

Every graph homomomorphism from a complete graph is injective.

@[simp]
theorem simple_graph.hom.comap_apply {V : Type u} {W : Type v} (f : V W) (G : simple_graph W) (ᾰ : V) :
= f ᾰ
@[protected]
def simple_graph.hom.comap {V : Type u} {W : Type v} (f : V W) (G : simple_graph W) :
→g G

There is a homomorphism to a graph from a comapped graph. When the function is injective, this is an embedding (see `simple_graph.embedding.comap`).

Equations
@[reducible]
def simple_graph.hom.comp {V : Type u} {W : Type v} {X : Type w} {G : simple_graph V} {G' : simple_graph W} {G'' : simple_graph X} (f' : G' →g G'') (f : G →g G') :
G →g G''

Composition of graph homomorphisms.

@[simp]
theorem simple_graph.hom.coe_comp {V : Type u} {W : Type v} {X : Type w} {G : simple_graph V} {G' : simple_graph W} {G'' : simple_graph X} (f' : G' →g G'') (f : G →g G') :
(f'.comp f) = f' f
def simple_graph.hom.of_le {V : Type u} {G H : simple_graph V} (h : G H) :
G →g H

The graph homomorphism from a smaller graph to a bigger one.

Equations
@[simp, norm_cast]
theorem simple_graph.hom.coe_of_le {V : Type u} {G H : simple_graph V} (h : G H) :
@[reducible]
def simple_graph.embedding.refl {V : Type u} {G : simple_graph V} :
G ↪g G

The identity embedding from a graph to itself.

@[reducible]
def simple_graph.embedding.to_hom {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ↪g G') :
G →g G'

An embedding of graphs gives rise to a homomorphism of graphs.

@[simp]
theorem simple_graph.embedding.coe_to_hom {V : Type u} {W : Type v} {G : simple_graph V} {H : simple_graph W} (f : G ↪g H) :
@[simp]
theorem simple_graph.embedding.map_adj_iff {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ↪g G') {v w : V} :
theorem simple_graph.embedding.map_mem_edge_set_iff {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ↪g G') {e : sym2 V} :
theorem simple_graph.embedding.apply_mem_neighbor_set_iff {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ↪g G') {v w : V} :
@[simp]
theorem simple_graph.embedding.map_edge_set_apply {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ↪g G') (e : ) :
def simple_graph.embedding.map_edge_set {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ↪g G') :

A graph embedding induces an embedding of edge sets.

Equations
def simple_graph.embedding.map_neighbor_set {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ↪g G') (v : V) :

A graph embedding induces an embedding of neighbor sets.

Equations
@[simp]
theorem simple_graph.embedding.map_neighbor_set_apply_coe {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ↪g G') (v : V) (w : (G.neighbor_set v)) :
@[protected]
def simple_graph.embedding.comap {V : Type u} {W : Type v} (f : V W) (G : simple_graph W) :

Given an injective function, there is an embedding from the comapped graph into the original graph.

Equations
@[simp]
theorem simple_graph.embedding.comap_apply {V : Type u} {W : Type v} (f : V W) (G : simple_graph W) (ᾰ : V) :
= f.to_fun
@[protected]
def simple_graph.embedding.map {V : Type u} {W : Type v} (f : V W) (G : simple_graph V) :
G ↪g

Given an injective function, there is an embedding from a graph into the mapped graph.

Equations
@[simp]
theorem simple_graph.embedding.map_apply {V : Type u} {W : Type v} (f : V W) (G : simple_graph V) (ᾰ : V) :
= f.to_fun
@[protected, reducible]
def simple_graph.embedding.induce {V : Type u} {G : simple_graph V} (s : set V) :

Induced graphs embed in the original graph.

Note that if `G.induce s = ⊤` (i.e., if `s` is a clique) then this gives the embedding of a complete graph.

Equations
@[protected, reducible]

Graphs on a set of vertices embed in their `spanning_coe`.

Equations
@[protected]
def simple_graph.embedding.complete_graph {α : Type u_1} {β : Type u_2} (f : α β) :

Embeddings of types induce embeddings of complete graphs on those types.

Equations
@[reducible]
def simple_graph.embedding.comp {V : Type u} {W : Type v} {X : Type w} {G : simple_graph V} {G' : simple_graph W} {G'' : simple_graph X} (f' : G' ↪g G'') (f : G ↪g G') :
G ↪g G''

Composition of graph embeddings.

@[simp]
theorem simple_graph.embedding.coe_comp {V : Type u} {W : Type v} {X : Type w} {G : simple_graph V} {G' : simple_graph W} {G'' : simple_graph X} (f' : G' ↪g G'') (f : G ↪g G') :
(f'.comp f) = f' f
def simple_graph.induce_hom {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} {s : set V} {t : set W} (φ : G →g G') (φst : s t) :

The restriction of a morphism of graphs to induced subgraphs.

Equations
@[simp, norm_cast]
theorem simple_graph.coe_induce_hom {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} {s : set V} {t : set W} (φ : G →g G') (φst : s t) :
φst) = φst
@[simp]
theorem simple_graph.induce_hom_id {V : Type u} (G : simple_graph V) (s : set V) :
@[simp]
theorem simple_graph.induce_hom_comp {V : Type u} {W : Type v} {X : Type w} {G : simple_graph V} {G' : simple_graph W} {G'' : simple_graph X} {s : set V} {t : set W} {r : set X} (φ : G →g G') (φst : s t) (ψ : G' →g G'') (ψtr : t r) :
ψtr).comp φst) = _
@[reducible]
def simple_graph.iso.refl {V : Type u} {G : simple_graph V} :
G ≃g G

The identity isomorphism of a graph with itself.

@[reducible]
def simple_graph.iso.to_embedding {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ≃g G') :
G ↪g G'

An isomorphism of graphs gives rise to an embedding of graphs.

@[reducible]
def simple_graph.iso.to_hom {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ≃g G') :
G →g G'

An isomorphism of graphs gives rise to a homomorphism of graphs.

@[reducible]
def simple_graph.iso.symm {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ≃g G') :
G' ≃g G

The inverse of a graph isomorphism.

theorem simple_graph.iso.map_adj_iff {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ≃g G') {v w : V} :
theorem simple_graph.iso.map_mem_edge_set_iff {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ≃g G') {e : sym2 V} :
theorem simple_graph.iso.apply_mem_neighbor_set_iff {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ≃g G') {v w : V} :
@[simp]
theorem simple_graph.iso.map_edge_set_apply {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ≃g G') (e : ) :
def simple_graph.iso.map_edge_set {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ≃g G') :

An isomorphism of graphs induces an equivalence of edge sets.

Equations
@[simp]
theorem simple_graph.iso.map_edge_set_symm_apply {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ≃g G') (e : ) :
@[simp]
theorem simple_graph.iso.map_neighbor_set_symm_apply_coe {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ≃g G') (v : V) (w : (G'.neighbor_set (f v))) :
def simple_graph.iso.map_neighbor_set {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ≃g G') (v : V) :

A graph isomorphism induces an equivalence of neighbor sets.

Equations
@[simp]
theorem simple_graph.iso.map_neighbor_set_apply_coe {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} (f : G ≃g G') (v : V) (w : (G.neighbor_set v)) :
theorem simple_graph.iso.card_eq_of_iso {V : Type u} {W : Type v} {G : simple_graph V} {G' : simple_graph W} [fintype V] [fintype W] (f : G ≃g G') :
@[protected]
def simple_graph.iso.comap {V : Type u} {W : Type v} (f : V W) (G : simple_graph W) :

Given a bijection, there is an embedding from the comapped graph into the original graph.

Equations
@[simp]
theorem simple_graph.iso.comap_apply {V : Type u} {W : Type v} (f : V W) (G : simple_graph W) (ᾰ : V) :
= f.to_fun
@[simp]
theorem simple_graph.iso.comap_symm_apply {V : Type u} {W : Type v} (f : V W) (G : simple_graph W) (ᾰ : W) :
= f.inv_fun
@[protected]
def simple_graph.iso.map {V : Type u} {W : Type v} (f : V W) (G : simple_graph V) :

Given an injective function, there is an embedding from a graph into the mapped graph.

Equations
@[simp]
theorem simple_graph.iso.map_symm_apply {V : Type u} {W : Type v} (f : V W) (G : simple_graph V) (ᾰ : W) :
(rel_iso.symm G)) = f.inv_fun
@[simp]
theorem simple_graph.iso.map_apply {V : Type u} {W : Type v} (f : V W) (G : simple_graph V) (ᾰ : V) :
G) = f.to_fun
@[protected]
def simple_graph.iso.complete_graph {α : Type u_1} {β : Type u_2} (f : α β) :

Equivalences of types induce isomorphisms of complete graphs on those types.

Equations
theorem simple_graph.iso.to_embedding_complete_graph {α : Type u_1} {β : Type u_2} (f : α β) :
@[reducible]
def simple_graph.iso.comp {V : Type u} {W : Type v} {X : Type w} {G : simple_graph V} {G' : simple_graph W} {G'' : simple_graph X} (f' : G' ≃g G'') (f : G ≃g G') :
G ≃g G''

Composition of graph isomorphisms.

@[simp]
theorem simple_graph.iso.coe_comp {V : Type u} {W : Type v} {X : Type w} {G : simple_graph V} {G' : simple_graph W} {G'' : simple_graph X} (f' : G' ≃g G'') (f : G ≃g G') :
(f'.comp f) = f' f