Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 7.2 — Yao's principle for the randomized competitive ratio

Proved
MetricalTaskSystem.Randomized.randomizedRatio_ge_limsup

by mikedeng1 · Sep 26, 2026 · Mathlib 0df444a (Lean v4.33.1)

competitive-analysisonline-algorithmsp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1probabilityrandomized-algorithms

Let (S,d)(S,d)(S,d) be a task system and s0s_0s0​ an initial state. Let the tasks come from a finite alphabet α\alphaα, letter aaa standing for the nonnegative task UaU_aUa​, and let DDD be a probability measure on infinite letter sequences. Write EEE for expectation under DDD, Tj\mathbf T^jTj for the first jjj tasks, and

mj=inf⁡AE(cA(Tj)),m_j=\inf_A E\big(c_A(\mathbf T^j)\big),mj​=Ainf​E(cA​(Tj)),

the infimum over all deterministic on-line algorithms AAA. Suppose that E(c0(Tj))→∞E(c_0(\mathbf T^j))\to\inftyE(c0​(Tj))→∞ as j→∞j\to\inftyj→∞. Then for every www such that some randomized on-line algorithm is expected www-competitive,

lim sup⁡j→∞mjE(c0(Tj))≤w.\limsup_{j\to\infty}\frac{m_j}{E\big(c_0(\mathbf T^j)\big)}\le w .j→∞limsup​E(c0​(Tj))mj​​≤w.

Equivalently, wˉ(S,d)≥lim sup⁡jmj/E(c0(Tj))\bar w(S,d)\ge\limsup_{j}m_j/E(c_0(\mathbf T^j))wˉ(S,d)≥limsupj​mj​/E(c0​(Tj)) with the convention inf⁡∅=+∞\inf\emptyset=+\inftyinf∅=+∞.

The lemma turns a lower bound on the expected cost of every deterministic algorithm against one input distribution into a lower bound on the randomized competitive ratio.

Formalization Note The lemma is stated for distributions on sequences over a finite task alphabet, so that E(cA(Tj))E(c_A(\mathbf T^j))E(cA​(Tj)) is a genuine expectation for every deterministic AAA; this covers the distribution used in the paper's application. The lim sup⁡\limsuplimsup is taken in the extended reals. The conclusion is stated for each achievable www rather than for the real infimum wˉ(S,d)\bar w(S,d)wˉ(S,d), whose value on an empty set would be 000.

Preamble
import Mathlib
import Definitions.Def_MetricalTaskSystem_Randomized_Model
import Definitions.Def_MetricalTaskSystem_Randomized_RandomizedAlgorithm
import Definitions.Def_MetricalTaskSystem_Randomized_TaskDistribution
Formal statement
namespace MetricalTaskSystem.Randomized

open MeasureTheory Filter

/-- **Lemma 7.2** (Borodin–Linial–Saks 1992, p. 759), for task sequences over a finite task
alphabet. Let `(S, d)` be a task system, `U : α → (S → ℝ)` a finite family of nonnegative tasks
and `D` a probability measure on infinite sequences of letters (so on infinite task sequences).
If `E(c₀(Tʲ)) → ∞`, then for every `w` such that some randomized on-line algorithm is expected
`w`-competitive, `limsup_j m_j / E(c₀(Tʲ)) ≤ w`, where `m_j` is the minimum over deterministic
on-line algorithms `A` of `E(c_A(Tʲ))`. This is `w̄(S, d) ≥ limsup_j m_j / E(c₀(Tʲ))` with
`inf ∅ = +∞`. -/
theorem randomizedRatio_ge_limsup {S α : Type} [Fintype S] [DecidableEq S] [Nonempty S]
    [Fintype α] [MeasurableSpace α] [MeasurableSingletonClass α]
    (d : S → S → ℝ) (hd : IsTaskSystem d)
    (U : α → S → ℝ) (hU : ∀ a s, 0 ≤ U a s)
    (D : Measure (ℕ → α)) [IsProbabilityMeasure D] (s₀ : S)
    (hE : Tendsto (fun j => expOfflineCost d s₀ U D j) atTop atTop)
    (R : RandomizedOnlineAlgorithm S) (w : ℝ) (hR : IsExpCompetitive d R w) :
    limsup (fun j : ℕ =>
        ((minDetExpCost d s₀ U D j / expOfflineCost d s₀ U D j : ℝ) : EReal)) atTop
      ≤ (w : EReal) := by sorry

end MetricalTaskSystem.Randomized
Source
Borodin, Linial, Saks, An Optimal On-Line Algorithm for Metrical Task System, J. ACM 39(4) (1992), p. 759, Lemma 7.2
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting.

  • SSS is a finite, nonempty type with decidable equality.
  • α\alphaα is a finite type of letters with a σ-algebra in which singletons are measurable.
  • ddd is a task system on SSS: d(i,i)=0d(i,i) = 0d(i,i)=0, d(i,j)>0d(i,j) > 0d(i,j)>0 for i≠ji \ne ji=j, and d(i,k)≤d(i,j)+d(j,k)d(i,k) \le d(i,j) + d(j,k)d(i,k)≤d(i,j)+d(j,k).
  • U:α→(S→R)U : \alpha \to (S \to \mathbb{R})U:α→(S→R) assigns to each letter aaa a task UaU_aUa​ with all values Ua(s)≥0U_a(s) \ge 0Ua​(s)≥0.
  • DDD is a probability measure on infinite letter sequences ω=(ω0,ω1,… )\omega = (\omega_0,\omega_1,\dots)ω=(ω0​,ω1​,…), with the product σ-algebra.
  • s0∈Ss_0 \in Ss0​∈S is an initial state.

For j∈Nj \in \mathbb{N}j∈N, let Tj(ω)=(Uω0,…,Uωj−1)T^j(\omega) = (U_{\omega_0},\dots,U_{\omega_{j-1}})Tj(ω)=(Uω0​​,…,Uωj−1​​) be the first jjj tasks. Define:

  • Ej=∫c0(Tj(ω)) dD(ω)E_j = \int c_0(T^j(\omega))\,dD(\omega)Ej​=∫c0​(Tj(ω))dD(ω), the expected optimal off-line cost from s0s_0s0​;
  • mj=inf⁡A∫cA(Tj(ω)) dD(ω)m_j = \inf_A \int c_A(T^j(\omega))\,dD(\omega)mj​=infA​∫cA​(Tj(ω))dD(ω), the infimum over all deterministic on-line algorithms AAA started at s0s_0s0​.

Both integrals are Bochner integrals, which are 000 if the integrand is not integrable. mjm_jmj​ is a real infimum, which is 000 if the values are not bounded below.

Hypotheses.

  • Ej→+∞E_j \to +\inftyEj​→+∞ as j→∞j \to \inftyj→∞.
  • There is some randomized on-line algorithm RRR that is expected www-competitive for ddd. That is, w>0w > 0w>0, and there is a constant KKK such that cˉR(T)≤w c0(T)+K\bar c_R(T) \le w\, c_0(T) + KcˉR​(T)≤wc0​(T)+K for all initial states, all lengths and all nonnegative task sequences TTT.

Conclusion. In the extended reals,

lim sup⁡j→∞mjEj  ≤  w.\limsup_{j\to\infty} \frac{m_j}{E_j} \;\le\; w.j→∞limsup​Ej​mj​​≤w.

The conclusion does not mention RRR; RRR enters only through the existence of the competitiveness bound.

Degenerate cases.

  • Division by zero: for any jjj with Ej=0E_j = 0Ej​=0, the ratio is evaluated as 000. Since Ej→∞E_j \to \inftyEj​→∞, this can happen for only finitely many jjj, so it does not affect the lim sup⁡\limsuplimsup.
  • j=0j = 0j=0: E0=m0=0E_0 = m_0 = 0E0​=m0​=0.
  • Unsatisfiable divergence hypothesis: the hypothesis Ej→∞E_j \to \inftyEj​→∞ fails, for example, when all Ua≡0U_a \equiv 0Ua​≡0 (then Ej=0E_j = 0Ej​=0 for all jjj). In such cases the theorem says nothing.
  • Integrability: all costs are nonnegative, because d≥0d \ge 0d≥0 follows from the task-system axioms and U≥0U \ge 0U≥0. Each cost depends on only finitely many letters from a finite alphabet, so it takes finitely many values. The integrals are therefore genuine expectations, and mjm_jmj​ is a genuine infimum, ≥0\ge 0≥0.
  • Initial states: the competitiveness hypothesis quantifies over all initial states, while the conclusion concerns the single given s0s_0s0​.
Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me