Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proof of Proposition 2.4, p. 155 — a timetable exists iff the conflict graph has n pairwise non-adjacent nodes

Proved
Timetabling85.TwoPeriod.timetable_iff_stable

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

conflict-graphp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1stable-settimetabling

Let III be an instance of the daily class–teacher problem CT4 with mmm classes, nnn teachers and ppp periods, and let GGG be its conflict graph: one node for each pair (teacher tjt_jtj​, possible schedule of tjt_jtj​), two nodes linked when they are different schedules of the same teacher or when they put the same class in the same period. Then

CT4 has a solution xˉ  ⟺  G contains a set of n pairwise non-adjacent nodes.\text{CT4 has a solution } \bar x \iff G \text{ contains a set of } n \text{ pairwise non-adjacent nodes.}CT4 has a solution xˉ⟺G contains a set of n pairwise non-adjacent nodes.

This is the reduction on which de Werra's algorithm for Proposition 2.4 rests: in the two-period case it turns the timetabling question into the question of finding a stable set with one node from each pair {xj,xˉj}\{x_j,\bar x_j\}{xj​,xˉj​}.

Formalization Note The statement holds for every CT4 instance, without the two-period bound; the page's "graph GGG with 2n2n2n nodes" is the case in which every teacher has exactly two schedules, while in general GGG has ∑j#{schedules of tj}\sum_j \#\{\text{schedules of } t_j\}∑j​#{schedules of tj​} nodes. "Set of nnn pairwise non-adjacent nodes" is Mathlib's IsNIndepSet n.

Preamble
import Mathlib
import Definitions.Def_Timetabling85_TwoPeriod_CT4
Formal statement
namespace Timetabling85.TwoPeriod

theorem timetable_iff_stable {m n p : ℕ} (I : CT4Data m n p) :
    (∃ x : Fin m → Fin n → Fin p → Bool, IsSolution I x) ↔
      ∃ S : Finset (Node I), (conflictGraph I).IsNIndepSet n S := by sorry

end Timetabling85.TwoPeriod
Source
de Werra, An introduction to timetabling, Eur. J. Oper. Res. 19 (1985), p. 155, Proof of Proposition 2.4 (construction of G and 'a timetable exists iff there is in G a set of n pairwise non adjacent nodes')
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