Hall's marriage theorem


In mathematics, Hall's marriage theorem, proved by, is a theorem with two equivalent formulations:
Let be a family of finite subsets of, where the members of are counted with multiplicity.
A transversal for is the image of an injective function from to such that is an element of the set for every in the family. In other words, selects one representative from each set in in such a way that no two sets from get the same representative. An alternative term for transversal is system of distinct representatives.
The collection S satisfies the marriage condition when for each subfamily,
Restated in words, the marriage condition asserts that every subfamily of covers at least different members of.
If the marriage condition fails then there cannot be a transversal of.
Suppose that the marriage condition fails, i.e., that for some subcollection of, Suppose, by way of contradiction, that a transversal of also exists.
The restriction of to the offending subcollection would be an injective function from into. This is impossible by the pigeonhole principle since. Therefore no transversal can exist if the marriage condition fails.
Hall's theorem states that the converse is also true:

Examples

Example 1: Consider S = with
A valid transversal would be.
Example 2: Consider S = with
No valid transversal exists; the marriage condition is violated as is shown by the subfamily W =. Here the number of sets in the subfamily is |W| = 3, while the union of the three sets A2 U A3 U A4 contains only 2 elements of X.
Example 3: Consider S = with
The only valid transversals are and.

Application to marriage

The standard example of an application of the marriage theorem is to imagine two groups; one of n men, and one of n women. For each woman, there is a subset of the men, any one of which she would happily marry; and any man would be happy to marry a woman who wants to marry him. Consider whether it is possible to pair up the men and women so that every person is happy.
If we let Ai be the set of men that the i-th woman would be happy to marry, then the marriage theorem states that each woman can happily marry a man if and only if the collection of sets meets the marriage condition.
Note that the marriage condition is that, for any subset of the women, the number of men whom at least one of the women would be happy to marry,, be at least as big as the number of women in that subset,. It is obvious that this condition is necessary, as if it does not hold, there are not enough men to share among the women. What is interesting is that it is also a sufficient condition.

Graph theoretic formulation

Let G be a finite bipartite graph with bipartite sets X and Y. An X-perfect matching is a matching which covers every vertex in X.
For a subset W of X, let NG denote the neighborhood of W in G, i.e. the set of all vertices in Y adjacent to some element of W. The marriage theorem in this formulation states that there is an X-perfect matching if and only if for every subset W of X:
In other words: every subset W of X has sufficiently many adjacent vertices in Y.

Proof of the graph theoretic version

Easy direction: we assume that some matching M saturates every vertex of X, and prove that Hall's condition is satisfied for all WX. Let M denote the set of all vertices in Y matched by M to a given W. By definition of a matching, |M| = |W |. But MNG, since all elements of M are neighbours of W. So, |NG| ≥ |M| and hence, |NG| ≥ |W|.
Hard direction: we assume that there is no X-perfect matching and prove that Hall's condition is violated for at least one WX. Let M be a maximum matching, and u a vertex not saturated by M. Consider all alternating paths starting from u. Let the set of all points in Y connected to u by these alternating paths be Z, and the set of all points in X connected to u by these alternating paths be W. No maximal alternating path can end in a vertex in Y, lest it would be an augmenting path, so that we could augment M to a strictly larger matching by toggling the status of all the edges of the path. Thus every vertex in Z is matched by M to a vertex in W \. Conversely, every vertex v in W \ is matched by M to a vertex in Z. Thus, M provides a bijection of W \ and Z, which implies |W| = |Z| + 1. On the other hand, NGZ: let v in Y be connected to a vertex w in W. If the edge is in M, then v is in Z by the previous part of the proof, otherwise we can take an alternating path ending in w and extend it with v, getting an augmenting path and showing that v is in Z. Hence, |NG| ≤ |Z| = |W| − 1 < |W|.

Constructive proof of the hard direction

Define a Hall violator as a subset W of X for which |NG| < |W|. If W is a Hall violator, then there is no matching that saturates all vertices of W. Therefore, there is also no matching that saturates X. Hall's marriage theorem says that a graph contains an X-perfect matching if and only if it contains no Hall violators. The following algorithm proves the hard direction of the theorem: it finds either an X-perfect matching or a Hall violator. It uses, as a subroutine, an algorithm that, given a matching M and an unmatched vertex x0, either finds an M-augmenting path or a Hall violator containing x0.
It uses
  1. Initialize M :=. // Empty matching.
  2. Assert: M is a matching in G.
  3. If M saturates all vertices of X, then return the X-perfect matching M.
  4. Let x0 be an unmatched vertex.
  5. Using the Hall violator algorithm, find either a Hall violator or an M-augmenting path.
  6. In the first case, return the Hall violator.
  7. In the second case, use the M-augmenting path to increase the size of M, and go back to step 2.
At each iteration, M grows by one edge. Hence, this algorithm must end after at most |E| iterations. Each iteration takes at most |X| time. The total runtime complexity is similar to the Ford-Fulkerson method for finding a maximum cardinality matching.

Equivalence of the combinatorial formulation and the graph-theoretic formulation

Let S = where the Ai are finite sets which need not be distinct. Let the set X = and the set Y be the union of all the elements in all the Ai.
We form a finite bipartite graph G :=, with bipartite sets X and Y by joining any element in Y to each Ai which it is a member of. A transversal of S is an X-perfect matching of the bipartite graph G. Thus a problem in the combinatorial formulation can be easily translated to a problem in the graph-theoretic formulation.

Topological proof

Hall's theorem can be proved based on Sperner's lemma.

Applications

The theorem has many other interesting "non-marital" applications. For example, take a standard deck of cards, and deal them out into 13 piles of 4 cards each. Then, using the marriage theorem, we can show that it is always possible to select exactly 1 card from each pile, such that the 13 selected cards contain exactly one card of each rank.
More abstractly, let G be a group, and H be a finite subgroup of G. Then the marriage theorem can be used to show that there is a set T such that T is a transversal for both the set of left cosets and right cosets of H in G.
The marriage theorem is used in the usual proofs of the fact that an Latin rectangle can always be extended to an Latin rectangle when r < n, and so, ultimately to a Latin square.

Logical equivalences

This theorem is part of a collection of remarkably powerful theorems in combinatorics, all of which are related to each other in an informal sense in that it is more straightforward to prove one of these theorems from another of them than from first principles. These include:
In particular, there are simple proofs of the implications Dilworth's theorem ⇔ Hall's theorem ⇔ König–Egerváry theorem ⇔ König's theorem.

Infinite families

Marshall Hall Jr. variant

By examining Philip Hall's original proof carefully, Marshall Hall, Jr. was able to tweak the result in a way that permitted the proof to work for infinite S. This variant refines the marriage theorem and provides a lower bound on the number of transversals that a given S may have. This variant is:
Suppose that, where the Ai are finite sets that need not be distinct, is a family of sets satisfying the marriage condition, and suppose that |Ai| ≥ r for i = 1,..., n. Then the number of different transversals for the family is at least r! if rn and r... if r > n.
Recall that a transversal for a family S is an ordered sequence, so two different transversals could have exactly the same elements. For instance, the family A1 =, A2 = has both and as distinct transversals.

Marriage condition does not extend

The following example, due to Marshall Hall, Jr., shows that the marriage condition will not guarantee the existence of a transversal in an infinite family in which infinite sets are allowed.
Let S be the family, A0 =, A1 =, A2 =,..., Ai =,...
The marriage condition holds for this infinite family, but no transversal can be constructed.
The more general problem of selecting a element from each of a collection of non-empty sets is permitted in general only if the axiom of choice is accepted.
The marriage theorem does extend to the infinite case if stated properly. Given a bipartite graph with sides A and B, we say that a subset C of B is smaller than or equal in size to a subset D of A in the graph if there exists an injection in the graph from C to D, and that it is strictly smaller in the graph if in addition there is no injection in the graph in the other direction. Note that omitting in the graph yields the ordinary notion of comparing cardinalities. The infinite marriage theorem states that there exists an injection from A to B in the graph, if and only if there is no subset C of A such that N is strictly smaller than C in the graph.

Fractional matching variant

A fractional matching in a graph is an assignment of non-negative weights to each edge, such that the sum of weights adjacent to each vertex is at most 1. A fractional matching is X-perfect if the sum of weights adjacent to each vertex is exactly 1. The following are equivalent for a bipartite graph G = :
When Hall's condition does not hold, the original theorem tells us only that a perfect matching does not exist, but does not tell us the largest matching that does exist. To learn this information we need the notion of deficiency of a graph. Given a bipartite graph G =, the deficiency of G w.r.t. X is the maximum, over all subsets W of X, of the difference |W| - |NG|. The larger the deficiency, the farther the graph is from satisfying Hall's condition.
Using Hall's marriage theorem, it can be proved that, if the deficiency of a bipartite graph G is d, then G admits a matching of size at least |X|-d. See Deficiency for a proof.

Generalizations