Documentation

CslibFrontier.Algorithms.Lean.HousingMarket.Basic

Shapley–Scarf housing markets #

This module sets up the housing market of [SS74]: n agents, indexed by Fin n, each owning one indivisible house (agent i owns house i) and each with a strict and complete preference order over all n houses. An agent need not prefer its own house to the others. Preferences follow the conventions of Cslib.Algorithms.Lean.StableMatching: pref i k is agent i's k-th choice, with rank 0 the favourite, and rank i h is the rank of house h.

An allocation is a permutation μ giving house μ i to agent i; the identity is the initial endowment. A coalition S can reallocate only its own houses, so its feasible allocations are the permutations ν with ν i ∈ S for every i ∈ S (the set A(S) of [SV07], §10.3).

Two cooperative solution concepts are distinguished, following [RP77]:

[SV07], p. 255, asserts that the core and the strict core coincide when preferences are strict. With the definitions here they do not: a weakly blocking coalition may contain a member who keeps the house μ gave it, which need not be its own house, so it cannot always be dropped.

With strict preferences the strict core is a single allocation, computed by top trading cycles (Cslib.Algorithms.Lean.HousingMarket.Instance.inStrictCore_iff). The core can be strictly larger; the test module CslibFrontierTests.HousingMarket exhibits a three-agent market with an allocation in the core but not in the strict core.

An allocation μ is competitive at prices p when every agent can afford its house (p (μ i) ≤ p i: the price of its new house is at most the price of the house it sells) and prefers it to every house it can afford. Competitive allocations lie in the strict core (IsCompetitive.inStrictCore), using budget balance: since μ permutes the houses, no agent pays less than it receives.

Main definitions #

Main results #

References #

A Shapley–Scarf housing market with n agents and n houses, both indexed by Fin n; agent i initially owns house i. pref i k is agent i's k-th choice of house (rank 0 is the most preferred). Preferences are strict and complete.

  • pref : Fin n → Equiv.Perm (Fin n)

    Agent i's preference list over houses, from most to least preferred.

@[reducible, inline]

An allocation gives house μ i to agent i. The identity is the initial endowment.

The rank of house h in agent i's list (0 is the favourite).

@[simp]
theorem Cslib.Algorithms.Lean.HousingMarket.Instance.rank_pref {n : ℕ} (I : Instance n) (i k : Fin n) :
I.rank i ((I.pref i) k) = k
@[simp]
theorem Cslib.Algorithms.Lean.HousingMarket.Instance.pref_rank {n : ℕ} (I : Instance n) (i h : Fin n) :
(I.pref i) (I.rank i h) = h

Blocking coalitions and the core #

Coalition S blocks μ: S is nonempty and some reallocation ν of the houses of S among the members of S gives every member a house it strictly prefers to its house in μ.

Instances For

    Coalition S weakly blocks μ: some reallocation ν of the houses of S among the members of S gives every member a house it weakly prefers to its house in μ, and some member a house it strictly prefers.

    Instances For

      μ is in the core: no coalition blocks it.

      Instances For

        μ is in the strict core: no coalition weakly blocks it.

        Instances For

          μ is individually rational: every agent weakly prefers its house to its own.

          Instances For

            μ is Pareto efficient: no allocation makes every agent weakly better off and some agent strictly better off.

            Instances For
              @[instance_reducible]

              The strict core is contained in the core.

              Strict-core allocations are individually rational: otherwise an agent blocks alone by keeping its own house.

              Strict-core allocations are Pareto efficient: otherwise the grand coalition weakly blocks.

              Competitive allocations #

              μ is competitive at prices p: every agent i can afford its house, p (μ i) ≤ p i, and weakly prefers it to every house h it can afford, p h ≤ p i. Prices take values in any linear order.

              Instances For
                @[instance_reducible]
                theorem Cslib.Algorithms.Lean.HousingMarket.Instance.IsCompetitive.price_apply {n : ℕ} {I : Instance n} {α : Type u_1} [LinearOrder α] {μ : Allocation n} {p : Fin n → α} (h : I.IsCompetitive μ p) (i : Fin n) :
                p (μ i) = p i

                Budget balance: at competitive prices every agent pays exactly the price of its own house, because the allocation is a permutation.

                Competitive allocations lie in the strict core ([RP77]). In a weakly blocking coalition nobody trades down in price, and some member trades up to a house it could not afford; following the reallocation around that member's cycle gives a contradiction.