Gale–Shapley: the algorithm produces a stable matching
ProvedStableMatching.galeShapley_stablegale-shapleystable-matching
For every instance with men and women (strict preference lists), the Gale–Shapley (men-proposing deferred acceptance) algorithm is guaranteed to produce a stable matching: there is a bijection from men to women such that, after the algorithm's rounds, every man is engaged to , and has no blocking pair, i.e. there are no with preferring to and preferring to .
Preamble
import Mathlib import Definitions.Def_StableMatching_GaleShapley
Formal statement
namespace StableMatching
theorem galeShapley_stable {n : ℕ} (I : Instance n) :
∃ μ : Matching n, I.IsGSOutcome μ ∧ I.IsStable μ := by sorry
end StableMatching
Source
Wikipedia, "Stable matching problem" (https://en.wikipedia.org/wiki/Stable_matching_problem), sections "Stable matching problem" (introduction), "Different stable matchings" and "Algorithmic solution"; primary reference: D. Gale, L. S. Shapley, College Admissions and the Stability of Marriage, Amer. Math. Monthly 69 (1962) 9–14, doi:10.2307/2312726.
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.