Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Section III.B — at every step of TTC with type-specific quotas there is at least one cycle

Proved
SchoolChoice.TTCQuota.ttcq_exists_cycle

by mikedeng1 · Sep 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

controlled-choicep2o-batch-p200ap2o-gran-per-chapterp2o-plan-paperp2o-v1school-choicetop-trading-cycles

Consider the top trading cycles algorithm with type-specific quotas, run on capacities qsq_sqs​ with no shortage of seats,

∣I∣≤∑s∈Sqs,|I|\le \sum_{s\in S} q_s,∣I∣≤s∈S∑​qs​,

arbitrary type quotas qstq_s^tqst​, student types τ\tauτ, school priorities and announced preferences PPP. Fix any step. Remove the students who have no remaining school with room for their type. If at least one student still remains, then some remaining student lies on a cycle of the pointing graph of that step: each remaining student points to her favourite school with room for her type, and each remaining school to its highest-priority remaining student.

This is the claim "There is at least one cycle" in the description of Steps 1 and kkk on p. 22. It guarantees that every step with a remaining student removes at least one student, so the algorithm ends after at most ∣I∣|I|∣I∣ steps.

Formalization Note As printed, the claim can fail when a remaining student cannot point (see the definition of the algorithm). It is stated for the step of the mission's convention, in which such stuck students have been removed first. The no-shortage hypothesis is the standing assumption of Section I; it is kept, although the statement does not need it.

Preamble
import Mathlib
import Definitions.Def_SchoolChoice_TTCQuota_Algorithm
Formal statement
namespace SchoolChoice.TTCQuota

/-- Section III.B, Step 1 (p. 22): "There is at least one cycle." At every step of the top
trading cycles algorithm with type-specific quotas, once the stuck students (those with no
remaining school that has room for their type) have been removed, if some student still
remains then some remaining student is in a cycle. `run … t` is the state at the
beginning of Step `t + 1` and `prune τ (run … t)` the state after the stuck removal. -/
theorem ttcq_exists_cycle {I S Ty : Type} [Fintype I] [DecidableEq I] [Fintype S]
    [DecidableEq S] [Fintype Ty] [DecidableEq Ty]
    (q : S → ℕ) (qt : S → Ty → ℕ) (τ : I → Ty) (hq : Fintype.card I ≤ ∑ s, q s)
    (pri : S → Priority I) (P : I → Pref S) (t : ℕ)
    (hrem : (prune τ (run q qt τ pri P t)).rem.Nonempty) :
    ∃ i ∈ (prune τ (run q qt τ pri P t)).rem,
      InCycle P pri τ (prune τ (run q qt τ pri P t)) i := by sorry

end SchoolChoice.TTCQuota
Source
Abdulkadiroğlu and Sönmez, School Choice: A Mechanism Design Approach, Columbia Univ. Economics Discussion Paper No. 0203-18 (July 2003), p. 22, Section III.B, Step 1 and Step k ("There is at least one cycle.")
Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me