Mathlib theorem · Existing formal mathematics

Existing in Mathlib · Graph theory

Handshaking Lemma

In every finite undirected simple graph, the number of vertices incident to an odd number of edges is even.

Exact theorem

Exact Mathlib statement

theorem SimpleGraph.even_card_odd_degree_vertices {V : Type*} (G : SimpleGraph V) [Fintype V] [DecidableRel G.Adj] : Even #{v | Odd (G.degree v)}

The theorem at a glance

Handshaking lemma at a glance

A visual guide to the theorem's hypotheses, structure, and conclusion; the exact statement gives the formal detail.

Each undirected edge contributes two endpoint incidences, so reducing the degree sum modulo two leaves an even number of odd-degree vertices. Explanatory diagram.
Detailed visual description

The poster leads with the parity theorem, then uses a count-exact eight-cycle with noncrossing chords v1—v4 and v5—v8. Its degree sequence 3,2,2,3,3,2,2,3 has four odd entries, while ten edges contribute twenty endpoint incidences. The checked route names the supporting degree-sum equality, reduces degrees modulo two, and closes the selected even-cardinality conclusion. The footer preserves the finite simple-graph scope and excludes a graph-edge pairing or classification claim.

Statement structure

From hypotheses to conclusion

Statement map for Handshaking LemmaA finite simple graph has an even number of vertices of odd degree. The pinned upstream declaration is SimpleGraph.even_card_odd_degree_vertices. The exact checked statement is theorem SimpleGraph.even_card_odd_degree_vertices {V : Type*} (G : SimpleGraph V) [Fintype V] [DecidableRel G.Adj] : Even #{v | Odd (G.degree v)}.Mathematical readingA finite simple graphhas an even number ofvertices of odd degree.Pinned declarationmathlib ·SimpleGraph.even_card_odd_degree_verticesExact checked formtheoremSimpleGraph.even_card_odd_degree_vertices{V : Type*} (G :SimpleGraph V) [FintypeV] [DecidableRel G.Adj]: Even #{v | Odd(G.degree v)}Statement map for Handshaking LemmaA finite simple graph has an even number of vertices of odd degree. The pinned upstream declaration is SimpleGraph.even_card_odd_degree_vertices. The exact checked statement is theorem SimpleGraph.even_card_odd_degree_vertices {V : Type*} (G : SimpleGraph V) [Fintype V] [DecidableRel G.Adj] : Even #{v | Odd (G.degree v)}.Mathematical readingA finite simple graphhas an even number ofvertices of odd degree.Pinned declarationmathlib ·SimpleGraph.even_card_odd_degree_verticesExact checked formtheoremSimpleGraph.even_card_odd_degree_vertices{V : Type*} (G :SimpleGraph V) [FintypeV] [DecidableRel G.Adj]: Even #{v | Odd(G.degree v)}

This map summarizes the statement's structure; the exact Mathlib declaration remains authoritative.

In this eight-vertex example, the four chord endpoints have degree three and the other four vertices have degree two, so the odd-degree set has four members. Explanatory scientific diagram.
Detailed visual description

Eight equally spaced vertices form one octagonal cycle. A straight vertical chord joins the top and bottom vertices, and a straight horizontal chord joins the left and right vertices. Their central crossing is unmarked and is not a vertex. The top, right, bottom, and left vertices have emerald centers with two gold rings and degree three. The upper-right, lower-right, lower-left, and upper-left vertices have ivory centers with one charcoal ring and degree two. Thus the graph has exactly ten edges and exactly four odd-degree vertices; no edge pairing of those vertices is asserted.

Why it matters

A mathematical landmark

The handshaking lemma is a foundational parity invariant in graph theory. Mathlib's selected declaration records the familiar odd-degree endpoint, with the degree-sum formula and a concise reduction modulo two exposed directly in the checked source.

ProofAtlas record

What has been checked

Upstream indexedPinned source bytes verified locally
Locally reproducedExact upstream declaration replayed
Reviewed pageCurrent public presentation reviewed
Accepted Atlas resultNot recorded for the preferred artifact

Mathlib is the source of the theorem; the local Lean replay and page review are separate.

Claim boundary

No new theorem is claimed

This page indexes Mathlib's odd-degree parity form of the handshaking lemma. For a simple graph G on a finite vertex type V, with decidable adjacency, the selected declaration concludes Even #{v | Odd (G.degree v)}. The degree-sum identity is a supporting declaration in the checked route, not the selected endpoint. The result allows zero odd-degree vertices and does not prescribe an exact positive number, pair odd vertices by edges, require connectivity, or classify finite graphs.

Source and local evidence

Where the theorem comes from

Existing declaration
SimpleGraph.even_card_odd_degree_vertices in mathlib
Relationship
The checked artifact is the upstream declaration itself
Local Lean evidence
artifact.library.mathlib.handshaking-lemma.v001
Source
Open the pinned upstream reference