Threshold reductions between objectives
Lax434175.Thresholds · concepts/Lax434175/Thresholds.lean · lax-434175
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural 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 be an integer.
- The makespan is at most exactly if no job is late for the common due date : if and only if . For negative both sides are made false: the due date is and the threshold .
- The maximum lateness is at most exactly if no job is tardy for the due dates : if and only if . If some is negative, or there are no jobs and is negative, the left side is false and the threshold is .
- The maximum lateness is at most exactly if no job is late for the due dates : if and only if , with the same treatment of negative due dates.
- Flow time is tardiness for the due dates : and 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 .
- If every job completes no earlier than its release date in every feasible schedule, then , so if and only if ; likewise without weights.
In all cases the kernel instance, the data of the constraint modules and the schedule are unchanged.
A specification reduces to a specification if is field by field a special case of , possibly after replacing the makespan or maximum lateness of by the number of late jobs or by the total tardiness, or the total flow time of , weighted or not, by the total tardiness. It reduces to through flow time if it is so after replacing the total completion time of 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 reduces to , then the decision version of the problem of reduces to that of the problem of ; 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
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
10 sumF_iff_sumT proven
11 sumWC_iff_sumWF proven
12 sumWF_iff_sumWT proven
Lean source view on GitHub
| 1 | import Mathlib.Data.Fintype.BigOperators |
| 2 | import Lax434175.Assembly |
| 3 | import Lax434175.Parameters |
| 4 | import Lax434175.Objectives |
| 5 | |
| 6 | /-! |
| 7 | --- |
| 8 | title: Threshold reductions between objectives |
| 9 | type: theorem |
| 10 | --- |
| 11 | Consider the problems assembled from arbitrary constraint modules over a |
| 12 | kernel and the completion-time objectives. |
| 13 | |
| 14 | Some relations between objectives hold for decision versions only. Let |
| 15 | be an integer. |
| 16 | |
| 17 | - The makespan is at most exactly if no job is late for the common due |
| 18 | date : if and only if . For negative |
| 19 | both sides are made false: the due date is and the threshold . |
| 20 | - The maximum lateness is at most exactly if no job is tardy for the due |
| 21 | dates : if and only if . If |
| 22 | some is negative, or there are no jobs and is negative, the |
| 23 | left side is false and the threshold is . |
| 24 | - The maximum lateness is at most exactly if no job is late for the due |
| 25 | dates : if and only if , with |
| 26 | the same treatment of negative due dates. |
| 27 | - Flow time is tardiness for the due dates : and |
| 28 | 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 | . |
| 32 | - If every job completes no earlier than its release date in every feasible |
| 33 | schedule, then , so |
| 34 | if and only if |
| 35 | ; likewise without weights. |
| 36 | |
| 37 | In all cases the kernel instance, the data of the constraint modules and the |
| 38 | schedule are unchanged. |
| 39 | |
| 40 | A specification reduces to a specification if is field by field |
| 41 | a special case of , possibly after replacing the makespan or maximum |
| 42 | lateness of by the number of late jobs or by the total tardiness, or the |
| 43 | total flow time of , weighted or not, by the total tardiness. It reduces to |
| 44 | through flow time if it is so after replacing the total completion time of |
| 45 | by the total flow time, weighted or not, or the maximum flow time by the |
| 46 | maximum lateness. |
| 47 | Both relations are decidable. |
| 48 | |
| 49 | **Theorem.** The equivalences hold. If the constraint modules are sound and |
| 50 | reduces to , then the decision version of the problem of reduces |
| 51 | to that of the problem of ; the same holds for reductions through flow |
| 52 | time if release dates are respected. |
| 53 | |
| 54 | **Theorem.** Every reduction obtained from these steps and a field-wise |
| 55 | comparison is in place: it keeps the kernel instance and every invariant |
| 56 | parameter of a constraint field, and changes only the due dates and the |
| 57 | threshold. |
| 58 | -/ |
| 59 | |
| 60 | namespace Lax434175.Thresholds |
| 61 | open Lax434175.Problems Lax434175.Kernels Lax434175.Modules Lax434175.Assembly |
| 62 | open Lax434175 |
| 63 | |
| 64 | /-- The family of given constraint modules with the completion-time |
| 65 | objectives. -/ |
| 66 | def family {K : Kernel} (Name : Type) (module : Name → Module K) : Family K where |
| 67 | ModuleName := Name |
| 68 | module := module |
| 69 | objective := Objectives.objective K |
| 70 | |
| 71 | variable {K : Kernel} {Name : Type} {module : Name → Module K} |
| 72 | |
| 73 | instance [Fintype Name] : Fintype (family Name module).ModuleName := |
| 74 | inferInstanceAs (Fintype Name) |
| 75 | |
| 76 | /-- The specification with given module values and a given objective. -/ |
| 77 | def 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 |
| 83 | instance counting the jobs that are late for the threshold. -/ |
| 84 | def 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. -/ |
| 94 | def lateThreshold (D : ℤ) : ℤ := if D < 0 then -1 else 0 |
| 95 | |
| 96 | /-- An instance with the maximum-lateness objective and a threshold, read as |
| 97 | an instance measuring tardiness for the due dates increased by the |
| 98 | threshold. -/ |
| 99 | def 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. -/ |
| 109 | def 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 |
| 115 | an instance counting the jobs that are late for the due dates increased by |
| 116 | the threshold. -/ |
| 117 | def 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 |
| 127 | dates equal to the release dates. -/ |
| 128 | def 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 |
| 138 | tardiness for the due dates equal to the release dates. -/ |
| 139 | def 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 |
| 149 | dates equal to the release dates. -/ |
| 150 | def 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. -/ |
| 160 | def 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 |
| 170 | flow time. -/ |
| 171 | def 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 |
| 181 | job completes no earlier than its release date. -/ |
| 182 | def 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 | |
| 188 | axiom 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 | |
| 193 | axiom 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 | |
| 199 | axiom 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 | |
| 205 | axiom 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 | |
| 210 | axiom 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 | |
| 215 | axiom 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 | |
| 220 | axiom 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 | |
| 226 | axiom 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. -/ |
| 234 | def objectiveOf (s : Spec (family Name module)) : Objectives.Value := s.objective |
| 235 | |
| 236 | /-- The specification `s` reduces to `t`: field by field, possibly after one |
| 237 | of the threshold steps. -/ |
| 238 | def 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 |
| 247 | flow time. -/ |
| 248 | def 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 | |
| 253 | instance [Fintype Name] (s t : Spec (family Name module)) : Decidable (Reduces s t) := by |
| 254 | unfold Reduces |
| 255 | infer_instance |
| 256 | |
| 257 | instance [Fintype Name] (s t : Spec (family Name module)) : |
| 258 | Decidable (ReducesThroughFlow s t) := by |
| 259 | unfold ReducesThroughFlow |
| 260 | infer_instance |
| 261 | |
| 262 | axiom reducible_of_reduces (sound : ∀ i, (module i).Sound) {s t : Spec (family Name module)} : |
| 263 | Reduces s t → Reducible (problem _ s) (problem _ t) |
| 264 | |
| 265 | axiom 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 | |
| 270 | axiom inPlace_of_reduces (sound : ∀ i, (module i).Sound) {s t : Spec (family Name module)} : |
| 271 | Reduces s t → Parameters.ReducibleInPlace s t |
| 272 | |
| 273 | axiom 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 | |
| 278 | end Lax434175.Thresholds |
| 279 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments