Degree-sum formula and handshaking lemma #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
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 #
simple_graph.sum_degrees_eq_twice_card_edges
is the degree-sum formula.simple_graph.even_card_odd_degree_vertices
is the handshaking lemma.simple_graph.odd_card_odd_degree_vertices_ne
is that the number of odd-degree vertices different from a given odd-degree vertex is odd.simple_graph.exists_ne_odd_degree_of_exists_odd_degree
is 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
The degree-sum formula. This is also known as the handshaking lemma, which might
more specifically refer to simple_graph.even_card_odd_degree_vertices
.
The handshaking lemma. See also simple_graph.sum_degrees_eq_twice_card_edges
.