Gale–Shapley terminates within n² rounds
ProvedStableMatching.galeShapley_all_engagedgale-shapleystable-matching
For every instance with men and women, after rounds of the Gale–Shapley algorithm every man is engaged (to some woman).
Preamble
import Mathlib import Definitions.Def_StableMatching_GaleShapley
Formal statement
namespace StableMatching
theorem galeShapley_all_engaged {n : ℕ} (I : Instance n) :
∀ m : Fin n, (I.gsRun (n ^ 2)).IsEngaged m := 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.