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

The auxiliary problem AUX(p, q)

Lax391470.AuxiliaryProblem · concepts/Lax391470/AuxiliaryProblem.lean · lax-391470

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 intermediate problem through which the hardness proof passes. Fix two job lengths p>qp > q. An instance consists of a set JJ of ordinary jobs, each long (of length pp) or short (of length qq), with non-negative release times and deadlines, together with two sequences JpJ_p and JqJ_q of NN pending jobs each. The pending jobs of JpJ_p are long and those of JqJ_q are short. Every pending job is released at time 00 and carries two deadlines: an early deadline dd' and a late deadline dd. The deadlines satisfy

    dp,1dp,1dp,2dp,2dp,Ndp,N,d'_{p,1} \le d_{p,1} \le d'_{p,2} \le d_{p,2} \le \dots \le d'_{p,N} \le d_{p,N},dq,1dq,1dq,2dq,2dq,Ndq,N,d'_{q,1} \le d_{q,1} \le d'_{q,2} \le d_{q,2} \le \dots \le d'_{q,N} \le d_{q,N},dp,idq,ifor all i=1,,N.d_{p,i} \le d'_{q,i} \quad\text{for all } i = 1, \dots, N.

    The pending jobs Jp,iJ_{p,i} and Jq,iJ_{q,i} are connected. The question is whether JJpJqJ \cup J_p \cup J_q has a feasible schedule, every job meeting its late deadline, in which for every ii at least one of Jp,iJ_{p,i} and Jq,iJ_{q,i} completes by its early deadline.

    A connected pair is a disjunction between two jobs that may sit anywhere on the time line, which is what lets the problem express the clauses of a formula.

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

    Lean source view on GitHub

    1import Lax391470.Scheduling
    2
    3/-!
    4---
    5title: The auxiliary problem AUX(p, q)
    6type: definition
    7---
    8The intermediate problem through which the hardness proof passes. Fix two job lengths
    9p>qp > q. An instance consists of a set JJ of *ordinary* jobs, each long (of length pp)
    10or short (of length qq), with non-negative release times and deadlines, together with
    11two sequences JpJ_p and JqJ_q of NN *pending* jobs each. The pending jobs of JpJ_p are
    12long and those of JqJ_q are short. Every pending job is released at time 00 and carries
    13two deadlines: an *early* deadline dd' and a *late* deadline dd. The deadlines satisfy
    14dp,1dp,1dp,2dp,2dp,Ndp,N,d'_{p,1} \le d_{p,1} \le d'_{p,2} \le d_{p,2} \le \dots \le d'_{p,N} \le d_{p,N},
    15dq,1dq,1dq,2dq,2dq,Ndq,N,d'_{q,1} \le d_{q,1} \le d'_{q,2} \le d_{q,2} \le \dots \le d'_{q,N} \le d_{q,N},
    16dp,idq,ifor all i=1,,N.d_{p,i} \le d'_{q,i} \quad\text{for all } i = 1, \dots, N.
    17The pending jobs Jp,iJ_{p,i} and Jq,iJ_{q,i} are *connected*. The question is whether
    18JJpJqJ \cup J_p \cup J_q has a feasible schedule, every job meeting its late deadline, in
    19which for every ii at least one of Jp,iJ_{p,i} and Jq,iJ_{q,i} completes by its early
    20deadline.
    21
    22A connected pair is a disjunction between two jobs that may sit anywhere on the time
    23line, which is what lets the problem express the clauses of a formula.
    24
    25# Formalization notes
    26
    27An instance is data only; the three chains of inequalities are the separate predicate
    28`Ordered`. A construction can then be written down without proof obligations, and that
    29its output is ordered becomes a statement about it.
    30
    31The job lengths pp and qq are not part of an instance. An ordinary job records only
    32whether it is long, and the lengths enter where the instance is read as a scheduling
    33instance. The problem is thereby one family of instances interpreted at each pair of
    34lengths, as the notation AUX(p,q)\mathrm{AUX}(p, q) suggests.
    35
    36All times of an instance are natural numbers: the source requires the ordinary jobs'
    37release times and deadlines to be non-negative, and a pending job, released at 00, could
    38not meet a negative deadline.
    39
    40Forgetting the early deadlines gives an ordinary scheduling instance, `toInstance`, whose
    41jobs are the ordinary jobs, then the long pending jobs, then the short ones. A solution
    42is a feasible schedule of that instance satisfying the condition on connected pairs.
    43-/
    44
    45namespace Lax391470.AuxiliaryProblem
    46
    47open Lax391470.Scheduling
    48
    49/-- The data of an instance of `AUX(p, q)`: ordinary jobs, each long or short, and
    50`pairs` connected pairs of pending jobs with an early and a late deadline each. -/
    51structure Instance where
    52 /-- The number of ordinary jobs. -/
    53 ordinary : ℕ
    54 /-- The release time of an ordinary job. -/
    55 r : Fin ordinary → ℕ
    56 /-- The deadline of an ordinary job. -/
    57 d : Fin ordinary → ℕ
    58 /-- Whether an ordinary job is long (of length `p`) rather than short (of length `q`). -/
    59 long : Fin ordinary → Bool
    60 /-- The number `N` of connected pairs of pending jobs. -/
    61 pairs : ℕ
    62 /-- The early deadline `d'_{p,i}` of the `i`-th long pending job. -/
    63 longEarly : Fin pairs → ℕ
    64 /-- The late deadline `d_{p,i}` of the `i`-th long pending job. -/
    65 longDue : Fin pairs → ℕ
    66 /-- The early deadline `d'_{q,i}` of the `i`-th short pending job. -/
    67 shortEarly : Fin pairs → ℕ
    68 /-- The late deadline `d_{q,i}` of the `i`-th short pending job. -/
    69 shortDue : Fin pairs → ℕ
    70
    71namespace Instance
    72
    73variable (A : Instance)
    74
    75/-- The conditions on the deadlines of the pending jobs: within each sequence the
    76intervals between early and late deadline are ordered and do not intersect, and in every
    77connected pair the long job is the more urgent. -/
    78structure Ordered : Prop where
    79 /-- `d'_{p,i} ≤ d_{p,i}`. -/
    80 longEarly_le : ∀ i, A.longEarly i ≤ A.longDue i
    81 /-- `d_{p,i} ≤ d'_{p,i+1}`. -/
    82 longDue_le : ∀ i j : Fin A.pairs, (i : ℕ) + 1 = j → A.longDue i ≤ A.longEarly j
    83 /-- `d'_{q,i} ≤ d_{q,i}`. -/
    84 shortEarly_le : ∀ i, A.shortEarly i ≤ A.shortDue i
    85 /-- `d_{q,i} ≤ d'_{q,i+1}`. -/
    86 shortDue_le : ∀ i j : Fin A.pairs, (i : ℕ) + 1 = j → A.shortDue i ≤ A.shortEarly j
    87 /-- `d_{p,i} ≤ d'_{q,i}`. -/
    88 longDue_le_shortEarly : ∀ i, A.longDue i ≤ A.shortEarly i
    89
    90/-- The scheduling instance underlying `A` at the job lengths `p` and `q`: the ordinary
    91jobs, then the long pending jobs, then the short pending jobs, the pending jobs released
    92at `0` and due at their late deadlines. -/
    93def toInstance (p q : ℕ) : Scheduling.Instance where
    94 jobs := A.ordinary + A.pairs + A.pairs
    95 r j := if h : (j : ℕ) < A.ordinary then A.r ⟨j, h⟩ else 0
    96 d j :=
    97 if h : (j : ℕ) < A.ordinary then A.d ⟨j, h⟩
    98 else if h' : (j : ℕ) < A.ordinary + A.pairs then
    99 A.longDue ⟨j - A.ordinary, by omega⟩
    100 else A.shortDue ⟨j - A.ordinary - A.pairs, by have := j.isLt; omega⟩
    101 p j :=
    102 if h : (j : ℕ) < A.ordinary then (if A.long ⟨j, h⟩ then p else q)
    103 else if (j : ℕ) < A.ordinary + A.pairs then p
    104 else q
    105
    106/-- The `i`-th long pending job, as a job of the underlying instance. -/
    107def longJob (p q : ℕ) (i : Fin A.pairs) : Fin (A.toInstance p q).jobs :=
    108 ⟨A.ordinary + i, by have := i.isLt; simp only [toInstance]; omega⟩
    109
    110/-- The `i`-th short pending job, as a job of the underlying instance. -/
    111def shortJob (p q : ℕ) (i : Fin A.pairs) : Fin (A.toInstance p q).jobs :=
    112 ⟨A.ordinary + A.pairs + i, by have := i.isLt; simp only [toInstance]; omega⟩
    113
    114variable {A}
    115
    116/-- A schedule *solves* `A` at the lengths `p` and `q`: it is feasible, and in every
    117connected pair the long job completes by its early deadline or the short one does. -/
    118def Solves (p q : ℕ) (t : (A.toInstance p q).Schedule) : Prop :=
    119 Scheduling.Instance.Feasible t ∧
    120 ∀ i : Fin A.pairs,
    121 t (A.longJob p q i) + p ≤ A.longEarly i ∨ t (A.shortJob p q i) + q ≤ A.shortEarly i
    122
    123variable (A)
    124
    125/-- `A` has a solution at the lengths `p` and `q`. -/
    126def Solvable (p q : ℕ) : Prop := ∃ t, A.Solves p q t
    127
    128end Instance
    129
    130end Lax391470.AuxiliaryProblem
    131
    Formalization notes

    An instance is data only; the three chains of inequalities are the separate predicate OrderedOrdered. A construction can then be written down without proof obligations, and that its output is ordered becomes a statement about it.

    The job lengths pp and qq are not part of an instance. An ordinary job records only whether it is long, and the lengths enter where the instance is read as a scheduling instance. The problem is thereby one family of instances interpreted at each pair of lengths, as the notation AUX(p,q)\mathrm{AUX}(p, q) suggests.

    All times of an instance are natural numbers: the source requires the ordinary jobs' release times and deadlines to be non-negative, and a pending job, released at 00, could not meet a negative deadline.

    Forgetting the early deadlines gives an ordinary scheduling instance, toInstancetoInstance, whose jobs are the ordinary jobs, then the long pending jobs, then the short ones. A solution is a feasible schedule of that instance satisfying the condition on connected pairs.

    Discussion

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

    Loading discussion…