Bipartite matching as matroid intersection #
A matching of a bipartite graph G : L × R → Bool is a set of edges that is independent in two
unit-capacity partition matroids on L × R: the one whose blocks are the fibres of Prod.fst
and the one whose blocks are the fibres of Prod.snd ([Sch17], Example 10.5a). This module
proves that correspondence and shows that a separator U from Edmonds' matroid intersection
theorem gives a vertex cover of size M₁.eRk U + M₂.eRk (E \ U). Edmonds' theorem then yields a
maximum matching together with a vertex cover of the same size. This is König's theorem
([Kon31]), derived by the matroid route of [Sch17], Exercise 10.22.
The library's primary statement of König's theorem is the flow-based
Cslib.Algorithms.Lean.MaxFlow.exists_maxMatching_eq_minVertexCover. This module gives a second,
flow-independent derivation via matroid intersection, with an explicit separator cover. It is
stated with the existing Cslib.Algorithms.Lean.MaxFlow.IsMatching, VertexCover and
IsVertexCover API, and shares with the flow proof only the matching/cover weak duality
Cslib.Algorithms.Lean.MaxFlow.card_le_size_of_matching_vertexCover, used to conclude minimality
of the cover.
Main definitions #
Cslib.Algorithms.Lean.Matroid.unitPartitionMatroid: the unit-capacity partition matroid of a mapf : α → β, in which a set is independent whenfis injective on it.Cslib.Algorithms.Lean.Matroid.bipartiteEdges: the edge set ofG : L × R → Boolas aFinset.Cslib.Algorithms.Lean.Matroid.separatorCover: the vertex cover(fst '' U, snd '' (E \ U))read off from a separatorU.
Main results #
Cslib.Algorithms.Lean.Matroid.unitPartitionMatroid_indep_iff,Cslib.Algorithms.Lean.Matroid.unitPartitionMatroid_eRk: independence and rank in the unit-capacity partition matroid.Cslib.Algorithms.Lean.Matroid.isMatching_iff_isCommonIndep: matchings ofGare exactly the common independent subsets ofbipartiteEdges Gfor the two partition matroids.Cslib.Algorithms.Lean.Matroid.isVertexCover_separatorCover,Cslib.Algorithms.Lean.Matroid.size_separatorCover: every separator gives a vertex cover whose size is the corresponding rank sum.Cslib.Algorithms.Lean.Matroid.exists_maxMatching_separatorCover: Edmonds' theorem gives a maximum matching and a minimum vertex cover of the formseparatorCoverwith equal sizes.
References #
Unit-capacity partition matroids #
The unit-capacity partition matroid of f : α → β: its ground set is all of α, and a set I
is independent exactly when f is injective on I, so each fibre of f is a block of capacity
one. It is the free matroid on β pulled back along f.
The rank of X in the unit-capacity partition matroid of f is the number of blocks that
X meets.
Matchings, separators and vertex covers #
Bipartite matchings are common independent sets ([Sch17], Example 10.5a): M is a
matching of G exactly when M ⊆ bipartiteEdges G and M is independent in both unit-capacity
partition matroids unitPartitionMatroid Prod.fst and unitPartitionMatroid Prod.snd.
The vertex cover read off from a separator U ⊆ E: the left endpoints of edges in U and the
right endpoints of edges in E \ U.
For every U, separatorCover (bipartiteEdges G) U covers every edge of G: an edge in U
is covered by its left endpoint, and an edge outside U by its right endpoint.
The size of separatorCover E U is the rank sum
(unitPartitionMatroid Prod.fst).eRk U + (unitPartitionMatroid Prod.snd).eRk (E \ U) from
Edmonds' theorem.
König's theorem by matroid intersection ([Sch17], Example 10.5a and
Exercise 10.22; [Kon31]): for a bipartite graph G on finite vertex types, Edmonds' theorem
for the two unit-capacity partition matroids on bipartiteEdges G gives a maximum matching M and
a separator U ⊆ bipartiteEdges G whose separatorCover is a minimum vertex cover of size
M.card. The flow-based proof of the same equality is
Cslib.Algorithms.Lean.MaxFlow.exists_maxMatching_eq_minVertexCover.