The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V30. Combinatorics

Mathlib.Combinatorics.SimpleGraph.Basic

243 declarations and 3 deprecated aliases. Mathlib docs · Source

Simple graphs

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

Main definitions

  • SimpleGraph is a structure for symmetric, irreflexive relations.

  • SimpleGraph.neighborSet is the Set of vertices adjacent to a given vertex.

  • SimpleGraph.commonNeighbors is the intersection of the neighbor sets of two given vertices.

  • SimpleGraph.incidenceSet is the Set of edges containing a given vertex.

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

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.

Incidence set

theorem SimpleGraph.mk.inj E1 #

∀ {V : Type u} {Adj : V → V → Prop} {symm : autoParam (Std.Symm Adj) SimpleGraph.symm._autoParam}
  {loopless : autoParam (Std.Irrefl Adj) SimpleGraph.loopless._autoParam} {Adj_1 : V → V → Prop}
  {symm_1 : autoParam (Std.Symm Adj_1) SimpleGraph.symm._autoParam}
  {loopless_1 : autoParam (Std.Irrefl Adj_1) SimpleGraph.loopless._autoParam},
  { Adj := Adj, symm := symm, loopless := loopless } = { Adj := Adj_1, symm := symm_1, loopless := loopless_1 } →
    Adj = Adj_1

def SimpleGraph.ctorIdx E1 #

{V : Type u} → SimpleGraph V → ℕ

theorem Sym2.Mem.other.congr_simp E1 #

∀ {α : Type u_1} {a a_1 : α} (e_a : a = a_1) {z z_1 : Sym2 α} (e_z : z = z_1) (h : a ∈ z),
  Sym2.Mem.other h = Sym2.Mem.other ⋯

theorem SimpleGraph.mk.injEq E0 #

∀ {V : Type u} (Adj : V → V → Prop) (symm : autoParam (Std.Symm Adj) SimpleGraph.symm._autoParam)
  (loopless : autoParam (Std.Irrefl Adj) SimpleGraph.loopless._autoParam) (Adj_1 : V → V → Prop)
  (symm_1 : autoParam (Std.Symm Adj_1) SimpleGraph.symm._autoParam)
  (loopless_1 : autoParam (Std.Irrefl Adj_1) SimpleGraph.loopless._autoParam),
  ({ Adj := Adj, symm := symm, loopless := loopless } = { Adj := Adj_1, symm := symm_1, loopless := loopless_1 }) =
    (Adj = Adj_1)

theorem SimpleGraph.mk.congr_simp E1 #

∀ {V : Type u} (Adj Adj_1 : V → V → Prop) (e_Adj : Adj = Adj_1) (symm : Std.Symm Adj) (loopless : Std.Irrefl Adj),
  { Adj := Adj, symm := symm, loopless := loopless } = { Adj := Adj_1, symm := ⋯, loopless := ⋯ }

theorem SimpleGraph.otherVertexOfIncident.congr_simp E1 #

∀ {V : Type u} (G G_1 : SimpleGraph V) (e_G : G = G_1) [inst : DecidableEq V] {v v_1 : V} (e_v : v = v_1)
  {e e_1 : Sym2 V} (e_e : e = e_1) (h : e ∈ G.incidenceSet v), G.otherVertexOfIncident h = G_1.otherVertexOfIncident ⋯

def aesop_graph E1 #

Lean.ParserDescr

A variant of the aesop tactic for use in the graph library. Changes relative to standard aesop:

  • We use the SimpleGraph rule set in addition to the default rule sets.
  • We instruct Aesop's intro rule to unfold with default transparency.
  • We instruct Aesop to fail if it can't fully solve the goal. This allows us to use aesop_graph for auto-params.

def aesop_graph? E1 #

Lean.ParserDescr

Use aesop_graph? to pass along a Try this suggestion when using aesop_graph

def aesop_graph_nonterminal E1 #

Lean.ParserDescr

A variant of aesop_graph which does not fail if it is unable to solve the goal. Use this only for exploration! Nonterminal Aesop is even worse than nonterminal simp.

structure SimpleGraph E3 #

Type u → 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 SimpleGraph.edgeSet for the corresponding edge set.

theorem SimpleGraph.ext_iff E0 #

∀ {V : Type u} {x y : SimpleGraph V}, x = y ↔ x.Adj = y.Adj

theorem SimpleGraph.ext E1 #

∀ {V : Type u} {x y : SimpleGraph V}, x.Adj = y.Adj → x = y

ctor SimpleGraph.mk E0 #

{V : Type u} →
  (Adj : V → V → Prop) →
    autoParam (Std.Symm Adj) SimpleGraph.symm._autoParam →
      autoParam (Std.Irrefl Adj) SimpleGraph.loopless._autoParam → SimpleGraph V

abbrev SimpleGraph.Adj E1 #

{V : Type u} → SimpleGraph V → V → V → Prop

The adjacency relation of a simple graph.

theorem SimpleGraph.symm E2 #

∀ {V : Type u} (self : SimpleGraph V), Std.Symm self.Adj

theorem SimpleGraph.loopless E1 #

∀ {V : Type u} (self : SimpleGraph V), Std.Irrefl self.Adj

def SimpleGraph.mk' E1 #

{V : Type u} → { adj // (∀ (x y : V), adj x y = adj y x) ∧ ∀ (x : V), ¬adj x x = true } ↪ SimpleGraph V

Constructor for simple graphs using a symmetric irreflexive Boolean function.

theorem SimpleGraph.mk'_apply_adj E0 #

∀ {V : Type u} (x : { adj // (∀ (x y : V), adj x y = adj y x) ∧ ∀ (x : V), ¬adj x x = true }) (v w : V),
  (SimpleGraph.mk' x).Adj v w = (↑x v w = true)

instance instFintypeSimpleGraphOfDecidableEq E0 #

{V : Type u} → [Fintype V] → [DecidableEq V] → Fintype (SimpleGraph V)

We can enumerate simple graphs by enumerating all functions V → V → Bool and filtering on whether they are symmetric and irreflexive.

instance SimpleGraph.instFinite E0 #

∀ {V : Type u} [Finite V], Finite (SimpleGraph V)

There are finitely many simple graphs on a given finite type.

def SimpleGraph.fromRel E1 #

{V : Type u} → (V → V → Prop) → SimpleGraph V

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

theorem SimpleGraph.fromRel_adj E0 #

∀ {V : Type u} (r : V → V → Prop) (v w : V), (SimpleGraph.fromRel r).Adj v w ↔ v ≠ w ∧ (r v w ∨ r w v)

instance instDecidableRelAdjFromRelOfDecidableEq E0 #

{V : Type u} → [DecidableEq V] → (r : V → V → Prop) → [DecidableRel r] → DecidableRel (SimpleGraph.fromRel r).Adj

def completeBipartiteGraph E1 #

(V : Type u_1) → (W : Type u_2) → SimpleGraph (V ⊕ W)

Two vertices are adjacent in the complete bipartite graph on two vertex types if and only if they are not from the same side. Any bipartite graph may be regarded as a subgraph of one of these.

theorem completeBipartiteGraph_adj E0 #

∀ (V : Type u_1) (W : Type u_2) (v w : V ⊕ W),
  (completeBipartiteGraph V W).Adj v w = (v.isLeft = true ∧ w.isRight = true ∨ v.isRight = true ∧ w.isLeft = true)

theorem SimpleGraph.irrefl E0 #

∀ {V : Type u} (G : SimpleGraph V) {v : V}, ¬G.Adj v v

theorem SimpleGraph.adj_comm E1 #

∀ {V : Type u} (G : SimpleGraph V) (u v : V), G.Adj u v ↔ G.Adj v u

theorem SimpleGraph.adj_symm E1 #

∀ {V : Type u} (G : SimpleGraph V) {u v : V}, G.Adj u v → G.Adj v u

theorem SimpleGraph.Adj.symm E2 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V}, G.Adj u v → G.Adj v u

theorem SimpleGraph.ne_of_adj E1 #

∀ {V : Type u} (G : SimpleGraph V) {a b : V}, G.Adj a b → a ≠ b

theorem SimpleGraph.Adj.ne E1 #

∀ {V : Type u} {G : SimpleGraph V} {a b : V}, G.Adj a b → a ≠ b

theorem SimpleGraph.Adj.ne' E1 #

∀ {V : Type u} {G : SimpleGraph V} {a b : V}, G.Adj a b → b ≠ a

theorem SimpleGraph.ne_of_adj_of_not_adj E1 #

∀ {V : Type u} (G : SimpleGraph V) {v w x : V}, G.Adj v x → ¬G.Adj w x → v ≠ w

theorem SimpleGraph.adj_injective E1 #

∀ {V : Type u}, Function.Injective SimpleGraph.Adj

theorem SimpleGraph.adj_inj E0 #

∀ {V : Type u} {G H : SimpleGraph V}, G.Adj = H.Adj ↔ G = H

theorem SimpleGraph.adj_congr_of_sym2 E1 #

∀ {V : Type u} (G : SimpleGraph V) {u v w x : V}, s(u, v) = s(w, x) → (G.Adj u v ↔ G.Adj w x)

instance SimpleGraph.symm_adj E0 #

∀ {ι : Sort u_1} {V : Type u} (G : SimpleGraph V) (f : ι → V), Std.Symm fun i j ↦ G.Adj (f i) (f j)

instance SimpleGraph.instInfinite E0 #

∀ {V : Type u} [Infinite V], Infinite (SimpleGraph V)

instance SimpleGraph.instLE E0 #

{V : Type u} → LE (SimpleGraph V)

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

theorem SimpleGraph.le_iff_adj E1 #

∀ {V : Type u} {G H : SimpleGraph V}, G ≤ H ↔ ∀ (v w : V), G.Adj v w → H.Adj v w

instance SimpleGraph.instMax E0 #

{V : Type u} → Max (SimpleGraph V)

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

theorem SimpleGraph.sup_adj E0 #

∀ {V : Type u} (x y : SimpleGraph V) (v w : V), (x ⊔ y).Adj v w ↔ x.Adj v w ∨ y.Adj v w

instance SimpleGraph.instMin E0 #

{V : Type u} → Min (SimpleGraph V)

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

theorem SimpleGraph.inf_adj E0 #

∀ {V : Type u} (x y : SimpleGraph V) (v w : V), (x ⊓ y).Adj v w ↔ x.Adj v w ∧ y.Adj v w

instance SimpleGraph.instCompl E0 #

{V : Type u} → Compl (SimpleGraph V)

We define Gᶜ to be the SimpleGraph 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).

theorem SimpleGraph.compl_adj E0 #

∀ {V : Type u} (G : SimpleGraph V) (v w : V), Gᶜ.Adj v w ↔ v ≠ w ∧ ¬G.Adj v w

instance SimpleGraph.sdiff E0 #

{V : Type u} → SDiff (SimpleGraph V)

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

theorem SimpleGraph.sdiff_adj E0 #

∀ {V : Type u} (x y : SimpleGraph V) (v w : V), (x \ y).Adj v w ↔ x.Adj v w ∧ ¬y.Adj v w

instance SimpleGraph.supSet E0 #

{V : Type u} → SupSet (SimpleGraph V)

instance SimpleGraph.infSet E0 #

{V : Type u} → InfSet (SimpleGraph V)

theorem SimpleGraph.sSup_adj E0 #

∀ {V : Type u} {s : Set (SimpleGraph V)} {a b : V}, (sSup s).Adj a b ↔ ∃ G ∈ s, G.Adj a b

theorem SimpleGraph.sInf_adj E0 #

∀ {V : Type u} {a b : V} {s : Set (SimpleGraph V)}, (sInf s).Adj a b ↔ (∀ G ∈ s, G.Adj a b) ∧ a ≠ b

theorem SimpleGraph.iSup_adj E0 #

∀ {ι : Sort u_1} {V : Type u} {a b : V} {f : ι → SimpleGraph V}, (⨆ i, f i).Adj a b ↔ ∃ i, (f i).Adj a b

theorem SimpleGraph.iInf_adj E0 #

∀ {ι : Sort u_1} {V : Type u} {a b : V} {f : ι → SimpleGraph V}, (⨅ i, f i).Adj a b ↔ (∀ (i : ι), (f i).Adj a b) ∧ a ≠ b

theorem SimpleGraph.sInf_adj_of_nonempty E1 #

∀ {V : Type u} {a b : V} {s : Set (SimpleGraph V)}, s.Nonempty → ((sInf s).Adj a b ↔ ∀ G ∈ s, G.Adj a b)

theorem SimpleGraph.iInf_adj_of_nonempty E1 #

∀ {ι : Sort u_1} {V : Type u} {a b : V} [Nonempty ι] {f : ι → SimpleGraph V},
  (⨅ i, f i).Adj a b ↔ ∀ (i : ι), (f i).Adj a b

instance SimpleGraph.instPartialOrder E0 #

{V : Type u} → PartialOrder (SimpleGraph V)

instance SimpleGraph.distribLattice E0 #

{V : Type u} → DistribLattice (SimpleGraph V)

instance SimpleGraph.completeAtomicBooleanAlgebra E0 #

{V : Type u} → CompleteAtomicBooleanAlgebra (SimpleGraph V)

abbrev SimpleGraph.completeGraph E1 #

(V : Type u) → SimpleGraph V

The complete graph on a type V is the simple graph with all pairs of distinct vertices.

abbrev SimpleGraph.emptyGraph E1 #

(V : Type u) → SimpleGraph V

The graph with no edges on a given vertex type V.

theorem SimpleGraph.top_adj E0 #

∀ {V : Type u} (v w : V), ⊤.Adj v w ↔ v ≠ w

theorem SimpleGraph.bot_adj E0 #

∀ {V : Type u} (v w : V), ⊥.Adj v w ↔ False

theorem SimpleGraph.completeGraph_eq_top E0 #

∀ (V : Type u), SimpleGraph.completeGraph V = ⊤

theorem SimpleGraph.emptyGraph_eq_bot E0 #

∀ (V : Type u), SimpleGraph.emptyGraph V = ⊥

theorem SimpleGraph.ne_bot_iff_exists_adj E1 #

∀ {V : Type u} {G : SimpleGraph V}, G ≠ ⊥ ↔ ∃ a b, G.Adj a b

theorem SimpleGraph.ne_top_iff_exists_not_adj E1 #

∀ {V : Type u} {G : SimpleGraph V}, G ≠ ⊤ ↔ ∃ a b, a ≠ b ∧ ¬G.Adj a b

theorem SimpleGraph.default_def E0 #

∀ (V : Type u), default = ⊥

instance SimpleGraph.instInhabited E0 #

(V : Type u) → Inhabited (SimpleGraph V)

instance SimpleGraph.uniqueOfSubsingleton E0 #

{V : Type u} → [Subsingleton V] → Unique (SimpleGraph V)

instance SimpleGraph.instNontrivial E0 #

∀ {V : Type u} [Nontrivial V], Nontrivial (SimpleGraph V)

instance SimpleGraph.Bot.adjDecidable E0 #

(V : Type u) → DecidableRel ⊥.Adj

instance SimpleGraph.Sup.adjDecidable E0 #

(V : Type u) → (G H : SimpleGraph V) → [DecidableRel G.Adj] → [DecidableRel H.Adj] → DecidableRel (G ⊔ H).Adj

instance SimpleGraph.Inf.adjDecidable E0 #

(V : Type u) → (G H : SimpleGraph V) → [DecidableRel G.Adj] → [DecidableRel H.Adj] → DecidableRel (G ⊓ H).Adj

instance SimpleGraph.Sdiff.adjDecidable E0 #

(V : Type u) → (G H : SimpleGraph V) → [DecidableRel G.Adj] → [DecidableRel H.Adj] → DecidableRel (G \ H).Adj

instance SimpleGraph.Top.adjDecidable E0 #

(V : Type u) → [DecidableEq V] → DecidableRel ⊤.Adj

instance SimpleGraph.Compl.adjDecidable E0 #

(V : Type u) → (G : SimpleGraph V) → [DecidableRel G.Adj] → [DecidableEq V] → DecidableRel Gᶜ.Adj

def SimpleGraph.support E1 #

{V : Type u} → SimpleGraph V → Set V

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

theorem SimpleGraph.mem_support E0 #

∀ {V : Type u} (G : SimpleGraph V) {v : V}, v ∈ G.support ↔ ∃ w, G.Adj v w

theorem SimpleGraph.Adj.mem_support_left E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V}, G.Adj u v → u ∈ G.support

theorem SimpleGraph.Adj.mem_support_right E0 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V}, G.Adj u v → v ∈ G.support

theorem SimpleGraph.support_mono E1 #

∀ {V : Type u} {G G' : SimpleGraph V}, G ≤ G' → G.support ⊆ G'.support

theorem SimpleGraph.Adj.left_mem_support E1 #

∀ {V : Type u} (G : SimpleGraph V) {u v : V}, G.Adj u v → u ∈ G.support

theorem SimpleGraph.Adj.right_mem_support E1 #

∀ {V : Type u} (G : SimpleGraph V) {u v : V}, G.Adj u v → v ∈ G.support

theorem SimpleGraph.support_top_of_nontrivial E1 #

∀ {V : Type u} [Nontrivial V], ⊤.support = Set.univ

All vertices are in the support of the complete graph if there is more than one vertex.

theorem SimpleGraph.support_bot E0 #

∀ {V : Type u}, ⊥.support = ∅

The support of the empty graph is empty.

theorem SimpleGraph.support_eq_bot_iff E0 #

∀ {V : Type u} (G : SimpleGraph V), G.support = ∅ ↔ G = ⊥

Only the empty graph has empty support.

theorem SimpleGraph.support_of_subsingleton E0 #

∀ {V : Type u} (G : SimpleGraph V) [Subsingleton V], G.support = ∅

The support of a graph is empty if there at most one vertex.

def SimpleGraph.neighborSet E3 #

{V : Type u} → SimpleGraph V → V → Set V

G.neighborSet v is the set of vertices adjacent to v in G.

instance SimpleGraph.neighborSet.memDecidable E0 #

{V : Type u} → (G : SimpleGraph V) → (v : V) → [DecidableRel G.Adj] → DecidablePred fun x ↦ x ∈ G.neighborSet v

theorem SimpleGraph.neighborSet_subset_support E1 #

∀ {V : Type u} (G : SimpleGraph V) (v : V), G.neighborSet v ⊆ G.support

def SimpleGraph.edgeSetEmbedding E1 #

(V : Type u_2) → SimpleGraph V ↪o Set (Sym2 V)

The edges of G consist of the unordered pairs of vertices related by G.Adj. This is the order embedding; for the edge set of a particular graph, see SimpleGraph.edgeSet.

The way edgeSet is defined is such that mem_edgeSet is proved by Iff.rfl. (That is, s(v, w) ∈ G.edgeSet is definitionally equal to G.Adj v w.)

abbrev SimpleGraph.edgeSet E1 #

{V : Type u} → SimpleGraph V → Set (Sym2 V)

G.edgeSet is the edge set for G. This is an abbreviation for edgeSetEmbedding G that permits dot notation.

theorem SimpleGraph.mem_edgeSet E0 #

∀ {V : Type u} (G : SimpleGraph V) {v w : V}, s(v, w) ∈ G.edgeSet ↔ G.Adj v w

theorem SimpleGraph.not_isDiag_of_mem_edgeSet E1 #

∀ {V : Type u} (G : SimpleGraph V) {e : Sym2 V}, e ∈ G.edgeSet → ¬e.IsDiag

theorem SimpleGraph.notMem_edgeSet_of_isDiag E0 #

∀ {V : Type u} (G : SimpleGraph V) {e : Sym2 V}, e.IsDiag → e ∉ G.edgeSet

theorem Sym2.IsDiag.notMem_edgeSet E1 #

∀ {V : Type u} (G : SimpleGraph V) {e : Sym2 V}, e.IsDiag → e ∉ G.edgeSet

Alias of SimpleGraph.notMem_edgeSet_of_isDiag.

theorem SimpleGraph.edgeSet_inj E1 #

∀ {V : Type u} {G₁ G₂ : SimpleGraph V}, G₁.edgeSet = G₂.edgeSet ↔ G₁ = G₂

theorem SimpleGraph.edgeSet_subset_edgeSet E1 #

∀ {V : Type u} {G₁ G₂ : SimpleGraph V}, G₁.edgeSet ⊆ G₂.edgeSet ↔ G₁ ≤ G₂

theorem SimpleGraph.edgeSet_ssubset_edgeSet E1 #

∀ {V : Type u} {G₁ G₂ : SimpleGraph V}, G₁.edgeSet ⊂ G₂.edgeSet ↔ G₁ < G₂

theorem SimpleGraph.edgeSet_injective E1 #

∀ {V : Type u}, Function.Injective SimpleGraph.edgeSet

theorem SimpleGraph.edgeSet_mono E1 #

∀ {V : Type u} {G₁ G₂ : SimpleGraph V}, G₁ ≤ G₂ → G₁.edgeSet ⊆ G₂.edgeSet

Alias of the reverse direction of SimpleGraph.edgeSet_subset_edgeSet.

theorem SimpleGraph.edgeSet_strict_mono E1 #

∀ {V : Type u} {G₁ G₂ : SimpleGraph V}, G₁ < G₂ → G₁.edgeSet ⊂ G₂.edgeSet

Alias of the reverse direction of SimpleGraph.edgeSet_ssubset_edgeSet.

theorem SimpleGraph.edgeSet_bot E0 #

∀ {V : Type u}, ⊥.edgeSet = ∅

theorem SimpleGraph.edgeSet_top E0 #

∀ {V : Type u}, ⊤.edgeSet = Sym2.diagSetᶜ

theorem SimpleGraph.edgeSet_subset_compl_diagSet E0 #

∀ {V : Type u} (G : SimpleGraph V), G.edgeSet ⊆ Sym2.diagSetᶜ

theorem SimpleGraph.disjoint_edgeSet_diagSet E1 #

∀ {V : Type u} (G : SimpleGraph V), Disjoint G.edgeSet Sym2.diagSet

theorem SimpleGraph.edgeSet_sup E0 #

∀ {V : Type u} (G₁ G₂ : SimpleGraph V), (G₁ ⊔ G₂).edgeSet = G₁.edgeSet ∪ G₂.edgeSet

theorem SimpleGraph.edgeSet_inf E0 #

∀ {V : Type u} (G₁ G₂ : SimpleGraph V), (G₁ ⊓ G₂).edgeSet = G₁.edgeSet ∩ G₂.edgeSet

theorem SimpleGraph.edgeSet_sSup E1 #

∀ {V : Type u} {s : Set (SimpleGraph V)}, (sSup s).edgeSet = ⋃₀ (SimpleGraph.edgeSet '' s)

theorem SimpleGraph.edgeSet_sInf E1 #

∀ {V : Type u} {s : Set (SimpleGraph V)}, s.Nonempty → (sInf s).edgeSet = ⋂₀ (SimpleGraph.edgeSet '' s)

theorem SimpleGraph.edgeSet_iSup E1 #

∀ {V : Type u} {ι : Sort u_2} {f : ι → SimpleGraph V}, (⨆ i, f i).edgeSet = ⋃ i, (f i).edgeSet

theorem SimpleGraph.edgeSet_iInf E1 #

∀ {V : Type u} {ι : Sort u_2} [Nonempty ι] {f : ι → SimpleGraph V}, (⨅ i, f i).edgeSet = ⋂ i, (f i).edgeSet

theorem SimpleGraph.edgeSet_sdiff E0 #

∀ {V : Type u} (G₁ G₂ : SimpleGraph V), (G₁ \ G₂).edgeSet = G₁.edgeSet \ G₂.edgeSet

theorem SimpleGraph.disjoint_edgeSet E0 #

∀ {V : Type u} {G₁ G₂ : SimpleGraph V}, Disjoint G₁.edgeSet G₂.edgeSet ↔ Disjoint G₁ G₂

theorem SimpleGraph.disjoint_of_disjoint_support E1 #

∀ {V : Type u} {G : SimpleGraph V} (H : SimpleGraph V), Disjoint G.support H.support → Disjoint G H

theorem SimpleGraph.edgeSet_eq_empty E0 #

∀ {V : Type u} {G : SimpleGraph V}, G.edgeSet = ∅ ↔ G = ⊥

theorem SimpleGraph.edgeSet_nonempty E0 #

∀ {V : Type u} {G : SimpleGraph V}, G.edgeSet.Nonempty ↔ G ≠ ⊥

theorem SimpleGraph.edgeSet_sdiff_sdiff_isDiag E0 #

∀ {V : Type u} (G : SimpleGraph V) (s : Set (Sym2 V)), G.edgeSet \ (s \ Sym2.diagSet) = G.edgeSet \ s

This lemma, combined with edgeSet_sdiff and edgeSet_fromEdgeSet, allows proving (G \ fromEdgeSet s).edgeSet = G.edgeSet \ s by simp.

theorem SimpleGraph.adj_iff_exists_edge E1 #

∀ {V : Type u} {G : SimpleGraph V} {v w : V}, G.Adj v w ↔ v ≠ w ∧ ∃ e ∈ G.edgeSet, 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.edgeSet), v ∈ e ∧ w ∈ e is satisfied by every edge incident to v.

theorem SimpleGraph.adj_iff_exists_edge_coe E0 #

∀ {V : Type u} {G : SimpleGraph V} {a b : V}, G.Adj a b ↔ ∃ e, ↑e = s(a, b)

theorem SimpleGraph.edgeSet_subset_sym2_iff E0 #

∀ {V : Type u} {G : SimpleGraph V} {s : Set V}, G.edgeSet ⊆ s.sym2 ↔ G.support ⊆ s

theorem SimpleGraph.edge_other_ne E1 #

∀ {V : Type u} (G : SimpleGraph V) {e : Sym2 V}, e ∈ G.edgeSet → ∀ {v : V} (h : v ∈ e), Sym2.Mem.other h ≠ v

instance SimpleGraph.decidableMemEdgeSet E0 #

{V : Type u} → (G : SimpleGraph V) → [DecidableRel G.Adj] → DecidablePred fun x ↦ x ∈ G.edgeSet

instance SimpleGraph.fintypeEdgeSet E0 #

{V : Type u} → (G : SimpleGraph V) → [Fintype (Sym2 V)] → [DecidableRel G.Adj] → Fintype ↑G.edgeSet

instance SimpleGraph.fintypeEdgeSetBot E0 #

{V : Type u} → Fintype ↑⊥.edgeSet

instance SimpleGraph.fintypeEdgeSetSup E0 #

{V : Type u} →
  (G₁ G₂ : SimpleGraph V) → [DecidableEq V] → [Fintype ↑G₁.edgeSet] → [Fintype ↑G₂.edgeSet] → Fintype ↑(G₁ ⊔ G₂).edgeSet

instance SimpleGraph.fintypeEdgeSetInf E0 #

{V : Type u} →
  (G₁ G₂ : SimpleGraph V) → [DecidableEq V] → [Fintype ↑G₁.edgeSet] → [Fintype ↑G₂.edgeSet] → Fintype ↑(G₁ ⊓ G₂).edgeSet

instance SimpleGraph.fintypeEdgeSetSdiff E0 #

{V : Type u} →
  (G₁ G₂ : SimpleGraph V) → [DecidableEq V] → [Fintype ↑G₁.edgeSet] → [Fintype ↑G₂.edgeSet] → Fintype ↑(G₁ \ G₂).edgeSet

theorem SimpleGraph.finite_edgeSet_iff_finite_support E0 #

∀ {V : Type u} {G : SimpleGraph V}, G.edgeSet.Finite ↔ G.support.Finite

theorem SimpleGraph.infinite_edgeSet_iff_infinite_support E0 #

∀ {V : Type u} {G : SimpleGraph V}, G.edgeSet.Infinite ↔ G.support.Infinite

def SimpleGraph.fromEdgeSet E1 #

{V : Type u} → Set (Sym2 V) → SimpleGraph V

fromEdgeSet constructs a SimpleGraph from a set of edges, without loops.

instance SimpleGraph.instDecidableRelAdjFromEdgeSetOfDecidablePredSym2MemSetOfDecidableEq E0 #

{V : Type u} →
  (s : Set (Sym2 V)) → [DecidablePred fun x ↦ x ∈ s] → [DecidableEq V] → DecidableRel (SimpleGraph.fromEdgeSet s).Adj

theorem SimpleGraph.fromEdgeSet_adj E0 #

∀ {V : Type u} {v w : V} (s : Set (Sym2 V)), (SimpleGraph.fromEdgeSet s).Adj v w ↔ s(v, w) ∈ s ∧ v ≠ w

theorem SimpleGraph.edgeSet_fromEdgeSet E0 #

∀ {V : Type u} (s : Set (Sym2 V)), (SimpleGraph.fromEdgeSet s).edgeSet = s \ Sym2.diagSet

theorem SimpleGraph.fromEdgeSet_edgeSet E0 #

∀ {V : Type u} (G : SimpleGraph V), SimpleGraph.fromEdgeSet G.edgeSet = G

theorem SimpleGraph.le_fromEdgeSet_iff E0 #

∀ {V : Type u} (G : SimpleGraph V) (s : Set (Sym2 V)), G ≤ SimpleGraph.fromEdgeSet s ↔ G.edgeSet ⊆ s

theorem SimpleGraph.fromEdgeSet_le E0 #

∀ {V : Type u} (G : SimpleGraph V) {s : Set (Sym2 V)}, SimpleGraph.fromEdgeSet s ≤ G ↔ s \ Sym2.diagSet ⊆ G.edgeSet

theorem SimpleGraph.edgeSet_eq_iff E0 #

∀ {V : Type u} (G : SimpleGraph V) (s : Set (Sym2 V)),
  G.edgeSet = s ↔ G = SimpleGraph.fromEdgeSet s ∧ Disjoint s Sym2.diagSet

theorem SimpleGraph.fromEdgeSet_empty E0 #

∀ {V : Type u}, SimpleGraph.fromEdgeSet ∅ = ⊥

theorem SimpleGraph.fromEdgeSet_not_isDiag E0 #

∀ {V : Type u}, SimpleGraph.fromEdgeSet Sym2.diagSetᶜ = ⊤

theorem SimpleGraph.fromEdgeSet_univ E0 #

∀ {V : Type u}, SimpleGraph.fromEdgeSet Set.univ = ⊤

theorem SimpleGraph.fromEdgeSet_inter E0 #

∀ {V : Type u} (s t : Set (Sym2 V)),
  SimpleGraph.fromEdgeSet (s ∩ t) = SimpleGraph.fromEdgeSet s ⊓ SimpleGraph.fromEdgeSet t

theorem SimpleGraph.fromEdgeSet_union E0 #

∀ {V : Type u} (s t : Set (Sym2 V)),
  SimpleGraph.fromEdgeSet (s ∪ t) = SimpleGraph.fromEdgeSet s ⊔ SimpleGraph.fromEdgeSet t

theorem SimpleGraph.fromEdgeSet_sUnion E1 #

∀ {V : Type u} {s : Set (Set (Sym2 V))}, SimpleGraph.fromEdgeSet (⋃₀ s) = sSup (SimpleGraph.fromEdgeSet '' s)

theorem SimpleGraph.fromEdgeSet_iUnion E1 #

∀ {V : Type u} {ι : Sort u_2} {f : ι → Set (Sym2 V)},
  SimpleGraph.fromEdgeSet (⋃ i, f i) = ⨆ i, SimpleGraph.fromEdgeSet (f i)

theorem SimpleGraph.fromEdgeSet_sInter E1 #

∀ {V : Type u} {s : Set (Set (Sym2 V))}, SimpleGraph.fromEdgeSet (⋂₀ s) = sInf (SimpleGraph.fromEdgeSet '' s)

theorem SimpleGraph.fromEdgeSet_iInter E1 #

∀ {V : Type u} {ι : Sort u_2} {f : ι → Set (Sym2 V)},
  SimpleGraph.fromEdgeSet (⋂ i, f i) = ⨅ i, SimpleGraph.fromEdgeSet (f i)

theorem SimpleGraph.fromEdgeSet_sdiff E0 #

∀ {V : Type u} (s t : Set (Sym2 V)),
  SimpleGraph.fromEdgeSet (s \ t) = SimpleGraph.fromEdgeSet s \ SimpleGraph.fromEdgeSet t

theorem SimpleGraph.fromEdgeSet_mono E1 #

∀ {V : Type u} {s t : Set (Sym2 V)}, s ⊆ t → SimpleGraph.fromEdgeSet s ≤ SimpleGraph.fromEdgeSet t

theorem SimpleGraph.disjoint_fromEdgeSet E0 #

∀ {V : Type u} (G : SimpleGraph V) (s : Set (Sym2 V)), Disjoint G (SimpleGraph.fromEdgeSet s) ↔ Disjoint G.edgeSet s

theorem SimpleGraph.fromEdgeSet_disjoint E0 #

∀ {V : Type u} (G : SimpleGraph V) (s : Set (Sym2 V)), Disjoint (SimpleGraph.fromEdgeSet s) G ↔ Disjoint s G.edgeSet

instance SimpleGraph.instFintypeElemSym2EdgeSetFromEdgeSetOfDecidableEq E0 #

{V : Type u} → (s : Set (Sym2 V)) → [DecidableEq V] → [Fintype ↑s] → Fintype ↑(SimpleGraph.fromEdgeSet s).edgeSet

theorem SimpleGraph.disjoint_left E1 #

∀ {V : Type u} {G H : SimpleGraph V}, Disjoint G H ↔ ∀ (x y : V), G.Adj x y → ¬H.Adj x y

def SimpleGraph.incidenceSet E3 #

{V : Type u} → SimpleGraph V → V → Set (Sym2 V)

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

theorem SimpleGraph.incidenceSet_subset E1 #

∀ {V : Type u} (G : SimpleGraph V) (v : V), G.incidenceSet v ⊆ G.edgeSet

theorem SimpleGraph.mk'_mem_incidenceSet_iff E0 #

∀ {V : Type u} (G : SimpleGraph V) {a b c : V}, s(b, c) ∈ G.incidenceSet a ↔ G.Adj b c ∧ (a = b ∨ a = c)

theorem SimpleGraph.mk'_mem_incidenceSet_left_iff E0 #

∀ {V : Type u} (G : SimpleGraph V) {a b : V}, s(a, b) ∈ G.incidenceSet a ↔ G.Adj a b

theorem SimpleGraph.mk'_mem_incidenceSet_right_iff E0 #

∀ {V : Type u} (G : SimpleGraph V) {a b : V}, s(a, b) ∈ G.incidenceSet b ↔ G.Adj a b

theorem SimpleGraph.edge_mem_incidenceSet_iff E0 #

∀ {V : Type u} (G : SimpleGraph V) {a : V} {e : ↑G.edgeSet}, ↑e ∈ G.incidenceSet a ↔ a ∈ ↑e

theorem SimpleGraph.iUnion_incidenceSet E1 #

∀ {V : Type u} (G : SimpleGraph V), ⋃ v, G.incidenceSet v = G.edgeSet

theorem SimpleGraph.disjoint_incidenceSet E1 #

∀ {V : Type u} {G H : SimpleGraph V}, (∀ (v : V), Disjoint (G.incidenceSet v) (H.incidenceSet v)) ↔ Disjoint G H

theorem SimpleGraph.incidenceSet_inter_incidenceSet_subset E1 #

∀ {V : Type u} (G : SimpleGraph V) {a b : V}, a ≠ b → G.incidenceSet a ∩ G.incidenceSet b ⊆ {s(a, b)}

theorem SimpleGraph.incidenceSet_inter_incidenceSet_of_adj E1 #

∀ {V : Type u} (G : SimpleGraph V) {a b : V}, G.Adj a b → G.incidenceSet a ∩ G.incidenceSet b = {s(a, b)}

theorem SimpleGraph.adj_of_mem_incidenceSet E1 #

∀ {V : Type u} (G : SimpleGraph V) {a b : V} {e : Sym2 V},
  a ≠ b → e ∈ G.incidenceSet a → e ∈ G.incidenceSet b → G.Adj a b

theorem SimpleGraph.incidenceSet_inter_incidenceSet_of_not_adj E1 #

∀ {V : Type u} (G : SimpleGraph V) {a b : V}, ¬G.Adj a b → a ≠ b → G.incidenceSet a ∩ G.incidenceSet b = ∅

instance SimpleGraph.decidableMemIncidenceSet E0 #

{V : Type u} →
  (G : SimpleGraph V) → [DecidableEq V] → [DecidableRel G.Adj] → (v : V) → DecidablePred fun x ↦ x ∈ G.incidenceSet v

theorem SimpleGraph.mem_neighborSet E0 #

∀ {V : Type u} (G : SimpleGraph V) (v w : V), w ∈ G.neighborSet v ↔ G.Adj v w

theorem SimpleGraph.notMem_neighborSet_self E1 #

∀ {V : Type u} (G : SimpleGraph V) {a : V}, a ∉ G.neighborSet a

theorem SimpleGraph.nonempty_neighborSet E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V}, (G.neighborSet v).Nonempty ↔ ∃ u, G.Adj v u

theorem SimpleGraph.neighborSet_subset_compl E1 #

∀ {V : Type u} (G : SimpleGraph V) (v : V), G.neighborSet v ⊆ {v}ᶜ

theorem SimpleGraph.neighborSet_ne_univ E1 #

∀ {V : Type u} (G : SimpleGraph V) (v : V), G.neighborSet v ≠ Set.univ

theorem SimpleGraph.disjoint_neighborSet E1 #

∀ {V : Type u} {G H : SimpleGraph V}, (∀ (v : V), Disjoint (G.neighborSet v) (H.neighborSet v)) ↔ Disjoint G H

theorem SimpleGraph.neighborSet_sup E0 #

∀ {V : Type u} {G₁ G₂ : SimpleGraph V} (v : V), (G₁ ⊔ G₂).neighborSet v = G₁.neighborSet v ∪ G₂.neighborSet v

theorem SimpleGraph.neighborSet_inf E0 #

∀ {V : Type u} {G₁ G₂ : SimpleGraph V} (v : V), (G₁ ⊓ G₂).neighborSet v = G₁.neighborSet v ∩ G₂.neighborSet v

theorem SimpleGraph.neighborSet_sdiff E0 #

∀ {V : Type u} {G₁ G₂ : SimpleGraph V} (v : V), (G₁ \ G₂).neighborSet v = G₁.neighborSet v \ G₂.neighborSet v

theorem SimpleGraph.neighborSet_iSup E0 #

∀ {ι : Sort u_1} {V : Type u} {s : ι → SimpleGraph V} (v : V), (⨆ i, s i).neighborSet v = ⋃ i, (s i).neighborSet v

theorem SimpleGraph.neighborSet_iInf E0 #

∀ {ι : Sort u_1} {V : Type u} [Nonempty ι] {s : ι → SimpleGraph V} (v : V),
  (⨅ i, s i).neighborSet v = ⋂ i, (s i).neighborSet v

theorem SimpleGraph.mem_incidenceSet E0 #

∀ {V : Type u} (G : SimpleGraph V) (v w : V), s(v, w) ∈ G.incidenceSet v ↔ G.Adj v w

theorem SimpleGraph.mem_incidence_iff_neighbor E0 #

∀ {V : Type u} (G : SimpleGraph V) {v w : V}, s(v, w) ∈ G.incidenceSet v ↔ w ∈ G.neighborSet v

theorem SimpleGraph.adj_incidenceSet_inter E1 #

∀ {V : Type u} (G : SimpleGraph V) {v : V} {e : Sym2 V},
  e ∈ G.edgeSet → ∀ (h : v ∈ e), G.incidenceSet v ∩ G.incidenceSet (Sym2.Mem.other h) = {e}

theorem SimpleGraph.compl_neighborSet_disjoint E1 #

∀ {V : Type u} (G : SimpleGraph V) (v : V), Disjoint (G.neighborSet v) (Gᶜ.neighborSet v)

theorem SimpleGraph.neighborSet_union_compl_neighborSet_eq E0 #

∀ {V : Type u} (G : SimpleGraph V) (v : V), G.neighborSet v ∪ Gᶜ.neighborSet v = {v}ᶜ

theorem SimpleGraph.card_neighborSet_union_compl_neighborSet E1 #

∀ {V : Type u} [inst : Fintype V] (G : SimpleGraph V) (v : V) [inst_1 : Fintype ↑(G.neighborSet v ∪ Gᶜ.neighborSet v)],
  (G.neighborSet v ∪ Gᶜ.neighborSet v).toFinset.card = Fintype.card V - 1

theorem SimpleGraph.neighborSet_compl E1 #

∀ {V : Type u} (G : SimpleGraph V) (v : V), Gᶜ.neighborSet v = (G.neighborSet v)ᶜ \ {v}

theorem SimpleGraph.neighborSet_mono E1 #

∀ {V : Type u} {G G' : SimpleGraph V}, G ≤ G' → ∀ (v : V), G.neighborSet v ⊆ G'.neighborSet v

theorem SimpleGraph.neighborSet_top E0 #

∀ {V : Type u} {v : V}, ⊤.neighborSet v = {v}ᶜ

theorem SimpleGraph.neighborSet_bot E1 #

∀ {V : Type u} {v : V}, ⊥.neighborSet v = ∅

theorem SimpleGraph.Adj.nontrivial E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V}, G.Adj u v → Nontrivial V

def SimpleGraph.commonNeighbors E3 #

{V : Type u} → SimpleGraph V → V → 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.

theorem SimpleGraph.commonNeighbors_eq E0 #

∀ {V : Type u} (G : SimpleGraph V) (v w : V), G.commonNeighbors v w = G.neighborSet v ∩ G.neighborSet w

theorem SimpleGraph.mem_commonNeighbors E0 #

∀ {V : Type u} (G : SimpleGraph V) {u v w : V}, u ∈ G.commonNeighbors v w ↔ G.Adj v u ∧ G.Adj w u

theorem SimpleGraph.commonNeighbors_symm E1 #

∀ {V : Type u} (G : SimpleGraph V) (v w : V), G.commonNeighbors v w = G.commonNeighbors w v

theorem SimpleGraph.notMem_commonNeighbors_left E1 #

∀ {V : Type u} (G : SimpleGraph V) (v w : V), v ∉ G.commonNeighbors v w

theorem SimpleGraph.notMem_commonNeighbors_right E1 #

∀ {V : Type u} (G : SimpleGraph V) (v w : V), w ∉ G.commonNeighbors v w

theorem SimpleGraph.commonNeighbors_subset_neighborSet_left E1 #

∀ {V : Type u} (G : SimpleGraph V) (v w : V), G.commonNeighbors v w ⊆ G.neighborSet v

theorem SimpleGraph.commonNeighbors_subset_neighborSet_right E1 #

∀ {V : Type u} (G : SimpleGraph V) (v w : V), G.commonNeighbors v w ⊆ G.neighborSet w

instance SimpleGraph.decidableMemCommonNeighbors E0 #

{V : Type u} → (G : SimpleGraph V) → [DecidableRel G.Adj] → (v w : V) → DecidablePred fun x ↦ x ∈ G.commonNeighbors v w

theorem SimpleGraph.disjoint_commonNeighbors E1 #

∀ {V : Type u} {G H : SimpleGraph V},
  (∀ (u v : V), Disjoint (G.commonNeighbors u v) (H.commonNeighbors u v)) ↔ Disjoint G H

theorem SimpleGraph.commonNeighbors_top_eq E0 #

∀ {V : Type u} {v w : V}, ⊤.commonNeighbors v w = Set.univ \ {v, w}

theorem SimpleGraph.commonNeighbors_bot_eq E0 #

∀ {V : Type u} {u v : V}, ⊥.commonNeighbors u v = ∅

def SimpleGraph.otherVertexOfIncident E1 #

{V : Type u} → (G : SimpleGraph V) → [DecidableEq V] → {v : V} → {e : Sym2 V} → e ∈ G.incidenceSet v → V

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

theorem SimpleGraph.edge_other_incident_set E1 #

∀ {V : Type u} (G : SimpleGraph V) [inst : DecidableEq V] {v : V} {e : Sym2 V} (h : e ∈ G.incidenceSet v),
  e ∈ G.incidenceSet (G.otherVertexOfIncident h)

theorem SimpleGraph.incidence_other_prop E1 #

∀ {V : Type u} (G : SimpleGraph V) [inst : DecidableEq V] {v : V} {e : Sym2 V} (h : e ∈ G.incidenceSet v),
  G.otherVertexOfIncident h ∈ G.neighborSet v

theorem SimpleGraph.incidence_other_neighbor_edge E0 #

∀ {V : Type u} (G : SimpleGraph V) [inst : DecidableEq V] {v w : V} (h : w ∈ G.neighborSet v),
  G.otherVertexOfIncident ⋯ = w

def SimpleGraph.incidenceSetEquivNeighborSet E1 #

{V : Type u} → (G : SimpleGraph V) → [DecidableEq V] → (v : V) → ↑(G.incidenceSet v) ≃ ↑(G.neighborSet v)

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

theorem SimpleGraph.incidenceSetEquivNeighborSet_apply_coe E0 #

∀ {V : Type u} (G : SimpleGraph V) [inst : DecidableEq V] (v : V) (e : ↑(G.incidenceSet v)),
  ↑((G.incidenceSetEquivNeighborSet v) e) = G.otherVertexOfIncident ⋯

theorem SimpleGraph.incidenceSetEquivNeighborSet_symm_apply_coe E0 #

∀ {V : Type u} (G : SimpleGraph V) [inst : DecidableEq V] (v : V) (w : ↑(G.neighborSet v)),
  ↑((G.incidenceSetEquivNeighborSet v).symm w) = s(v, ↑w)

def SimpleGraph.IsCompleteBetween E1 #

{V : Type u} → SimpleGraph V → Set V → Set V → Prop

The condition that the portion of the simple graph G between s and t is complete, that is, every vertex in s is adjacent to every vertex in t, and vice versa.

theorem SimpleGraph.IsCompleteBetween.disjoint E1 #

∀ {V : Type u} (G : SimpleGraph V) {s t : Set V}, G.IsCompleteBetween s t → Disjoint s t

theorem SimpleGraph.isCompleteBetween_comm E1 #

∀ {V : Type u} (G : SimpleGraph V) {s t : Set V}, G.IsCompleteBetween s t ↔ G.IsCompleteBetween t s

theorem SimpleGraph.IsCompleteBetween.symm E1 #

∀ {V : Type u} (G : SimpleGraph V) {s t : Set V}, G.IsCompleteBetween s t → G.IsCompleteBetween t s

Alias of the forward direction of SimpleGraph.isCompleteBetween_comm.

theorem SimpleGraph.IsCompleteBetween.completeBipartiteGraph E1 #

∀ (V : Type u_2) (W : Type u_3), (completeBipartiteGraph V W).IsCompleteBetween (Set.range Sum.inl) (Set.range Sum.inr)

theorem SimpleGraph.subsingleton_iff E0 #

∀ {V : Type u}, Subsingleton (SimpleGraph V) ↔ Subsingleton V

theorem SimpleGraph.nontrivial_iff E0 #

∀ {V : Type u}, Nontrivial (SimpleGraph V) ↔ Nontrivial V

def SimpleGraph.IsIsolated E1 #

{V : Type u} → SimpleGraph V → V → Prop

A vertex in a graph is isolated if it's adjacent to no other vertex.

theorem SimpleGraph.neighborSet_eq_empty E0 #

∀ {V : Type u} (G : SimpleGraph V) {v : V}, G.neighborSet v = ∅ ↔ G.IsIsolated v

theorem SimpleGraph.neighborSet_nonempty E0 #

∀ {V : Type u} (G : SimpleGraph V) {v : V}, (G.neighborSet v).Nonempty ↔ ¬G.IsIsolated v

theorem SimpleGraph.IsIsolated.neighborSet_eq_empty E0 #

∀ {V : Type u} (G : SimpleGraph V) {v : V}, G.IsIsolated v → G.neighborSet v = ∅

Alias of the reverse direction of SimpleGraph.neighborSet_eq_empty.

theorem SimpleGraph.IsIsolated.of_neighborSet_eq_empty E1 #

∀ {V : Type u} (G : SimpleGraph V) {v : V}, G.neighborSet v = ∅ → G.IsIsolated v

Alias of the forward direction of SimpleGraph.neighborSet_eq_empty.

theorem SimpleGraph.mem_support_iff_not_isIsolated E0 #

∀ {V : Type u} (G : SimpleGraph V) {v : V}, v ∈ G.support ↔ ¬G.IsIsolated v

theorem SimpleGraph.notMem_support_iff_isIsolated E0 #

∀ {V : Type u} (G : SimpleGraph V) {v : V}, v ∉ G.support ↔ G.IsIsolated v

theorem SimpleGraph.exists_adj_iff_not_isIsolated E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V}, (∃ u, G.Adj v u) ↔ ¬G.IsIsolated v

theorem SimpleGraph.isIsolated_iff_forall_edgeSet_notMem E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V}, G.IsIsolated v ↔ ∀ e ∈ G.edgeSet, v ∉ e

theorem SimpleGraph.not_isIsolated_iff_exists_edgeSet_mem E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V}, ¬G.IsIsolated v ↔ ∃ e ∈ G.edgeSet, v ∈ e

theorem SimpleGraph.IsIsolated.of_subsingleton E0 #

∀ {V : Type u} [Subsingleton V] (G : SimpleGraph V) (v : V), G.IsIsolated v

theorem SimpleGraph.nontrivial_of_not_isIsolated E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V}, ¬G.IsIsolated v → Nontrivial V

theorem SimpleGraph.Adj.not_isIsolated_left E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V}, G.Adj u v → ¬G.IsIsolated u

theorem SimpleGraph.Adj.not_isIsolated_right E1 #

∀ {V : Type u} {G : SimpleGraph V} {u v : V}, G.Adj u v → ¬G.IsIsolated v

theorem SimpleGraph.IsIsolated.bot E0 #

∀ {V : Type u} {v : V}, ⊥.IsIsolated v

def SimpleGraph.IsUniversal E1 #

{V : Type u} → SimpleGraph V → V → Prop

A vertex in a graph is universal if it's adjacent to every other vertex.

theorem SimpleGraph.insert_neighborSet_eq_univ E0 #

∀ {V : Type u} {G : SimpleGraph V} {v : V}, insert v (G.neighborSet v) = Set.univ ↔ G.IsUniversal v

theorem SimpleGraph.neighborSet_eq_compl_singleton E0 #

∀ {V : Type u} {G : SimpleGraph V} {v : V}, G.neighborSet v = {v}ᶜ ↔ G.IsUniversal v

theorem SimpleGraph.IsUniversal.neighborSet_eq E0 #

∀ {V : Type u} {G : SimpleGraph V} {v : V}, G.IsUniversal v → G.neighborSet v = {v}ᶜ

Alias of the reverse direction of SimpleGraph.neighborSet_eq_compl_singleton.

theorem SimpleGraph.IsUniversal.of_neighborSet_eq E0 #

∀ {V : Type u} {G : SimpleGraph V} {v : V}, G.neighborSet v = {v}ᶜ → G.IsUniversal v

Alias of the forward direction of SimpleGraph.neighborSet_eq_compl_singleton.

theorem SimpleGraph.IsUniversal.of_subsingleton E0 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [Subsingleton V], G.IsUniversal v

theorem SimpleGraph.IsUniversal.not_isIsolated E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [Nontrivial V], G.IsUniversal v → ∀ (w : V), ¬G.IsIsolated w

theorem SimpleGraph.IsIsolated.not_isUniversal E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V} [Nontrivial V], G.IsIsolated v → ∀ (w : V), ¬G.IsUniversal w

theorem SimpleGraph.isUniversal_compl_iff_isIsolated E0 #

∀ {V : Type u} {G : SimpleGraph V} {v : V}, Gᶜ.IsUniversal v ↔ G.IsIsolated v

theorem SimpleGraph.IsIsolated.of_isUniversal_compl E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V}, Gᶜ.IsUniversal v → G.IsIsolated v

Alias of the forward direction of SimpleGraph.isUniversal_compl_iff_isIsolated.

theorem SimpleGraph.isIsolated_compl_iff_isUniversal E0 #

∀ {V : Type u} {G : SimpleGraph V} {v : V}, Gᶜ.IsIsolated v ↔ G.IsUniversal v

theorem SimpleGraph.IsUniversal.of_isIsolated_compl E1 #

∀ {V : Type u} {G : SimpleGraph V} {v : V}, Gᶜ.IsIsolated v → G.IsUniversal v

Alias of the forward direction of SimpleGraph.isIsolated_compl_iff_isUniversal.

theorem SimpleGraph.IsUniversal.top E0 #

∀ {V : Type u} {v : V}, ⊤.IsUniversal v

Deprecated aliases

NameNew nameSince
SimpleGraph.isIsolated_botSimpleGraph.IsIsolated.bot2026-06-19
SimpleGraph.not_mem_edgeSet_of_isDiagSimpleGraph.notMem_edgeSet_of_isDiag2026-09-28
Sym2.IsDiag.not_mem_edgeSetSym2.IsDiag.notMem_edgeSet2026-09-28