GS.stableJoin_isStable
theoremverifiedformalizationimported Lean
The join of two stable matchings is stable.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in open GS in variable {n : ℕ} (w m : Preferences n) in variable {w m} in variable (μ ν : Matching (Fin n) (Fin n)) (hμ : Matching.IsStable (MatchingMarket.ofEquivData w m) μ) (hν : Matching.IsStable (MatchingMarket.ofEquivData w m) ν) in theorem GS.stableJoin_isStable : Matching.IsStable (MatchingMarket.ofEquivData w m) (stableJoin μ ν hμ hν)
- Formalizes
- EconCSLib, `GS.stableJoin_isStable`
- 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.GS.stableJoin_isStable← GS.stableJoin_isStable (EconCSLib/MarketDesign/Matching/Lattice.lean:274): verbatim
- Verified
- 08 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 23
- GS.joinWoman_le_rightGS.joinWoman_le_right
- GS.joinWoman_mem_menIf
iis manj's join-partner thenjis one ofi's two men. - GS.mPartnerThe man partnered to woman
iunder a stable matchingμ. - Matching.IsStableA matching is stable if it has no blocking pair. [MSZ 22.5]
- GS.prefM_strictGS.prefM_strict
- GS.stableJoin_matchMGS.stableJoin_matchM
- Matching.IsBlockingA pair
(m, w)is a blocking pair for matchingμif bothmandwstrictly prefer each other to their current partners. [MSZ 22.5] - strictStrict preference derived from a weak preference relation.
- MatchingA matching is a partial bijection between
MandW.matchM iis the partner ofi ∈ M(ornoneif unmatched).matchW jis the… - GS.matchM_mPartnerGS.matchM_mPartner
- instCoeFunPrefForallForallPropinstCoeFunPrefForallForallProp
- GS.matchW_wPartnerGS.matchW_wPartner
- GS.stableJoinThe join
μ ∨ ν: each man keeps his more-preferred of the two partners; each woman keeps her less-preferred man. - GS.joinWoman_le_leftGS.joinWoman_le_left
- GS.stableJoin_matchWGS.stableJoin_matchW
- GS.wPartnerThe woman partnered to man
junder a stable matchingμ(total, since a stable matching of the balanced market is perfect). - GS.joinEquivThe join woman-assignment packaged as an equivalence (injective on the finite
Fin n, hence bijective). - GS.PreferencesList-based preferences:
prefs iis a full permutation ofFin n, ordered from most to least preferred. - MatchingMarketA two-sided matching market.
MandWare the two sides (e.g., men and women, hospitals and residents). Each agent has a preference… - MatchingMarket.ofEquivDataBuild a
MatchingMarket (Fin n) (Fin n)from list-based preference data.some j ≻ some kiffjappears earlier in the list;noneis… - GS.joinWomanMan
j's more-preferred partner across stable matchingsμandν. - GS.prefW_strictGS.prefW_strict
- PrefA bundled weak preference relation. Use this interface when several agents may rank the same outcome type differently. Use…
- Used by 2
- GS.wPartner_stableJoinGS.wPartner_stableJoin
- GS.StableMatching.instLatticeConway–Knuth lattice. The stable matchings of a one-to-one market form a lattice under the men-preference order: the join gives every…
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
set_option autoImplicit true inset_option relaxedAutoImplicit true inopen GS invariable {n : ℕ} (w m : Preferences n) invariable {w m} invariable (μ ν : Matching (Fin n) (Fin n)) (hμ : Matching.IsStable (MatchingMarket.ofEquivData w m) μ) (hν : Matching.IsStable (MatchingMarket.ofEquivData w m) ν) in/-- The join of two stable matchings is stable. -/theorem GS.stableJoin_isStable : Matching.IsStable (MatchingMarket.ofEquivData w m) (stableJoin μ ν hμ hν) := by intro i j hblock obtain ⟨hi, hj⟩ := hblock rw [stableJoin_matchM] at hi rw [stableJoin_matchW] at hj set jm := (joinEquiv μ ν hμ hν).symm i with hjmdef have hi' : (w.prefs i).idxOf j < (w.prefs i).idxOf jm := prefM_strict.mp hi have hj' : (m.prefs j).idxOf i < (m.prefs j).idxOf (joinWoman μ ν hμ hν j) := prefW_strict.mp hj have hjoin_jm : joinWoman μ ν hμ hν jm = i := (joinEquiv μ ν hμ hν).apply_symm_apply i rcases joinWoman_mem_men μ ν hμ hν hjoin_jm with hm | hn · -- `jm` is `i`'s `μ`-man, so `(i, j)` blocks `μ`. refine hμ i j ⟨?_, ?_⟩ · rw [matchM_mPartner μ hμ i, hm]; exact prefM_strict.mpr hi' · rw [matchW_wPartner μ hμ j] exact prefW_strict.mpr (lt_of_lt_of_le hj' (joinWoman_le_left μ ν hμ hν j)) · -- `jm` is `i`'s `ν`-man, so `(i, j)` blocks `ν`. refine hν i j ⟨?_, ?_⟩ · rw [matchM_mPartner ν hν i, hn]; exact prefM_strict.mpr hi' · rw [matchW_wPartner ν hν j] exact prefW_strict.mpr (lt_of_lt_of_le hj' (joinWoman_le_right μ ν hμ hν j))