The areas / V30. Combinatorics
Mathlib.Combinatorics.SimpleGraph.Copy
135 declarations and 4 deprecated aliases. Mathlib docs · Source
Containment of graphs
This file introduces the concept of one simple graph containing a copy of another.
For two simple graphs G and H, a copy of G in H is a (not necessarily induced) subgraph of
H isomorphic to G.
If there exists a copy of G in H, we say that H contains G. This is equivalent to saying
that there is an injective graph homomorphism G → H between them (this is not the same as a
graph embedding, as we do not require the subgraph to be induced).
If there exists an induced copy of G in H, we say that H inducingly contains G. This is
equivalent to saying that there is a graph embedding G ↪ H.
Main declarations
Containment:
SimpleGraph.Copy G His the type of copies ofGinH, implemented as the subtype of injective homomorphisms.SimpleGraph.IsContained G H,G ⊑ His the relation thatHcontains a copy ofG, that is, the type of copies ofGinHis nonempty. This is equivalent to the existence of an isomorphism fromGto a subgraph ofH. This is similar toSimpleGraph.IsSubgraphexcept that the simple graphs here need not have the same underlying vertex type.SimpleGraph.Freeis the predicate thatHisG-free, that is,Hdoes not contain a copy ofG. This is the negation ofSimpleGraph.IsContainedimplemented for convenience.SimpleGraph.UnlabeledCopy H G: Type ofSimpleGraph.Subgraphs ofGisomorphic toH.SimpleGraph.killCopies G H: Subgraph ofGthat does not containH. Obtained by arbitrarily removing an edge from each copy ofHinG.SimpleGraph.copyCount G H: Number of copies ofHinG, i.e. number of subgraphs ofGisomorphic toH.SimpleGraph.labelledCopyCount G H: Number of labelled copies ofHinG, i.e. number of graph embeddings fromHtoG.
Induced containment:
- Induced copies of
GinsideHare already defined asG ↪g H. SimpleGraph.IsIndContained G H:Gis contained as an induced subgraph inH.
Notation
The following notation is declared in scope SimpleGraph:
G ⊑ HforSimpleGraph.IsContained G H.G ⊴ HforSimpleGraph.IsIndContained G H.
TODO
- Relate
⊥ ⊴ Hto there being an independent set inH. - Count induced copies of a graph inside another.
- Make
copyCount/labelledCopyCountcomputable (not necessarily efficiently).
Copies
Not necessarily induced copies
A copy of a subgraph G inside a subgraph H is an embedding of the vertices of G into the
vertices of H, such that adjacency in G implies adjacency in H.
We capture this concept by injective graph homomorphisms.
Induced copies
An induced copy of a graph G inside a graph H is an embedding from the vertices of
G into the vertices of H which preserves the adjacency relation.
This is already captured by the notion of graph embeddings, defined as G ↪g H.
Containment
Not necessarily induced containment
A graph H contains a graph G if there is some copy f : Copy G H of G inside H. This
amounts to H having a subgraph isomorphic to G.
We denote "G is contained in H" by G ⊑ H (\squb).
Induced containment
A graph H inducingly contains a graph G if there is some graph embedding G ↪ H. This amounts
to H having an induced subgraph isomorphic to G.
We denote "G is inducingly contained in H" by G ⊴ H (\trianglelefteq).
Counting the copies
If G and H are finite graphs, we can count the number of unlabelled and labelled copies of G
in H.
Not necessarily induced copies
Induced copies
TODO
Killing a subgraph
An important aspect of graph containment is that we can remove not too many edges from a graph H
to get a graph H' that doesn't contain G.
Killing not necessarily induced copies
SimpleGraph.killCopies G H is a subgraph of G where an edge was removed from each copy of H in
G. By construction, it doesn't contain H and has at most the number of copies of H edges less
than G.
Killing induced copies
TODO
def SimpleGraph.Copy.ctorIdx E1 #
{V : Type u_1} → {W : Type u_2} → {H : SimpleGraph W} → {G : SimpleGraph V} → H.Copy G → ℕ
theorem SimpleGraph.Copy.mk.injEq E0 #
∀ {V : Type u_1} {W : Type u_2} {H : SimpleGraph W} {G : SimpleGraph V} (toHom : H →g G)
(injective' : Function.Injective ⇑toHom) (toHom_1 : H →g G) (injective'_1 : Function.Injective ⇑toHom_1),
({ toHom := toHom, injective' := injective' } = { toHom := toHom_1, injective' := injective'_1 }) = (toHom = toHom_1)
theorem SimpleGraph.Copy.ofLE.congr_simp E1 #
∀ {V : Type u_1} (G₁ G₂ : SimpleGraph V) (h : G₁ ≤ G₂), SimpleGraph.Copy.ofLE G₁ G₂ h = SimpleGraph.Copy.ofLE G₁ G₂ h
theorem SimpleGraph.Copy.mk.inj E1 #
∀ {V : Type u_1} {W : Type u_2} {H : SimpleGraph W} {G : SimpleGraph V} {toHom : H →g G}
{injective' : Function.Injective ⇑toHom} {toHom_1 : H →g G} {injective'_1 : Function.Injective ⇑toHom_1},
{ toHom := toHom, injective' := injective' } = { toHom := toHom_1, injective' := injective'_1 } → toHom = toHom_1
structure SimpleGraph.Copy E1 #
{V : Type u_1} → {W : Type u_2} → SimpleGraph W → SimpleGraph V → Type (max u_1 u_2)
The type of copies as a subtype of injective homomorphisms.
ctor SimpleGraph.Copy.mk E0 #
{V : Type u_1} →
{W : Type u_2} → {H : SimpleGraph W} → {G : SimpleGraph V} → (toHom : H →g G) → Function.Injective ⇑toHom → H.Copy G
abbrev SimpleGraph.Copy.toHom E1 #
{V : Type u_1} → {W : Type u_2} → {H : SimpleGraph W} → {G : SimpleGraph V} → H.Copy G → H →g G
A copy gives rise to a homomorphism.
theorem SimpleGraph.Copy.injective' E1 #
∀ {V : Type u_1} {W : Type u_2} {H : SimpleGraph W} {G : SimpleGraph V} (self : H.Copy G),
Function.Injective ⇑self.toHom
abbrev SimpleGraph.Hom.toCopy E1 #
{V : Type u_1} →
{W : Type u_2} → {G : SimpleGraph V} → {H : SimpleGraph W} → (f : H →g G) → Function.Injective ⇑f → H.Copy G
An injective homomorphism gives rise to a copy.
abbrev SimpleGraph.Embedding.toCopy E1 #
{V : Type u_1} → {W : Type u_2} → {G : SimpleGraph V} → {H : SimpleGraph W} → H ↪g G → H.Copy G
An embedding gives rise to a copy.
abbrev SimpleGraph.Iso.toCopy E1 #
{V : Type u_1} → {W : Type u_2} → {G : SimpleGraph V} → {H : SimpleGraph W} → H ≃g G → H.Copy G
An isomorphism gives rise to a copy.
instance SimpleGraph.Copy.instFunLike E0 #
{V : Type u_1} → {W : Type u_2} → {G : SimpleGraph V} → {H : SimpleGraph W} → FunLike (H.Copy G) W V
theorem SimpleGraph.Copy.injective E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} (f : H.Copy G), Function.Injective ⇑f.toHom
theorem SimpleGraph.Copy.ext_iff E0 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} {f g : H.Copy G}, f = g ↔ ∀ (a : W), f a = g a
theorem SimpleGraph.Copy.ext E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} {f g : H.Copy G}, (∀ (a : W), f a = g a) → f = g
theorem SimpleGraph.Copy.coe_toHom E0 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} (f : H.Copy G), ⇑f.toHom = ⇑f
theorem SimpleGraph.Copy.toHom_apply E0 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} (f : H.Copy G) (a : W), f.toHom a = f a
theorem SimpleGraph.Copy.coe_mk E0 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} (f : H →g G) (hf : Function.Injective ⇑f),
⇑{ toHom := f, injective' := hf } = ⇑f
def SimpleGraph.Copy.mapEdgeSet E1 #
{V : Type u_1} → {W : Type u_2} → {G : SimpleGraph V} → {H : SimpleGraph W} → H.Copy G → ↑H.edgeSet ↪ ↑G.edgeSet
A copy induces an embedding of edge sets.
def SimpleGraph.Copy.mapNeighborSet E1 #
{V : Type u_1} →
{W : Type u_2} →
{G : SimpleGraph V} → {H : SimpleGraph W} → (f : H.Copy G) → (a : W) → ↑(H.neighborSet a) ↪ ↑(G.neighborSet (f a))
A copy induces an embedding of neighbor sets.
def SimpleGraph.Copy.toEmbedding E1 #
{V : Type u_1} → {W : Type u_2} → {G : SimpleGraph V} → {H : SimpleGraph W} → H.Copy G → W ↪ V
A copy gives rise to an embedding of vertex types.
def SimpleGraph.Copy.id E1 #
{V : Type u_1} → (G : SimpleGraph V) → G.Copy G
The identity copy from a simple graph to itself.
theorem SimpleGraph.Copy.coe_id E0 #
∀ {V : Type u_1} {G : SimpleGraph V}, ⇑(SimpleGraph.Copy.id G) = id
def SimpleGraph.Copy.comp E1 #
{V : Type u_1} →
{W : Type u_2} →
{X : Type u_3} → {G : SimpleGraph V} → {H : SimpleGraph W} → {I : SimpleGraph X} → G.Copy I → H.Copy G → H.Copy I
The composition of copies is a copy.
theorem SimpleGraph.Copy.comp_apply E0 #
∀ {V : Type u_1} {W : Type u_2} {X : Type u_3} {G : SimpleGraph V} {H : SimpleGraph W} {I : SimpleGraph X}
(g : G.Copy I) (f : H.Copy G) (a : W), (g.comp f) a = g (f a)
def SimpleGraph.Copy.ofLE E1 #
{V : Type u_1} → (G₁ G₂ : SimpleGraph V) → G₁ ≤ G₂ → G₁.Copy G₂
The copy from a subgraph to the supergraph.
theorem SimpleGraph.Copy.coe_comp E0 #
∀ {V : Type u_1} {W : Type u_2} {X : Type u_3} {G : SimpleGraph V} {H : SimpleGraph W} {I : SimpleGraph X}
(g : G.Copy I) (f : H.Copy G), ⇑(g.comp f) = ⇑g ∘ ⇑f
theorem SimpleGraph.Copy.coe_ofLE E0 #
∀ {V : Type u_1} {G₁ G₂ : SimpleGraph V} (h : G₁ ≤ G₂), ⇑(SimpleGraph.Copy.ofLE G₁ G₂ h) = id
theorem SimpleGraph.Copy.ofLE_refl E0 #
∀ {V : Type u_1} {G : SimpleGraph V}, SimpleGraph.Copy.ofLE G G ⋯ = SimpleGraph.Copy.id G
theorem SimpleGraph.Copy.ofLE_comp E0 #
∀ {V : Type u_1} {G₁ G₂ G₃ : SimpleGraph V} (h₁₂ : G₁ ≤ G₂) (h₂₃ : G₂ ≤ G₃),
(SimpleGraph.Copy.ofLE G₂ G₃ h₂₃).comp (SimpleGraph.Copy.ofLE G₁ G₂ h₁₂) = SimpleGraph.Copy.ofLE G₁ G₃ ⋯
def SimpleGraph.Copy.induce E1 #
{V : Type u_1} → (G : SimpleGraph V) → (s : Set V) → (SimpleGraph.induce s G).Copy G
The copy from an induced subgraph to the initial simple graph.
def SimpleGraph.Copy.bot E1 #
{V : Type u_1} → {W : Type u_2} → {G : SimpleGraph V} → (W ↪ V) → ⊥.Copy G
The copy of ⊥ in any simple graph that can embed its vertices.
def SimpleGraph.Copy.isoSubgraphMap E1 #
{V : Type u_1} →
{W : Type u_2} →
{G : SimpleGraph V} →
{H : SimpleGraph W} → (f : H.Copy G) → (A' : H.Subgraph) → A'.coe ≃g (SimpleGraph.Subgraph.map f.toHom A').coe
The isomorphism from a subgraph of H to its map under a copy f : Copy H G.
abbrev SimpleGraph.Copy.toSubgraph E1 #
{V : Type u_1} → {W : Type u_2} → {G : SimpleGraph V} → {H : SimpleGraph W} → H.Copy G → G.Subgraph
The subgraph of G corresponding to a copy of H inside G.
def SimpleGraph.Copy.isoToSubgraph E1 #
{V : Type u_1} → {W : Type u_2} → {G : SimpleGraph V} → {H : SimpleGraph W} → (f : H.Copy G) → H ≃g f.toSubgraph.coe
The isomorphism from H to its copy under f : Copy H G.
theorem SimpleGraph.Copy.range_toSubgraph E0 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W},
Set.range SimpleGraph.Copy.toSubgraph = {G' | Nonempty (H ≃g G'.coe)}
theorem SimpleGraph.Copy.toSubgraph_surjOn E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W},
Set.SurjOn SimpleGraph.Copy.toSubgraph Set.univ {G' | Nonempty (H ≃g G'.coe)}
instance SimpleGraph.Copy.instSubsingletonOfForall E0 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [Subsingleton (V → W)], Subsingleton (G.Copy H)
instance SimpleGraph.Copy.instFintypeOfSubtypeHomInjectiveCoe E0 #
{V : Type u_1} →
{W : Type u_2} →
{G : SimpleGraph V} → {H : SimpleGraph W} → [Fintype { f // Function.Injective ⇑f }] → Fintype (G.Copy H)
def SimpleGraph.Copy.topEmbedding E1 #
{V : Type u_1} → {W : Type u_2} → {G : SimpleGraph V} → ⊤.Copy G → ⊤ ↪g G
A copy of ⊤ gives rise to an embedding of ⊤.
theorem SimpleGraph.Copy.topEmbedding_apply E0 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} (f : ⊤.Copy G) (a : W), f.topEmbedding a = f a
def SimpleGraph.Subgraph.coeCopy E1 #
{V : Type u_1} → {G : SimpleGraph V} → (G' : G.Subgraph) → G'.coe.Copy G
A Subgraph G gives rise to a copy from the coercion to G.
abbrev SimpleGraph.IsContained E3 #
{V : Type u_1} → {W : Type u_2} → SimpleGraph W → SimpleGraph V → Prop
The relation IsContained H G, H ⊑ G says that G contains a copy of H.
This is equivalent to the existence of an isomorphism from H to a subgraph of G.
def SimpleGraph.«term_⊑_» E1 #
Lean.TrailingParserDescr
The relation IsContained H G, H ⊑ G says that G contains a copy of H.
This is equivalent to the existence of an isomorphism from H to a subgraph of G.
theorem SimpleGraph.IsContained.refl E1 #
∀ {V : Type u_1} (G : SimpleGraph V), G.IsContained G
A simple graph contains itself.
theorem SimpleGraph.IsContained.rfl E1 #
∀ {V : Type u_1} {G : SimpleGraph V}, G.IsContained G
theorem SimpleGraph.IsContained.of_le E1 #
∀ {V : Type u_1} {G₁ G₂ : SimpleGraph V}, G₁ ≤ G₂ → G₁.IsContained G₂
A simple graph contains its subgraphs.
theorem SimpleGraph.IsContained.trans E1 #
∀ {V : Type u_1} {W : Type u_2} {X : Type u_3} {G : SimpleGraph V} {H : SimpleGraph W} {I : SimpleGraph X},
H.IsContained G → G.IsContained I → H.IsContained I
If G contains H and I contains G, then I contains H.
theorem SimpleGraph.IsContained.trans' E1 #
∀ {V : Type u_1} {W : Type u_2} {X : Type u_3} {G : SimpleGraph V} {H : SimpleGraph W} {I : SimpleGraph X},
G.IsContained I → H.IsContained G → H.IsContained I
If I contains G and G contains H, then I contains H.
theorem SimpleGraph.IsContained.mono_right E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} {G' : SimpleGraph V},
H.IsContained G → G ≤ G' → H.IsContained G'
theorem SimpleGraph.IsContained.trans_le E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} {G' : SimpleGraph V},
H.IsContained G → G ≤ G' → H.IsContained G'
Alias of SimpleGraph.IsContained.mono_right.
theorem SimpleGraph.IsContained.mono_left E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H H' : SimpleGraph W}, H ≤ H' → H'.IsContained G → H.IsContained G
theorem SimpleGraph.IsContained.trans_le' E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H H' : SimpleGraph W}, H ≤ H' → H'.IsContained G → H.IsContained G
Alias of SimpleGraph.IsContained.mono_left.
theorem SimpleGraph.isContained_congr E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} {V' : Type u_4} {W' : Type u_5}
{G' : SimpleGraph V'} {H' : SimpleGraph W'} (e₁ : H ≃g H') (e₂ : G ≃g G'), H.IsContained G ↔ H'.IsContained G'
If H ≃g H' and G ≃g G' then H is contained in G if and only if H' is contained
in G'.
theorem SimpleGraph.isContained_congr_left E1 #
∀ {V : Type u_1} {W : Type u_2} {X : Type u_3} {G : SimpleGraph V} {H : SimpleGraph W} {I : SimpleGraph X}
(e₁ : H ≃g G), H.IsContained I ↔ G.IsContained I
theorem SimpleGraph.IsContained.congr_left E1 #
∀ {V : Type u_1} {W : Type u_2} {X : Type u_3} {G : SimpleGraph V} {H : SimpleGraph W} {I : SimpleGraph X}
(e₁ : H ≃g G), G.IsContained I → H.IsContained I
Alias of the reverse direction of SimpleGraph.isContained_congr_left.
theorem SimpleGraph.isContained_congr_right E1 #
∀ {V : Type u_1} {W : Type u_2} {X : Type u_3} {G : SimpleGraph V} {H : SimpleGraph W} {I : SimpleGraph X}
(e₂ : G ≃g I), H.IsContained G ↔ H.IsContained I
theorem SimpleGraph.IsContained.congr_right E1 #
∀ {V : Type u_1} {W : Type u_2} {X : Type u_3} {G : SimpleGraph V} {H : SimpleGraph W} {I : SimpleGraph X}
(e₂ : G ≃g I), H.IsContained I → H.IsContained G
Alias of the reverse direction of SimpleGraph.isContained_congr_right.
instance SimpleGraph.instIsPreorderIsContained E0 #
∀ {W : Type u_2}, IsPreorder (SimpleGraph W) SimpleGraph.IsContained
instance SimpleGraph.instTransIsContained E0 #
{V : Type u_1} →
{W : Type u_2} → {X : Type u_3} → Trans SimpleGraph.IsContained SimpleGraph.IsContained SimpleGraph.IsContained
theorem SimpleGraph.IsContained.of_isEmpty E0 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [IsEmpty W], H.IsContained G
A simple graph having no vertices is contained in any simple graph.
theorem SimpleGraph.bot_isContained_iff_card_le E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} [inst : Fintype W] [inst_1 : Fintype V],
⊥.IsContained G ↔ Fintype.card W ≤ Fintype.card V
⊥ is contained in any simple graph having sufficiently many vertices.
theorem SimpleGraph.IsContained.bot E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} [inst : Fintype W] [inst_1 : Fintype V],
⊥.IsContained G ↔ Fintype.card W ≤ Fintype.card V
Alias of SimpleGraph.bot_isContained_iff_card_le.
⊥ is contained in any simple graph having sufficiently many vertices.
theorem SimpleGraph.Subgraph.coe_isContained E0 #
∀ {V : Type u_1} {G : SimpleGraph V} (G' : G.Subgraph), G'.coe.IsContained G
A simple graph G contains all Subgraph G coercions.
theorem SimpleGraph.isContained_iff_exists_iso_subgraph E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W}, H.IsContained G ↔ ∃ G', Nonempty (H ≃g G'.coe)
G contains H if and only if G has a subgraph G' and G' is isomorphic to H.
theorem SimpleGraph.IsContained.exists_iso_subgraph E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W}, H.IsContained G → ∃ G', Nonempty (H ≃g G'.coe)
Alias of the forward direction of SimpleGraph.isContained_iff_exists_iso_subgraph.
G contains H if and only if G has a subgraph G' and G' is isomorphic to H.
theorem SimpleGraph.IsContained.of_exists_iso_subgraph E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W},
(∃ G', Nonempty (H ≃g G'.coe)) → H.IsContained G
Alias of the reverse direction of SimpleGraph.isContained_iff_exists_iso_subgraph.
G contains H if and only if G has a subgraph G' and G' is isomorphic to H.
theorem SimpleGraph.Copy.degree_le E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} (f : G.Copy H) (v : V)
[inst : Fintype ↑(G.neighborSet v)] [inst_1 : Fintype ↑(H.neighborSet (f v))], G.degree v ≤ H.degree (f v)
theorem SimpleGraph.Copy.maxDegree_mono E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [inst : Fintype V] [inst_1 : Fintype W]
[inst_2 : DecidableRel G.Adj] [inst_3 : DecidableRel H.Adj] (f : G.Copy H), G.maxDegree ≤ H.maxDegree
theorem SimpleGraph.IsContained.maxDegree_mono E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [inst : Fintype V] [inst_1 : Fintype W]
[inst_2 : DecidableRel G.Adj] [inst_3 : DecidableRel H.Adj], G.IsContained H → G.maxDegree ≤ H.maxDegree
theorem SimpleGraph.maxDegree_mono E1 #
∀ {V : Type u_1} {G H : SimpleGraph V} [inst : Fintype V] [inst_1 : DecidableRel G.Adj] [inst_2 : DecidableRel H.Adj],
G ≤ H → G.maxDegree ≤ H.maxDegree
theorem SimpleGraph.Copy.minDegree_mono E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [inst : Fintype V] [inst_1 : Fintype W]
[inst_2 : DecidableRel G.Adj] [inst_3 : DecidableRel H.Adj] {f : G.Copy H},
Function.Surjective ⇑f → G.minDegree ≤ H.minDegree
theorem SimpleGraph.Hom.minDegree_mono E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [inst : Fintype V] [inst_1 : Fintype W]
[inst_2 : DecidableRel G.Adj] [inst_3 : DecidableRel H.Adj] {f : G →g H},
Function.Bijective ⇑f → G.minDegree ≤ H.minDegree
theorem SimpleGraph.maxDegree_induce_of_support_subset E1 #
∀ {V : Type u_1} {G : SimpleGraph V} [inst : Fintype V] [inst_1 : DecidableRel G.Adj] {s : Set V}
[inst_2 : DecidablePred fun x ↦ x ∈ s], G.support ⊆ s → (SimpleGraph.induce s G).maxDegree = G.maxDegree
abbrev SimpleGraph.Free E3 #
{V : Type u_1} → {W : Type u_2} → SimpleGraph W → SimpleGraph V → Prop
H.Free G means that G does not contain a copy of H.
theorem SimpleGraph.not_free E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W}, ¬H.Free G ↔ H.IsContained G
theorem SimpleGraph.free_congr E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} {V' : Type u_4} {W' : Type u_5}
{G' : SimpleGraph V'} {H' : SimpleGraph W'} (e₁ : H ≃g H') (e₂ : G ≃g G'), H.Free G ↔ H'.Free G'
If H ≃g H' and G ≃g G' then G is H-free if and only if G' is H'-free.
theorem SimpleGraph.free_congr_left E1 #
∀ {V : Type u_1} {W : Type u_2} {X : Type u_3} {G : SimpleGraph V} {H : SimpleGraph W} {I : SimpleGraph X}
(e₁ : H ≃g G), H.Free I ↔ G.Free I
theorem SimpleGraph.Free.congr_left E1 #
∀ {V : Type u_1} {W : Type u_2} {X : Type u_3} {G : SimpleGraph V} {H : SimpleGraph W} {I : SimpleGraph X}
(e₁ : H ≃g G), G.Free I → H.Free I
Alias of the reverse direction of SimpleGraph.free_congr_left.
theorem SimpleGraph.free_congr_right E1 #
∀ {V : Type u_1} {W : Type u_2} {X : Type u_3} {G : SimpleGraph V} {H : SimpleGraph W} {I : SimpleGraph X}
(e₂ : G ≃g I), H.Free G ↔ H.Free I
theorem SimpleGraph.Free.congr_right E1 #
∀ {V : Type u_1} {W : Type u_2} {X : Type u_3} {G : SimpleGraph V} {H : SimpleGraph W} {I : SimpleGraph X}
(e₂ : G ≃g I), H.Free I → H.Free G
Alias of the reverse direction of SimpleGraph.free_congr_right.
theorem SimpleGraph.free_bot E1 #
∀ {V : Type u_1} {W : Type u_2} {H : SimpleGraph W}, H ≠ ⊥ → H.Free ⊥
theorem SimpleGraph.Free.mono E1 #
∀ {V : Type u_1} {W : Type u_2} {X : Type u_3} {G : SimpleGraph V} {H : SimpleGraph W} {I : SimpleGraph X},
I.Free G → I.IsContained H → H.Free G
theorem SimpleGraph.Free.anti E1 #
∀ {V : Type u_1} {W : Type u_2} {X : Type u_3} {G : SimpleGraph V} {H : SimpleGraph W} {I : SimpleGraph X},
I.Free G → H.IsContained G → I.Free H
def SimpleGraph.IsIndContained E1 #
{V : Type u_1} → {W : Type u_2} → SimpleGraph V → SimpleGraph W → Prop
A simple graph G is inducingly contained in a simple graph H if there exists an induced
subgraph of H isomorphic to G. This is denoted by G ⊴ H.
def SimpleGraph.«term_⊴_» E1 #
Lean.TrailingParserDescr
A simple graph G is inducingly contained in a simple graph H if there exists an induced
subgraph of H isomorphic to G. This is denoted by G ⊴ H.
theorem SimpleGraph.Copy.isContained E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} (f : G.Copy H), G.IsContained H
theorem SimpleGraph.Embedding.isIndContained E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} (f : G ↪g H), G.IsIndContained H
theorem SimpleGraph.Embedding.isContained E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} (f : G ↪g H), G.IsContained H
theorem SimpleGraph.IsIndContained.isContained E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W}, G.IsIndContained H → G.IsContained H
theorem SimpleGraph.Iso.isContained E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} (e : G ≃g H), G.IsContained H
If G is isomorphic to H, then G is contained in H.
theorem SimpleGraph.Iso.isContained' E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} (e : G ≃g H), H.IsContained G
If G is isomorphic to H, then H is contained in G.
theorem SimpleGraph.Iso.isIndContained E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} (e : G ≃g H), G.IsIndContained H
If G is isomorphic to H, then G is inducingly contained in H.
theorem SimpleGraph.Iso.isIndContained' E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} (e : G ≃g H), H.IsIndContained G
If G is isomorphic to H, then H is inducingly contained in G.
theorem SimpleGraph.Subgraph.IsInduced.isIndContained E1 #
∀ {V : Type u_1} {G : SimpleGraph V} {G' : G.Subgraph}, G'.IsInduced → G'.coe.IsIndContained G
theorem SimpleGraph.IsIndContained.refl E1 #
∀ {V : Type u_1} (G : SimpleGraph V), G.IsIndContained G
theorem SimpleGraph.IsIndContained.rfl E1 #
∀ {V : Type u_1} {G : SimpleGraph V}, G.IsIndContained G
theorem SimpleGraph.IsIndContained.trans E1 #
∀ {V : Type u_1} {W : Type u_2} {X : Type u_3} {G : SimpleGraph V} {H : SimpleGraph W} {I : SimpleGraph X},
G.IsIndContained H → H.IsIndContained I → G.IsIndContained I
instance SimpleGraph.instIsPreorderIsIndContained E0 #
∀ {W : Type u_2}, IsPreorder (SimpleGraph W) SimpleGraph.IsIndContained
instance SimpleGraph.instTransIsIndContained E0 #
{V : Type u_1} →
{W : Type u_2} →
{X : Type u_3} → Trans SimpleGraph.IsIndContained SimpleGraph.IsIndContained SimpleGraph.IsIndContained
theorem SimpleGraph.IsIndContained.of_isEmpty E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [IsEmpty V], G.IsIndContained H
theorem SimpleGraph.isIndContained_iff_exists_iso_subgraph E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W}, G.IsIndContained H ↔ ∃ H' _e, H'.IsInduced
theorem SimpleGraph.IsIndContained.of_exists_iso_subgraph E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W}, (∃ H' _e, H'.IsInduced) → G.IsIndContained H
Alias of the reverse direction of SimpleGraph.isIndContained_iff_exists_iso_subgraph.
theorem SimpleGraph.IsIndContained.exists_iso_subgraph E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W}, G.IsIndContained H → ∃ H' _e, H'.IsInduced
Alias of the forward direction of SimpleGraph.isIndContained_iff_exists_iso_subgraph.
theorem SimpleGraph.isIndContained_iff_exists_iso_induce E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W},
G.IsIndContained H ↔ ∃ s, Nonempty (G ≃g SimpleGraph.induce s H)
theorem SimpleGraph.top_isIndContained_iff_top_isContained E0 #
∀ {V : Type u_1} {W : Type u_2} {H : SimpleGraph W}, ⊤.IsIndContained H ↔ ⊤.IsContained H
theorem SimpleGraph.isContained_top_iff E0 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V}, G.IsContained (SimpleGraph.completeGraph W) ↔ Nonempty (V ↪ W)
theorem SimpleGraph.top_isIndContained_top_iff E0 #
∀ {V : Type u_1} {W : Type u_2},
(SimpleGraph.completeGraph V).IsIndContained (SimpleGraph.completeGraph W) ↔ Nonempty (V ↪ W)
theorem SimpleGraph.compl_isIndContained_compl E0 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W}, Gᶜ.IsIndContained Hᶜ ↔ G.IsIndContained H
theorem SimpleGraph.IsIndContained.of_compl E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W}, Gᶜ.IsIndContained Hᶜ → G.IsIndContained H
Alias of the forward direction of SimpleGraph.compl_isIndContained_compl.
theorem SimpleGraph.IsIndContained.compl E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W}, G.IsIndContained H → Gᶜ.IsIndContained Hᶜ
Alias of the reverse direction of SimpleGraph.compl_isIndContained_compl.
theorem SimpleGraph.isContained_iff_exists_le_comap E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W},
H.IsContained G ↔ ∃ f, H ≤ SimpleGraph.comap (⇑f) G
theorem SimpleGraph.isIndContained_iff_exists_comap_eq E0 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W},
H.IsIndContained G ↔ ∃ f, SimpleGraph.comap (⇑f) G = H
def SimpleGraph.labelledCopyCount E1 #
{V : Type u_1} → {W : Type u_2} → [Fintype V] → [Fintype W] → SimpleGraph V → SimpleGraph W → ℕ
G.labelledCopyCount H is the number of labelled copies of H in G, i.e. the number of graph
embeddings from H to G. See SimpleGraph.copyCount for the number of unlabelled copies.
theorem SimpleGraph.labelledCopyCount_of_isEmpty E0 #
∀ {V : Type u_1} {W : Type u_2} [inst : Fintype V] [inst_1 : Fintype W] [IsEmpty W] (G : SimpleGraph V)
(H : SimpleGraph W), G.labelledCopyCount H = 1
theorem SimpleGraph.labelledCopyCount_eq_zero E0 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [inst : Fintype V] [inst_1 : Fintype W],
G.labelledCopyCount H = 0 ↔ H.Free G
theorem SimpleGraph.labelledCopyCount_pos E0 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [inst : Fintype V] [inst_1 : Fintype W],
0 < G.labelledCopyCount H ↔ H.IsContained G
abbrev SimpleGraph.UnlabeledCopy E1 #
{V : Type u_1} → {W : Type u_2} → SimpleGraph W → SimpleGraph V → Type u_1
H.UnlabeledCopy G is the type of SimpleGraph.Subgraphs of G isomorphic to H.
The corresponding count is SimpleGraph.copyCount.
def SimpleGraph.copyCount E1 #
{V : Type u_1} → {W : Type u_2} → [Fintype V] → SimpleGraph V → SimpleGraph W → ℕ
G.copyCount H is the number of unlabelled copies of H in G, i.e. the number of subgraphs
of G isomorphic to H. See SimpleGraph.labelledCopyCount for the number of labelled copies.
theorem SimpleGraph.copyCount_eq_card_image_copyToSubgraph E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [inst : Fintype V]
[inst_1 : Fintype { f // Function.Injective ⇑f }] [inst_2 : DecidableEq G.Subgraph],
G.copyCount H = (Finset.image SimpleGraph.Copy.toSubgraph Finset.univ).card
theorem SimpleGraph.copyCount_eq_zero E0 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [inst : Fintype V], G.copyCount H = 0 ↔ H.Free G
theorem SimpleGraph.copyCount_pos E0 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [inst : Fintype V],
0 < G.copyCount H ↔ H.IsContained G
theorem SimpleGraph.copyCount_le_labelledCopyCount E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [inst : Fintype V] [inst_1 : Fintype W],
G.copyCount H ≤ G.labelledCopyCount H
There's at least as many labelled copies of H in G than unlabelled ones.
instance SimpleGraph.uniqueUnlabeledCopyBot E0 #
{V : Type u_1} → [Fintype V] → (G : SimpleGraph V) → Unique (⊥.UnlabeledCopy G)
theorem SimpleGraph.copyCount_bot E0 #
∀ {V : Type u_1} [inst : Fintype V] (G : SimpleGraph V), G.copyCount ⊥ = 1
theorem SimpleGraph.copyCount_of_isEmpty E0 #
∀ {V : Type u_1} {W : Type u_2} [inst : Fintype V] [IsEmpty W] (G : SimpleGraph V) (H : SimpleGraph W),
G.copyCount H = 1
def SimpleGraph.killCopies E1 #
{V : Type u_1} → {W : Type u_2} → SimpleGraph V → SimpleGraph W → SimpleGraph V
G.killCopies H is a subgraph of G where an arbitrary edge was removed from each copy of
H in G. By construction, it doesn't contain H (unless H had no edges) and has at most the
number of copies of H edges less than G. See free_killCopies and
le_card_edgeFinset_killCopies for these two properties.
theorem SimpleGraph.killCopies_le_left E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W}, G.killCopies H ≤ G
Removing an edge from G for each subgraph isomorphic to H results in a subgraph of G.
theorem SimpleGraph.killCopies_bot E0 #
∀ {V : Type u_1} {W : Type u_2} (G : SimpleGraph V), G.killCopies ⊥ = G
theorem SimpleGraph.killCopies_eq_left E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W}, H ≠ ⊥ → (G.killCopies H = G ↔ H.Free G)
G.killCopies H has no effect on G if and only if G already contained no copies of H. See
Free.killCopies_eq_left for the reverse implication with no assumption on H.
theorem SimpleGraph.Free.killCopies_eq_left E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W}, H.Free G → G.killCopies H = G
theorem SimpleGraph.free_killCopies E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W}, H ≠ ⊥ → H.Free (G.killCopies H)
Removing an edge from G for each subgraph isomorphic to H results in a graph that doesn't
contain H.
instance SimpleGraph.killCopies.edgeSet.instFintype E0 #
{V : Type u_1} →
{W : Type u_2} → {G : SimpleGraph V} → {H : SimpleGraph W} → [Fintype ↑G.edgeSet] → Fintype ↑(G.killCopies H).edgeSet
theorem SimpleGraph.le_card_edgeFinset_killCopies E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [inst : Fintype ↑G.edgeSet]
[inst_1 : Fintype V], G.edgeFinset.card - G.copyCount H ≤ (G.killCopies H).edgeFinset.card
Removing an edge from H for each subgraph isomorphic to G means that the number of edges
we've removed is at most the number of copies of G in H.
theorem SimpleGraph.le_card_edgeFinset_killCopies_add_copyCount E1 #
∀ {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [inst : Fintype ↑G.edgeSet]
[inst_1 : Fintype V], G.edgeFinset.card ≤ (G.killCopies H).edgeFinset.card + G.copyCount H
Removing an edge from H for each subgraph isomorphic to G means that the number of edges
we've removed is at most the number of copies of G in H.
Deprecated aliases
| Name | New name | Since |
|---|---|---|
SimpleGraph.Copy.max_degree_le | SimpleGraph.Copy.maxDegree_mono | 2026-05-20 |
SimpleGraph.Copy.minDegree_le | SimpleGraph.Copy.minDegree_mono | 2026-05-20 |
SimpleGraph.Hom.minDegree_le | SimpleGraph.Hom.minDegree_mono | 2026-05-20 |
SimpleGraph.IsContained.max_degree_le | SimpleGraph.IsContained.maxDegree_mono | 2026-05-20 |