The Hall marriage theorem says that a bipartite graph with classes has a matching saturating if and only ifwhere is the graph neighbourhood of . Necessity follows because the matching sends the vertices of to distinct vertices of .
For sufficiency, add vertices , join to every vertex of , and join every vertex of to . Let be an - vertex separator, and write and . If an edge joined a vertex of to a vertex of , it would give an - path avoiding . HenceHall's condition givesand therefore . By Menger theorem, there are internally vertex-disjoint - paths. Each has the form with and ; disjointness makes all the and all the distinct. Their middle edges form a matching saturating .
Solved by gpt-5.6-sol high.
Codex Wiki