{
  "artifactId": "artifact.library.mathlib.handshaking-lemma.v001",
  "candidateOnly": false,
  "category": "Graph theory",
  "claimBoundary": "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.",
  "collectionSlug": "landmark-theorems-in-mathlib",
  "exactFormalStatement": "theorem SimpleGraph.even_card_odd_degree_vertices {V : Type*} (G : SimpleGraph V) [Fintype V] [DecidableRel G.Adj] : Even #{v | Odd (G.degree v)}",
  "family": "Finite graph invariants",
  "id": "library.mathlib.handshaking-lemma.v001",
  "links": {
    "collection": "/collections/landmark-theorems-in-mathlib/",
    "collectionData": "/data/collections/mathlib-landmarks.json",
    "entry": "/library-theorems/handshaking-lemma/",
    "entryData": "/data/library-theorems/handshaking-lemma.json",
    "evidence": "/proofs/artifact.library.mathlib.handshaking-lemma.v001.html",
    "evidenceData": "/data/proofs/artifact.library.mathlib.handshaking-lemma.v001.evidence.json",
    "source": "/sources/upstream/handshaking-lemma/"
  },
  "landmark": {
    "completeFormalType": "theorem SimpleGraph.even_card_odd_degree_vertices {V : Type*} (G : SimpleGraph V) [Fintype V] [DecidableRel G.Adj] : Even #{v | Odd (G.degree v)}",
    "concepts": [
      "handshaking lemma",
      "finite simple graphs",
      "vertex degree",
      "degree-sum formula",
      "parity",
      "double counting"
    ],
    "plainLanguage": "In every finite undirected simple graph, the number of vertices incident to an odd number of edges is even.",
    "poster": {
      "alt": "An ivory handshaking-lemma poster states the even-cardinality endpoint above an exact eight-vertex, ten-edge example. Four double-ringed vertices have degree three, the other four have degree two, and a three-stage route moves from the degree sum through reduction modulo two to even parity.",
      "byteSize": 2117552,
      "caption": "Each undirected edge contributes two endpoint incidences, so reducing the degree sum modulo two leaves an even number of odd-degree vertices.",
      "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.",
      "derivatives": [
        {
          "byteSize": 91926,
          "height": 960,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/handshaking-lemma/theorem-poster-v1-640.webp",
          "sha256": "sha256:0b81f456fea945102a2f8691d580c208656ea0a652be34944dd79e49e545d942",
          "width": 640
        },
        {
          "byteSize": 169340,
          "height": 1536,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/handshaking-lemma/theorem-poster-v1-1024.webp",
          "sha256": "sha256:6b93094f9e7093c76489b8b987974d7931904e3b8987add3c895a4768be2a037",
          "width": 1024
        }
      ],
      "generatedAt": "2026-07-27T10:36:27-04:00",
      "height": 1536,
      "mediaType": "image/png",
      "modelRequested": "gpt-image-2",
      "publicPath": "/assets/library-theorems/handshaking-lemma/theorem-poster-v1.png",
      "sha256": "sha256:0c851eb1b5ec30692f694ada58b26c5a0d07f35d3361954c6c9d198cffd89122",
      "title": "Handshaking lemma at a glance",
      "width": 1024,
      "kind": "theorem_poster",
      "transcript": "GRAPH THEORY · PARITY\nHANDSHAKING LEMMA\nIN A FINITE SIMPLE GRAPH\nTHE NUMBER OF ODD-DEGREE VERTICES IS EVEN\nEven #{v | Odd (degree v)}\nA COUNT-EXACT EXAMPLE\nv₁ · v₂ · v₃ · v₄ · v₅ · v₆ · v₇ · v₈\ndegrees: 3 · 2 · 2 · 3 · 3 · 2 · 2 · 3\n4 odd-degree vertices\n10 undirected edges\n20 endpoint incidences\n× 10\ndegree sum\n20 = 2×10\nTHE CHECKED ROUTE\n1 · SUM THE DEGREES\n∑ degree(v) = 2|E|\n2 · REDUCE MODULO 2\neven terms vanish · odd terms count as 1\n3 · CLOSE THE PARITY\n#{v | Odd (degree v)} ≡ 0 (mod 2)\nEXACT SCOPE\nFinite vertex type · undirected simple graph.\nThe theorem allows 0, 2, 4, … odd-degree vertices.\nIt does not pair them by edges or classify all graphs."
    },
    "visual": {
      "alt": "A dark engraved eight-vertex graph has an eight-cycle plus crossing chords v1—v4 and v3—v6. Double gold rings mark exactly the four degree-three vertices v1, v3, v4, and v6, while four teal vertices have degree two; an adjacent parity motif reads 4 = 2 × 2.",
      "byteSize": 2923403,
      "caption": "The example has exactly four odd-degree vertices; the theorem says that the odd-degree vertex set always has even cardinality.",
      "description": "Exactly eight vertices form a cycle, with two additional chords v1—v4 and v3—v6 whose crossing is not a vertex. The highlighted vertices v1, v3, v4, and v6 each have degree three, and the remaining four each have degree two. Distinct rings as well as color separate odd from even degree, while the closing motif emphasizes even cardinality without suggesting that the graph edges pair the highlighted vertices.",
      "derivatives": [
        {
          "byteSize": 36290,
          "height": 427,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/handshaking-lemma/theorem-schematic-v1-640.webp",
          "sha256": "sha256:66050eb15e621c59f24f2e44bcb9e16a1a74fbeb513a1a9f5fe0631913d7efe1",
          "width": 640
        },
        {
          "byteSize": 133476,
          "height": 800,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/handshaking-lemma/theorem-schematic-v1-1200.webp",
          "sha256": "sha256:c5ff836748aab668398e7b5155f92eeb1c438683aeeafe1a99648babc31ecabe",
          "width": 1200
        }
      ],
      "generatedAt": "2026-07-27T10:36:27-04:00",
      "height": 1024,
      "mediaType": "image/png",
      "modelRequested": "gpt-image-2",
      "publicPath": "/assets/library-theorems/handshaking-lemma/theorem-schematic-v1.png",
      "sha256": "sha256:e6cbf5744dfe874f406107a8ad4694ccb53cc3ec8ba6241a90054b58e148d77e",
      "title": "Odd-degree vertices close in an even count",
      "width": 1536
    },
    "walkthrough": null,
    "whyLandmark": "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."
  },
  "nonClaims": [
    "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."
  ],
  "publicExportEligible": true,
  "relationship": "upstream_direct",
  "schemaVersion": "library-theorem-entry-data.v1",
  "statementId": "statement.library.mathlib.handshaking-lemma.v001",
  "statusAxes": {
    "acceptedAtlasResult": "Not recorded for the preferred artifact",
    "locallyReproduced": "Exact upstream declaration replayed",
    "reviewedPage": "Current public presentation reviewed",
    "upstreamIndexed": "Pinned source bytes verified locally"
  },
  "summary": "A finite simple graph has an even number of vertices of odd degree.",
  "targetId": "target.library.mathlib.handshaking-lemma.v001",
  "title": "Handshaking Lemma",
  "upstreamOrigin": {
    "declarationName": "SimpleGraph.even_card_odd_degree_vertices",
    "immutableSourceUrl": "https://github.com/leanprover-community/mathlib4/blob/5e932f97dd25535344f80f9dd8da3aab83df0fe6/Mathlib/Combinatorics/SimpleGraph/DegreeSum.lean#L126",
    "packageName": "mathlib",
    "repositoryUrl": "https://github.com/leanprover-community/mathlib4",
    "sourceArtifactHash": "sha256:c19c3d1980cda4eab5a82af01a6b2435198c37d68055582d9a77bf5ea6de9537",
    "sourceByteLength": 6416,
    "sourceCommit": "5e932f97dd25535344f80f9dd8da3aab83df0fe6",
    "sourceFile": "Mathlib/Combinatorics/SimpleGraph/DegreeSum.lean",
    "sourceLine": 126,
    "verificationKind": "git_worktree"
  },
  "publicPresentationReview": {
    "status": "reviewed"
  }
}
