Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§2.1, p. 153 — the minimum number of days for CT2 is max(max_j ⌈Σ_i r_ij/b_j⌉, max_i ⌈Σ_j r_ij/a_i⌉)

Proved
Timetabling85.ClassTeacher.min_days

by mikedeng1 · Oct 6, 2026 · Mathlib 0df444a (Lean v4.33.1)

edge-coloringminimum-daysp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1timetabling

Let R=(rij)R=(r_{ij})R=(rij​) be an m×nm\times nm×n requirement matrix of nonnegative integers and a1,…,ama_1,\dots,a_ma1​,…,am​, b1,…,bnb_1,\dots,b_nb1​,…,bn​ positive integers. Put

pmin⁡=max⁡(max⁡j⌈∑i=1mrijbj⌉, max⁡i⌈∑j=1nrijai⌉)p_{\min}=\max\Big(\max_j\Big\lceil \tfrac{\sum_{i=1}^m r_{ij}}{b_j}\Big\rceil,\ \max_i\Big\lceil \tfrac{\sum_{j=1}^n r_{ij}}{a_i}\Big\rceil\Big)pmin​=max(jmax​⌈bj​∑i=1m​rij​​⌉, imax​⌈ai​∑j=1n​rij​​⌉)

(an empty maximum being 000). Then for every number of days ppp, problem CT2 with daily bounds aia_iai​, bjb_jbj​ has a solution over ppp days if and only if p≥pmin⁡p\ge p_{\min}p≥pmin​.

So pmin⁡p_{\min}pmin​ days suffice and no smaller number of days does: pmin⁡p_{\min}pmin​ is the minimum number of days needed, as the paper states.

Formalization Note The "minimum" is stated as the equivalence "solvable over ppp days iff p≥pmin⁡p\ge p_{\min}p≥pmin​", which says both that pmin⁡p_{\min}pmin​ is feasible and that every smaller ppp is infeasible, without an sInf over a possibly empty set.

Preamble
import Mathlib
import Definitions.Def_Timetabling85_ClassTeacher_Problems
Formal statement
namespace Timetabling85.ClassTeacher

/-- The minimum number of days (de Werra 1985, §2.1, p. 153): for positive `a i`, `b j`, CT2 is
solvable over `p` days exactly when `p ≥ minDays R a b`. -/
theorem min_days {m n : ℕ} (R : Fin m → Fin n → ℕ) (a : Fin m → ℕ) (b : Fin n → ℕ)
    (ha : ∀ i, 0 < a i) (hb : ∀ j, 0 < b j) (p : ℕ) :
    (∃ x : Fin m → Fin n → Fin p → ℕ, IsCT2 R p a b x) ↔ minDays R a b ≤ p := by sorry

end Timetabling85.ClassTeacher
Source
de Werra, An introduction to timetabling, Eur. J. Oper. Res. 19 (1985), p. 153, §2.1, display for the minimum number of days p
Human review
  • Endorsed by Shuze Chen · Oct 6, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 6, 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