Hall's Marriage Theorem #
Given a list of finite subsets $X_1,X_2,\dots,X_n$ of some given set $S$, Hall in [Hal35] gave a necessary and sufficient condition for there to be a list of distinct elements $x_1,x_2,\dots,x_n$ with $x_i\in X_i$ for each $i$: it is when for each $k$, the union of every $k$ of these subsets has at least $k$ elements.
This file proves this for an indexed family t : ι → finset α
of
finite sets, with [fintype ι]
, along with some variants of the
statement. The list of distinct representatives is given by an
injective function f : ι → α
such that ∀ i, f i ∈ t i
.
A description of this formalization is in [GMM].
Main statements #
finset.all_card_le_bUnion_card_iff_exists_injective
is in terms oft : ι → finset α
.fintype.all_card_le_rel_image_card_iff_exists_injective
is in terms of a relationr : α → β → Prop
such thatrel.image r {a}
is a finite set for alla : α
.fintype.all_card_le_filter_rel_iff_exists_injective
is in terms of a relationr : α → β → Prop
on finite types, with the Hall condition given in terms offinset.univ.filter
.
Todo #
- The theorem is still true even if
ι
is not a finite type. The infinite case follows from a compactness argument. - The statement of the theorem in terms of bipartite graphs is in preparation.
Tags #
Hall's Marriage Theorem, indexed families
First case of the inductive step: assuming that
∀ (s : finset ι), s.nonempty → s ≠ univ → s.card < (s.bUnion t).card
and that the statement of Hall's Marriage Theorem is true for all
ι'
of cardinality ≤ n
, then it is true for ι
of cardinality n + 1
.
Second case of the inductive step: assuming that
∃ (s : finset ι), s ≠ univ → s.card = (s.bUnion t).card
and that the statement of Hall's Marriage Theorem is true for all
ι'
of cardinality ≤ n
, then it is true for ι
of cardinality n + 1
.
If ι
has cardinality n + 1
and the statement of Hall's Marriage Theorem
is true for all ι'
of cardinality ≤ n
, then it is true for ι
.
Here we combine the base case and the inductive step into a full strong induction proof, thus completing the proof of the second direction.
This the version of Hall's Marriage Theorem in terms of indexed
families of finite sets t : ι → finset α
. It states that there is a
set of distinct representatives if and only if every union of k
of the
sets has at least k
elements.
Recall that s.bUnion t
is the union of all the sets t i
for i ∈ s
.
Given a relation such that the image of every singleton set is finite, then the image of every finite set is finite.
Equations
- rel.image.fintype r A = _.mpr (finset_coe.fintype (A.bUnion (λ (a : α), (rel.image r {a}).to_finset)))
This is a version of Hall's Marriage Theorem in terms of a relation
between types α
and β
such that α
is finite and the image of
each x : α
is finite (it suffices for β
to be finite). There is
an injective function α → β
respecting the relation iff every subset of
k
terms of α
is related to at least k
terms of β
.
If [fintype β]
, then [∀ (a : α), fintype (rel.image r {a})]
is automatically implied.
This is a version of Hall's Marriage Theorem in terms of a relation between finite types.
There is an injective function α → β
respecting the relation iff every subset of
k
terms of α
is related to at least k
terms of β
.
It is like fintype.all_card_le_rel_image_card_iff_exists_injective
but uses finset.filter
rather than rel.image
.