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

Threshold reductions between objectives

Lax434175.Thresholds · concepts/Lax434175/Thresholds.lean · lax-434175

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

    Consider the problems assembled from arbitrary constraint modules over a kernel and the completion-time objectives.

    Some relations between objectives hold for decision versions only. Let DD be an integer.

    • The makespan is at most DD exactly if no job is late for the common due date DD: Cmax⁡≤DC_{\max} \le D if and only if ∑jUj≤0\sum_j U_j \le 0. For negative DD both sides are made false: the due date is 00 and the threshold −1-1.
    • The maximum lateness is at most DD exactly if no job is tardy for the due dates dj+Dd_j + D: Lmax⁡≤DL_{\max} \le D if and only if ∑jTj≤0\sum_j T_j \le 0. If some dj+Dd_j + D is negative, or there are no jobs and DD is negative, the left side is false and the threshold is −1-1.
    • The maximum lateness is at most DD exactly if no job is late for the due dates dj+Dd_j + D: Lmax⁡≤DL_{\max} \le D if and only if ∑jUj≤0\sum_j U_j \le 0, with the same treatment of negative due dates.
    • Flow time is tardiness for the due dates dj=rjd_j = r_j: ∑jwjFj\sum_j w_j F_j and ∑jwjTj\sum_j w_j T_j with these due dates are the same cost, weighted or not.
    • If every job completes no earlier than its release date in every feasible schedule, the maximum flow time is the maximum lateness for the due dates dj=rjd_j = r_j.
    • If every job completes no earlier than its release date in every feasible schedule, then ∑jwjFj=∑jwjCj−∑jwjrj\sum_j w_j F_j = \sum_j w_j C_j - \sum_j w_j r_j, so ∑jwjCj≤D\sum_j w_j C_j \le D if and only if ∑jwjFj≤D−∑jwjrj\sum_j w_j F_j \le D - \sum_j w_j r_j; likewise without weights.

    In all cases the kernel instance, the data of the constraint modules and the schedule are unchanged.

    A specification ss reduces to a specification tt if ss is field by field a special case of tt, possibly after replacing the makespan or maximum lateness of ss by the number of late jobs or by the total tardiness, or the total flow time of ss, weighted or not, by the total tardiness. It reduces to tt through flow time if it is so after replacing the total completion time of ss by the total flow time, weighted or not, or the maximum flow time by the maximum lateness. Both relations are decidable.

    Theorem. The equivalences hold. If the constraint modules are sound and ss reduces to tt, then the decision version of the problem of ss reduces to that of the problem of tt; the same holds for reductions through flow time if release dates are respected.

    Theorem. Every reduction obtained from these steps and a field-wise comparison is in place: it keeps the kernel instance and every invariant parameter of a constraint field, and changes only the due dates and the threshold.

    Concept map
    7 concepts
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on ADescendants are omitted for concepts with more than 10 descendants.
    Evidence

    This concept declares 12 statements. Each proof establishes one of them relative to its assumptions.

    1 fmax_iff_lmax proven

    2 inPlace_of_reduces proven

    3 inPlace_of_reducesThroughFlow proven

    4 lmax_iff_sumT proven

    5 lmax_iff_sumU proven

    6 makespan_iff_sumU proven

    7 reducible_of_reduces proven

    8 reducible_of_reducesThroughFlow proven

    9 sumC_iff_sumF proven

    11 sumWC_iff_sumWF proven

    12 sumWF_iff_sumWT proven

    Lean source view on GitHub

    1import Mathlib.Data.Fintype.BigOperators
    2import Lax434175.Assembly
    3import Lax434175.Parameters
    4import Lax434175.Objectives
    5
    6/-!
    7---
    8title: Threshold reductions between objectives
    9type: theorem
    10---
    11Consider the problems assembled from arbitrary constraint modules over a
    12kernel and the completion-time objectives.
    13
    14Some relations between objectives hold for decision versions only. Let DD
    15be an integer.
    16
    17- The makespan is at most DD exactly if no job is late for the common due
    18 date DD: Cmax⁡≤DC_{\max} \le D if and only if ∑jUj≤0\sum_j U_j \le 0. For negative
    19 DD both sides are made false: the due date is 00 and the threshold −1-1.
    20- The maximum lateness is at most DD exactly if no job is tardy for the due
    21 dates dj+Dd_j + D: Lmax⁡≤DL_{\max} \le D if and only if ∑jTj≤0\sum_j T_j \le 0. If
    22 some dj+Dd_j + D is negative, or there are no jobs and DD is negative, the
    23 left side is false and the threshold is −1-1.
    24- The maximum lateness is at most DD exactly if no job is late for the due
    25 dates dj+Dd_j + D: Lmax⁡≤DL_{\max} \le D if and only if ∑jUj≤0\sum_j U_j \le 0, with
    26 the same treatment of negative due dates.
    27- Flow time is tardiness for the due dates dj=rjd_j = r_j: ∑jwjFj\sum_j w_j F_j and
    28 ∑jwjTj\sum_j w_j T_j with these due dates are the same cost, weighted or not.
    29- If every job completes no earlier than its release date in every feasible
    30 schedule, the maximum flow time is the maximum lateness for the due dates
    31 dj=rjd_j = r_j.
    32- If every job completes no earlier than its release date in every feasible
    33 schedule, then ∑jwjFj=∑jwjCj−∑jwjrj\sum_j w_j F_j = \sum_j w_j C_j - \sum_j w_j r_j, so
    34 ∑jwjCj≤D\sum_j w_j C_j \le D if and only if
    35 ∑jwjFj≤D−∑jwjrj\sum_j w_j F_j \le D - \sum_j w_j r_j; likewise without weights.
    36
    37In all cases the kernel instance, the data of the constraint modules and the
    38schedule are unchanged.
    39
    40A specification ss reduces to a specification tt if ss is field by field
    41a special case of tt, possibly after replacing the makespan or maximum
    42lateness of ss by the number of late jobs or by the total tardiness, or the
    43total flow time of ss, weighted or not, by the total tardiness. It reduces to
    44tt through flow time if it is so after replacing the total completion time of
    45ss by the total flow time, weighted or not, or the maximum flow time by the
    46maximum lateness.
    47Both relations are decidable.
    48
    49**Theorem.** The equivalences hold. If the constraint modules are sound and
    50ss reduces to tt, then the decision version of the problem of ss reduces
    51to that of the problem of tt; the same holds for reductions through flow
    52time if release dates are respected.
    53
    54**Theorem.** Every reduction obtained from these steps and a field-wise
    55comparison is in place: it keeps the kernel instance and every invariant
    56parameter of a constraint field, and changes only the due dates and the
    57threshold.
    58-/
    59
    60namespace Lax434175.Thresholds
    61open Lax434175.Problems Lax434175.Kernels Lax434175.Modules Lax434175.Assembly
    62open Lax434175
    63
    64/-- The family of given constraint modules with the completion-time
    65objectives. -/
    66def family {K : Kernel} (Name : Type) (module : Name → Module K) : Family K where
    67 ModuleName := Name
    68 module := module
    69 objective := Objectives.objective K
    70
    71variable {K : Kernel} {Name : Type} {module : Name → Module K}
    72
    73instance [Fintype Name] : Fintype (family Name module).ModuleName :=
    74 inferInstanceAs (Fintype Name)
    75
    76/-- The specification with given module values and a given objective. -/
    77def withObjective (values : (i : Name) → (module i).Value) (objective : Objectives.Value) :
    78 Spec (family Name module) where
    79 module := values
    80 objective := objective
    81
    82/-- An instance with the makespan objective and a threshold, read as an
    83instance counting the jobs that are late for the threshold. -/
    84def toLate (values : (i : Name) → (module i).Value)
    85 (x : Inst (family Name module) (withObjective values .makespan)) (D : ℤ) :
    86 Inst (family Name module) (withObjective values .sumU) where
    87 base := x.base
    88 data := x.data
    89 admitted := x.admitted
    90 objectiveData := fun _ => D.toNat
    91 objectiveAdmitted := trivial
    92
    93/-- The threshold for the number of late jobs. -/
    94def lateThreshold (D : ℤ) : ℤ := if D < 0 then -1 else 0
    95
    96/-- An instance with the maximum-lateness objective and a threshold, read as
    97an instance measuring tardiness for the due dates increased by the
    98threshold. -/
    99def toTardy (values : (i : Name) → (module i).Value)
    100 (x : Inst (family Name module) (withObjective values .lmax)) (D : ℤ) :
    101 Inst (family Name module) (withObjective values .sumT) where
    102 base := x.base
    103 data := x.data
    104 admitted := x.admitted
    105 objectiveData := fun j => ((Objectives.dueDate .lmax x.objectiveData j : ℤ) + D).toNat
    106 objectiveAdmitted := trivial
    107
    108/-- The threshold for the total tardiness. -/
    109def tardyThreshold (values : (i : Name) → (module i).Value)
    110 (x : Inst (family Name module) (withObjective values .lmax)) (D : ℤ) : ℤ :=
    111 if (K.jobs x.base = 0 ∧ D < 0) ∨
    112 ∃ j, (Objectives.dueDate .lmax x.objectiveData j : ℤ) + D < 0 then -1 else 0
    113
    114/-- An instance with the maximum-lateness objective and a threshold, read as
    115an instance counting the jobs that are late for the due dates increased by
    116the threshold. -/
    117def toLateShifted (values : (i : Name) → (module i).Value)
    118 (x : Inst (family Name module) (withObjective values .lmax)) (D : ℤ) :
    119 Inst (family Name module) (withObjective values .sumU) where
    120 base := x.base
    121 data := x.data
    122 admitted := x.admitted
    123 objectiveData := fun j => ((Objectives.dueDate .lmax x.objectiveData j : ℤ) + D).toNat
    124 objectiveAdmitted := trivial
    125
    126/-- An instance with total flow time, read with total tardiness for the due
    127dates equal to the release dates. -/
    128def flowToTardy (values : (i : Name) → (module i).Value)
    129 (x : Inst (family Name module) (withObjective values .sumF)) :
    130 Inst (family Name module) (withObjective values .sumT) where
    131 base := x.base
    132 data := x.data
    133 admitted := x.admitted
    134 objectiveData := fun j => K.release x.base j
    135 objectiveAdmitted := trivial
    136
    137/-- An instance with total weighted flow time, read with total weighted
    138tardiness for the due dates equal to the release dates. -/
    139def weightedFlowToTardy (values : (i : Name) → (module i).Value)
    140 (x : Inst (family Name module) (withObjective values .sumWF)) :
    141 Inst (family Name module) (withObjective values .sumWT) where
    142 base := x.base
    143 data := x.data
    144 admitted := x.admitted
    145 objectiveData := (Objectives.weight .sumWF x.objectiveData, fun j => K.release x.base j)
    146 objectiveAdmitted := trivial
    147
    148/-- An instance with maximum flow time, read with maximum lateness for the due
    149dates equal to the release dates. -/
    150def flowToLateness (values : (i : Name) → (module i).Value)
    151 (x : Inst (family Name module) (withObjective values .fmax)) :
    152 Inst (family Name module) (withObjective values .lmax) where
    153 base := x.base
    154 data := x.data
    155 admitted := x.admitted
    156 objectiveData := fun j => K.release x.base j
    157 objectiveAdmitted := trivial
    158
    159/-- An instance with total completion time, read with total flow time. -/
    160def toFlow (values : (i : Name) → (module i).Value)
    161 (x : Inst (family Name module) (withObjective values .sumC)) :
    162 Inst (family Name module) (withObjective values .sumF) where
    163 base := x.base
    164 data := x.data
    165 admitted := x.admitted
    166 objectiveData := ()
    167 objectiveAdmitted := trivial
    168
    169/-- An instance with total weighted completion time, read with total weighted
    170flow time. -/
    171def toWeightedFlow (values : (i : Name) → (module i).Value)
    172 (x : Inst (family Name module) (withObjective values .sumWC)) :
    173 Inst (family Name module) (withObjective values .sumWF) where
    174 base := x.base
    175 data := x.data
    176 admitted := x.admitted
    177 objectiveData := Objectives.weight .sumWC x.objectiveData
    178 objectiveAdmitted := trivial
    179
    180/-- In every schedule that is feasible for the kernel and the modules, every
    181job completes no earlier than its release date. -/
    182def ReleaseRespected (values : (i : Name) → (module i).Value) : Prop :=
    183 ∀ (x : K.Inst) (data : (i : Name) → (module i).Data (values i) x) (σ : K.Sched x),
    184 (∀ i, (module i).admits (values i) x (data i)) → K.feasible x σ →
    185 (∀ i, (module i).constraint (values i) x (data i) σ) →
    186 ∀ j, (K.release x j : NNRat) ≤ K.completion x σ j
    187
    188axiom makespan_iff_sumU (values : (i : Name) → (module i).Value)
    189 (x : Inst (family Name module) (withObjective values .makespan)) (D : ℤ) :
    190 (problem _ (withObjective values .makespan)).Decides x D ↔
    191 (problem _ (withObjective values .sumU)).Decides (toLate values x D) (lateThreshold D)
    192
    193axiom lmax_iff_sumT (values : (i : Name) → (module i).Value)
    194 (x : Inst (family Name module) (withObjective values .lmax)) (D : ℤ) :
    195 (problem _ (withObjective values .lmax)).Decides x D ↔
    196 (problem _ (withObjective values .sumT)).Decides (toTardy values x D)
    197 (tardyThreshold values x D)
    198
    199axiom lmax_iff_sumU (values : (i : Name) → (module i).Value)
    200 (x : Inst (family Name module) (withObjective values .lmax)) (D : ℤ) :
    201 (problem _ (withObjective values .lmax)).Decides x D ↔
    202 (problem _ (withObjective values .sumU)).Decides (toLateShifted values x D)
    203 (tardyThreshold values x D)
    204
    205axiom sumF_iff_sumT (values : (i : Name) → (module i).Value)
    206 (x : Inst (family Name module) (withObjective values .sumF)) (D : ℤ) :
    207 (problem _ (withObjective values .sumF)).Decides x D ↔
    208 (problem _ (withObjective values .sumT)).Decides (flowToTardy values x) D
    209
    210axiom sumWF_iff_sumWT (values : (i : Name) → (module i).Value)
    211 (x : Inst (family Name module) (withObjective values .sumWF)) (D : ℤ) :
    212 (problem _ (withObjective values .sumWF)).Decides x D ↔
    213 (problem _ (withObjective values .sumWT)).Decides (weightedFlowToTardy values x) D
    214
    215axiom fmax_iff_lmax (values : (i : Name) → (module i).Value) (h : ReleaseRespected values)
    216 (x : Inst (family Name module) (withObjective values .fmax)) (D : ℤ) :
    217 (problem _ (withObjective values .fmax)).Decides x D ↔
    218 (problem _ (withObjective values .lmax)).Decides (flowToLateness values x) D
    219
    220axiom sumC_iff_sumF (values : (i : Name) → (module i).Value) (h : ReleaseRespected values)
    221 (x : Inst (family Name module) (withObjective values .sumC)) (D : ℤ) :
    222 (problem _ (withObjective values .sumC)).Decides x D ↔
    223 (problem _ (withObjective values .sumF)).Decides (toFlow values x)
    224 ((D - ∑ j, (K.release x.base j : ℤ) : ℤ) : ℚ)
    225
    226axiom sumWC_iff_sumWF (values : (i : Name) → (module i).Value) (h : ReleaseRespected values)
    227 (x : Inst (family Name module) (withObjective values .sumWC)) (D : ℤ) :
    228 (problem _ (withObjective values .sumWC)).Decides x D ↔
    229 (problem _ (withObjective values .sumWF)).Decides (toWeightedFlow values x)
    230 ((D - ∑ j, (Objectives.weight .sumWC x.objectiveData j : ℤ) * (K.release x.base j : ℤ) :
    231 ℤ) : ℚ)
    232
    233/-- The objective of a specification. -/
    234def objectiveOf (s : Spec (family Name module)) : Objectives.Value := s.objective
    235
    236/-- The specification `s` reduces to `t`: field by field, possibly after one
    237of the threshold steps. -/
    238def Reduces (s t : Spec (family Name module)) : Prop :=
    239 s.le t ∨
    240 ((objectiveOf s = .makespan ∨ objectiveOf s = .lmax) ∧
    241 (withObjective s.module .sumU : Spec (family Name module)).le t) ∨
    242 ((objectiveOf s = .makespan ∨ objectiveOf s = .lmax ∨ objectiveOf s = .sumF) ∧
    243 (withObjective s.module .sumT : Spec (family Name module)).le t) ∨
    244 (objectiveOf s = .sumWF ∧ (withObjective s.module .sumWT : Spec (family Name module)).le t)
    245
    246/-- The specification `s` reduces to `t` after replacing completion time by
    247flow time. -/
    248def ReducesThroughFlow (s t : Spec (family Name module)) : Prop :=
    249 (objectiveOf s = .sumC ∧ (withObjective s.module .sumF : Spec (family Name module)).le t) ∨
    250 (objectiveOf s = .sumWC ∧ (withObjective s.module .sumWF : Spec (family Name module)).le t) ∨
    251 (objectiveOf s = .fmax ∧ (withObjective s.module .lmax : Spec (family Name module)).le t)
    252
    253instance [Fintype Name] (s t : Spec (family Name module)) : Decidable (Reduces s t) := by
    254 unfold Reduces
    255 infer_instance
    256
    257instance [Fintype Name] (s t : Spec (family Name module)) :
    258 Decidable (ReducesThroughFlow s t) := by
    259 unfold ReducesThroughFlow
    260 infer_instance
    261
    262axiom reducible_of_reduces (sound : ∀ i, (module i).Sound) {s t : Spec (family Name module)} :
    263 Reduces s t → Reducible (problem _ s) (problem _ t)
    264
    265axiom reducible_of_reducesThroughFlow (sound : ∀ i, (module i).Sound)
    266 (respected : ∀ values : (i : Name) → (module i).Value, ReleaseRespected values)
    267 {s t : Spec (family Name module)} :
    268 ReducesThroughFlow s t → Reducible (problem _ s) (problem _ t)
    269
    270axiom inPlace_of_reduces (sound : ∀ i, (module i).Sound) {s t : Spec (family Name module)} :
    271 Reduces s t → Parameters.ReducibleInPlace s t
    272
    273axiom inPlace_of_reducesThroughFlow (sound : ∀ i, (module i).Sound)
    274 (respected : ∀ values : (i : Name) → (module i).Value, ReleaseRespected values)
    275 {s t : Spec (family Name module)} :
    276 ReducesThroughFlow s t → Parameters.ReducibleInPlace s t
    277
    278end Lax434175.Thresholds
    279
    Show ProofShow ProofShow ProofShow ProofShow ProofShow ProofShow ProofShow ProofShow ProofShow ProofShow ProofShow Proof

    Discussion

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

    Loading discussion…