Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

THEOREM 1, p. 336 — the total discrepancy problem is NP-complete (given that Partition is)

Proved
GTWSched.NPC.theorem_1

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

complexityearliness-tardinessnp-completenessp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1scheduling

THEOREM 1. The total discrepancy problem is NP-complete.

The total discrepancy problem asks, for NNN tasks with lengths li∈Z+l_i\in\mathbb Z^+li​∈Z+, preferred midtimes Mi∈Z+M_i\in\mathbb Z^+Mi​∈Z+ and a threshold k∈Z+k\in\mathbb Z^+k∈Z+, whether some one-processor schedule SSS (nonnegative real starting times sis_isi​, nonoverlapping execution intervals [si,si+li][s_i,s_i+l_i][si​,si​+li​]) has

cost(S)=∑i=1N∣mi(S)−Mi∣≤k,mi(S)=si+li/2.\mathrm{cost}(S)=\sum_{i=1}^N|m_i(S)-M_i|\le k,\qquad m_i(S)=s_i+l_i/2 .cost(S)=i=1∑N​∣mi​(S)−Mi​∣≤k,mi​(S)=si​+li​/2.

The statement is: if Partition is NP-complete, then this problem (as the language of codes of its yes-instances) is NP-complete.

Since preferred midtimes and preferred starting times are equivalent (ai=Mi−li/2a_i=M_i-l_i/2ai​=Mi​−li​/2), it follows that minimizing the total discrepancy from preferred starting times on one processor is NP-hard.

Formalization Note NP-completeness is the published CookPvsNP.NPComplete; positivePartitionLang uses nonempty lists of positive integers, matching the paper's source problem. The NP-completeness of Partition (Garey and Johnson 1979) is the only fact the paper imports and is the hypothesis. The paper's construction D has half-integer midtimes and threshold, so a reduction to the integer-valued language must rescale. Nonnegative starting times are a standing assumption of the model (p. 336–337) and are essential to the reduction.

Preamble
import Mathlib
import Definitions.Def_CookPvsNP_defs
import Definitions.Def_ProjSchedTW_Complexity_Encoding
import Definitions.Def_GTWSched_NPC_Schedules
import Definitions.Def_GTWSched_NPC_Problems
Formal statement
namespace GTWSched.NPC

open CookPvsNP ProjSchedTW.Complexity

/-- THEOREM 1, p. 336, relative to the NP-completeness of PARTITION: the total discrepancy problem
is NP-complete. -/
theorem theorem_1 (hP : NPComplete positivePartitionLang) : NPComplete tdLang := by sorry

end GTWSched.NPC
Source
Garey, Tarjan & Wilfong, One-Processor Scheduling with Symmetric Earliness and Tardiness Penalties, Math. Oper. Res. 13 (1988), p. 336, THEOREM 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