Stable matchings #
This module sets up the one-to-one two-sided matching model of [GS62]: n proposers
and n receivers, both indexed by Fin n, each with a strict and complete preference order over
the other side. A matching pairs proposer p with receiver μ p for a permutation μ, so every
matching is perfect. A pair (p, r) blocks μ when each strictly prefers the other to its partner
in μ; a matching is stable when no pair blocks it.
Preferences are permutations listing agents from most to least preferred: propPref p k is
proposer p's k-th choice, with rank 0 the favourite, and recvPref r k likewise. Ranks are
read off the inverse permutation (propRank, recvRank), so a smaller rank is better.
Main definitions #
Cslib.Algorithms.Lean.StableMatching.Instance: a two-sided market with strict complete preferences.Instance.IsBlockingPair,Instance.IsStable: blocking pairs and stability.Instance.swap: the market with the roles of the two sides exchanged.Instance.updatePropPref,Instance.updateRecvPref: one agent misreports its list.Instance.IsProposerOptimal,Instance.IsReceiverPessimal: a stable matching that every proposer weakly prefers to every other stable matching, and one that every receiver weakly dislikes relative to every other stable matching;Instance.IsReceiverOptimalandInstance.IsProposerPessimalare the same notions with the sides exchanged.Cslib.Algorithms.Lean.StableMatching.permOfInjective: a computable permutation from an injective self-map ofFin n, used for computed matchings and concrete preference lists.
Main results #
Instance.isStable_swap_iff:μ.symmis stable for the swapped market iffμis stable.Instance.recvRank_le_of_propRank_le,Instance.propRank_le_of_recvRank_le: opposing interests; if every proposer weakly prefersμto a stable matchingν, then every receiver weakly prefersνtoμ, and symmetrically.Instance.IsProposerOptimal.isReceiverPessimal,Instance.IsProposerOptimal.unique,Instance.isReceiverOptimal_iff_swap.
References #
A one-to-one two-sided market with n proposers and n receivers, both indexed by Fin n.
propPref p k is proposer p's k-th choice and recvPref r k is receiver r's k-th choice
(rank 0 is the most preferred). Preferences are strict and complete.
Proposer
p's preference list, from most to least preferred receiver.Receiver
r's preference list, from most to least preferred proposer.
A matching pairs proposer p with receiver μ p; μ.symm r is receiver r's partner.
A computable permutation from an injective self-map of Fin n. For a concrete map the
injectivity proof defaults to decide, so permOfInjective ![2, 0, 1] lists the agents 2, 0, 1
in order.
In a stable matching, a receiver that p strictly prefers to its partner strictly prefers its
own partner to p.
Exchanging the two sides #
The market with the roles of proposers and receivers exchanged.
Misreports #
The instance in which proposer p reports the list π and everyone else reports truthfully.
The instance in which receiver r reports the list π and everyone else reports truthfully.
A receiver's misreport is a proposer's misreport in the swapped market.
Optimal and pessimal stable matchings #
Opposing interests (see [GI89]): if every proposer weakly prefers μ to the
stable matching ν, then every receiver weakly prefers ν to μ.
The symmetric form: if every receiver weakly prefers μ to the stable matching ν, then every
proposer weakly prefers ν to μ.
There is at most one proposer-optimal stable matching.