On this page
Four people each say which jobs they can do, and you want to give everyone a different job. Hall's marriage theorem gives a test instead of trial and error, and when the test fails it names the reason.
The theorem comes from Philip Hall's paper On Representatives of Subsets, Journal of the London Mathematical Society, 1935. Below we check it on workers and jobs, break it on purpose, then use it to build a Latin square.
What does Hall's marriage theorem say?
Picture a bipartite graph: workers on the left, jobs on the right, and a line from a worker to each job they can do. A matching is a set of lines with no worker and no job used twice. For any group S of workers, write N(S) for the set of jobs at least one of them can do.
Hall's theorem: a matching that covers every worker exists if and only if |N(S)| ≥ |S| for every group S of workers (statement and proof summary).
One direction is common sense: if k workers between them can do only k − 1 jobs, two must clash. Hall's insight is the converse. If no group is short of jobs, a full assignment always exists.
How do you check the condition on an example?
Four workers, four jobs:
Asha can do Coding or Design
Bilal can do Coding or Editing
Chitra can do Design or Finance
Dev can do Editing or Finance
Check every group, smallest first.
Single workers: each can do 2 jobs, and 2 ≥ 1.
Pairs: there are 6. Asha and Bilal reach {Coding, Design, Editing}, 3 jobs. Bilal and Dev reach {Coding, Editing, Finance}, 3 jobs. Every pair reaches at least 3 jobs, and 3 ≥ 2.
Triples: there are 4, and each reaches all 4 jobs.
All four workers reach all 4 jobs.
No group is short, so Hall promises a matching. Here is one: Asha takes Coding, Bilal takes Editing, Chitra takes Design, Dev takes Finance. The diagram at the top of this post draws it in gold.
What does it look like when Hall's condition fails?
Change the lists:
Asha can do Coding or Design
Bilal can do only Coding
Chitra can do only Design
Dev can do Editing or Finance
Everyone can do at least one job and there are four jobs for four people, so it looks fine. But take S = {Asha, Bilal, Chitra}: N(S) = {Coding, Design}, so |N(S)| = 2 while |S| = 3. Three people share two jobs, so someone is left out whatever you try.
A failed check is a certificate: show anyone the group S and its small N(S), and they can see that no assignment exists without listing every possibility.
How does Hall's theorem build Latin squares?
A Latin square of order n is an n × n grid where each of n symbols appears once in every row and once in every column. A Latin rectangle is the same thing with fewer rows than columns. Hall's theorem is used in the usual proofs that an r × n Latin rectangle with r < n can always gain one more row, and so can be completed to a full Latin square (Wikipedia, applications). For this result Wikipedia cites An existence theorem for Latin squares, published in 1945 by Marshall Hall, a different mathematician from Philip Hall.
Work it with n = 4 and two rows already filled:
Row 1: 1 2 3 4
Row 2: 2 3 4 1
For row 3, match columns to symbols each column has not used yet. Column 1 may take {3, 4}, column 2 {4, 1}, column 3 {1, 2}, column 4 {2, 3}.
Every column has exactly 2 options, and every symbol is missing from exactly 2 columns. So any group of k columns sends out 2k lines, and each symbol can absorb at most 2 of them, so the group reaches at least k symbols. Hall's condition holds, so a matching exists: row 3 is 3 4 1 2. Only one choice per column remains, so row 4 is 4 1 2 3. The same counting works for any r < n, so no Latin rectangle ever gets stuck: when every vertex on both sides has the same number of lines, a perfect matching always exists.
Where should you practise matching problems next?
Related graph ideas: see how Dirac's test decides whether a Hamiltonian cycle exists, why the three-utilities puzzle forces lines to cross, and how counting with a bijection pairs one set with another.
To practise, take a problem, draw the two sides, and test the smallest groups first. If you get stuck on why a step works, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer. For background on bipartite graphs and sets, the Fermi Concept Library gives each concept its own lesson and its place in the map.



