Containment of graphs #
This file introduces the concept of one simple graph containing a copy of another.
For two simple graph 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
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 H
is the type of copies ofG
inH
, implemented as the subtype of injective homomorphisms.SimpleGraph.IsContained G H
,G ⊑ H
is the relation thatH
contains a copy ofG
, that is, the type of copies ofG
inH
is nonempty. This is equivalent to the existence of an isomorphism fromG
to a subgraph ofH
. This is similar toSimpleGraph.IsSubgraph
except that the simple graphs here need not have the same underlying vertex type.SimpleGraph.Free
is the predicate thatH
isG
-free, that is,H
does not contain a copy ofG
. This is the negation ofSimpleGraph.IsContained
implemented for convenience.
Induced containment:
- Induced copies of
G
insideH
are already defined asG ↪g H
. SimpleGraph.IsIndContained G H
:G
is contained as an induced subgraph inH
.
Notation #
The following notation is declared in locale SimpleGraph
:
G ⊑ H
forSimpleGraph.IsContained G H
.G ⊴ H
forSimpleGraph.IsIndContained G H
.
TODO #
Relate ⊤ ⊑ H
/⊥ ⊑ H
to there being a clique/independent set in H
.
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.
The type of copies as a subtype of injective homomorphisms.
A copy gives rise to a homomorphism.
- injective' : Function.Injective ⇑self.toHom
An injective homomorphism gives rise to a copy.
An embedding gives rise to a copy.
An isomorphism gives rise to a copy.
Equations
- f.toCopy = f.toEmbedding.toCopy
Equations
- SimpleGraph.Copy.instFunLike = { coe := fun (f : A.Copy B) => ⇑f.toHom, coe_injective' := ⋯ }
Alias of SimpleGraph.Copy.toHom_apply
.
A copy induces an embedding of edge sets.
Equations
- f.mapEdgeSet = { toFun := f.toHom.mapEdgeSet, inj' := ⋯ }
A copy induces an embedding of neighbor sets.
Equations
- f.mapNeighborSet a = { toFun := fun (v : ↑(A.neighborSet a)) => ⟨f ↑v, ⋯⟩, inj' := ⋯ }
A copy gives rise to an embedding of vertex types.
Equations
- f.toEmbedding = { toFun := ⇑f, inj' := ⋯ }
The identity copy from a simple graph to itself.
Equations
- SimpleGraph.Copy.id G = { toHom := SimpleGraph.Hom.id, injective' := ⋯ }
The composition of copies is a copy.
The copy from a subgraph to the supergraph.
Equations
- SimpleGraph.Copy.ofLE G₁ G₂ h = { toHom := SimpleGraph.Hom.ofLE h, injective' := ⋯ }
The copy from an induced subgraph to the initial simple graph.
Equations
The copy of ⊥
in any simple graph that can embed its vertices.
Equations
- SimpleGraph.Copy.bot f = { toHom := { toFun := ⇑f, map_rel' := ⋯ }, injective' := ⋯ }
The isomorphism from a subgraph of A
to its map under a copy f : Copy A B
.
Equations
- f.isoSubgraphMap A' = { toEquiv := Equiv.Set.image (⇑f.toHom) A'.verts ⋯, map_rel_iff' := ⋯ }
The subgraph of B
corresponding to a copy of A
inside B
.
Equations
The isomorphism from A
to its copy under f : Copy A B
.
Equations
Equations
- One or more equations did not get rendered due to their size.
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
).
The relation IsContained A B
, A ⊑ B
says that B
contains a copy of A
.
This is equivalent to the existence of an isomorphism from A
to a subgraph of B
.
Equations
- A.IsContained B = Nonempty (A.Copy B)
The relation IsContained A B
, A ⊑ B
says that B
contains a copy of A
.
This is equivalent to the existence of an isomorphism from A
to a subgraph of B
.
Equations
- SimpleGraph.«term_⊑_» = Lean.ParserDescr.trailingNode `SimpleGraph.«term_⊑_» 50 50 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⊑ ") (Lean.ParserDescr.cat `term 51))
A simple graph contains itself.
A simple graph contains its subgraphs.
If A
contains B
and B
contains C
, then A
contains C
.
If B
contains C
and A
contains B
, then A
contains C
.
Alias of SimpleGraph.IsContained.mono_right
.
Alias of SimpleGraph.IsContained.mono_left
.
If A ≃g B
, then A
is contained in C
if and only if B
is contained in C
.
A simple graph having no vertices is contained in any simple graph.
⊥
is contained in any simple graph having sufficently many vertices.
Alias of SimpleGraph.bot_isContained_iff_card_le
.
⊥
is contained in any simple graph having sufficently many vertices.
A simple graph G
contains all Subgraph G
coercions.
Alias of SimpleGraph.Copy.isoSubgraphMap
.
The isomorphism from a subgraph of A
to its map under a copy f : Copy A B
.
B
contains A
if and only if B
has a subgraph B'
and B'
is isomorphic to A
.
Alias of the reverse direction of SimpleGraph.isContained_iff_exists_iso_subgraph
.
B
contains A
if and only if B
has a subgraph B'
and B'
is isomorphic to A
.
Alias of the forward direction of SimpleGraph.isContained_iff_exists_iso_subgraph
.
B
contains A
if and only if B
has a subgraph B'
and B'
is isomorphic to A
.
The proposition that a simple graph does not contain a copy of another simple graph.
Equations
- A.Free B = ¬A.IsContained B
If A ≃g B
, then C
is A
-free if and only if C
is B
-free.
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
).
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
.
Equations
- G.IsIndContained H = Nonempty (G ↪g H)
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
.
Equations
- SimpleGraph.«term_⊴_» = Lean.ParserDescr.trailingNode `SimpleGraph.«term_⊴_» 50 50 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⊴ ") (Lean.ParserDescr.cat `term 51))
If G
is isomorphic to H
, then G
is inducingly contained in H
.
If G
is isomorphic to H
, then H
is inducingly contained in G
.
Alias of the forward direction of SimpleGraph.isIndContained_iff_exists_iso_subgraph
.
Alias of the reverse direction of SimpleGraph.isIndContained_iff_exists_iso_subgraph
.
Alias of the reverse direction of SimpleGraph.compl_isIndContained_compl
.
Alias of the forward direction of SimpleGraph.compl_isIndContained_compl
.