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.Graph.Delete

39 declarations and 1 deprecated aliases. Mathlib docs · Source

Deletion of edges and vertices

This file defines the deletion of edges and vertices from a graph.

Main definitions

  • restrict: the subgraph of G restricted to the edges in F without removing vertices
  • deleteEdges: the subgraph of G with the edges in F deleted
  • induce: the subgraph of G induced by the set X of vertices
  • deleteVerts : the graph obtained from G by deleting the set X of vertices

Tags

graphs, edge deletion, vertex deletion

def Graph.restrict E3 #

{α : Type u_1} → {β : Type u_2} → Graph α β → Set β → Graph α β

Restrict G : Graph α β to the edges in a set E₀ without removing vertices

theorem Graph.edgeSet_restrict E0 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β) (E₀ : Set β), (G.restrict E₀).edgeSet = G.edgeSet ∩ E₀

theorem Graph.vertexSet_restrict E0 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β) (E₀ : Set β), (G.restrict E₀).vertexSet = G.vertexSet

theorem Graph.restrict_le E0 #

∀ {α : Type u_1} {β : Type u_2} {G : Graph α β} {E₀ : Set β}, G.restrict E₀ ≤ G

theorem Graph.restrict_eq_self_iff E0 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β) (E₀ : Set β), G.restrict E₀ = G ↔ G.edgeSet ⊆ E₀

theorem Graph.restrict_self E0 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β), G.restrict G.edgeSet = G

theorem Graph.restrict_edgeSet_inter E0 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β) (F : Set β), G.restrict (G.edgeSet ∩ F) = G.restrict F

theorem Graph.restrict_inter_edgeSet E0 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β) (F : Set β), G.restrict (F ∩ G.edgeSet) = G.restrict F

theorem Graph.restrict_mono_left E1 #

∀ {α : Type u_1} {β : Type u_2} {G H : Graph α β}, H ≤ G → ∀ (F : Set β), H.restrict F ≤ G.restrict F

theorem Graph.restrict_mono_right E1 #

∀ {α : Type u_1} {β : Type u_2} {F F₀ : Set β} (G : Graph α β), F₀ ⊆ F → G.restrict F₀ ≤ G.restrict F

theorem Graph.restrict_inc E0 #

∀ {α : Type u_1} {β : Type u_2} {x : α} {e : β} {G : Graph α β} {F : Set β}, (G.restrict F).Inc e x ↔ G.Inc e x ∧ e ∈ F

theorem Graph.restrict_isLoopAt E0 #

∀ {α : Type u_1} {β : Type u_2} {x : α} {e : β} {G : Graph α β} {F : Set β},
  (G.restrict F).IsLoopAt e x ↔ G.IsLoopAt e x ∧ e ∈ F

theorem Graph.restrict_restrict E0 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β) (F₁ F₂ : Set β), (G.restrict F₁).restrict F₂ = G.restrict (F₁ ∩ F₂)

def Graph.deleteEdges E3 #

{α : Type u_1} → {β : Type u_2} → Graph α β → Set β → Graph α β

Delete a set F of edges from G. This is a special case of restrict, but we define it with copy so that the edge set is definitionally equal to E(G) \ F.

theorem Graph.edgeSet_deleteEdges E0 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β) (F : Set β), (G.deleteEdges F).edgeSet = G.edgeSet \ F

theorem Graph.vertexSet_deleteEdges E0 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β) (F : Set β), (G.deleteEdges F).vertexSet = G.vertexSet

theorem Graph.restrict_edgeSet_sdiff_eq_deleteEdges E0 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β) (F : Set β), G.restrict (G.edgeSet \ F) = G.deleteEdges F

theorem Graph.deleteEdges_le E0 #

∀ {α : Type u_1} {β : Type u_2} {G : Graph α β} {F : Set β}, G.deleteEdges F ≤ G

theorem Graph.restrict_eq_deleteEdges E1 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β) (F : Set β), G.restrict F = G.deleteEdges (G.edgeSet \ F)

theorem Graph.deleteEdges_empty E0 #

∀ {α : Type u_1} {β : Type u_2} {G : Graph α β}, G.deleteEdges ∅ = G

theorem Graph.deleteEdges_mono_left E1 #

∀ {α : Type u_1} {β : Type u_2} {G H : Graph α β}, H ≤ G → ∀ (F : Set β), H.deleteEdges F ≤ G.deleteEdges F

theorem Graph.deleteEdges_inc E0 #

∀ {α : Type u_1} {β : Type u_2} {x : α} {e : β} {G : Graph α β} {F : Set β},
  (G.deleteEdges F).Inc e x ↔ G.Inc e x ∧ e ∉ F

theorem Graph.deleteEdges_isLoopAt E0 #

∀ {α : Type u_1} {β : Type u_2} {x : α} {e : β} {G : Graph α β} {F : Set β},
  (G.deleteEdges F).IsLoopAt e x ↔ G.IsLoopAt e x ∧ e ∉ F

theorem Graph.deleteEdges_deleteEdges E0 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β) (F₁ F₂ : Set β),
  (G.deleteEdges F₁).deleteEdges F₂ = G.deleteEdges (F₁ ∪ F₂)

def Graph.induce E3 #

{α : Type u_1} → {β : Type u_2} → Graph α β → Set α → Graph α β

The subgraph of G induced by a set X of vertices. The edges are the edges of G with both ends in X. (X is not required to be a subset of V(G) for this definition to work, even though this is the standard use case)

theorem Graph.vertexSet_induce E0 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β) (X : Set α), (G.induce X).vertexSet = X

theorem Graph.induce_le E1 #

∀ {α : Type u_1} {β : Type u_2} {G : Graph α β} {X : Set α}, X ⊆ G.vertexSet → G.induce X ≤ G

theorem Graph.induce_le_iff E0 #

∀ {α : Type u_1} {β : Type u_2} {G : Graph α β} {X : Set α}, G.induce X ≤ G ↔ X ⊆ G.vertexSet

theorem Graph.edgeSet_induce E1 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β) (X : Set α),
  (G.induce X).edgeSet = {e | ∃ x y, G.IsLink e x y ∧ x ∈ X ∧ y ∈ X}

theorem Graph.induce_vertexSet E0 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β), G.induce G.vertexSet = G

def Graph.deleteVerts E3 #

{α : Type u_1} → {β : Type u_2} → Graph α β → Set α → Graph α β

The graph obtained from G by deleting a set of vertices.

theorem Graph.vertexSet_deleteVerts E0 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β) (X : Set α), (G.deleteVerts X).vertexSet = G.vertexSet \ X

theorem Graph.edgeSet_deleteVerts E0 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β) (X : Set α),
  (G.deleteVerts X).edgeSet = {e | ∃ x y, G.IsLink e x y ∧ x ∉ X ∧ y ∉ X}

theorem Graph.deleteVerts_empty E0 #

∀ {α : Type u_1} {β : Type u_2} (G : Graph α β), G.deleteVerts ∅ = G

theorem Graph.deleteVerts_le E0 #

∀ {α : Type u_1} {β : Type u_2} {G : Graph α β} {X : Set α}, G.deleteVerts X ≤ G

Deprecated aliases

NameNew nameSince
Graph.restrict_edgeSet_diff_eq_deleteEdgesGraph.restrict_edgeSet_sdiff_eq_deleteEdges2026-06-03