The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V30. Combinatorics

Mathlib.Combinatorics.Hall.Finite

7 declarations. Mathlib docs · Source

Hall's Marriage Theorem for finite index types

This module proves the basic form of Hall's theorem. In contrast to the theorem described in Combinatorics.Hall.Basic, this version requires that the indexed family t : ι → Finset α have ι be finite. The Combinatorics.Hall.Basic module applies a compactness argument to this version to remove the Finite constraint on ι.

The modules are split like this since the generalized statement depends on the topology and category theory libraries, but the finite case in this module has few dependencies.

A description of this formalization is in [Gusakov2021].

Main statements

  • Finset.all_card_le_biUnion_card_iff_existsInjective' is Hall's theorem with a finite index set. This is elsewhere generalized to Finset.all_card_le_biUnion_card_iff_existsInjective.

Tags

Hall's Marriage Theorem, indexed families

theorem HallMarriageTheorem.hall_cond_of_erase E1 #

∀ {ι : Type u} {α : Type v} [inst : DecidableEq α] {t : ι → Finset α} [inst_1 : Fintype ι] {x : ι} (a : α),
  (∀ (s : Finset ι), s.Nonempty → s ≠ Finset.univ → s.card < (s.biUnion t).card) →
    ∀ (s' : Finset ↑{x' | x' ≠ x}), s'.card ≤ (s'.biUnion fun x' ↦ (t ↑x').erase a).card

theorem HallMarriageTheorem.hall_hard_inductive_step_A E1 #

∀ {ι : Type u} {α : Type v} [inst : DecidableEq α] {t : ι → Finset α} [inst_1 : Fintype ι] {n : ℕ},
  Fintype.card ι = n + 1 →
    (∀ (s : Finset ι), s.card ≤ (s.biUnion t).card) →
      (∀ {ι' : Type u} [inst_2 : Fintype ι'] (t' : ι' → Finset α),
          Fintype.card ι' ≤ n →
            (∀ (s' : Finset ι'), s'.card ≤ (s'.biUnion t').card) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x) →
        (∀ (s : Finset ι), s.Nonempty → s ≠ Finset.univ → s.card < (s.biUnion t).card) →
          ∃ f, Function.Injective f ∧ ∀ (x : ι), f x ∈ t x

First case of the inductive step: assuming that ∀ (s : Finset ι), s.Nonempty → s ≠ univ → #s < #(s.biUnion t) 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.

theorem HallMarriageTheorem.hall_cond_of_restrict E1 #

∀ {α : Type v} [inst : DecidableEq α] {ι : Type u} {t : ι → Finset α} {s : Finset ι},
  (∀ (s : Finset ι), s.card ≤ (s.biUnion t).card) → ∀ (s' : Finset ↑↑s), s'.card ≤ (s'.biUnion fun a' ↦ t ↑a').card

theorem HallMarriageTheorem.hall_cond_of_compl E1 #

∀ {α : Type v} [inst : DecidableEq α] {ι : Type u} {t : ι → Finset α} {s : Finset ι},
  s.card = (s.biUnion t).card →
    (∀ (s : Finset ι), s.card ≤ (s.biUnion t).card) →
      ∀ (s' : Finset ↑(↑s)ᶜ), s'.card ≤ (s'.biUnion fun x' ↦ t ↑x' \ s.biUnion t).card

theorem HallMarriageTheorem.hall_hard_inductive_step_B E1 #

∀ {ι : Type u} {α : Type v} [inst : DecidableEq α] {t : ι → Finset α} [inst_1 : Fintype ι] {n : ℕ},
  Fintype.card ι = n + 1 →
    (∀ (s : Finset ι), s.card ≤ (s.biUnion t).card) →
      (∀ {ι' : Type u} [inst_2 : Fintype ι'] (t' : ι' → Finset α),
          Fintype.card ι' ≤ n →
            (∀ (s' : Finset ι'), s'.card ≤ (s'.biUnion t').card) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x) →
        ∀ (s : Finset ι),
          s.Nonempty → s ≠ Finset.univ → s.card = (s.biUnion t).card → ∃ f, Function.Injective f ∧ ∀ (x : ι), f x ∈ t x

Second case of the inductive step: assuming that ∃ (s : Finset ι), s ≠ univ → #s = #(s.biUnion t) 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.

theorem HallMarriageTheorem.hall_hard_inductive E1 #

∀ {ι : Type u} {α : Type v} [inst : DecidableEq α] {t : ι → Finset α} [Finite ι],
  (∀ (s : Finset ι), s.card ≤ (s.biUnion t).card) → ∃ f, Function.Injective f ∧ ∀ (x : ι), f x ∈ t x

Here we combine the two inductive steps into a full strong induction proof, completing the proof the harder direction of Hall's Marriage Theorem.

theorem Finset.all_card_le_biUnion_card_iff_existsInjective' E3 #

∀ {ι : Type u_1} {α : Type u_2} [Finite ι] [inst : DecidableEq α] (t : ι → Finset α),
  (∀ (s : Finset ι), s.card ≤ (s.biUnion t).card) ↔ ∃ f, Function.Injective f ∧ ∀ (x : ι), f x ∈ t x

This is the version of Hall's Marriage Theorem in terms of indexed families of finite sets t : ι → Finset α with ι finite. 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.

See Finset.all_card_le_biUnion_card_iff_exists_injective for a version where the Finite ι constraint is removed.