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

Parallel machines

Lax434175.ParallelMachines · concepts/Lax434175/ParallelMachines.lean · lax-434175

proven

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

    Theorem

    An instance on parallel machines has nn jobs, mm machines, and a processing time pijp_{ij} of job jj on machine ii. A machine model on parallel machines is a kernel whose instances are of this form, together with the relation "at some time of schedule σ\sigma, job jj occupies exactly the set SS of machines". Non-preemptive and preemptive scheduling are two such models. A job may occupy several machines at once; the time it then needs is its largest processing time on these machines.

    The following fields restrict the instances of every machine model.

    The machine-environment field:

    • identical machines: the processing time of a job is the same on every machine;
    • uniform machines: there are a length qjq_j for every job and a positive speed sis_i for every machine with pij⋅si=qjp_{ij} \cdot s_i = q_j;
    • unrelated machines: no restriction.

    Processing times are integral, so uniform machines are represented with the time unit chosen fine enough that every quotient qj/siq_j / s_i is an integer.

    The processing-time field:

    • unit: pij=1p_{ij} = 1;
    • equal: there is a number pp with pij=pp_{ij} = p;
    • one or two: pij∈{1,2}p_{ij} \in \{1, 2\};
    • arbitrary: no restriction.

    In the environment field each value is a special case of the next. Unit processing times are a special case of equal ones and of one or two, and every value of arbitrary ones.

    Theorem. Over every machine model, the machine-environment and processing-time fields are sound.

    Concept map
    3 concepts
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on ADescendants are omitted for concepts with more than 10 descendants.
    Evidence

    This concept declares 2 statements. Each proof establishes one of them relative to its assumptions.

    Lean source view on GitHub

    1import Mathlib.Data.Finset.Lattice.Fold
    2import Mathlib.Data.Fintype.Basic
    3import Lax434175.Modules
    4
    5/-!
    6---
    7title: Parallel machines
    8type: theorem
    9---
    10An instance on parallel machines has nn jobs, mm machines, and a
    11processing time pijp_{ij} of job jj on machine ii. A machine model on
    12parallel machines is a kernel whose instances are of this form, together
    13with the relation "at some time of schedule σ\sigma, job jj occupies
    14exactly the set SS of machines". Non-preemptive and preemptive scheduling
    15are two such models. A job may occupy several machines at once; the time it
    16then needs is its largest processing time on these machines.
    17
    18The following fields restrict the instances of every machine model.
    19
    20The machine-environment field:
    21
    22- identical machines: the processing time of a job is the same on every
    23 machine;
    24- uniform machines: there are a length qjq_j for every job and a positive
    25 speed sis_i for every machine with pij⋅si=qjp_{ij} \cdot s_i = q_j;
    26- unrelated machines: no restriction.
    27
    28Processing times are integral, so uniform machines are represented with the
    29time unit chosen fine enough that every quotient qj/siq_j / s_i is an integer.
    30
    31The processing-time field:
    32
    33- unit: pij=1p_{ij} = 1;
    34- equal: there is a number pp with pij=pp_{ij} = p;
    35- one or two: pij∈{1,2}p_{ij} \in \{1, 2\};
    36- arbitrary: no restriction.
    37
    38In the environment field each value is a special case of the next. Unit
    39processing times are a special case of equal ones and of one or two, and
    40every value of arbitrary ones.
    41
    42**Theorem.** Over every machine model, the machine-environment and
    43processing-time fields are sound.
    44-/
    45
    46namespace Lax434175.ParallelMachines
    47open Lax434175.Kernels Lax434175.Modules
    48
    49structure Inst where
    50 jobs : ℕ
    51 machines : ℕ
    52 /-- The processing time of a job on a machine. -/
    53 p : Fin jobs → Fin machines → ℕ
    54 /-- The release date of a job. -/
    55 r : Fin jobs → ℕ
    56
    57/-- The time a job needs when it occupies a set of machines. -/
    58def duration (x : Inst) (j : Fin x.jobs) (S : Finset (Fin x.machines)) : ℕ :=
    59 S.sup (x.p j)
    60
    61/-- A kernel on parallel machines. -/
    62structure Model where
    63 kernel : Kernel
    64 /-- The parallel-machine instance underlying an instance of the kernel. -/
    65 inst : kernel.Inst → Inst
    66 /-- The jobs of the kernel are those of the underlying instance. -/
    67 jobs_eq : ∀ x, kernel.jobs x = (inst x).jobs
    68 /-- At some time of the schedule the job occupies exactly this set of
    69 machines. -/
    70 uses : (x : kernel.Inst) → kernel.Sched x → Fin (inst x).jobs →
    71 Finset (Fin (inst x).machines) → Prop
    72
    73inductive Environment
    74 | identical
    75 | uniform
    76 | unrelated
    77
    78/-- The instances of a machine environment. -/
    79def Environment.holds : Environment → Inst → Prop
    80 | .identical, x => ∀ j i i', x.p j i = x.p j i'
    81 | .uniform, x => ∃ (q : Fin x.jobs → ℕ) (s : Fin x.machines → ℕ),
    82 ∀ j i, 0 < s i ∧ x.p j i * s i = q j
    83 | .unrelated, _ => True
    84
    85/-- The position of an environment in the chain identical, uniform, unrelated. -/
    86def Environment.rank : Environment → ℕ
    87 | .identical => 0
    88 | .uniform => 1
    89 | .unrelated => 2
    90
    91/-- The machine-environment field. -/
    92def environment (M : Model) : Module M.kernel :=
    93 Module.ofRestriction Environment (fun v x => v.holds (M.inst x))
    94 (fun v w => decide (v.rank ≤ w.rank))
    95
    96inductive ProcessingTimes
    97 | unit
    98 | equal
    99 | oneOrTwo
    100 | arbitrary
    101 deriving DecidableEq
    102
    103/-- The instances of a processing-time restriction. -/
    104def ProcessingTimes.holds : ProcessingTimes → Inst → Prop
    105 | .unit, x => ∀ j i, x.p j i = 1
    106 | .equal, x => ∃ p, ∀ j i, x.p j i = p
    107 | .oneOrTwo, x => ∀ j i, x.p j i = 1 ∨ x.p j i = 2
    108 | .arbitrary, _ => True
    109
    110def ProcessingTimes.le : ProcessingTimes → ProcessingTimes → Bool
    111 | _, .arbitrary => true
    112 | .unit, _ => true
    113 | v, w => decide (v = w)
    114
    115/-- The processing-time field. -/
    116def processingTimes (M : Model) : Module M.kernel :=
    117 Module.ofRestriction ProcessingTimes (fun v x => v.holds (M.inst x)) ProcessingTimes.le
    118
    119/-- The number of machines, a parameter of every machine model. -/
    120def machines (M : Model) : M.kernel.Inst → ℕ := fun x => (M.inst x).machines
    121
    122axiom environment_sound (M : Model) : (environment M).Sound
    123
    124axiom processingTimes_sound (M : Model) : (processingTimes M).Sound
    125
    126end Lax434175.ParallelMachines
    127
    Show ProofShow Proof

    Discussion

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

    Loading discussion…