{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe argue by [[strong induction|0KMVFSHFGZ]] on the length $k$ of the walk.\n\n1. Claim for each $k \\in \\N$: let $W$ be a [[walk|0VJZM0F9YM]] of length $k$ from a vertex $u$ to a vertex $v$. Then there is a [[path|0JDE56HWQ8]] from $u$ to $v$ whose vertices and edges all belong to $W$.\n2. Let $W = (w_0, w_1, \\dots, w_k)$ be a walk from $u$ to $v$, and assume the claim for all lengths smaller than $k$.\n3. If the vertices $w_0, \\dots, w_k$ are pairwise distinct, then $W$ itself is a path, and we are done.\n4. Otherwise there are indices $0 \\le i \u003c j \\le k$ with $w_i = w_j$.\n5. Let $W' = (w_0, \\dots, w_i, w_{j+1}, \\dots, w_k)$. If $j = k$, this is $W' = (w_0, \\dots, w_i)$.\n6. $W'$ is a walk: consecutive vertices inside the two blocks are adjacent in $W$, and $w_i = w_j \\sim w_{j+1}$ when $j \u003c k$.\n7. $W'$ starts at $w_0 = u$. It ends at $w_k = v$ if $j \u003c k$, and at $w_i = w_j = w_k = v$ if $j = k$.\n8. The vertices of $W'$ are vertices of $W$. Its edges are edges of $W$, because the only new edge $w_i w_{j+1}$ equals the edge $w_j w_{j+1}$ of $W$.\n9. The length of $W'$ is $k - (j - i) \u003c k$. By the induction hypothesis, $W'$ contains a path from $u$ to $v$ as in the claim.\n10. By step 8, the vertices and edges of that path are vertices and edges of $W$. This proves the claim for $k$, and hence the statement.\n\n## Idea\n\nIf a walk visits some vertex twice, the part between the two visits is a detour. Cutting it out gives a shorter walk with the same ends, and this cannot go on forever.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "05C38"
    ],
    "name": "Proof that every walk contains a path",
    "proves": "09VZBHB33V",
    "sources": [
      {
        "locator": "Walk, trail, and path",
        "url": "https://en.wikipedia.org/wiki/Path_(graph_theory)"
      }
    ],
    "tag": "RQMSNCYW06",
    "uses": [
      "0VJZM0F9YM",
      "0JDE56HWQ8",
      "0KMVFSHFGZ"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/RQMSNCYW06/",
  "links": [
    {
      "field": "proves",
      "target": "09VZBHB33V"
    },
    {
      "field": "uses",
      "target": "0VJZM0F9YM"
    },
    {
      "field": "uses",
      "target": "0JDE56HWQ8"
    },
    {
      "field": "uses",
      "target": "0KMVFSHFGZ"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/RQMSNCYW06.md",
  "msc": [
    "05C38"
  ],
  "name": "Proof that every walk contains a path",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/RQM/RQMSNCYW06.md",
  "status": null,
  "tag": "RQMSNCYW06",
  "uri": "m2://RQMSNCYW06",
  "url": "https://math2.tamnd.com/wiki/proof-that-every-walk-contains-a-path/",
  "writing": {
    "tag": "RQMSNCYW06",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
