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

Online scheduling as a game

Lax434175.Online · concepts/Lax434175/Online.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

    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 t≥0t \ge 0, which instances look the same to the scheduler at time tt, and which schedules of two instances have made the same decisions up to time tt.

    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 tt it makes the same decisions up to time tt. The adversary then chooses an instance. For a ratio ρ\rho and an additive constant α\alpha, the scheduler wins if its schedule is feasible and costs at most ρ\rho times the cost of every feasible schedule of the instance, plus α\alpha; otherwise the adversary wins. An algorithm with which the scheduler always wins is (ρ,α)(\rho, \alpha)-competitive.

    A randomized algorithm is a finite probability distribution over non-anticipative algorithms; it is (ρ,α)(\rho, \alpha)-competitive if all its algorithms schedule every instance feasibly and its expected cost is at most ρ\rho times the cost of every feasible schedule, plus α\alpha. 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 ρ\rho times the witness's cost minus α\alpha.

    An embedding of one problem into another is causal for two revelations if instances that look the same at time tt are mapped to instances that look the same at time tt, and schedules that made the same decisions up to time tt are translated back to schedules that made the same decisions up to time tt.

    Theorem.

    1. The game is determined: the adversary wins against every non-anticipative algorithm exactly if the scheduler has no winning algorithm.
    2. A deterministic competitive algorithm is a randomized one.
    3. (Yao's principle, the direction used for lower bounds.) If a distribution over instances defeats a ratio, no randomized algorithm has that ratio.
    4. Along a sound causal embedding of AA into BB and for ρ≥0\rho \ge 0, a (ρ,α)(\rho, \alpha)-competitive algorithm for BB yields one for AA, so that lower bounds pass from AA to BB.
    Concept map
    2 concepts
    100%
    Proven claimThis conceptRelated conceptA → B: B builds on ADescendants are omitted for concepts with more than 10 descendants.
    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

    1import Lax434175.Problems
    2
    3/-!
    4---
    5title: Online scheduling as a game
    6type: theorem
    7---
    8In an online problem the instance is revealed over time, and a schedule must
    9be fixed as time passes. A revelation of a problem says, for every time
    10t≥0t \ge 0, which instances look the same to the scheduler at time tt, and
    11which schedules of two instances have made the same decisions up to time
    12tt.
    13
    14The competitive-ratio game is played by the scheduler and an adversary. The
    15scheduler chooses an algorithm, a schedule for every instance, which must be
    16non-anticipative: on two instances that look the same at time tt it makes
    17the same decisions up to time tt. The adversary then chooses an instance.
    18For a ratio ρ\rho and an additive constant α\alpha, the scheduler wins if
    19its schedule is feasible and costs at most ρ\rho times the cost of every
    20feasible schedule of the instance, plus α\alpha; otherwise the adversary
    21wins. An algorithm with which the scheduler always wins is
    22(ρ,α)(\rho, \alpha)-competitive.
    23
    24A randomized algorithm is a finite probability distribution over
    25non-anticipative algorithms; it is (ρ,α)(\rho, \alpha)-competitive if all its
    26algorithms schedule every instance feasibly and its expected cost is at most
    27ρ\rho times the cost of every feasible schedule, plus α\alpha. A
    28distribution over instances, each with a feasible schedule as witness,
    29defeats the ratio if every non-anticipative algorithm schedules some instance
    30of it infeasibly or has positive expected excess, the cost minus ρ\rho
    31times the witness's cost minus α\alpha.
    32
    33An embedding of one problem into another is causal for two revelations if
    34instances that look the same at time tt are mapped to instances that look
    35the same at time tt, and schedules that made the same decisions up to time
    36tt are translated back to schedules that made the same decisions up to
    37time tt.
    38
    39**Theorem.**
    40
    411. The game is determined: the adversary wins against every non-anticipative
    42 algorithm exactly if the scheduler has no winning algorithm.
    432. A deterministic competitive algorithm is a randomized one.
    443. (Yao's principle, the direction used for lower bounds.) If a distribution
    45 over instances defeats a ratio, no randomized algorithm has that ratio.
    464. Along a sound causal embedding of AA into BB and for ρ≥0\rho \ge 0, a
    47 (ρ,α)(\rho, \alpha)-competitive algorithm for BB yields one for AA, so
    48 that lower bounds pass from AA to BB.
    49-/
    50
    51namespace Lax434175.Online
    52open Lax434175.Problems
    53
    54/-- How the instances of a problem are revealed over time. -/
    55structure 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
    61variable {P : Problem}
    62
    63/-- A deterministic algorithm: a schedule for every instance. -/
    64abbrev 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`. -/
    67def 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 `α`. -/
    72def 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. -/
    76def SchedulerWins (R : Revelation P) (ρ α : ℚ) : Prop :=
    77 ∃ A, NonAnticipative R A ∧ Competitive A ρ α
    78
    79/-- The adversary beats every non-anticipative algorithm. -/
    80def 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. -/
    85structure 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. -/
    92def 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
    95def 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
    100schedule. -/
    101structure 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 `α`. -/
    107def 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
    111schedules one of its instances infeasibly or has positive expected excess. -/
    112def 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. -/
    117structure 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
    123axiom adversaryWins_iff (R : Revelation P) (ρ α : ℚ) :
    124 AdversaryWins R ρ α ↔ ¬ SchedulerWins R ρ α
    125
    126axiom randomized_of_competitive (R : Revelation P) {A : Algorithm P} {ρ α : ℚ}
    127 (hA : NonAnticipative R A) (hc : Competitive A ρ α) :
    128 ∃ μ : Randomized R, μ.Competitive ρ α
    129
    130axiom yao (R : Revelation P) (H : Hard P) {ρ α : ℚ} (hH : H.Defeats R ρ α) :
    131 ¬ ∃ μ : Randomized R, μ.Competitive ρ α
    132
    133axiom 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
    137axiom 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
    141end Lax434175.Online
    142
    Show ProofShow ProofShow ProofShow ProofShow Proof
    Builds on
    Used by
    From Mathlib

    none

    Discussion

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

    Loading discussion…