Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§3.1, p. 157 — a feasible course schedule in p periods is exactly a node coloring of the lecture graph with p colors

Proved
Timetabling85.CourseColoring.schedule_iff_coloring

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

course-schedulinggraph-coloringp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1timetabling

Let a course scheduling instance be given: courses KbK_bKb​ with their lectures lal_ala​, and students each taking a set of courses. Let GGG be its lecture graph: one node mabm_{ab}mab​ per lecture, two lecture-nodes of the same course adjacent, and two lecture-nodes of distinct courses KbK_bKb​, KbˉK_{\bar b}Kbˉ​ adjacent whenever some student takes both courses. Let p≥0p \ge 0p≥0.

Then an assignment sss of periods {1,…,p}\{1,\dots,p\}{1,…,p} to lectures is a feasible course schedule (no two lectures of a course at one period, and no student required to take two lectures at one period) if and only if sss is a node colouring of GGG with ppp colours:

s feasible  ⟺  s(m)≠s(m′) for every edge mm′ of G.s \text{ feasible} \iff s(m) \ne s(m') \text{ for every edge } mm' \text{ of } G.s feasible⟺s(m)=s(m′) for every edge mm′ of G.

In particular

∃ feasible schedule in p periods  ⟺  χ(G)≤p.\exists\, \text{feasible schedule in } p \text{ periods} \iff \chi(G) \le p .∃feasible schedule in p periods⟺χ(G)≤p.

This is the basic graph model of course scheduling, on which the treatment of unavailabilities and preassignments (Proposition 3.1) builds.

Formalization Note The schedule and the colouring are the same function Lecture → Fin p; the first conjunct says that the feasible schedules are exactly the underlying functions of the proper colourings of lectureGraph, the second is the existence form with SimpleGraph.Colorable.

Preamble
import Mathlib
import Definitions.Def_Timetabling85_CourseColoring_CSUP
Formal statement
namespace Timetabling85.CourseColoring

theorem schedule_iff_coloring {q r : ℕ} (I : CourseInstance q r) (p : ℕ) :
    (∀ s : I.Lecture → Fin p,
      I.IsFeasibleSchedule p s ↔ ∃ c : I.lectureGraph.Coloring (Fin p), ⇑c = s) ∧
    ((∃ s : I.Lecture → Fin p, I.IsFeasibleSchedule p s) ↔ I.lectureGraph.Colorable p) := by sorry

end Timetabling85.CourseColoring
Source
de Werra, An introduction to timetabling, Eur. J. Oper. Res. 19 (1985), p. 157, §3.1, sentence "A feasible course schedule in p periods will correspond to a node coloring of the above graph with p colors"
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