{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe show that every vertex cover is at least as large as every matching. Then, from a maximum matching, we build a vertex cover of the same size.\n\n*Covers are at least as large as matchings.*\n\n1. Let $G$ be a finite [[bipartite graph|07DVHJ8N0A]] with parts $X$ and $Y$. Let $M$ be a [[matching|0Z87BHAFTB]] and $C$ a [[vertex cover|0KDADE9RQ8]].\n2. Each edge of $M$ has an end in $C$. A vertex is an end of at most one edge of $M$. So choosing such an end for each edge of $M$ gives an injective map from $M$ to $C$, and $\\abs{M} \\le \\abs{C}$.\n\n*A cover from a maximum matching.*\n\n3. Fix a matching $M$ with the largest number of edges. A vertex is *matched* if it is an end of an edge of $M$. Let $U$ be the set of unmatched vertices of $X$.\n4. An *alternating path* is a [[path|0JDE56HWQ8]] $p_0, p_1, \\dots, p_k$ with $p_0 \\in U$, such that $p_{i-1} p_i \\notin M$ for odd $i$ and $p_{i-1} p_i \\in M$ for even $i$. As $G$ is bipartite and $p_0 \\in X$, $p_i \\in X$ exactly when $i$ is even.\n5. Let $Z$ be the set of vertices that lie on some alternating path. Let $K = (X \\setminus Z) \\cup (Y \\cap Z)$.\n6. *No alternating path ends at an unmatched vertex of $Y$.* Suppose $p_0, \\dots, p_k$ is one, with $p_k \\in Y$ unmatched. Then $k$ is odd.\n7. Let $P$ be its set of edges, and let $M' = M \\mathbin{\\triangle} P$ be the [[symmetric difference|0Z49NTR1DZ]]. It drops the $(k-1)/2$ edges $p_{i-1}p_i$ with $i$ even and adds the $(k+1)/2$ edges with $i$ odd.\n8. The vertices $p_0$ and $p_k$ are unmatched, and the edge of $M$ at an inner vertex $p_j$ lies on the path. So no edge of $M \\setminus P$ touches the path. Each $p_j$ is an end of exactly one added edge.\n9. Hence $M'$ is a matching with $\\abs{M} + 1$ edges. This contradicts the choice of $M$.\n10. *$K$ is a vertex cover.* Let $ab$ be an edge with $a \\in X$ and $b \\in Y$. If $a \\notin Z$, then $a \\in K$.\n11. Let $a \\in Z$, on an alternating path $p_0, \\dots, p_j = a$, with $j$ even. If $b$ lies on this path, then $b \\in Z$.\n12. Otherwise, if $j = 0$, then $a \\in U$, so $ab \\notin M$. If $j \\ge 2$, then the edge of $M$ at $a$ is $p_{j-1}a$, and $b \\ne p_{j-1}$, so $ab \\notin M$.\n13. In both cases $p_0, \\dots, p_j, b$ is an alternating path, since its last edge has odd index and is not in $M$. So $b \\in Z$, and $b \\in K$.\n14. *Every vertex of $K$ is matched.* Vertices of $X \\setminus Z$ are matched, because $U \\subseteq Z$. A vertex of $Y \\cap Z$ lies on an alternating path. Cut the path at this vertex to get an alternating path ending there. By Step 6, the vertex is matched.\n15. *Each edge of $M$ has at most one end in $K$.* Let $ab \\in M$ with $a \\in X$ and $b \\in Y \\cap Z$, on an alternating path $p_0, \\dots, p_k = b$ with $k$ odd.\n16. If $a$ lies on this path, then $a \\in Z$. Otherwise the path ends with an edge not in $M$, and $p_0, \\dots, p_k, a$ is an alternating path. So $a \\in Z$ in both cases.\n17. Thus $b \\in K$ implies $a \\notin K$. Since $K$ is a vertex cover, each edge of $M$ has exactly one end in $K$.\n18. Map each vertex of $K$ to the edge of $M$ at it, which exists by Step 14. By Step 17, this map is a bijection from $K$ to $M$. So $\\abs{K} = \\abs{M}$.\n\n*Conclusion.*\n\n19. Let $\\nu$ be the largest size of a matching and $\\tau$ the smallest size of a vertex cover. By Step 2, $\\nu \\le \\tau$.\n20. By Steps 10 to 18, there is a vertex cover $K$ with $\\abs{K} = \\nu$. So $\\tau \\le \\nu$, and $\\nu = \\tau$.\n\n## Idea\n\nStarting from the unmatched vertices on one side, follow paths that alternate between non-matching and matching edges. A maximum matching admits no such path to an unmatched vertex, because flipping it would give a bigger matching. Taking the unreached vertices on one side and the reached ones on the other gives a cover with one vertex per matching edge.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "methods": [
      "0J0XBKG64S"
    ],
    "msc": [
      "05C70"
    ],
    "name": "Proof of Kőnig's theorem by alternating paths",
    "proves": "0JP0ZF57PN",
    "sources": [
      {
        "locator": "Constructive proof without flow concepts",
        "url": "https://en.wikipedia.org/wiki/Kőnig's_theorem_(graph_theory)"
      }
    ],
    "tag": "H5463B2XND",
    "uses": [
      "07DVHJ8N0A",
      "0Z87BHAFTB",
      "0KDADE9RQ8",
      "0JDE56HWQ8",
      "0Z49NTR1DZ"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/H5463B2XND/",
  "links": [
    {
      "field": "proves",
      "target": "0JP0ZF57PN"
    },
    {
      "field": "uses",
      "target": "07DVHJ8N0A"
    },
    {
      "field": "uses",
      "target": "0Z87BHAFTB"
    },
    {
      "field": "uses",
      "target": "0KDADE9RQ8"
    },
    {
      "field": "uses",
      "target": "0JDE56HWQ8"
    },
    {
      "field": "uses",
      "target": "0Z49NTR1DZ"
    },
    {
      "field": "methods",
      "target": "0J0XBKG64S"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/H5463B2XND.md",
  "msc": [
    "05C70"
  ],
  "name": "Proof of Kőnig's theorem by alternating paths",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/H54/H5463B2XND.md",
  "status": null,
  "tag": "H5463B2XND",
  "uri": "m2://H5463B2XND",
  "url": "https://math2.tamnd.com/wiki/proof-of-konigs-theorem-by-alternating-paths/",
  "writing": {
    "tag": "H5463B2XND",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
