The Construction of Section 8

Lax496464.Construction · concepts/Lax496464/Construction.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 shop built from a Hitting Set instance (F1,…,Fm)(F_1, \dots, F_m) over {1,…,n}\{1, \dots, n\} with solution size kk. It has kk second-stage machines and unit weights.

    The time axis is measured in the unit Q=(k−1)(n+1)Q = (k-1)(n+1) and divided into RR segments, each of which is divided into mm epochs, one per set of the family. The epoch of segment rr and set jj is numbered g(r,j)=rm+jg(r,j) = rm + j and occupies the interval from G(r,j)=g(r,j)2QG(r,j) = g(r,j)^2 Q to G(r,j)+(2g(r,j)+1)Q=(g(r,j)+1)2QG(r,j) + (2g(r,j)+1)Q = (g(r,j)+1)^2 Q; the squares make each epoch exactly (2g+1)Q(2g+1)Q long, which is what the jobs are cut to fit.

    Each epoch carries three families of jobs.

    • One selection job for every element ii of FjF_j. It needs no preprocessing, occupies the whole epoch, and is due at its end, offset by ii.
    • Two dummy jobs for every element ii of the universe. The first occupies the first g(r,j)Qg(r,j)Q of the epoch, the second the last (g(r,j)+1)Q(g(r,j)+1)Q; both need g(r,j)(n+1)g(r,j)(n+1) units of preprocessing, which is what limits how many of them an epoch can afford.

    A hitting set of size kk selects, in every epoch, one selection job — the one for the element hitting that epoch's set — and 2(k−1)2(k-1) dummies, one pair for each of the other k−1k-1 elements. The target is R⋅m⋅(2k−1)R \cdot m \cdot (2k-1) just-in-time jobs.

    Concept map
    7 concepts; 2 descendants hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    In the paper

    • page 7 of this submission's paper

    Lean source view on GitHub

    1import Lax496464.FlowShop
    2import Lax496464.HittingSet
    3
    4/-!
    5---
    6title: The Construction of Section 8
    7type: definition
    8---
    9The shop built from a Hitting Set instance (F1,…,Fm)(F_1, \dots, F_m) over {1,…,n}\{1, \dots, n\}
    10with solution size kk. It has kk second-stage machines and unit weights.
    11
    12The time axis is measured in the unit Q=(k−1)(n+1)Q = (k-1)(n+1) and divided into RR *segments*,
    13each of which is divided into mm *epochs*, one per set of the family. The epoch of
    14segment rr and set jj is numbered g(r,j)=rm+jg(r,j) = rm + j and occupies the interval from
    15G(r,j)=g(r,j)2QG(r,j) = g(r,j)^2 Q to G(r,j)+(2g(r,j)+1)Q=(g(r,j)+1)2QG(r,j) + (2g(r,j)+1)Q = (g(r,j)+1)^2 Q; the squares make each
    16epoch exactly (2g+1)Q(2g+1)Q long, which is what the jobs are cut to fit.
    17
    18Each epoch carries three families of jobs.
    19
    20* One *selection job* for every element ii of FjF_j. It needs no preprocessing, occupies
    21 the whole epoch, and is due at its end, offset by ii.
    22* Two *dummy jobs* for every element ii of the universe. The first occupies the first
    23 g(r,j)Qg(r,j)Q of the epoch, the second the last (g(r,j)+1)Q(g(r,j)+1)Q; both need g(r,j)(n+1)g(r,j)(n+1) units
    24 of preprocessing, which is what limits how many of them an epoch can afford.
    25
    26A hitting set of size kk selects, in every epoch, one selection job — the one for the
    27element hitting that epoch's set — and 2(k−1)2(k-1) dummies, one pair for each of the other
    28k−1k-1 elements. The target is R⋅m⋅(2k−1)R \cdot m \cdot (2k-1) just-in-time jobs.
    29
    30# Formalization Notes
    31
    32**Two corrections to the published construction.** Both are recorded here because the
    33construction below is the corrected one.
    34
    35The first is the number of segments. The paper takes R=k(n−1)+1R = k(n-1)+1, and that is one too
    36few. The extraction of a hitting set is a pigeonhole: each machine's offset is
    37nondecreasing across segments and confined to {1,…,n}\{1, \dots, n\}, so it changes at most
    38n−1n-1 times, and at most k(n−1)k(n-1) of the gaps between consecutive segments see any
    39change. A gap across which nothing changes therefore exists only if there are *more* than
    40k(n−1)k(n-1) gaps, that is only if R−1>k(n−1)R - 1 > k(n-1). The published value gives exactly
    41R−1=k(n−1)R - 1 = k(n-1), and the count is not slack: let the first machine change across the
    42first n−1n-1 gaps, the second across the next n−1n-1, and so on, and every gap is consumed
    43with no two segments alike. Taking R=k(n−1)+2R = k(n-1)+2 repairs it, and costs nothing: every
    44statement about the construction is generic in RR.
    45
    46The second is the range of kk. The paper writes p(Ai,jr)=1k−1g(r,j)Qp(A^r_{i,j}) = \frac{1}{k-1} g(r,j) Q,
    47which presupposes k≥2k \ge 2 and says so nowhere. At k≤1k \le 1 the construction does not
    48merely degenerate, it is wrong: there Q=0Q = 0, so every second operation has length zero,
    49every interval [s,d)[s, d) is empty and no two jobs conflict at all. Every dummy still costs
    50more to preprocess than it has time for, but *all* selection jobs become schedulable
    51simultaneously, whatever the family looks like, and the target is met with no hitting set
    52in sight. The problem reduced from is accordingly restricted to 2≤k≤n2 \le k \le n, which
    53costs nothing.
    54
    55Two smaller things: the printed 1k−1g(r,j)Q\frac{1}{k-1} g(r,j) Q is the integer g(r,j)(n+1)g(r,j)(n+1),
    56which is what appears below, and the target size printed in the opening paragraph of the
    57section as 2m(2k−1)2m(2k-1) is the R⋅m⋅(2k−1)R \cdot m \cdot (2k-1) that the section's own subsections
    58and lemmas use.
    59
    60**Numbering.** Jobs are numbered rather than tagged, because an instance is something a
    61machine is handed and a word presents its jobs in an order. The selection block comes
    62first, RR copies of one job per membership pair (j,i)(j, i) with i∈Fji \in F_j, in the order
    63in which the pairs are enumerated; then the two dummy blocks, each R⋅m⋅nR \cdot m \cdot n
    64jobs indexed by segment, set and element in that order. Only the memberships that exist
    65are given jobs, so the weights are all one and the hardness claim lands on the
    66unit-weight slice, which is the problem FF(1,m)∣∣∑jZjFF(1,m) \mid\mid \sum_j Z_j the paper's first
    67theorem is about.
    68
    69The universe is counted from zero here and from one in the paper, and the offset that
    70distinguishes the nn jobs of an epoch from one another is correspondingly i+1i+1. It has
    71to be nonzero: an offset of zero would make two jobs of one epoch share a due date, and
    72the extraction of the hitting set reads the element off the due date.
    73
    74The element offsets are smaller than QQ, so they perturb the due dates without
    75disturbing the tiling of an epoch. That n<Qn < Q is exactly what k≥2k \ge 2 buys.
    76-/
    77
    78namespace Lax496464.Construction
    79
    80open Lax496464.FlowShop
    81
    82variable (P : HittingSet.Instance) (k : ℕ)
    83
    84/-- `R = k(n − 1) + 2`, the number of segments. The paper's value is one smaller; see the
    85notes above. -/
    86def R : ℕ := k * (P.n - 1) + 2
    87
    88/-- `Q = (k − 1)(n + 1)`, the unit the whole time axis is measured in. -/
    89def Q : ℕ := (k - 1) * (P.n + 1)
    90
    91/-- `g(r,j) = rm + j`, the position of the epoch of segment `r` and set `j`, counted from
    92one. -/
    93def g (r j : ℕ) : ℕ := r * P.m + (j + 1)
    94
    95/-- `G(r,j) = g(r,j)²Q`, the instant that epoch begins. -/
    96def G (r j : ℕ) : ℕ := g P r j ^ 2 * Q P k
    97
    98/-- The membership pairs `(j, i)` with `i ∈ F j`, enumerated. Each of them contributes one
    99selection job per segment. -/
    100def memberList : List (ℕ × ℕ) :=
    101 (List.finRange P.m).flatMap fun j =>
    102 (P.members j).map fun i : Fin P.n => ((j : ℕ), (i : ℕ))
    103
    104/-- The number of selection jobs: one per segment and membership pair. -/
    105def selCount : ℕ := R P k * (memberList P).length
    106
    107/-- The number of jobs in one dummy block: one per segment, set and universe element. -/
    108def dumCount : ℕ := R P k * P.m * P.n
    109
    110/-- The number of jobs of the constructed shop. -/
    111def numJobs : ℕ := selCount P k + 2 * dumCount P k
    112
    113/-- Job `t` described: which of the three families it belongs to — `0` selection, `1` the
    114first dummy, `2` the second — and its segment, set and element. -/
    115def slot (t : ℕ) : ℕ × ℕ × ℕ × ℕ :=
    116 if t < selCount P k then
    117 let e := (memberList P).getD (t % (memberList P).length) (0, 0)
    118 (0, t / (memberList P).length, e.1, e.2)
    119 else
    120 let u := t - selCount P k
    121 let v := if u < dumCount P k then u else u - dumCount P k
    122 (if u < dumCount P k then 1 else 2,
    123 v / (P.m * P.n), v % (P.m * P.n) / P.n, v % P.n)
    124
    125/-- Which of the three families job `t` belongs to. -/
    126def family (t : ℕ) : ℕ := (slot P k t).1
    127
    128/-- The segment of job `t`. -/
    129def seg (t : ℕ) : ℕ := (slot P k t).2.1
    130
    131/-- The set of the family job `t` belongs to. -/
    132def setIdx (t : ℕ) : ℕ := (slot P k t).2.2.1
    133
    134/-- The universe element of job `t`. -/
    135def elem (t : ℕ) : ℕ := (slot P k t).2.2.2
    136
    137/-- Preprocessing times: a selection job needs none, a dummy of epoch `(r,j)` needs
    138`g(r,j)(n+1)`, which is the paper's `g(r,j)Q/(k−1)`. -/
    139def jp (t : ℕ) : ℕ :=
    140 if family P k t = 0 then 0 else g P (seg P k t) (setIdx P k t) * (P.n + 1)
    141
    142/-- Processing times: a selection job fills its whole epoch, and the two dummies split it
    143in the ratio `g : g+1`. -/
    144def jq (t : ℕ) : ℕ :=
    145 if family P k t = 0 then (2 * g P (seg P k t) (setIdx P k t) + 1) * Q P k
    146 else if family P k t = 1 then g P (seg P k t) (setIdx P k t) * Q P k
    147 else (g P (seg P k t) (setIdx P k t) + 1) * Q P k
    148
    149/-- Due dates: the first dummy is due a `g(r,j)Q` into its epoch, the other two at its
    150end; all three are offset by the element they carry. -/
    151def jd (t : ℕ) : ℕ :=
    152 if family P k t = 1 then
    153 G P k (seg P k t) (setIdx P k t) + g P (seg P k t) (setIdx P k t) * Q P k
    154 + (elem P k t + 1)
    155 else
    156 G P k (seg P k t) (setIdx P k t) + (2 * g P (seg P k t) (setIdx P k t) + 1) * Q P k
    157 + (elem P k t + 1)
    158
    159/-- The shop built from `P` and `k`: `k` machines and unit weights. -/
    160def construct : FlowShop.Instance where
    161 jobs := numJobs P k
    162 machines := k
    163 p t := jp P k t
    164 q t := jq P k t
    165 d t := jd P k t
    166 w _ := 1
    167
    168/-- The number of just-in-time jobs the construction asks for: one selection job and
    169`2(k−1)` dummies in each of the `R·m` epochs. -/
    170def target : ℕ := R P k * P.m * (2 * k - 1)
    171
    172end Lax496464.Construction
    173
    Formalization Notes

    Two corrections to the published construction. Both are recorded here because the construction below is the corrected one.

    The first is the number of segments. The paper takes R=k(n−1)+1R = k(n-1)+1, and that is one too few. The extraction of a hitting set is a pigeonhole: each machine's offset is nondecreasing across segments and confined to {1,…,n}\{1, \dots, n\}, so it changes at most n−1n-1 times, and at most k(n−1)k(n-1) of the gaps between consecutive segments see any change. A gap across which nothing changes therefore exists only if there are more than k(n−1)k(n-1) gaps, that is only if R−1>k(n−1)R - 1 > k(n-1). The published value gives exactly R−1=k(n−1)R - 1 = k(n-1), and the count is not slack: let the first machine change across the first n−1n-1 gaps, the second across the next n−1n-1, and so on, and every gap is consumed with no two segments alike. Taking R=k(n−1)+2R = k(n-1)+2 repairs it, and costs nothing: every statement about the construction is generic in RR.

    The second is the range of kk. The paper writes p(Ai,jr)=1k−1g(r,j)Qp(A^r_{i,j}) = \frac{1}{k-1} g(r,j) Q, which presupposes k≥2k \ge 2 and says so nowhere. At k≤1k \le 1 the construction does not merely degenerate, it is wrong: there Q=0Q = 0, so every second operation has length zero, every interval [s,d)[s, d) is empty and no two jobs conflict at all. Every dummy still costs more to preprocess than it has time for, but all selection jobs become schedulable simultaneously, whatever the family looks like, and the target is met with no hitting set in sight. The problem reduced from is accordingly restricted to 2≤k≤n2 \le k \le n, which costs nothing.

    Two smaller things: the printed 1k−1g(r,j)Q\frac{1}{k-1} g(r,j) Q is the integer g(r,j)(n+1)g(r,j)(n+1), which is what appears below, and the target size printed in the opening paragraph of the section as 2m(2k−1)2m(2k-1) is the R⋅m⋅(2k−1)R \cdot m \cdot (2k-1) that the section's own subsections and lemmas use.

    Numbering. Jobs are numbered rather than tagged, because an instance is something a machine is handed and a word presents its jobs in an order. The selection block comes first, RR copies of one job per membership pair (j,i)(j, i) with i∈Fji \in F_j, in the order in which the pairs are enumerated; then the two dummy blocks, each R⋅m⋅nR \cdot m \cdot n jobs indexed by segment, set and element in that order. Only the memberships that exist are given jobs, so the weights are all one and the hardness claim lands on the unit-weight slice, which is the problem FF(1,m)∣∣∑jZjFF(1,m) \mid\mid \sum_j Z_j the paper's first theorem is about.

    The universe is counted from zero here and from one in the paper, and the offset that distinguishes the nn jobs of an epoch from one another is correspondingly i+1i+1. It has to be nonzero: an offset of zero would make two jobs of one epoch share a due date, and the extraction of the hitting set reads the element off the due date.

    The element offsets are smaller than QQ, so they perturb the due dates without disturbing the tiling of an epoch. That n<Qn < Q is exactly what k≥2k \ge 2 buys.

    Discussion

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

    Loading discussion…