Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Range and monotonicity of the kkk-branch hit probability p(k)p(k)p(k)

Proved
SpecActions.phit_bounds

by naimengye · Sep 10, 2026 · Mathlib 0df444a (Lean v4.33.1)

machine-learningprobabilitytheoretical-computer-science

For a per-branch success probability p∈[0,1]p\in[0,1]p∈[0,1] and any breadth kkk, the probability that at least one of kkk independent speculative branches implies the correct next call, p(k)=1−(1−p)kp(k)=1-(1-p)^kp(k)=1−(1−p)k, lies in [0,1][0,1][0,1] and is non-decreasing in kkk.

These are the range facts that the latency and cost theorems assume of their pkp_kpk​ argument, together with the statement that widening speculation never lowers the per-step hit probability.

Preamble
import Definitions.Def_SpecActions_model
Formal statement
import Definitions.Def_SpecActions_model

namespace SpecActions
theorem phit_bounds (k : ℕ) (p : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) :
    0 ≤ phit k p ∧ phit k p ≤ 1 ∧ phit k p ≤ phit (k + 1) p := by sorry
end SpecActions
Source
Ye, Ahuja, Liargkovas, Lu, Kaffes, Peng, "Speculative Actions: A Lossless Framework for Faster Agentic Systems", ICLR 2026, arXiv:2510.04371, https://arxiv.org/abs/2510.04371, §5.1 / Appendix C.1 (p. 19), definition of p(k)=1−(1−p)kp(k)=1-(1-p)^kp(k)=1−(1−p)k
Read-back

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

Read-back of SpecActions.phit_bounds.

Fix a natural number kkk (the quantifier ranges over all of N\mathbb{N}N, so k=0k = 0k=0 is included) and a real number ppp. Assume the two hypotheses

0≤pandp≤1.0 \le p \qquad\text{and}\qquad p \le 1 .0≤pandp≤1.

The quantity named phit(k,p)\mathrm{phit}(k,p)phit(k,p) is not a standard notion; it is the definition supplied by the imported bundle, namely

phit(k,p)  =  1−(1−p)k,\mathrm{phit}(k,p) \;=\; 1 - (1-p)^{k},phit(k,p)=1−(1−p)k,

where the exponent is a natural-number power (so (1−p)0=1(1-p)^0 = 1(1−p)0=1 by the usual convention that the empty product is 111, including in the case 1−p=01 - p = 01−p=0, i.e. 00=10^0 = 100=1). No probabilistic interpretation is asserted by the statement; phit(k,p)\mathrm{phit}(k,p)phit(k,p) is simply this real-valued expression.

Under those hypotheses the theorem asserts the conjunction of the following three claims, all for the same kkk and ppp:

  1. 0≤1−(1−p)k0 \le 1 - (1-p)^{k}0≤1−(1−p)k;
  2. 1−(1−p)k≤11 - (1-p)^{k} \le 11−(1−p)k≤1;
  3. 1−(1−p)k  ≤  1−(1−p)k+11 - (1-p)^{k} \;\le\; 1 - (1-p)^{k+1}1−(1−p)k≤1−(1−p)k+1, i.e. the single-step comparison between phit(k,p)\mathrm{phit}(k,p)phit(k,p) and phit(k+1,p)\mathrm{phit}(k+1,p)phit(k+1,p).

All three inequalities are non-strict (≤\le≤, not <<<), and claim 3 compares only consecutive exponents kkk and k+1k+1k+1; no statement is made about phit(j,p)≤phit(k,p)\mathrm{phit}(j,p) \le \mathrm{phit}(k,p)phit(j,p)≤phit(k,p) for general j≤kj \le kj≤k, about strict increase, about any limiting value as k→∞k \to \inftyk→∞, or about behaviour when ppp lies outside [0,1][0,1][0,1].

Degenerate cases that the quantifiers silently include:

  • k=0k = 0k=0: here phit(0,p)=1−(1−p)0=1−1=0\mathrm{phit}(0,p) = 1 - (1-p)^0 = 1 - 1 = 0phit(0,p)=1−(1−p)0=1−1=0, so claims 1 and 2 read 0≤00 \le 00≤0 and 0≤10 \le 10≤1, and claim 3 reduces to 0≤p0 \le p0≤p.
  • p=0p = 0p=0: phit(k,0)=1−1k=0\mathrm{phit}(k,0) = 1 - 1^{k} = 0phit(k,0)=1−1k=0 for every kkk, so claims 1 and 3 hold with equality.
  • p=1p = 1p=1: 1−p=01 - p = 01−p=0, so phit(0,1)=1−00=0\mathrm{phit}(0,1) = 1 - 0^0 = 0phit(0,1)=1−00=0 while phit(k,1)=1−0=1\mathrm{phit}(k,1) = 1 - 0 = 1phit(k,1)=1−0=1 for every k≥1k \ge 1k≥1; claim 3 is then 0≤10 \le 10≤1 at k=0k = 0k=0 and 1≤11 \le 11≤1 afterwards.

The hypothesis set is satisfiable (any ppp in the closed unit interval, e.g. p=12p = \tfrac12p=21​, together with any kkk), so the statement is not vacuous. Nothing else from the surrounding bundle — the recursion SSS, the runtime and cost expressions, the confidence-aware quantities — enters this statement; it involves only phit\mathrm{phit}phit, the two order hypotheses on ppp, and the three inequalities above.

Human review
  • Endorsed by Shuze Chen · Sep 12, 2026

  • Endorsed by naimengye · Sep 12, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me