Online scheduling as a game
Lax434175.Online · concepts/Lax434175/Online.lean · lax-434175
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
In an online problem the instance is revealed over time, and a schedule must be fixed as time passes. A revelation of a problem says, for every time , which instances look the same to the scheduler at time , and which schedules of two instances have made the same decisions up to time .
The competitive-ratio game is played by the scheduler and an adversary. The scheduler chooses an algorithm, a schedule for every instance, which must be non-anticipative: on two instances that look the same at time it makes the same decisions up to time . The adversary then chooses an instance. For a ratio and an additive constant , the scheduler wins if its schedule is feasible and costs at most times the cost of every feasible schedule of the instance, plus ; otherwise the adversary wins. An algorithm with which the scheduler always wins is -competitive.
A randomized algorithm is a finite probability distribution over non-anticipative algorithms; it is -competitive if all its algorithms schedule every instance feasibly and its expected cost is at most times the cost of every feasible schedule, plus . A distribution over instances, each with a feasible schedule as witness, defeats the ratio if every non-anticipative algorithm schedules some instance of it infeasibly or has positive expected excess, the cost minus times the witness's cost minus .
An embedding of one problem into another is causal for two revelations if instances that look the same at time are mapped to instances that look the same at time , and schedules that made the same decisions up to time are translated back to schedules that made the same decisions up to time .
Theorem.
- The game is determined: the adversary wins against every non-anticipative algorithm exactly if the scheduler has no winning algorithm.
- A deterministic competitive algorithm is a randomized one.
- (Yao's principle, the direction used for lower bounds.) If a distribution over instances defeats a ratio, no randomized algorithm has that ratio.
- Along a sound causal embedding of into and for , a -competitive algorithm for yields one for , so that lower bounds pass from to .
Concept map
Evidence
This concept declares 5 statements. Each proof establishes one of them relative to its assumptions.
1 adversaryWins_iff proven
2 adversaryWins_of_embedding proven
3 randomized_of_competitive proven
4 schedulerWins_of_embedding proven
5 yao proven
Lean source view on GitHub
| 1 | import Lax434175.Problems |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Online scheduling as a game |
| 6 | type: theorem |
| 7 | --- |
| 8 | In an online problem the instance is revealed over time, and a schedule must |
| 9 | be fixed as time passes. A revelation of a problem says, for every time |
| 10 | , which instances look the same to the scheduler at time , and |
| 11 | which schedules of two instances have made the same decisions up to time |
| 12 | . |
| 13 | |
| 14 | The competitive-ratio game is played by the scheduler and an adversary. The |
| 15 | scheduler chooses an algorithm, a schedule for every instance, which must be |
| 16 | non-anticipative: on two instances that look the same at time it makes |
| 17 | the same decisions up to time . The adversary then chooses an instance. |
| 18 | For a ratio and an additive constant , the scheduler wins if |
| 19 | its schedule is feasible and costs at most times the cost of every |
| 20 | feasible schedule of the instance, plus ; otherwise the adversary |
| 21 | wins. An algorithm with which the scheduler always wins is |
| 22 | -competitive. |
| 23 | |
| 24 | A randomized algorithm is a finite probability distribution over |
| 25 | non-anticipative algorithms; it is -competitive if all its |
| 26 | algorithms schedule every instance feasibly and its expected cost is at most |
| 27 | times the cost of every feasible schedule, plus . A |
| 28 | distribution over instances, each with a feasible schedule as witness, |
| 29 | defeats the ratio if every non-anticipative algorithm schedules some instance |
| 30 | of it infeasibly or has positive expected excess, the cost minus |
| 31 | times the witness's cost minus . |
| 32 | |
| 33 | An embedding of one problem into another is causal for two revelations if |
| 34 | instances that look the same at time are mapped to instances that look |
| 35 | the same at time , and schedules that made the same decisions up to time |
| 36 | are translated back to schedules that made the same decisions up to |
| 37 | time . |
| 38 | |
| 39 | **Theorem.** |
| 40 | |
| 41 | 1. The game is determined: the adversary wins against every non-anticipative |
| 42 | algorithm exactly if the scheduler has no winning algorithm. |
| 43 | 2. A deterministic competitive algorithm is a randomized one. |
| 44 | 3. (Yao's principle, the direction used for lower bounds.) If a distribution |
| 45 | over instances defeats a ratio, no randomized algorithm has that ratio. |
| 46 | 4. Along a sound causal embedding of into and for , a |
| 47 | -competitive algorithm for yields one for , so |
| 48 | that lower bounds pass from to . |
| 49 | -/ |
| 50 | |
| 51 | namespace Lax434175.Online |
| 52 | open Lax434175.Problems |
| 53 | |
| 54 | /-- How the instances of a problem are revealed over time. -/ |
| 55 | structure Revelation (P : Problem) where |
| 56 | /-- The two instances look the same to the scheduler at time `t`. -/ |
| 57 | same : P.Inst → P.Inst → NNRat → Prop |
| 58 | /-- Two schedules of two instances made the same decisions up to time `t`. -/ |
| 59 | agree : (x y : P.Inst) → P.Sched x → P.Sched y → NNRat → Prop |
| 60 | |
| 61 | variable {P : Problem} |
| 62 | |
| 63 | /-- A deterministic algorithm: a schedule for every instance. -/ |
| 64 | abbrev Algorithm (P : Problem) := (x : P.Inst) → P.Sched x |
| 65 | |
| 66 | /-- The algorithm decides up to time `t` only from what is revealed at `t`. -/ |
| 67 | def NonAnticipative (R : Revelation P) (A : Algorithm P) : Prop := |
| 68 | ∀ x y t, R.same x y t → R.agree x y (A x) (A y) t |
| 69 | |
| 70 | /-- The scheduler wins on every instance: a feasible schedule costing at most |
| 71 | `ρ` times every feasible schedule, plus `α`. -/ |
| 72 | def Competitive (A : Algorithm P) (ρ α : ℚ) : Prop := |
| 73 | ∀ x, P.feasible x (A x) ∧ ∀ σ, P.feasible x σ → P.cost x (A x) ≤ ρ * P.cost x σ + α |
| 74 | |
| 75 | /-- The scheduler has a winning strategy. -/ |
| 76 | def SchedulerWins (R : Revelation P) (ρ α : ℚ) : Prop := |
| 77 | ∃ A, NonAnticipative R A ∧ Competitive A ρ α |
| 78 | |
| 79 | /-- The adversary beats every non-anticipative algorithm. -/ |
| 80 | def AdversaryWins (R : Revelation P) (ρ α : ℚ) : Prop := |
| 81 | ∀ A, NonAnticipative R A → ∃ x, ¬ P.feasible x (A x) ∨ |
| 82 | ∃ σ, P.feasible x σ ∧ ρ * P.cost x σ + α < P.cost x (A x) |
| 83 | |
| 84 | /-- A finite probability distribution over non-anticipative algorithms. -/ |
| 85 | structure Randomized (R : Revelation P) where |
| 86 | algorithms : List (ℚ × Algorithm P) |
| 87 | nonneg : ∀ a ∈ algorithms, 0 ≤ a.1 |
| 88 | total : (algorithms.map Prod.fst).sum = 1 |
| 89 | nonAnticipative : ∀ a ∈ algorithms, NonAnticipative R a.2 |
| 90 | |
| 91 | /-- The expected cost of a randomized algorithm on an instance. -/ |
| 92 | def Randomized.cost {R : Revelation P} (μ : Randomized R) (x : P.Inst) : ℚ := |
| 93 | (μ.algorithms.map fun a => a.1 * P.cost x (a.2 x)).sum |
| 94 | |
| 95 | def Randomized.Competitive {R : Revelation P} (μ : Randomized R) (ρ α : ℚ) : Prop := |
| 96 | ∀ x, (∀ a ∈ μ.algorithms, P.feasible x (a.2 x)) ∧ |
| 97 | ∀ σ, P.feasible x σ → μ.cost x ≤ ρ * P.cost x σ + α |
| 98 | |
| 99 | /-- A finite distribution over instances, each with a feasible witness |
| 100 | schedule. -/ |
| 101 | structure Hard (P : Problem) where |
| 102 | instances : List (ℚ × (x : P.Inst) × P.Sched x) |
| 103 | nonneg : ∀ a ∈ instances, 0 ≤ a.1 |
| 104 | feasible : ∀ a ∈ instances, P.feasible a.2.1 a.2.2 |
| 105 | |
| 106 | /-- The expected excess of an algorithm over `ρ` times the witnesses plus `α`. -/ |
| 107 | def Hard.excess (H : Hard P) (A : Algorithm P) (ρ α : ℚ) : ℚ := |
| 108 | (H.instances.map fun a => a.1 * (P.cost a.2.1 (A a.2.1) - ρ * P.cost a.2.1 a.2.2 - α)).sum |
| 109 | |
| 110 | /-- The distribution defeats the ratio: every non-anticipative algorithm |
| 111 | schedules one of its instances infeasibly or has positive expected excess. -/ |
| 112 | def Hard.Defeats (H : Hard P) (R : Revelation P) (ρ α : ℚ) : Prop := |
| 113 | ∀ A, NonAnticipative R A → (∃ a ∈ H.instances, ¬ P.feasible a.2.1 (A a.2.1)) ∨ |
| 114 | 0 < H.excess A ρ α |
| 115 | |
| 116 | /-- The embedding respects what is revealed and what is decided. -/ |
| 117 | structure Causal {A B : Problem} (RA : Revelation A) (RB : Revelation B) |
| 118 | (e : Embedding A B) : Prop where |
| 119 | same : ∀ x y t, RA.same x y t → RB.same (e.map x) (e.map y) t |
| 120 | agree : ∀ x y τ τ' t, RB.agree (e.map x) (e.map y) τ τ' t → |
| 121 | RA.agree x y (e.back x τ) (e.back y τ') t |
| 122 | |
| 123 | axiom adversaryWins_iff (R : Revelation P) (ρ α : ℚ) : |
| 124 | AdversaryWins R ρ α ↔ ¬ SchedulerWins R ρ α |
| 125 | |
| 126 | axiom randomized_of_competitive (R : Revelation P) {A : Algorithm P} {ρ α : ℚ} |
| 127 | (hA : NonAnticipative R A) (hc : Competitive A ρ α) : |
| 128 | ∃ μ : Randomized R, μ.Competitive ρ α |
| 129 | |
| 130 | axiom yao (R : Revelation P) (H : Hard P) {ρ α : ℚ} (hH : H.Defeats R ρ α) : |
| 131 | ¬ ∃ μ : Randomized R, μ.Competitive ρ α |
| 132 | |
| 133 | axiom schedulerWins_of_embedding {A B : Problem} {RA : Revelation A} {RB : Revelation B} |
| 134 | {e : Embedding A B} (he : e.Sound) (hc : Causal RA RB e) {ρ α : ℚ} (hρ : 0 ≤ ρ) : |
| 135 | SchedulerWins RB ρ α → SchedulerWins RA ρ α |
| 136 | |
| 137 | axiom adversaryWins_of_embedding {A B : Problem} {RA : Revelation A} {RB : Revelation B} |
| 138 | {e : Embedding A B} (he : e.Sound) (hc : Causal RA RB e) {ρ α : ℚ} (hρ : 0 ≤ ρ) : |
| 139 | AdversaryWins RA ρ α → AdversaryWins RB ρ α |
| 140 | |
| 141 | end Lax434175.Online |
| 142 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments