The areas / V30. Combinatorics
Mathlib.Combinatorics.SimpleGraph.DegreeSum
12 declarations. Mathlib docs · Source
Degree-sum formula and handshaking lemma
The degree-sum formula is that the sum of the degrees of the vertices in a finite graph is equal to twice the number of edges. The handshaking lemma, a corollary, is that the number of odd-degree vertices is even.
Main definitions
SimpleGraph.sum_degrees_eq_twice_card_edgesis the degree-sum formula.SimpleGraph.even_card_odd_degree_verticesis the handshaking lemma.SimpleGraph.odd_card_odd_degree_vertices_neis that the number of odd-degree vertices different from a given odd-degree vertex is odd.SimpleGraph.exists_ne_odd_degree_of_exists_odd_degreeis that the existence of an odd-degree vertex implies the existence of another one.
Implementation notes
We give a combinatorial proof by using the facts that (1) the map from darts to vertices is such that each fiber has cardinality the degree of the corresponding vertex and that (2) the map from darts to edges is 2-to-1.
Tags
simple graphs, sums, degree-sum formula, handshaking lemma
theorem SimpleGraph.dart_fst_fiber E1 #
∀ {V : Type u} (G : SimpleGraph V) [inst : Fintype V] [inst_1 : DecidableRel G.Adj] [inst_2 : DecidableEq V] (v : V),
{d | d.toProd.1 = v} = Finset.image (G.dartOfNeighborSet v) Finset.univ
theorem SimpleGraph.dart_fst_fiber_card_eq_degree E1 #
∀ {V : Type u} (G : SimpleGraph V) [inst : Fintype V] [inst_1 : DecidableRel G.Adj] [inst_2 : DecidableEq V] (v : V),
{d | d.toProd.1 = v}.card = G.degree v
theorem SimpleGraph.dart_card_eq_sum_degrees E1 #
∀ {V : Type u} (G : SimpleGraph V) [inst : Fintype V] [inst_1 : DecidableRel G.Adj],
Fintype.card G.Dart = ∑ v, G.degree v
theorem SimpleGraph.Dart.edge_fiber E1 #
∀ {V : Type u} {G : SimpleGraph V} [inst : Fintype V] [inst_1 : DecidableRel G.Adj] [inst_2 : DecidableEq V]
(d : G.Dart), {d' | d'.edge = d.edge} = {d, d.symm}
theorem SimpleGraph.dart_edge_fiber_card E1 #
∀ {V : Type u} (G : SimpleGraph V) [inst : Fintype V] [inst_1 : DecidableRel G.Adj] [inst_2 : DecidableEq V],
∀ e ∈ G.edgeSet, {d | d.edge = e}.card = 2
theorem SimpleGraph.dart_card_eq_twice_card_edges E1 #
∀ {V : Type u} (G : SimpleGraph V) [inst : Fintype V] [inst_1 : DecidableRel G.Adj],
Fintype.card G.Dart = 2 * G.edgeFinset.card
theorem SimpleGraph.sum_degrees_eq_twice_card_edges E3 #
∀ {V : Type u} (G : SimpleGraph V) [inst : Fintype V] [inst_1 : DecidableRel G.Adj],
∑ v, G.degree v = 2 * G.edgeFinset.card
The degree-sum formula. This is also known as the handshaking lemma, which might
more specifically refer to SimpleGraph.even_card_odd_degree_vertices.
theorem SimpleGraph.two_mul_card_edgeFinset E1 #
∀ {V : Type u} (G : SimpleGraph V) [inst : Fintype V] [inst_1 : DecidableRel G.Adj],
2 * G.edgeFinset.card =
{x |
match x with
| (x, y) => G.Adj x y}.card
theorem SimpleGraph.sum_degrees_support_eq_twice_card_edges E1 #
∀ {V : Type u} (G : SimpleGraph V) [inst : Fintype V] [inst_1 : DecidableRel G.Adj],
∑ v ∈ G.support.toFinset, G.degree v = 2 * G.edgeFinset.card
The degree-sum formula only counting over the vertices that form edges.
See SimpleGraph.sum_degrees_eq_twice_card_edges for the general version.
theorem SimpleGraph.even_card_odd_degree_vertices E3 #
∀ {V : Type u} (G : SimpleGraph V) [inst : Fintype V] [inst_1 : DecidableRel G.Adj], Even {v | Odd (G.degree v)}.card
The handshaking lemma. See also SimpleGraph.sum_degrees_eq_twice_card_edges.
theorem SimpleGraph.odd_card_odd_degree_vertices_ne E3 #
∀ {V : Type u} (G : SimpleGraph V) [inst : Fintype V] [inst_1 : DecidableEq V] [inst_2 : DecidableRel G.Adj] (v : V),
Odd (G.degree v) → Odd {w | w ≠ v ∧ Odd (G.degree w)}.card
theorem SimpleGraph.exists_ne_odd_degree_of_exists_odd_degree E3 #
∀ {V : Type u} (G : SimpleGraph V) [inst : Fintype V] [inst_1 : DecidableRel G.Adj] (v : V),
Odd (G.degree v) → ∃ w, w ≠ v ∧ Odd (G.degree w)