Forbidden times and input encodings
Lax434175.ForbiddenTimes · concepts/Lax434175/ForbiddenTimes.lean · lax-434175
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
Two fields that apply to every kernel.
The forbidden-times field has the values "none" and "forbidden times". With forbidden times, an instance carries a finite list of points in time, and no job may start or complete at one of them. An instance without forbidden times is read as one with the empty list.
The encoding field has the values "standard" and "high multiplicity". It does not restrict the instances or the schedules: the value high multiplicity records that the input lists every kind of job once, with its multiplicity in binary, which concerns the size of the input only. The standard encoding is the special case in which every multiplicity is one.
Theorem. Over every kernel, both fields are sound.
Concept map
Evidence
Lean source view on GitHub
| 1 | import Mathlib.Data.NNRat.Defs |
| 2 | import Lax434175.Modules |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: Forbidden times and input encodings |
| 7 | type: theorem |
| 8 | --- |
| 9 | Two fields that apply to every kernel. |
| 10 | |
| 11 | The forbidden-times field has the values "none" and "forbidden times". With |
| 12 | forbidden times, an instance carries a finite list of points in time, and no |
| 13 | job may start or complete at one of them. An instance without forbidden |
| 14 | times is read as one with the empty list. |
| 15 | |
| 16 | The encoding field has the values "standard" and "high multiplicity". It |
| 17 | does not restrict the instances or the schedules: the value high |
| 18 | multiplicity records that the input lists every kind of job once, with its |
| 19 | multiplicity in binary, which concerns the size of the input only. The |
| 20 | standard encoding is the special case in which every multiplicity is one. |
| 21 | |
| 22 | **Theorem.** Over every kernel, both fields are sound. |
| 23 | -/ |
| 24 | |
| 25 | namespace Lax434175.ForbiddenTimes |
| 26 | open Lax434175.Kernels Lax434175.Modules |
| 27 | |
| 28 | inductive Value |
| 29 | | none |
| 30 | | forbidden |
| 31 | |
| 32 | /-- No data without forbidden times; a list of points in time with them. -/ |
| 33 | def Data : Value → Type |
| 34 | | .none => Unit |
| 35 | | .forbidden => List ℕ |
| 36 | |
| 37 | /-- The forbidden times; none when the field is absent. -/ |
| 38 | def view : (v : Value) → Data v → List ℕ |
| 39 | | .none, _ => [] |
| 40 | | .forbidden, l => l |
| 41 | |
| 42 | def le : Value → Value → Bool |
| 43 | | .forbidden, .none => false |
| 44 | | _, _ => true |
| 45 | |
| 46 | def embed : {v w : Value} → le v w = true → Data v → Data w |
| 47 | | _, .none, _, _ => () |
| 48 | | v, .forbidden, _, d => view v d |
| 49 | |
| 50 | /-- The forbidden-times field over a kernel. -/ |
| 51 | def module (K : Kernel) : Module K where |
| 52 | Value := Value |
| 53 | Data v _ := Data v |
| 54 | admits _ _ _ := True |
| 55 | constraint v x d σ := ∀ t ∈ view v d, ∀ j, |
| 56 | K.start x σ j ≠ (t : NNRat) ∧ K.completion x σ j ≠ (t : NNRat) |
| 57 | le := le |
| 58 | embed h _ d := embed h d |
| 59 | |
| 60 | inductive Encoding |
| 61 | | standard |
| 62 | | highMultiplicity |
| 63 | deriving DecidableEq |
| 64 | |
| 65 | /-- The encoding field over a kernel. -/ |
| 66 | def encoding (K : Kernel) : Module K := |
| 67 | Module.ofRestriction Encoding (fun _ _ => True) |
| 68 | (fun v w => decide (v = .standard ∨ v = w)) |
| 69 | |
| 70 | axiom sound (K : Kernel) : (module K).Sound |
| 71 | |
| 72 | axiom encoding_sound (K : Kernel) : (encoding K).Sound |
| 73 | |
| 74 | end Lax434175.ForbiddenTimes |
| 75 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments