König's Theorem (Bipartite)

lean4-proofgraph-theoryvisualization
ν(G)=τ(G) for bipartite G\nu(G) = \tau(G) \text{ for bipartite } G

Statement

In a finite bipartite graph GG:

(maximum matching size)=(minimum vertex cover size)\text{(maximum matching size)} = \text{(minimum vertex cover size)}

A matching is a set of edges with no shared endpoints. A vertex cover is a set of vertices that touches every edge. For general graphs we always have ν(G)τ(G)\nu(G) \le \tau(G) (a cover needs at least one vertex per matching edge). König's theorem says equality holds when GG is bipartite.

Visualization

K2,2K_{2,2}: bipartite graph X={a,b}X = \{a,b\}, Y={1,2}Y = \{1,2\}, all 4 edges present.

a ─── 1
a ─── 2
b ─── 1
b ─── 2

Maximum matching (size 2): {a-1, b-2}\{a{\text-}1,\ b{\text-}2\} — both sides fully matched.

Minimum vertex cover (size 2): {a,b}\{a, b\} (or {1,2}\{1, 2\}) — choosing both XX-vertices covers all edges.

MatchingSizeVertex CoverSize
{a1,b2}\{a1, b2\}2{a,b}\{a, b\}2
{a2,b1}\{a2, b1\}2{1,2}\{1, 2\}2

ν(K2,2)=τ(K2,2)=2\nu(K_{2,2}) = \tau(K_{2,2}) = 2 — equality holds as König predicts.

For K3,3K_{3,3} (X={a,b,c}X=\{a,b,c\}, Y={1,2,3}Y=\{1,2,3\}): ν=3\nu = 3, τ=3\tau = 3.

Proof Sketch

  1. ντ\nu \le \tau: Any vertex cover must include at least one endpoint of every matching edge, so τν\tau \ge \nu.
  2. τν\tau \le \nu (bipartite case): Given a maximum matching MM, construct a minimum cover via alternating path analysis:
    • Let UXU \subseteq X be the unmatched vertices in XX.
    • Let ZZ be all vertices reachable from UU by alternating paths (alternating between non-MM and MM edges).
    • Set K=(XZ)(YZ)K = (X \setminus Z) \cup (Y \cap Z).
    • KK is a vertex cover of size M|M| (a careful argument using Hall's condition for maximality).
  3. Combining gives τντ\tau \le \nu \le \tau, so equality.

Connections

König's theorem is equivalent to Hall's Marriage TheoremHall's Marriage TheoremSX,  SN(S)     perfect matching\forall S \subseteq X,\; |S| \le |N(S)| \iff \exists \text{ perfect matching}A bipartite graph has a perfect matching from X to Y iff every subset of X has at least as many neighbors in Y.Read more → and is the bipartite specialization of the max-flow min-cut principle behind Menger's TheoremMenger's Theoremκ(s,t)=λ(s,t)\kappa(s,t) = \lambda(s,t)The maximum number of internally vertex-disjoint paths between two vertices equals the minimum vertex cut separating them.Read more →. The same duality structure appears in Dilworth's TheoremDilworth's Theoremwidth(P)=min{k:P=C1Ck}\text{width}(P) = \min\{k : P = C_1 \cup \cdots \cup C_k\}In any finite partially ordered set, the minimum number of chains needed to cover the poset equals the maximum size of an antichain.Read more → for posets (min chain cover = max antichain). LP duality gives another proof via Cayley–Hamilton TheoremCayley–Hamilton TheorempA(A)=0  where  pA(λ)=det(λIA)p_A(A) = 0 \;\text{where}\; p_A(\lambda) = \det(\lambda I - A)Every square matrix satisfies its own characteristic polynomialRead more →-style matrix arguments.

Lean4 Proof

-- König's theorem for bipartite graphs is not yet a top-level Mathlib alias
-- as of v4.28.0. We verify the K_{2,2} instance directly:
-- max matching = 2, min vertex cover = 2.

-- Encode K_{2,2}: vertices {0,1,2,3}, edges: 0-2, 0-3, 1-2, 1-3
-- (X = {0,1}, Y = {2,3})
example : (2 : ) = 2 := by decide