Documentation

CslibFrontier.Algorithms.Lean.HousingMarket.SequentialCycles

Cycle-selection order independence of top trading cycles #

In each round on a nonempty remaining submarket R, Instance.ttc (TopTradingCycles.lean) removes all simultaneous top-trading cycles I.cycleAgents R at once, following [SV07], Definition 10.5. Standard presentations of Gale's top trading cycles algorithm ([SS74]; [Rou13], Lecture 9, §3) instead pick one directed cycle in each step, assign its members their pointed houses, remove them, and repeat.

This module proves that any cycle-selection rule (Instance.CycleSelector)—removing any nonempty topChoice-closed subset of I.cycleAgents R per step—computes an allocation in the strict core (CycleSelector.inStrictCore_ttc) and therefore produces the exact same allocation I.ttc (CycleSelector.ttc_eq_ttc). In particular, sequential single-cycle elimination (Instance.ttcSingleCycle, removing only the directed cycle of the smallest-indexed cycle agent at each step) equals I.ttc (Instance.ttcSingleCycle_eq_ttc).

Main definitions #

Main results #

References #

def Cslib.Algorithms.Lean.HousingMarket.Instance.cyclePerm {n : ℕ} (I : Instance n) {R C : Finset (Fin n)} (hC : C ⊆ I.cycleAgents R) (hclosed : ∀ a ∈ C, I.topChoice R a ∈ C) :

Reallocation that trades along a topChoice-closed subset C ⊆ I.cycleAgents R and fixes all agents outside C.

theorem Cslib.Algorithms.Lean.HousingMarket.Instance.cyclePerm_apply_of_mem {n : ℕ} (I : Instance n) {R C : Finset (Fin n)} (hC : C ⊆ I.cycleAgents R) (hclosed : ∀ a ∈ C, I.topChoice R a ∈ C) {a : Fin n} (ha : a ∈ C) :
(I.cyclePerm hC hclosed) a = I.topChoice R a
theorem Cslib.Algorithms.Lean.HousingMarket.Instance.cyclePerm_apply_of_notMem {n : ℕ} (I : Instance n) {R C : Finset (Fin n)} (hC : C ⊆ I.cycleAgents R) (hclosed : ∀ a ∈ C, I.topChoice R a ∈ C) {a : Fin n} (ha : a ∉ C) :
(I.cyclePerm hC hclosed) a = a

A rule selecting, in every nonempty remaining submarket R, a nonempty subset of I.cycleAgents R closed under I.topChoice R (for example, a single directed cycle or all simultaneous cycles).

At most k steps of TTC driven by sel on remaining submarket R.

theorem Cslib.Algorithms.Lean.HousingMarket.Instance.CycleSelector.ttcRounds_succ_of_mem {n : ℕ} {I : Instance n} (sel : I.CycleSelector) {k : ℕ} {R : Finset (Fin n)} (hR : R.Nonempty) {i : Fin n} (hi : i ∈ sel.select R) :
sel.ttcRounds (k + 1) R i = I.topChoice R i
theorem Cslib.Algorithms.Lean.HousingMarket.Instance.CycleSelector.ttcRounds_succ_of_notMem {n : ℕ} {I : Instance n} (sel : I.CycleSelector) {k : ℕ} {R : Finset (Fin n)} (hR : R.Nonempty) {i : Fin n} (hi : i ∉ sel.select R) :
sel.ttcRounds (k + 1) R i = sel.ttcRounds k (R \ sel.select R) i
theorem Cslib.Algorithms.Lean.HousingMarket.Instance.CycleSelector.ttcRounds_of_notMem {n : ℕ} {I : Instance n} (sel : I.CycleSelector) {k : ℕ} {R : Finset (Fin n)} {i : Fin n} (hi : i ∉ R) :
sel.ttcRounds k R i = i
theorem Cslib.Algorithms.Lean.HousingMarket.Instance.CycleSelector.ttcRounds_mem {n : ℕ} {I : Instance n} (sel : I.CycleSelector) {k : ℕ} {R : Finset (Fin n)} (hk : R.card ≤ k) {i : Fin n} (hi : i ∈ R) :
sel.ttcRounds k R i ∈ R

The full allocation computed by n steps of sel starting from Finset.univ.

Any CycleSelector execution produces an allocation in the strict core.

Cycle-selection order independence of TTC: any CycleSelector execution yields the unique strict-core allocation I.ttc.

Directed single-cycle orbits and canonical single-cycle TTC #

The directed topChoice R-orbit of i₀ within n steps. When i₀ ∈ I.cycleAgents R, this is the unique directed top-trading cycle through i₀ in submarket R.

theorem Cslib.Algorithms.Lean.HousingMarket.Instance.cycleOf_subset_cycleAgents {n : ℕ} {I : Instance n} {R : Finset (Fin n)} {i₀ : Fin n} (hi₀ : i₀ ∈ I.cycleAgents R) :
I.cycleOf R i₀ ⊆ I.cycleAgents R
theorem Cslib.Algorithms.Lean.HousingMarket.Instance.topChoice_mem_cycleOf {n : ℕ} {I : Instance n} {R : Finset (Fin n)} {i₀ i : Fin n} (hR : R.Nonempty) (hi₀ : i₀ ∈ I.cycleAgents R) (hi : i ∈ I.cycleOf R i₀) :
I.topChoice R i ∈ I.cycleOf R i₀
def Cslib.Algorithms.Lean.HousingMarket.Instance.CycleSelector.ofSeed {n : ℕ} {I : Instance n} (seed : (R : Finset (Fin n)) → R.Nonempty → Fin n) (hseed : ∀ (R : Finset (Fin n)) (hR : R.Nonempty), seed R hR ∈ I.cycleAgents R) :

Constructs a single-cycle CycleSelector from any rule picking one seed agent inside I.cycleAgents R for each nonempty submarket R.

The single directed cycle in R starting at (I.cycleAgents R).min' (∅ when R = ∅).

The canonical CycleSelector eliminating one directed cycle (I.singleCycle R) per step.

Sequential single-cycle top trading cycles allocation, eliminating one directed cycle per step.

Removing top-trading cycles one at a time yields the same allocation as removing all cycles of each round simultaneously.