{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe count, for each vertex, how often the trail enters and leaves it.\n\n1. Write $W = (w_0, w_1, \\dots, w_k)$ with $w_0 = u$ and $w_k = v$. It is a [[trail|062MQGP8M5]], so its edges $w_{t-1} w_t$ for $1 \\le t \\le k$ are pairwise distinct.\n2. Since $W$ is an [[Eulerian trail|0NNYDD1AVR]], every edge of $G$ is one of these $k$ edges, and each appears exactly once.\n3. If $k = 0$, then $G$ has no edges and $u = w_0 = v$. Every vertex has [[degree|0T0F6CCS9W]] $0$, which is even. So the statement holds. From now on let $k \\ge 1$.\n4. Fix a vertex $x$. For a condition $\\varphi$, let $[\\varphi]$ be $1$ if $\\varphi$ holds and $0$ otherwise.\n5. The degree of $x$ is the number of edges that contain $x$. By steps 1 and 2, $\\deg(x)$ is the number of $t \\in \\set{1, \\dots, k}$ with $x \\in \\set{w_{t-1}, w_t}$.\n6. In a [[graph|0JD5C82QMB]], $w_{t-1} \\ne w_t$, because adjacent vertices are distinct. So $[x \\in \\set{w_{t-1}, w_t}] = [w_{t-1} = x] + [w_t = x]$.\n7. Summing over $t$ gives $\\deg(x) = \\sum_{t=0}^{k-1} [w_t = x] + \\sum_{t=1}^{k} [w_t = x]$.\n8. Hence $\\deg(x) = 2 \\sum_{t=1}^{k-1} [w_t = x] + [w_0 = x] + [w_k = x]$.\n9. So $\\deg(x) \\equiv [x = u] + [x = v] \\pmod 2$.\n10. If $u = v$, the right side of step 9 is $2[x = u]$, which is even. So every vertex has even degree.\n11. If $u \\ne v$, the right side of step 9 is $1$ for $x = u$ and for $x = v$, and $0$ for every other $x$. So $u$ and $v$ have odd degree, and every other vertex has even degree.\n\n## Idea\n\nEach visit of the trail to a vertex in the middle uses one edge to arrive and one edge to leave, so these edges come in pairs. Only the first and the last vertex get an unpaired edge, and when they coincide those two edges pair up as well.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "05C45"
    ],
    "name": "Proof of the degrees along an Eulerian trail",
    "proves": "0CDVDGWGEG",
    "sources": [
      {
        "locator": "Properties",
        "url": "https://en.wikipedia.org/wiki/Eulerian_path"
      }
    ],
    "tag": "X26F0CWR19",
    "uses": [
      "0NNYDD1AVR",
      "062MQGP8M5",
      "0VJZM0F9YM",
      "0T0F6CCS9W",
      "0JD5C82QMB"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/X26F0CWR19/",
  "links": [
    {
      "field": "proves",
      "target": "0CDVDGWGEG"
    },
    {
      "field": "uses",
      "target": "0NNYDD1AVR"
    },
    {
      "field": "uses",
      "target": "062MQGP8M5"
    },
    {
      "field": "uses",
      "target": "0VJZM0F9YM"
    },
    {
      "field": "uses",
      "target": "0T0F6CCS9W"
    },
    {
      "field": "uses",
      "target": "0JD5C82QMB"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/X26F0CWR19.md",
  "msc": [
    "05C45"
  ],
  "name": "Proof of the degrees along an Eulerian trail",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/X26/X26F0CWR19.md",
  "status": null,
  "tag": "X26F0CWR19",
  "uri": "m2://X26F0CWR19",
  "url": "https://math2.tamnd.com/wiki/proof-of-the-degrees-along-an-eulerian-trail/",
  "writing": {
    "tag": "X26F0CWR19",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
