While this submission is a draft, it cannot be used by other submissions.

The Dynamic Program for Day-Independent Due Dates

Lax117284.Theorem12 · concepts/Lax117284/Theorem12.lean · lax-117284

proven

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Theorem

    Theorem 12. Let II be an instance whose due dates are day-independent, so that client jj has one due date djd_j on every day. Order the clients by due date and process them in that order, carrying as state, for every day, the time at which that day's machine becomes free. Serving a client on a set of days requires that on each of those days the machine be free early enough for its job to be completed at its due date, and leaves the machine of each of those days free from that due date onwards. The instance admits a kk-fair schedule if and only if the program, started with every machine free from time 00 and applied to the clients in due-date order, can serve every client on kk days.

    Processing the clients in due-date order is what makes the state sufficient: a client considered later has a due date at least as large, so the only thing a decision about the earlier clients can leave behind that matters is how late each machine is occupied. For a constant number mm of days the number of reachable states is polynomial, and the program decides the problem in polynomial time.

    Concept map
    2 concepts
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A
    Evidence

    Each proof establishes this claim relative to its assumptions.

    In the paper

    • page 2 of this submission's paper

    Lean source view on GitHub

    1import Lax117284.Scheduling
    2
    3/-!
    4---
    5title: The Dynamic Program for Day-Independent Due Dates
    6type: theorem
    7---
    8**Theorem 12.** Let II be an instance whose due dates are day-independent, so that client
    9jj has one due date djd_j on every day. Order the clients by due date and process them in
    10that order, carrying as state, for every day, the time at which that day's machine becomes
    11free. Serving a client on a set of days requires that on each of those days the machine be
    12free early enough for its job to be completed at its due date, and leaves the machine of
    13each of those days free from that due date onwards. The instance admits a kk-fair schedule
    14if and only if the program, started with every machine free from time 00 and applied to
    15the clients in due-date order, can serve every client on kk days.
    16
    17Processing the clients in due-date order is what makes the state sufficient: a client
    18considered later has a due date at least as large, so the only thing a decision about the
    19earlier clients can leave behind that matters is how late each machine is occupied. For a
    20constant number mm of days the number of reachable states is polynomial, and the program
    21decides the problem in polynomial time.
    22
    23# Formalization Notes
    24
    25The program is a predicate: it holds of a list of clients and a state when the clients of
    26the list can each be served on kk days from that state onwards. It is recursive in the
    27list, and the recursion is the transition of the dynamic program rather than a table, which
    28is the form in which its correctness is stated and proved. A table filled in the order of
    29the list has the same reachable states.
    30
    31The list is required to contain every client exactly once and to be sorted by due date,
    32which is the precondition of the program rather than a property of the instance, so a
    33statement about it says what the algorithm must be given.
    34-/
    35
    36namespace Lax117284.Theorem12
    37
    38open Lax117284.Scheduling
    39
    40variable {I : Instance}
    41
    42/-- The dynamic program of Theorem 12: given the due dates `dd`, the fairness parameter
    43`k`, the clients still to be served, and for each day the time at which its machine is
    44free, can every remaining client be served on `k` days? -/
    45def Program (dd : Fin I.clients → ℕ) (k : ℕ) :
    46 List (Fin I.clients) → (Fin I.days → ℕ) → Prop
    47 | [], _ => True
    48 | j :: rest, free => ∃ S : Finset (Fin I.days), S.card = k ∧
    49 (∀ i ∈ S, I.p i j + free i ≤ dd j) ∧
    50 Program dd k rest fun i => if i ∈ S then dd j else free i
    51
    52/-- **Theorem 12.** With day-independent due dates, an instance admits a `k`-fair schedule
    53exactly when the dynamic program, applied to the clients in due-date order with every
    54machine free from time `0`, can serve every client on `k` days. -/
    55axiom hasKFairSchedule_iff_program (hd : I.DayIndepD) (i₀ : Fin I.days) (k : ℕ)
    56 {l : List (Fin I.clients)} (hnd : l.Nodup) (hall : ∀ j, j ∈ l)
    57 (hsorted : l.Pairwise fun a b => I.d i₀ a ≤ I.d i₀ b) :
    58 I.HasKFairSchedule k ↔ Program (I.d i₀) k l fun _ => 0
    59
    60end Lax117284.Theorem12
    61
    Show Proof
    Formalization Notes

    The program is a predicate: it holds of a list of clients and a state when the clients of the list can each be served on kk days from that state onwards. It is recursive in the list, and the recursion is the transition of the dynamic program rather than a table, which is the form in which its correctness is stated and proved. A table filled in the order of the list has the same reachable states.

    The list is required to contain every client exactly once and to be sorted by due date, which is the precondition of the program rather than a property of the instance, so a statement about it says what the algorithm must be given.

    Builds on
    Used by

    none

    From Mathlib

    none

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…