Complete Multipartite Graphs #
A graph is complete multipartite iff non-adjacency is transitive.
Main declarations #
SimpleGraph.IsCompleteMultipartite
: predicate for a graph to be complete-multi-partite.SimpleGraph.IsCompleteMultipartite.setoid
: theSetoid
given by non-adjacency.SimpleGraph.IsCompleteMultipartite.iso
: the graph isomorphism from a graph thatIsCompleteMultipartite
to the correspondingcompleteMultipartiteGraph
.SimpleGraph.IsPathGraph3Compl
: predicate for three vertices to be a witness to non-complete-multi-partite-ness of a graph G. (The name refers to the fact that the three vertices form the complement ofpathGraph 3
.)See also:
Mathlib/Combinatorics/SimpleGraph/FiveWheelLike.lean
colorable_iff_isCompleteMultipartite_of_maximal_cliqueFree
a maximallyr + 1
- cliquefree graph isr
-colorable iff it is complete-multipartite.SimpleGraph.completeEquipartiteGraph
: the complete equipartite graph in parts of equal size such that two vertices are adjacent if and only if they are in different parts.
Implementation Notes #
The definition of completeEquipartiteGraph
is similar to completeMultipartiteGraph
except that Sigma.fst
is replaced by Prod.fst
in the definition. The difference is that the
former vertices are a product type whereas the latter vertices are a dependent product type.
While completeEquipartiteGraph r t
could have been defined as the specialisation
completeMultipartiteGraph (const (Fin r) (Fin t))
(or turanGraph (r * t) r
), it is convenient
to instead have a non-dependent product type for the vertices.
See completeEquipartiteGraph.completeMultipartiteGraph
, completeEquipartiteGraph.turanGraph
for the isomorphisms between a completeEquipartiteGraph
and a corresponding
completeMultipartiteGraph
, turanGraph
.
G
is IsCompleteMultipartite
iff non-adjacency is transitive
Equations
- G.IsCompleteMultipartite = Transitive fun (x1 x2 : α) => ¬G.Adj x1 x2
Instances For
The setoid given by non-adjacency
Instances For
The graph isomorphism from a graph G
that IsCompleteMultipartite
to the corresponding
completeMultipartiteGraph
(see also isCompleteMultipartite_iff
)
Equations
- One or more equations did not get rendered due to their size.
Instances For
The vertices v, w₁, w₂
form an IsPathGraph3Compl
in G
iff w₁w₂
is the only edge present
between these three vertices. It is a witness to the non-complete-multipartite-ness of G
(see
not_isCompleteMultipartite_iff_exists_isPathGraph3Compl
). This structure is an explicit way of
saying that the induced graph on {v, w₁, w₂}
is the complement of P3
.
- adj : G.Adj w₁ w₂
Instances For
Any IsPathGraph3Compl
in G
gives rise to a graph embedding of the complement of the path graph
Equations
- h.pathGraph3ComplEmbedding = { toFun := fun (x : Fin 3) => match x with | 0 => w₁ | 1 => v | 2 => w₂, inj' := ⋯, map_rel_iff' := ⋯ }
Instances For
Embedding of (pathGraph 3)ᶜ
into G
that is not complete-multipartite.
Instances For
The complete equipartite graph in r
parts each of equal size t
such that two
vertices are adjacent if and only if they are in different parts, often denoted $K_r(t)$.
This is isomorphic to a corresponding completeMultipartiteGraph
and turanGraph
. The difference
is that the former vertices are a product type.
See completeEquipartiteGraph.completeMultipartiteGraph
, completeEquipartiteGraph.turanGraph
.
Equations
Instances For
A completeEquipartiteGraph
is isomorphic to a corresponding completeMultipartiteGraph
.
The difference is that the former vertices are a product type whereas the latter vertices are a dependent product type.
Equations
- SimpleGraph.completeEquipartiteGraph.completeMultipartiteGraph = { toEquiv := (Equiv.sigmaEquivProd (Fin r) (Fin t)).symm, map_rel_iff' := ⋯ }
Instances For
A completeEquipartiteGraph
is isomorphic to a corresponding turanGraph
.
The difference is that the former vertices are a product type whereas the latter vertices are not.
Equations
- One or more equations did not get rendered due to their size.
Instances For
completeEquipartiteGraph r t
contains no edges when r ≤ 1
or t = 0
.
Every n
-colorable graph is contained in a completeEquipartiteGraph
in n
parts (as long
as the parts are at least as large as the largest color class).