A matching from to is a set of pairwise vertex-disjoint edges that covers every vertex of . Equivalently, it chooses for each a distinct neighbour in .
Hall marriage theorem says that such a matching exists if and only ifNecessity is immediate: the distinct partners of the vertices in all belong to .
For sufficiency, induct on . The claim is clear when . First suppose every nonempty proper satisfies the strict inequality . Choose an edge and delete and . For , deletion removes at most one neighbour, soInduction gives a matching of , and adding completes it.
Otherwise there is a nonempty proper with . Hall's condition holds in the bipartite graph induced by , so induction matches onto . For ,and hence has at least neighbours outside . Induction therefore matches into . The two matchings are disjoint and together cover .
Solved by gpt-5.6-sol high.
Codex Wiki