MatchingMarket
structureimported Lean
A two-sided matching market. M and W are the two sides (e.g., men and women, hospitals and residents). Each agent has a preference over agents on the other side plus the option of being unmatched (none).
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in structure MatchingMarket (M W : Type*)
- Defined in
- EconCSLib, `MatchingMarket`
- Lean proof
- By xbei (from the file's git history), from github.com/gametheoryinlean/EconCSLib at
1a88f809b538(Copyright (c) 2026 EconCSLib contributors. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.30.0.MatchingMarket← MatchingMarket (EconCSLib/MarketDesign/Matching/Basic.lean:45): verbatim
- Verified
- 08 Oct 2026
- Axioms
- none listed
- Built on 2
- instCoeFunPrefForallForallPropinstCoeFunPrefForallForallProp
- PrefA bundled weak preference relation. Use this interface when several agents may rank the same outcome type differently. Use…
- Used by 16
- Matching.IsStableA matching is stable if it has no blocking pair. [MSZ 22.5]
- GS.prefM_strictGS.prefM_strict
- GS.StableMatching.gsStable_greatestThe GS output is the greatest stable matching in the men-preference order: every man weakly prefers his GS partner to his partner in…
- GS.stableMeet_isStableThe meet of two stable matchings is stable.
- Matching.IsBlockingA pair
(m, w)is a blocking pair for matchingμif bothmandwstrictly prefer each other to their current partners. [MSZ 22.5] - GS.StableMatching.gsStable_isGreatest
gsStableis the greatest element of the stable-matching lattice. - GS.daStep_NoAchievableRejectionInductive step (KEY LEMMA).
NoAchievableRejectionis preserved by onedaStep. Also threadsHoldInv(for the old-holder index… - Matching.IsIndividuallyRationalA matching is individually rational if every matched agent strictly prefers their partner to being unmatched.
- GS.StableMatching.gsStableThe men-proposing Gale–Shapley output, as an element of the lattice of stable matchings.
- GS.opposed_preferencesOpposed preferences. Let
μbe a stable matching. If manjis matched to womanwjunder another matchingνand **strictly… - GS.stableJoin_isStableThe join of two stable matchings is stable.
- GS.opposed_preferences_womenDual of
opposed_preferences: if womanistrictly prefers manmito hercandidate-manmi', thenmistrictly prefers his… - MatchingMarket.ofEquivDataBuild a
MatchingMarket (Fin n) (Fin n)from list-based preference data.some j ≻ some kiffjappears earlier in the list;noneis… - galeShapley_isStableGale-Shapley stability: the DA output has no blocking pair. The statement is in the *market* frame (
IsBlocking … (i : M) (j : W)).… - GS.stable_matching_perfectIn the balanced full-preference one-to-one market, every stable matching is perfect: every woman and every man is matched. This is the…
- GS.prefW_strictGS.prefW_strict
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in /-- A two-sided matching market. `M` and `W` are the two sides (e.g., men and women, hospitals and residents). Each agent has a preference over agents on the other side plus the option of being unmatched (`none`). -/ structure MatchingMarket (M W : Type*) where /-- Each agent on side `M` has a preference over `Option W`. -/ prefM : M → Pref (Option W) /-- Each agent on side `W` has a preference over `Option M`. -/ prefW : W → Pref (Option M)