The Greedy of Section 6.1, and Its Domination Order

Lax496464.Greedy · concepts/Lax496464/Greedy.lean · lax-496464

definition

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

    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 AA of already selected jobs is maintained. On reaching job jj:

    • if the first stage can still preprocess ∣A∣+1|A| + 1 jobs by sjs_j, and fewer than mm of the selected jobs are alive at sjs_j, then jj joins AA;
    • otherwise one job of A∪{j}A \cup \{j\} with the largest due date is dropped, and the rest becomes the new AA.

    The set kept is compared to others through a domination order: SS dominates S′S' when, below every threshold, S′S' has no more due dates than SS.

    Concept map
    5 concepts; 1 descendant hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    In the paper

    • page 6 of this submission's paper

    Lean source view on GitHub

    1import Lax496464.Conditions
    2import Lax496464.EstOrder
    3import Lax496464.ProperInstances
    4
    5/-!
    6---
    7title: The Greedy of Section 6.1, and Its Domination Order
    8type: definition
    9---
    10The algorithm behind the first half of the fourth theorem, for the case in which all
    11preprocessing times are equal and every weight is one. The jobs are taken in
    12earliest-start-time order, and a set AA of already selected jobs is maintained. On
    13reaching job jj:
    14
    15* if the first stage can still preprocess ∣A∣+1|A| + 1 jobs by sjs_j, and fewer than mm of
    16 the selected jobs are alive at sjs_j, then jj joins AA;
    17* otherwise one job of A∪{j}A \cup \{j\} with the largest due date is dropped, and the rest
    18 becomes the new AA.
    19
    20The set kept is compared to others through a *domination* order: SS dominates S′S' when,
    21below every threshold, S′S' has no more due dates than SS.
    22
    23# Formalization Notes
    24
    25The greedy is given as a relation between the set before a step and the set after it,
    26not as a function. Both rules leave a choice — which job with the largest due date to
    27drop — and a relation covers every way of resolving it at once, so the theorem is about
    28the 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
    31defines: SS dominates S′S' if ∣S∣>∣S′∣|S| > |S'|, or ∣S∣=∣S′∣|S| = |S'| and the ii-th largest due
    32date in SS is not greater than the ii-th largest in S′S'. The first disjunct throws
    33away all information about the due dates whenever the cardinalities differ, and the
    34induction needs it exactly there: in the step that drops a job, the set compared against
    35has 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
    37act on.
    38
    39Dropping the disjunct repairs it. Counting, for each threshold tt, how many due dates of
    40a set lie at or below tt gives an order that is the paper's pointwise condition when the
    41cardinalities agree, that implies ∣S′∣≤∣S∣|S'| \le |S|, and that every greedy step preserves —
    42which is what the induction needs. Stating it by counting rather than by listing the
    43sorted due dates also turns every step of the argument into arithmetic.
    44-/
    45
    46namespace Lax496464.Greedy
    47
    48open Lax496464.FlowShop Lax496464.FlowShop.Instance
    49
    50variable (I : Instance)
    51
    52/-- How many jobs of `Z` are due at or before `t`. -/
    53def 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
    56dates than `S`. -/
    57def 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. -/
    60def 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
    63reaching job `j`. Either `j` is added, or a job of largest due date is dropped from
    64`A ∪ {j}`. -/
    65def 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
    72end 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: SS dominates S′S' if ∣S∣>∣S′∣|S| > |S'|, or ∣S∣=∣S′∣|S| = |S'| and the ii-th largest due date in SS is not greater than the ii-th largest in S′S'. 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 tt, how many due dates of a set lie at or below tt gives an order that is the paper's pointwise condition when the cardinalities agree, that implies ∣S′∣≤∣S∣|S'| \le |S|, 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.

    Discussion

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

    Loading discussion…