AFTD Auto-Formalizing Theoretical Domains

GS.stableMeet_isStable

theoremverifiedformalizationimported Lean

The meet 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.stableMeet_isStable :
    Matching.IsStable (MatchingMarket.ofEquivData w m) (stableMeet μ ν hμ hν)
Formalizes
EconCSLib, `GS.stableMeet_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.
Verified
08 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 23
  • GS.mPartnerThe man partnered to woman i under a stable matching μ.
  • Matching.IsStableA matching is stable if it has no blocking pair. [MSZ 22.5]
  • GS.prefM_strictGS.prefM_strict
  • GS.stableMeetThe meet μ ∧ ν: each woman keeps her more-preferred man; each man keeps his less-preferred woman.
  • GS.stableMeet_matchMGS.stableMeet_matchM
  • Matching.IsBlockingA pair (m, w) is a blocking pair for matching μ if both m and w strictly prefer each other to their current partners. [MSZ 22.5]
  • GS.stableMeet_matchWGS.stableMeet_matchW
  • strictStrict preference derived from a weak preference relation.
  • MatchingA matching is a partial bijection between M and W. matchM i is the partner of i ∈ M (or none if unmatched). matchW j is the…
  • GS.meetMan_le_leftGS.meetMan_le_left
  • GS.matchM_mPartnerGS.matchM_mPartner
  • instCoeFunPrefForallForallPropinstCoeFunPrefForallForallProp
  • GS.meetMan_mem_womenGS.meetMan_mem_women
  • GS.matchW_wPartnerGS.matchW_wPartner
  • GS.meetManWoman i's more-preferred man across μ and ν.
  • GS.wPartnerThe woman partnered to man j under a stable matching μ (total, since a stable matching of the balanced market is perfect).
  • GS.PreferencesList-based preferences: prefs i is a full permutation of Fin n, ordered from most to least preferred.
  • MatchingMarketA two-sided matching market. M and W are the two sides (e.g., men and women, hospitals and residents). Each agent has a preference…
  • GS.meetEquivThe meet man-assignment packaged as an equivalence.
  • MatchingMarket.ofEquivDataBuild a MatchingMarket (Fin n) (Fin n) from list-based preference data. some j ≻ some k iff j appears earlier in the list; none is…
  • GS.meetMan_le_rightGS.meetMan_le_right
  • 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

Lean source view module on GitHub

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 meet of two stable matchings is stable. -/theorem GS.stableMeet_isStable :    Matching.IsStable (MatchingMarket.ofEquivData w m) (stableMeet μ ν hμ hν) := by  intro i j hblock  obtain ⟨hi, hj⟩ := hblock  rw [stableMeet_matchM] at hi  rw [stableMeet_matchW] at hj  set jw := (meetEquiv μ ν hμ hν).symm j with hjwdef  have hi' : (w.prefs i).idxOf j < (w.prefs i).idxOf (meetMan μ ν hμ hν i) := prefM_strict.mp hi  have hj' : (m.prefs j).idxOf i < (m.prefs j).idxOf jw := prefW_strict.mp hj  have hmeet_jw : meetMan μ ν hμ hν jw = j := (meetEquiv μ ν hμ hν).apply_symm_apply j  rcases meetMan_mem_women μ ν hμ hν hmeet_jw with hm | hn  · -- `jw` is `j`'s `μ`-woman, so `(i, j)` blocks `μ`.    refine hμ i j ⟨?_, ?_⟩    · rw [matchM_mPartner μ hμ i]      exact prefM_strict.mpr (lt_of_lt_of_le hi' (meetMan_le_left μ ν hμ hν i))    · rw [matchW_wPartner μ hμ j, hm]; exact prefW_strict.mpr hj'  · -- `jw` is `j`'s `ν`-woman, so `(i, j)` blocks `ν`.    refine hν i j ⟨?_, ?_⟩    · rw [matchM_mPartner ν hν i]      exact prefM_strict.mpr (lt_of_lt_of_le hi' (meetMan_le_right μ ν hμ hν i))    · rw [matchW_wPartner ν hν j, hn]; exact prefW_strict.mpr hj'
See it in the graphDiscuss this resultChallenge it