Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proposition 2.1, p. 152 — CT1 has a solution iff every row and column sum of R is at most p (König)

Proved
Timetabling85.ClassTeacher.prop_2_1

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

edge-coloringkonig-theoremp2o-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 ppp a number of periods. Problem CT1 — find xijk∈{0,1}x_{ijk}\in\{0,1\}xijk​∈{0,1} with ∑kxijk=rij\sum_k x_{ijk}=r_{ij}∑k​xijk​=rij​ for all i,ji,ji,j, ∑jxijk≤1\sum_j x_{ijk}\le1∑j​xijk​≤1 for all i,ki,ki,k and ∑ixijk≤1\sum_i x_{ijk}\le1∑i​xijk​≤1 for all j,kj,kj,k — has a solution if and only if

∑i=1mrij≤p(j=1,…,n)and∑j=1nrij≤p(i=1,…,m).\sum_{i=1}^m r_{ij}\le p\quad(j=1,\dots,n)\qquad\text{and}\qquad\sum_{j=1}^n r_{ij}\le p\quad(i=1,\dots,m).i=1∑m​rij​≤p(j=1,…,n)andj=1∑n​rij​≤p(i=1,…,m).

This is König's edge-colouring theorem for bipartite multigraphs: a bipartite multigraph of maximum degree Δ\DeltaΔ can be properly edge-coloured with ppp colours iff Δ≤p\Delta\le pΔ≤p. In timetabling terms, there is a timetable in ppp periods iff no teacher and no class is involved in more than ppp lectures.

Formalization Note The statement holds for every ppp, including p=0p=0p=0, where both sides say R=0R=0R=0.

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

/-- Proposition 2.1 (König; de Werra 1985, p. 152): CT1 has a solution iff every column sum and
every row sum of `R` is at most `p`. -/
theorem prop_2_1 {m n : ℕ} (R : Fin m → Fin n → ℕ) (p : ℕ) :
    (∃ x : Fin m → Fin n → Fin p → ℕ, IsCT1 R p x) ↔
      (∀ j, colSum R j ≤ p) ∧ (∀ i, rowSum R i ≤ p) := by sorry

end Timetabling85.ClassTeacher
Source
de Werra, An introduction to timetabling, Eur. J. Oper. Res. 19 (1985), p. 152, Proposition 2.1
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