Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Input-or-output test — i starts first or j ends last, and i → j when i ≠ j

Proved
ComplexScheduling.input_or_output_test

by naimengye · Sep 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

combinatoricsconstraint-propagationoperations-researchoptimizationscheduling

Consider an RCPSP instance with conjunction set CCC, disjunction set DDD and time windows [ri,di][r_i,d_i][ri​,di​], let III be a disjunctive set for (C,D)(C,D)(C,D) whose activities have positive processing times, let J⊆IJ\subseteq IJ⊆I have at least two elements, and let i,j∈Ji,j\in Ji,j∈J. If

max⁡μ∈J∖{j}dμ  −  min⁡ν∈J∖{i}rν  <  P(J),\max_{\mu\in J\setminus\{j\}}d_\mu\;-\;\min_{\nu\in J\setminus\{i\}}r_\nu\;<\;P(J) ,μ∈J∖{j}max​dμ​−ν∈J∖{i}min​rν​<P(J),

then in every feasible schedule — feasible for the RCPSP, satisfying CCC and DDD, within the windows — activity iii starts first in JJJ or activity jjj ends last in JJJ; and if i≠ji\ne ji=j then i→ji\to ji→j, that is, Si+pi≤SjS_i+p_i\le S_jSi​+pi​≤Sj​.

This is the input-or-output test, the instance J′={i}J'=\{i\}J′={i}, J′′={j}J''=\{j\}J′′={j} of Theorem 3.7 in its form (3.122) without the restriction ν≠μ\nu\ne\muν=μ. The conjunction i→ji\to ji→j follows in either case: if iii starts first it cannot overlap jjj and so finishes before jjj starts, and if jjj ends last the same disjunction, read the other way, again forces iii before jjj.

Formalization Note The condition is the family dμ<rν+P(J)d_\mu<r_\nu+P(J)dμ​<rν​+P(J) over μ∈J∖{j}\mu\in J\setminus\{j\}μ∈J∖{j}, ν∈J∖{i}\nu\in J\setminus\{i\}ν∈J∖{i}. The requirement ∣J∣≥2|J|\ge 2∣J∣≥2 is the book's {i},{j}⊂J\{i\},\{j\}\subset J{i},{j}⊂J (proper subsets); with J={i}J=\{i\}J={i} the index sets would be empty and the first conclusion still holds trivially, but the book does not state the test there. Positivity of the processing times on III is what the conjunction i→ji\to ji→j needs.

Preamble
import Definitions.Def_ComplexScheduling_RCPSP
import Definitions.Def_ComplexScheduling_JobShop
import Definitions.Def_ComplexScheduling_ConstraintPropagation
Formal statement
namespace ComplexScheduling
theorem input_or_output_test {n r : ℕ} (p : Fin n → ℕ) (Rcap : Fin r → ℕ)
    (demand : Fin n → Fin r → ℕ) (prec C D : Finset (Fin n × Fin n)) (rel dl : Fin n → ℕ)
    (I : Finset (Fin n)) (hI : IsDisjunctiveSet C D I) (hp : ∀ i ∈ I, 0 < p i)
    (J : Finset (Fin n)) (hJI : J ⊆ I) (hJ : 2 ≤ J.card) (i j : Fin n) (hi : i ∈ J) (hj : j ∈ J)
    (hcond : ∀ μ ∈ J.erase j, ∀ ν ∈ J.erase i, dl μ < rel ν + totalProcessing p J)
    (S : Fin n → ℕ) (hS : FeasibleSchedule p Rcap demand prec S) (hC : RespectsArcs p C S)
    (hD : SatisfiesDisjunctions p D S) (hw : WithinWindows rel dl p S) :
    (StartsFirstIn S J i ∨ EndsLastIn p S J j) ∧ (i ≠ j → S i + p i ≤ S j) := by sorry
end ComplexScheduling
Source
Peter Brucker and Sigrid Knust, Complex Scheduling, 2nd ed., Springer 2012, https://doi.org/10.1007/978-3-642-23929-8 — Section 3.6.4, printed p. 170 (PDF p. 180), the input-or-output test: "Let J′ = {i} and J′′ = {j} with i, j ∈ J. Then condition (3.122) can be rewritten as max_{μ∈J\{j}} d_μ − min_{ν∈J\{i}} r_ν < P(J). If this condition holds, then activity i must start first in J or activity j must end last in J, i.e. i is input for J or j is output for J. If i ≠ j, the conjunction i → j is implied."
Human review
  • Endorsed by Shuze Chen · Sep 25, 2026

    Confirmed by the moderator at approval.

  • Endorsed by naimengye · Sep 25, 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