Documentation

EconCSLib.MarketDesign.Matching.Optimal

EconCSLib.MarketDesign.Matching.Optimal #

Men-optimal property of the men-proposing Gale–Shapley deferred-acceptance algorithm: every man's GS partner is at least as preferred (by him) as his partner in any other stable matching.

This is the proposer-side dominance result. The dual receiver-side pessimality result belongs with the lattice and Rural-Hospitals developments.

Main theorem #

Proof strategy (Gale–Shapley 1962 / Gusfield–Irving 1989) #

The standard achievable-partner argument. A pair (j, wj) is achievable if some stable matching pairs them (IsAchievable). The heart of the proof is the no-achievable-rejection invariant on the GS run state:

j wj, IsAchievable j wj →
  (m.prefs j).idxOf wj < s.nextChoice js.holding wj = some j

— informally: "if man j has already proposed to woman wj and wj is achievable for him, then wj is currently holding j." Equivalently, no man has been rejected by any of his achievable partners.

Once this invariant holds at finalState, the main theorem follows mechanically: j's GS partner is in his proposed-prefix (by HoldInv), and any other achievable partner must either also be in the prefix (and then by injectivity = the GS partner), or lie strictly past the prefix (so it's a worse rank).

The inductive step daStep_NoAchievableRejection is the deep core (now proved): if at daStep man q displaces man j at woman wj (i.e., wj was holding j and switches to q), and wj is achievable for j via stable matching μ, then (q, wj) blocks μ — because the run invariant for s forces q to be free and to not yet have proposed past any of his μ-achievable partners, hence q strictly prefers wj over his μ-partner. The invariant carries HoldInv and holding-injectivity alongside (both preserved by daStep).

References #

Achievability #

def GS.IsAchievable {n : } (w m : Preferences n) (j wj : Fin n) :

IsAchievable w m j wj says woman wj is achievable for man j: some stable matching pairs them. Recall the codebase convention MatchingMarket M W with M = women, W = men; man j's partner under μ is μ.matchW j.

Equations
Instances For
    theorem GS.gs_partner_isAchievable {n : } [NeZero n] (w m : Preferences n) (j : Fin n) :
    IsAchievable w m j ((Equiv.ofBijective (gs w m) ).symm j)

    The GS output itself witnesses that gs.symm j is achievable for j.

    Run-state invariant: no rejection by an achievable partner #

    def GS.NoAchievableRejection {n : } (w m : Preferences n) (s : DAState n) :

    Run-state invariant for proposer optimality.

    NoAchievableRejection w m s says: at state s, for every achievable pair (j, wj), if man j has already proposed to wj (i.e. idxOf wj < nextChoice j), then wj is currently holding j. Contrapositively, j has not been rejected by wj.

    Equations
    Instances For

      The invariant holds vacuously at initState: no man has proposed yet.

      theorem GS.daStep_NoAchievableRejection {n : } [NeZero n] (w m : Preferences n) (s : DAState n) (hhold : HoldInv m s) (hinj : ∀ (j1 j2 i : Fin n), s.holding j1 = some is.holding j2 = some ij1 = j2) (hinv : NoAchievableRejection w m s) :

      Inductive step (KEY LEMMA). NoAchievableRejection is preserved by one daStep. Also threads HoldInv (for the old-holder index bound) and holding-injectivity (a man is held by at most one woman).

      Proof: reduce (daStep).holding wj to its match and split on whether j had already proposed to wj before this round (hinv then pins s.holding wj = some j) or proposes exactly now (jpl wj). In every branch where some hj ends up holding wj, the local build_block helper produces a blocking pair (h, wj) for the achievability witness μ:

      A blocking pair contradicts μ's stability, so no such displacement occurs: wj keeps/takes j, and the invariant is preserved.

      theorem GS.daRun_NoAchievableRejection {n : } [NeZero n] (w m : Preferences n) (fuel : ) (s : DAState n) (hhold : HoldInv m s) (hinj : ∀ (j1 j2 i : Fin n), s.holding j1 = some is.holding j2 = some ij1 = j2) (hinv : NoAchievableRejection w m s) :
      NoAchievableRejection w m (daRun w m fuel s)

      NoAchievableRejection is preserved by daRun (threading HoldInv and holding-injectivity, both also preserved by daStep).

      The invariant holds at finalState.

      Main theorem #

      theorem GS.galeShapley_isProposingOptimal {n : } [NeZero n] (w m : Preferences n) (μ : Matching (Fin n) (Fin n)) ( : Matching.IsStable (MatchingMarket.ofEquivData w m) μ) (j wj : Fin n) :
      μ.matchW j = some wjList.idxOf ((Equiv.ofBijective (gs w m) ).symm j) (m.prefs j) List.idxOf wj (m.prefs j)

      Men-optimal stable matching (Gale–Shapley 1962, [MSZ 22.10]): in the men-proposing DA, every man's GS partner is at least as preferred (by him) as his partner under any other stable matching μ.

      Equivalently: for any stable μ pairing man j with woman wj, the GS output's matching of j is ranked at most as high (i.e., as good or better) as wj in m.prefs j.