Gale's top trading cycles #
This module implements Gale's top trading cycles algorithm (TTC) for the Shapley–Scarf housing
market ([SS74], where it is credited to David Gale) as a total, decide-evaluable
Lean function, and proves that its allocation is the unique allocation in the strict core
([RP77]; [SV07], Theorem 10.6, whose core is defined by weak blocking)
and the unique competitive allocation.
[Rou13], Lecture 9, Theorem 3.2, states that TTC is the unique core allocation for
a core defined by strict blocking (Instance.InCore). Only the existence half holds for that
notion (inCore_ttc): the test module CslibFrontierTests.HousingMarket exhibits a three-agent
market with a second allocation in the core, so uniqueness is stated for the strict core only.
While agents remain, every remaining agent points to the owner of its favourite remaining house,
topChoice R i. Each agent has one outgoing pointer, so the pointer graph has a cycle; the
agents on its cycles (cycleAgents R, the periodic points of topChoice R) receive the houses they
point to and leave with their houses. ttcRounds k R runs at most k such rounds starting from
the remaining agents R; every round removes at least one agent (card_sdiff_cycleAgents_lt), so
n rounds suffice and ttc is ttcRounds n univ. All cycles of a round are removed together, as
in [SV07], Definition 10.5; removing them one at a time yields the same allocation,
which is not stated here.
ttcPrice h is the number of agents present in the round in which house h leaves. These prices
decrease from round to round, every agent receives a house of the same price as its own, and at
these prices TTC is a competitive allocation (isCompetitive_ttc).
Main definitions #
Instance.topChoice: an agent's favourite house among the remaining ones.Instance.cycleAgents: the agents on cycles of the pointer map.Instance.ttcRounds,Instance.ttc: rounds of TTC and the TTC allocation.Instance.ttcPriceRounds,Instance.ttcPrice: the round size at which a house leaves.
Main results #
Instance.mem_cycleAgents,Instance.cycleAgents_nonempty: the agents removed in a round are the periodic points of the pointer map, and some agent is removed.Instance.inStrictCore_ttc,Instance.inCore_ttc,Instance.isIndividuallyRational_ttc,Instance.isParetoEfficient_ttc: the TTC allocation is in the strict core, hence in the core, individually rational and Pareto efficient.Instance.InStrictCore.eq_ttc,Instance.inStrictCore_iff: it is the only strict-core allocation ([RP77]).Instance.isCompetitive_ttc,Instance.exists_isCompetitive_iff: TTC is competitive at the pricesttcPrice, and it is the only allocation that is competitive at some prices ([SS74]; [RP77]).Instance.rank_ttcRounds_le_of_iterate: an agent reached along pointers from househreceives a house it weakly prefers toh; this drives strategy-proofness inCslibFrontier.Algorithms.Lean.HousingMarket.Incentives.
Cost model #
No running time is certified: ttcRounds recomputes cycles from scratch each round and is meant
for specification and kernel evaluation on small instances, not as an efficient implementation.
References #
Pointers and cycles #
At most k rounds of top trading cycles on the remaining agents R: each agent on a cycle of
the pointer map receives the house it points to, and the rest continue with the remaining
houses. Agents outside R keep their own houses.
An agent on a cycle points to an agent on a cycle.
No two agents on cycles point to the same house.
Every round removes some agent.
Rounds #
The top trading cycles allocation: n rounds of TTC starting from all agents.
The strict core #
An allocation that maps a finite set C into itself maps it onto itself, so it sends no agent
outside C into C.
The TTC allocation is in the strict core: no coalition weakly blocks it ([RP77]; [SV07], Theorem 10.6).
The TTC allocation is in the core ([SS74]; the existence half of
[Rou13], Lecture 9, Theorem 3.2). That theorem also claims uniqueness for this
strict-blocking core, which fails: see CslibFrontierTests.HousingMarket.
The TTC allocation is individually rational.
The TTC allocation is Pareto efficient.
The TTC allocation is the only allocation in the strict core ([RP77]; [SV07], Theorem 10.6).
The strict core consists of the TTC allocation alone. Uniqueness needs weak blocking: the
core, defined by strict blocking, can contain other allocations (see the test module
CslibFrontierTests.HousingMarket).
Following pointers #
An agent i reached from house h ∈ R by following pointers in R receives a house it weakly
prefers to h. In particular (m = 0) TTC is individually rational on every submarket.
Competitive prices #
A house leaving no earlier than agent i is still available to i when i receives its
house.
The TTC allocation is competitive at the TTC prices: every agent's house costs as much as its own, and it is the agent's favourite among the houses it can afford ([SS74]).
An allocation that is competitive at some prices, in any linear order, is the TTC allocation: competitive allocations are unique ([RP77]).
An allocation is competitive at some natural-number prices iff it is the TTC allocation.