Stable matchings exist (Gale-Shapley)
ProvedAGT.stable_matching_existsEvery marriage market has a stable matching — Gale–Shapley, rendered from Theorem 10.10 of Algorithmic Game Theory. For finite sets of men and women with strict preferences over the opposite side and (the hypothesis , which the book arranges by dummy partners), some bijection admits no blocking pair: no man and woman both prefer each other to their assigned partners.
A note on the rendering. The book's Theorem 10.10 states that the male-propose Deferred Acceptance Algorithm terminates in a stable matching; the algorithm is the book's proof device, and this milestone asserts its existence content. A solver may formalize deferred acceptance and its termination, or reach existence by any other route — the fixed-point formulation the book sketches as Theorem 10.14 (via Tarski), for instance.
import Definitions.Def_agt_matching
namespace AGT
/-- A stable matching always exists (Gale–Shapley; Theorem 10.10 of
*Algorithmic Game Theory* — the book obtains it as the terminal state of
the male-propose Deferred Acceptance Algorithm). The hypothesis
`Nonempty (M ≃ W)` is the book's standing convention `|M| = |W|`, arranged
there by dummy partners; with no bijection at all there are no matchings
to speak of. -/
theorem stable_matching_exists {M W : Type*} [Fintype M] [Fintype W]
(PM : M → W → W → Prop) (PW : W → M → M → Prop)
(hM : IsPrefProfile PM) (hW : IsPrefProfile PW)
(hcard : Nonempty (M ≃ W)) :
∃ μ : M ≃ W, IsStableMatching PM PW μ := by
sorry
end AGTRead-back
What the Lean code literally says, in plain math · claude-fable-5
Read-back: stable_matching_exists
Setting and hypotheses. Let and be two finite types (both carry Fintype instances; either or both may be empty). The data are:
- , assigning to each a binary relation on (write when the relation holds of the ordered pair );
- , assigning to each a binary relation on ;
- hypothesis : for every , the relation is a strict total order on — that is, trichotomous (, or or ), irreflexive, and transitive;
- hypothesis : symmetrically, for every , is a strict total order on ;
- hypothesis : the type of bijections is nonempty — i.e. there merely exists some bijection between and (a Lean
Equivis a function with a two-sided inverse; the hypothesis provides no particular one). Since and are finite, this is equivalent to .
Conclusion. There exists a bijection such that no pair blocks it, i.e.
where is the inverse of . In words: there is no man–woman pair such that 's relation holds of (, 's partner ) and 's relation holds of (, 's partner ). This unfolds the custom predicate IsStableMatching (which is exactly the "no blocking pair" condition above, and nothing more: no individual-rationality clause, no unmatched agents — matches everyone).
Edge cases. If and are both empty, holds (the empty bijection exists), the stability condition is vacuous, and the conclusion holds trivially. If exactly one of is empty, is false and the theorem is vacuously true for that instance. The theorem asserts mere existence (, not ): nothing is claimed about uniqueness or about any particular construction.
Confirmed by the mission captain (proposal self-audit).