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.
- handshaking lemma
- finite simple graphs
- vertex degree
- degree-sum formula
- parity
- double counting
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.
Handshaking lemma at a glance

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
This map summarizes the statement's structure; the exact Mathlib declaration remains authoritative.
Four odd-degree vertices on an eight-cycle with two chords

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
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.
- ProofAtlas did not originate the handshaking lemma or Mathlib's declaration.
- The selected endpoint is even cardinality of the odd-degree vertex set; the supporting degree-sum identity is not substituted for it.
- The theorem does not assert that every graph has exactly two or four odd-degree vertices.
- It does not pair odd-degree vertices by actual graph edges.
- It does not require the graph to be connected or classify finite simple graphs.
- The generated explanation and visuals are not proof evidence.
Source and local evidence
Where the theorem comes from
- Existing declaration
SimpleGraph.even_card_odd_degree_verticesin mathlib- Relationship
- The checked artifact is the upstream declaration itself
- Local Lean evidence
artifact.library.mathlib.handshaking-lemma.v001