Even graphs are edge-disjoint unions of cycles #
Source: url:https://github.com/jtraverso/erdos-81-chordal-clique-partitions/blob/b3423f3e8c8db7c2d1b279673293ef3079faf903/preprints/PAPER_III/05_formalization/lean_v1.4_freeze/Contrib/EvenGraphCycles.lean
Authors: Juan Pablo Traverso Gianini, Aristotle
Status: verified
Main declarations: Finset.exists_cycleDecomp, Finset.exists_edge_pairing_of_even
Tags: graph-theory, eulerian-graphs, cycle-decompositions
MSC: 05C45
Even graphs are edge-disjoint unions of cycles #
A finite graph, encoded as a finite set of edges E : Finset (Sym2 V), all of whose degrees are
even is the edge-disjoint union of cycles. As a consequence the edges at each vertex can be
paired up, simultaneously at every vertex ("Eulerian pairing").
Main results #
Finset.exists_cycleDecomp:theorem Finset.exists_cycleDecomp {V : Type*} [DecidableEq V] {E : Finset (Sym2 V)} (hdiag : ∀ e ∈ E, ¬ e.IsDiag) (heven : ∀ v : V, Even (E.cycleEdgeDegree v)) : ∃ cs : List (List V), (∀ c ∈ cs, c.Nodup ∧ 3 ≤ c.length) ∧ (cs.flatMap List.cycleEdges).Nodup ∧ (cs.flatMap List.cycleEdges).toFinset = EFinset.exists_edge_pairing_of_even:theorem Finset.exists_edge_pairing_of_even {V : Type*} [DecidableEq V] {E : Finset (Sym2 V)} (heven : ∀ v : V, Even (E.cycleEdgeDegree v)) : ∃ pair : V → Sym2 V → Sym2 V, ∀ v : V, ∀ e ∈ E, v ∈ e → pair v e ∈ E ∧ v ∈ pair v e ∧ pair v e ≠ e ∧ pair v (pair v e) = e
Along the way we prove Finset.exists_cycle_of_even (a nonempty loopless even graph contains a
cycle), Finset.exists_cycleDecomp_finset (the decomposition stated as a pairwise disjoint family
of edge sets) and Finset.exists_involution_of_even_card (a finite set of even size carries a
fixed-point-free involution).
Implementation notes #
Graphs are encoded as finite sets of edges E : Finset (Sym2 V);
E.cycleEdgeDegree v is the number of edges of E incident with v. A cycle is encoded by a
list l : List V of pairwise distinct
vertices with 3 ≤ l.length, its edge list being l.cycleEdges, the list of pairs of cyclically
consecutive entries of l.
The cycle decomposition is proved by strong induction on the edge set: a nonempty even graph has
minimum positive degree at least two, so a path of maximal length closes up into a cycle
(Finset.exists_cycle_of_even); removing the edges of that cycle keeps all degrees even
(List.even_edgeDegree_cycleEdges), and one recurses.
Main definitions #
List.pathEdges,List.cycleEdges: the edges of a walk, resp. of a closed walk, given as a list of vertices;Finset.cycleEdgeDegree: the degree of a vertex in a finite edge set;Finset.edgeSupport: the set of vertices incident with an edge of a finite edge set.
A closed walk on n vertices has n edges.
An endpoint of an edge of a closed walk is a vertex of that walk.
The number of edges of E incident with v.
The project-specific name avoids colliding with analogous definitions in other pooled projects.
Equations
- E.cycleEdgeDegree v = {e ∈ E | v ∈ e}.card
Instances For
The raw-edge degree agrees with SimpleGraph.degree on a graph's edge finset.
A vertex lies in the support of E if and only if it is incident with an edge of E.
Degrees are monotone in the edge set.
Deleting a set of edges subtracts its degrees.
The degrees of a cycle #
Every degree of a cycle is even (in fact 0 or 2).
A nonempty even graph contains a cycle #
Every nonempty loopless graph with all degrees even contains a cycle. The cycle is found at the end of a path of maximal length.
The cycle decomposition #
Every finite loopless graph with all degrees even is the edge-disjoint union of cycles.
The cycles are given as a list cs of lists of pairwise distinct vertices, each of length at
least three; their edge lists concatenate, without repetition, to the edge set E.
Every finite loopless graph with all degrees even decomposes into edge-disjoint cycles,
stated as a family of edge sets: the cycles are given as a list Cs of edge sets, each of them
the edge set l.cycleEdges of a cycle l (a list of pairwise distinct vertices of length at
least three); they are pairwise disjoint and their union is E.
Pairing up a set of even size #
The Eulerian pairing #
The Eulerian pairing. If every degree of E is even then the edges of E at every
vertex v can be paired up: pair v is a fixed-point-free involution of the set of edges of E
incident with v. The pairing is defined at every vertex simultaneously, so each edge xy of E
is paired with an edge at x and with an edge at y.
A finite simple graph of even degree decomposes into edge-disjoint simple cycles.
The incident edges of a finite simple graph of even degree admit Eulerian pairings.