Section III.B — at every step of TTC with type-specific quotas there is at least one cycle
ProvedSchoolChoice.TTCQuota.ttcq_exists_cycleConsider the top trading cycles algorithm with type-specific quotas, run on capacities with no shortage of seats,
arbitrary type quotas , student types , school priorities and announced preferences . 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 on p. 22. It guarantees that every step with a remaining student removes at least one student, so the algorithm ends after at most 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.
import Mathlib import Definitions.Def_SchoolChoice_TTCQuota_Algorithm
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
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.