The Greedy of Section 6.1, and Its Domination Order
Lax496464.Greedy · concepts/Lax496464/Greedy.lean · lax-496464
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
The algorithm behind the first half of the fourth theorem, for the case in which all preprocessing times are equal and every weight is one. The jobs are taken in earliest-start-time order, and a set of already selected jobs is maintained. On reaching job :
- if the first stage can still preprocess jobs by , and fewer than of the selected jobs are alive at , then joins ;
- otherwise one job of with the largest due date is dropped, and the rest becomes the new .
The set kept is compared to others through a domination order: dominates when, below every threshold, has no more due dates than .
Concept map
In the paper
- page 6 of this submission's paper
Lean source view on GitHub
| 1 | import Lax496464.Conditions |
| 2 | import Lax496464.EstOrder |
| 3 | import Lax496464.ProperInstances |
| 4 | |
| 5 | /-! |
| 6 | --- |
| 7 | title: The Greedy of Section 6.1, and Its Domination Order |
| 8 | type: definition |
| 9 | --- |
| 10 | The algorithm behind the first half of the fourth theorem, for the case in which all |
| 11 | preprocessing times are equal and every weight is one. The jobs are taken in |
| 12 | earliest-start-time order, and a set of already selected jobs is maintained. On |
| 13 | reaching job : |
| 14 | |
| 15 | * if the first stage can still preprocess jobs by , and fewer than of |
| 16 | the selected jobs are alive at , then joins ; |
| 17 | * otherwise one job of with the largest due date is dropped, and the rest |
| 18 | becomes the new . |
| 19 | |
| 20 | The set kept is compared to others through a *domination* order: dominates when, |
| 21 | below every threshold, has no more due dates than . |
| 22 | |
| 23 | # Formalization Notes |
| 24 | |
| 25 | The greedy is given as a relation between the set before a step and the set after it, |
| 26 | not as a function. Both rules leave a choice — which job with the largest due date to |
| 27 | drop — and a relation covers every way of resolving it at once, so the theorem is about |
| 28 | the rule and not about one implementation of it. |
| 29 | |
| 30 | **The domination order is not the paper's, and the paper's will not do.** Section 6.1 |
| 31 | defines: dominates if , or and the -th largest due |
| 32 | date in is not greater than the -th largest in . The first disjunct throws |
| 33 | away all information about the due dates whenever the cardinalities differ, and the |
| 34 | induction needs it exactly there: in the step that drops a job, the set compared against |
| 35 | has one element fewer, so the induction hypothesis says only that the greedy's set is |
| 36 | *larger*, and "the job removed is the one with the largest due date" has nothing left to |
| 37 | act on. |
| 38 | |
| 39 | Dropping the disjunct repairs it. Counting, for each threshold , how many due dates of |
| 40 | a set lie at or below gives an order that is the paper's pointwise condition when the |
| 41 | cardinalities agree, that implies , and that every greedy step preserves — |
| 42 | which is what the induction needs. Stating it by counting rather than by listing the |
| 43 | sorted due dates also turns every step of the argument into arithmetic. |
| 44 | -/ |
| 45 | |
| 46 | namespace Lax496464.Greedy |
| 47 | |
| 48 | open Lax496464.FlowShop Lax496464.FlowShop.Instance |
| 49 | |
| 50 | variable (I : Instance) |
| 51 | |
| 52 | /-- How many jobs of `Z` are due at or before `t`. -/ |
| 53 | def dueCount (Z : Finset I.Job) (t : ℤ) : ℕ := (Z.filter fun i => (I.d i : ℤ) ≤ t).card |
| 54 | |
| 55 | /-- **Domination.** `S` dominates `S'` when, below every threshold, `S'` has no more due |
| 56 | dates than `S`. -/ |
| 57 | def SDom (S S' : Finset I.Job) : Prop := ∀ t : ℤ, dueCount I S' t ≤ dueCount I S t |
| 58 | |
| 59 | /-- The first `k` jobs in earliest-start-time order. -/ |
| 60 | def firstJobs (k : ℕ) : Finset I.Job := Finset.univ.filter fun i : I.Job => (i : ℕ) < k |
| 61 | |
| 62 | /-- **One greedy step**, with common preprocessing time `p`: from `A` to `next` on |
| 63 | reaching job `j`. Either `j` is added, or a job of largest due date is dropped from |
| 64 | `A ∪ {j}`. -/ |
| 65 | def Step (p : ℕ) (A next : Finset I.Job) (j : I.Job) : Prop := |
| 66 | (((A.card : ℤ) + 1) * p ≤ s j ∧ (running I A (s j)).card < I.machines ∧ |
| 67 | next = insert j A) ∨ |
| 68 | ((s j < ((A.card : ℤ) + 1) * p ∨ I.machines ≤ (running I A (s j)).card) ∧ |
| 69 | ∃ c ∈ insert j A, (∀ i ∈ insert j A, (I.d i : ℤ) ≤ (I.d c : ℤ)) ∧ |
| 70 | next = (insert j A).erase c) |
| 71 | |
| 72 | end Lax496464.Greedy |
| 73 |
Formalization Notes
The greedy is given as a relation between the set before a step and the set after it, not as a function. Both rules leave a choice — which job with the largest due date to drop — and a relation covers every way of resolving it at once, so the theorem is about the rule and not about one implementation of it.
The domination order is not the paper's, and the paper's will not do. Section 6.1 defines: dominates if , or and the -th largest due date in is not greater than the -th largest in . The first disjunct throws away all information about the due dates whenever the cardinalities differ, and the induction needs it exactly there: in the step that drops a job, the set compared against has one element fewer, so the induction hypothesis says only that the greedy's set is larger, and "the job removed is the one with the largest due date" has nothing left to act on.
Dropping the disjunct repairs it. Counting, for each threshold , how many due dates of a set lie at or below gives an order that is the paper's pointwise condition when the cardinalities agree, that implies , and that every greedy step preserves — which is what the induction needs. Stating it by counting rather than by listing the sorted due dates also turns every step of the argument into arithmetic.
Used by
From Mathlib
none
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments