Closed form for the expected hit count
ProvedSpecActions.hits_closed_formLet be the expected number of speculation hits by round . Because a correct guess leaves the next call already cached, that round opens no speculation window, which gives the two-term recursion
For every and every ,
The characteristic polynomial has roots and ; since is a root, a constant particular solution collides with the homogeneous family and the particular solution is linear in .
import Definitions.Def_SpecActions_model
import Definitions.Def_SpecActions_model
namespace SpecActions
theorem hits_closed_form (p : ℝ) (hp : 0 ≤ p) (n : ℕ) :
hits p n = p / (1 + p) * n + p ^ 2 / (1 + p) ^ 2 * (1 - (-p) ^ n) := by sorry
end SpecActions
Read-back
What the Lean code literally says, in plain math · claude-opus-5
Read-back — SpecActions.hits_closed_form
The declaration is an equational claim about one real-valued sequence. Fix a real number subject to the single hypothesis (no upper bound is imposed: may be , may equal , and may be arbitrarily large; nothing in the statement asserts that is a probability), and fix an arbitrary natural number (the quantifier includes ).
The symbol — written hits p n in the code under audit — is not a standard notion; it is the sequence introduced in the imported bundle by the two-step recursion
i.e. each term two steps ahead is a fixed real combination of the two preceding terms, with the coefficients and taken as literal real numbers built from the same (they are not assumed to lie in or to sum to a probability weighting beyond the algebraic fact that they sum to ). The recursion is total: it defines a real number for every natural and every real , whatever the sign or size of .
For every such and , the theorem asserts the exact real-number identity
Points of literal reading:
- The two coefficients are written exactly as displayed: a first-power quotient multiplying , and a quotient of squares multiplying the bracket. The factor is the natural number regarded as a real number, and is the -th natural-number power of the negated quantity (so it alternates in sign with the parity of when ).
- The claim is an exact equality of real numbers for each individual , not an approximation, a bound, an asymptotic statement, or a limit.
- Because forces , both denominators are nonzero under the hypothesis, so no degenerate division arises anywhere in the right-hand side; the hypothesis is exactly what rules out the one value at which the displayed expression would divide by zero, and it additionally excludes all other negative .
- The hypothesis is satisfiable (e.g. ), so the statement is not vacuous.
- Degenerate instances are included by the quantifier over . At both sides are : the left side by the base case, the right side because and makes the bracket — this uses the convention that the zeroth power is even when . At both sides equal . At the recursion gives for all and the right-hand side is as well.
- The statement mentions only the recursively defined and the arithmetic expression above; it makes no reference to the separately defined closed-form function
hitsClosedof the bundle, nor to any of the runtime or token-cost quantities defined there, even though the right-hand side is written with the same symbols as that definition's body.
No proof is supplied in the declaration; the proof position is occupied by a placeholder, so the file asserts the identity without establishing it.
Confirmed by the mission captain (proposal self-audit).