Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proposition 1 — exact expected runtime ratio and limit

Proved
SpecActionsProb.Latency.proposition_1

by mikedeng1 · Oct 21, 2026 · Mathlib 0df444a (Lean v4.33.1)

closed-formexpected-runtimeexponential-distributionp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1speculative-execution

Suppose each of kkk independent branches is correct with probability 0<p≤10<p\le10<p≤1, the speculator latency has rate α\alphaα, and the real-call latency has rate 0<β<α0<\beta<\alpha0<β<α. All guesses and latencies are mutually independent. Put p(k)=1−(1−p)kp(k)=1-(1-p)^kp(k)=1−(1−p)k. For every horizon T≥1T\ge1T≥1, the expected runtimes of the Appendix A speculative and sequential executions satisfy

E[Ts]E[Tseq]=1−1Tαα+β[(T−1)p(k)1+p(k)+p(k)2(1+p(k))2−p(k)2(1+p(k))2(−p(k))T−1].\frac{\mathbb E[T_s]}{\mathbb E[T_{\mathrm{seq}}]}=1-\frac1T\frac{\alpha}{\alpha+\beta}\left[\frac{(T-1)p(k)}{1+p(k)}+\frac{p(k)^2}{(1+p(k))^2}-\frac{p(k)^2}{(1+p(k))^2}(-p(k))^{T-1}\right].E[Tseq​]E[Ts​]​=1−T1​α+βα​[1+p(k)(T−1)p(k)​+(1+p(k))2p(k)2​−(1+p(k))2p(k)2​(−p(k))T−1].

As T→∞T\to\inftyT→∞, this ratio converges to 1−p(k)1+p(k)αα+β1-\frac{p(k)}{1+p(k)}\frac{\alpha}{\alpha+\beta}1−1+p(k)p(k)​α+βα​. The result identifies the finite-horizon and limiting latency savings for an execution model built from random calls.

Formalization Note The ratio uses integrals of the random runtimes, not expressions defined to equal those integrals. The restriction T≥1T\ge1T≥1 makes the denominator positive. Windows use zero-based indices; a hit costs min⁡(At,Bt)+Bt+1\min(A_t,B_t)+B_{t+1}min(At​,Bt​)+Bt+1​ and consumes the following window. The page's β<α\beta<\alphaβ<α and p>0p>0p>0 hypotheses are retained. Concurrency without interference and negligible transition and parameter-construction costs are part of the runtime model.

Preamble
import Mathlib
import Definitions.Def_SpecActionsProb_Latency_Model

set_option autoImplicit false
Formal statement
namespace SpecActionsProb.Latency

open MeasureTheory ProbabilityTheory

/-- Proposition 1, p. 5: exact finite horizon ratio and its limit for the random runtimes. -/
theorem proposition_1 {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P]
    (k : ℕ) (α β p : ℝ) (hβ : 0 < β) (hβα : β < α) (hp0 : 0 < p) (hp1 : p ≤ 1)
    (X : Idx k → Ω → ℝ) (hX : IsSpecModel P k α β p X) :
    let pk : ℝ := 1 - (1 - p) ^ k
    (∀ T : ℕ, 1 ≤ T →
      (∫ ω, specRuntime X T ω ∂P) / (∫ ω, seqRuntime X T ω ∂P)
        = 1 - 1 / (T : ℝ) * (α / (α + β)) *
            (((T : ℝ) - 1) * pk / (1 + pk) + pk ^ 2 / (1 + pk) ^ 2
              - pk ^ 2 / (1 + pk) ^ 2 * (-pk) ^ (T - 1))) ∧
    Filter.Tendsto (fun T : ℕ => (∫ ω, specRuntime X T ω ∂P) / (∫ ω, seqRuntime X T ω ∂P))
      Filter.atTop (nhds (1 - pk / (1 + pk) * (α / (α + β)))) := by sorry

end SpecActionsProb.Latency
Source
Ye et al., Speculative Actions: A Lossless Framework for Faster Agentic Systems, arXiv:2510.04371v2, p. 5, Proposition 1; Appendix A, pp. 14–15
Human review
  • Endorsed by Shuze Chen · Oct 21, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 21, 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