Documentation

CslibFrontier.Algorithms.Lean.StableMatching.Incomplete.Basic

Stable matchings with incomplete preference lists #

This module sets up the one-to-one two-sided matching model with unacceptable partners (the marriage model of [RS90], Chapter 2): m proposers indexed by Fin m and n receivers indexed by Fin n, the two sides possibly of different sizes. Each agent lists the agents of the other side that it finds acceptable, from most to least preferred; an agent prefers every acceptable partner to staying unmatched, and staying unmatched to every unacceptable partner. A matching is partial: a partial bijection Fin m ≃. Fin n, under which an agent may be unmatched.

A matching is individually rational when every matched agent finds its partner acceptable. A pair (p, r) blocks it when each strictly prefers the other to its outcome in the matching (being unmatched included); a matching is stable when it is individually rational and has no blocking pair. Gusfield and Irving treat this setting as stable marriage with incomplete lists ([GI89], Section 1.4; locator from secondary sources, unverified).

Preferences are lists propPref p : List (Fin n) and recvPref r : List (Fin m). An outcome o : Option (Fin n) of proposer p has rank propRank p o: the position of the receiver in p's list, and the length of the list for none or an unlisted receiver. A smaller rank is better, so every acceptable receiver beats being unmatched. Ranks use the first occurrence of an agent in a list, so a list with repetitions is equivalent to the list with them removed.

The complete-list model Instance n of CslibFrontier.Algorithms.Lean.StableMatching.Basic is the special case of equal sides and complete lists (see CslibFrontier.Algorithms.Lean.StableMatching.Incomplete.Complete).

Main definitions #

Main results #

References #

A one-to-one two-sided market with m proposers and n receivers whose preference lists may be incomplete. propPref p lists the receivers acceptable to proposer p, from most to least preferred, and recvPref r lists the proposers acceptable to receiver r. An agent that does not appear in a list is unacceptable: the list's owner prefers staying unmatched to it.

  • propPref : Fin m → List (Fin n)

    Proposer p's acceptable receivers, from most to least preferred.

  • recvPref : Fin n → List (Fin m)

    Receiver r's acceptable proposers, from most to least preferred.

@[reducible, inline]

A matching that may leave agents unmatched: proposer p is matched to receiver r when μ p = some r (equivalently μ.symm r = some p), and unmatched when μ p = none.

The receivers matched by μ are the partners of the proposers matched by μ.

def Cslib.Algorithms.Lean.StableMatching.PartialMatching.ofInjOn {m n : ℕ} (f : Fin m → Option (Fin n)) (hf : ∀ (p q : Fin m) (r : Fin n), f p = some r → f q = some r → p = q) :

A computable partial matching from a partial map f that is injective on its domain (the proposers where f is some): the inverse of receiver r is the first proposer that f sends to r.

@[simp]
theorem Cslib.Algorithms.Lean.StableMatching.PartialMatching.ofInjOn_apply {m n : ℕ} (f : Fin m → Option (Fin n)) (hf : ∀ (p q : Fin m) (r : Fin n), f p = some r → f q = some r → p = q) (p : Fin m) :
(ofInjOn f hf) p = f p

The rank of outcome o for proposer p: the position of the receiver in p's list, and the length of the list when o = none or the receiver is unacceptable. A smaller rank is better.

The rank of outcome o for receiver r: the position of the proposer in r's list, and the length of the list when o = none or the proposer is unacceptable. A smaller rank is better.

Every outcome is ranked no worse than being unmatched.

Every outcome is ranked no worse than being unmatched.

Proposer p strictly prefers receiver r to being unmatched exactly when r is on its list.

Receiver r strictly prefers proposer p to being unmatched exactly when p is on its list.

theorem Cslib.Algorithms.Lean.StableMatching.IncompleteInstance.eq_of_propRank_eq {m n : ℕ} (I : IncompleteInstance m n) {p : Fin m} {r : Fin n} (hr : r ∈ I.propPref p) {o : Option (Fin n)} (h : I.propRank p (some r) = I.propRank p o) :
o = some r

Ranks are strict on acceptable outcomes: an acceptable receiver has the same rank as an outcome only if the outcome is that receiver.

theorem Cslib.Algorithms.Lean.StableMatching.IncompleteInstance.eq_of_recvRank_eq {m n : ℕ} (I : IncompleteInstance m n) {r : Fin n} {p : Fin m} (hp : p ∈ I.recvPref r) {o : Option (Fin m)} (h : I.recvRank r (some p) = I.recvRank r o) :
o = some p

Ranks are strict on acceptable outcomes: an acceptable proposer has the same rank as an outcome only if the outcome is that proposer.

Stability #

A matching is individually rational when every matched agent finds its partner acceptable.

Instances For

    The pair (p, r) blocks μ when p strictly prefers r to its outcome in μ and r strictly prefers p to its outcome in μ. Since being unmatched is ranked below every acceptable partner, p and r then find each other acceptable.

    Instances For

      A matching is stable when it is individually rational and no pair blocks it.

      Instances For

        In a blocking pair, the receiver finds the proposer acceptable.

        In a blocking pair, the proposer finds the receiver acceptable.

        Exchanging the two sides #

        The market with the roles of proposers and receivers exchanged.

        μ.symm is stable for the swapped market exactly when μ is stable.

        Optimal and pessimal stable matchings #

        A stable matching that every proposer weakly prefers to every stable matching.

        A stable matching that every proposer weakly dislikes relative to every stable matching.

        A stable matching that every receiver weakly prefers to every stable matching.

        A stable matching that every receiver weakly dislikes relative to every stable matching.

        theorem Cslib.Algorithms.Lean.StableMatching.IncompleteInstance.recvRank_le_of_propRank_le {m n : ℕ} (I : IncompleteInstance m n) {μ ν : PartialMatching m n} (hμ : I.IsIndividuallyRational μ) (hν : I.IsStable ν) (h : ∀ (p : Fin m), I.propRank p (μ p) ≤ I.propRank p (ν p)) (r : Fin n) :
        I.recvRank r ((PEquiv.symm ν) r) ≤ I.recvRank r ((PEquiv.symm μ) r)

        Opposing interests (a form of [RS90], Theorem 2.13, which Roth and Sotomayor attribute to Knuth): if every proposer weakly prefers the individually rational matching μ to the stable matching ν, then every receiver weakly prefers ν to μ.

        theorem Cslib.Algorithms.Lean.StableMatching.IncompleteInstance.propRank_le_of_recvRank_le {m n : ℕ} (I : IncompleteInstance m n) {μ ν : PartialMatching m n} (hμ : I.IsIndividuallyRational μ) (hν : I.IsStable ν) (h : ∀ (r : Fin n), I.recvRank r ((PEquiv.symm μ) r) ≤ I.recvRank r ((PEquiv.symm ν) r)) (p : Fin m) :
        I.propRank p (ν p) ≤ I.propRank p (μ p)

        The symmetric form: if every receiver weakly prefers the individually rational matching μ to the stable matching ν, then every proposer weakly prefers ν to μ.

        Two individually rational matchings that give proposer p outcomes of the same rank give it the same outcome.

        There is at most one proposer-optimal stable matching.