Documentation

CslibFrontier.Algorithms.Lean.StableMatching.Lattice

The lattice of stable matchings #

For two stable matchings μ and ν, letting every proposer take the better of its two partners gives a stable matching propJoin, in which every receiver gets the worse of its two partners; letting every proposer take the worse partner gives a stable matching propMeet. This is the lattice theorem that [Knu76] attributes to J. H. Conway (see also [GI89]). We package it as a DistribLattice on the type Instance.Stable I of stable matchings, ordered so that μ ≤ ν when every proposer weakly prefers ν, with ⊤ the proposer-proposing and ⊥ the receiver-proposing deferred-acceptance matching.

Main definitions #

Main results #

References #

Each proposer takes the better of its partners in μ and ν (as a function; it is a matching when μ and ν are stable, see propJoin).

theorem Cslib.Algorithms.Lean.StableMatching.Instance.propRank_propBest {n : ℕ} (I : Instance n) (μ ν : Matching n) (p : Fin n) :
I.propRank p (I.propBest μ ν p) = min (I.propRank p (μ p)) (I.propRank p (ν p))
theorem Cslib.Algorithms.Lean.StableMatching.Instance.propBest_mem {n : ℕ} (I : Instance n) (μ ν : Matching n) (p : Fin n) :
I.propBest μ ν p = μ p ∨ I.propBest μ ν p = ν p

The proposer-wise best of two stable matchings is injective.

def Cslib.Algorithms.Lean.StableMatching.Instance.propJoin {n : ℕ} (I : Instance n) {μ ν : Matching n} (hμ : I.IsStable μ) (hν : I.IsStable ν) :

The proposer-wise best of two stable matchings: each proposer takes the partner it prefers.

theorem Cslib.Algorithms.Lean.StableMatching.Instance.propRank_propJoin {n : ℕ} {I : Instance n} {μ ν : Matching n} (hμ : I.IsStable μ) (hν : I.IsStable ν) (p : Fin n) :
I.propRank p ((I.propJoin hμ hν) p) = min (I.propRank p (μ p)) (I.propRank p (ν p))

In propJoin, every proposer gets the better of its two partners.

theorem Cslib.Algorithms.Lean.StableMatching.Instance.isStable_propJoin {n : ℕ} {I : Instance n} {μ ν : Matching n} (hμ : I.IsStable μ) (hν : I.IsStable ν) :
I.IsStable (I.propJoin hμ hν)

The proposer-wise best of two stable matchings is stable.

theorem Cslib.Algorithms.Lean.StableMatching.Instance.recvRank_propJoin {n : ℕ} {I : Instance n} {μ ν : Matching n} (hμ : I.IsStable μ) (hν : I.IsStable ν) (r : Fin n) :
I.recvRank r ((Equiv.symm (I.propJoin hμ hν)) r) = max (I.recvRank r ((Equiv.symm μ) r)) (I.recvRank r ((Equiv.symm ν) r))

In propJoin, every receiver gets the worse of its two partners.

def Cslib.Algorithms.Lean.StableMatching.Instance.propMeet {n : ℕ} (I : Instance n) {μ ν : Matching n} (hμ : I.IsStable μ) (hν : I.IsStable ν) :

The proposer-wise worst of two stable matchings: the receiver-wise best, computed in the swapped market.

theorem Cslib.Algorithms.Lean.StableMatching.Instance.isStable_propMeet {n : ℕ} {I : Instance n} {μ ν : Matching n} (hμ : I.IsStable μ) (hν : I.IsStable ν) :
I.IsStable (I.propMeet hμ hν)

The proposer-wise worst of two stable matchings is stable.

theorem Cslib.Algorithms.Lean.StableMatching.Instance.propRank_propMeet {n : ℕ} {I : Instance n} {μ ν : Matching n} (hμ : I.IsStable μ) (hν : I.IsStable ν) (p : Fin n) :
I.propRank p ((I.propMeet hμ hν) p) = max (I.propRank p (μ p)) (I.propRank p (ν p))

In propMeet, every proposer gets the worse of its two partners.

theorem Cslib.Algorithms.Lean.StableMatching.Instance.recvRank_propMeet {n : ℕ} {I : Instance n} {μ ν : Matching n} (hμ : I.IsStable μ) (hν : I.IsStable ν) (r : Fin n) :
I.recvRank r ((Equiv.symm (I.propMeet hμ hν)) r) = min (I.recvRank r ((Equiv.symm μ) r)) (I.recvRank r ((Equiv.symm ν) r))

In propMeet, every receiver gets the better of its two partners.

The stable matchings of I. They form a finite distributive lattice, ordered so that μ ≤ ν when every proposer weakly prefers its partner in ν (Stable.le_iff).

Instances For

    The proposers' ranks of their partners, in the order dual to Fin n (so that a better partner is larger). The order on I.Stable is pulled back along this injective map.

    @[simp]
    theorem Cslib.Algorithms.Lean.StableMatching.Instance.Stable.coe_sup {n : ℕ} {I : Instance n} (μ ν : I.Stable) :
    ↑(μ ⊔ ν) = I.propJoin ⋯ ⋯
    @[simp]
    theorem Cslib.Algorithms.Lean.StableMatching.Instance.Stable.coe_inf {n : ℕ} {I : Instance n} (μ ν : I.Stable) :
    ↑(μ ⊓ ν) = I.propMeet ⋯ ⋯
    theorem Cslib.Algorithms.Lean.StableMatching.Instance.Stable.le_iff {n : ℕ} {I : Instance n} {μ ν : I.Stable} :
    μ ≤ ν ↔ ∀ (p : Fin n), I.propRank p (↑ν p) ≤ I.propRank p (↑μ p)

    μ ≤ ν exactly when every proposer weakly prefers its partner in ν.

    @[instance_reducible]

    The lattice of stable matchings is distributive (Conway, reported in [Knu76]).

    @[simp]

    The top stable matching is proposer-proposing deferred acceptance.

    @[simp]

    The bottom stable matching is receiver-proposing deferred acceptance.