Theorem 4 — finite-horizon relative cost increase
ProvedSpecActions.thm4_cost_finite_horizonLet be the number of distinct actions produced across the speculative branches (duplicated speculations are killed). Then for every , and ,
The bracket is the same that governs the latency ratio, which is what lets a practitioner tune the breadth against a joint latency/cost budget from a single estimate of .
import Definitions.Def_SpecActions_model
import Definitions.Def_SpecActions_model
namespace SpecActions
theorem thm4_cost_finite_horizon (T : ℕ) (α β pk kt : ℝ) (hT : 1 ≤ T)
(hα : 0 < α) (hβ : 0 < β) (hpk0 : 0 ≤ pk) (hpk1 : pk ≤ 1) :
(specCost T α β pk kt - seqCost T β) / seqCost T β
= kt - (1 / (T : ℝ)) * (kt + α / (α + β)) *
(((T : ℝ) - 1) * pk / (1 + pk)
+ pk ^ 2 / (1 + pk) ^ 2
- pk ^ 2 / (1 + pk) ^ 2 * (-pk) ^ (T - 1)) := by sorry
end SpecActions
Read-back
What the Lean code literally says, in plain math · claude-opus-5
Read-back — thm4_cost_finite_horizon
Data and standing assumptions. The statement fixes a natural number and four real numbers , , , (all universally quantified; are arbitrary reals, not constrained to be integers or probabilities except as listed). It assumes exactly five hypotheses:
- (as a natural number),
- ,
- ,
- ,
- .
Nothing else is assumed: in particular no order relation between and is imposed, and is completely unconstrained — it may be , negative, or non-integral.
The two quantities being compared. Both are defined in the imported bundle and are unfolded here.
First, an auxiliary real sequence , depending on a real parameter , given by the two-step recursion
This is the recursively defined sequence; the statement does not refer to any closed form for it.
Then
where in the index the subtraction is truncated natural-number subtraction (so it would be at ; under the hypothesis it coincides with the ordinary ). Here is coerced to a real number wherever it occurs in an arithmetic expression.
The asserted identity. The claim is the following exact equality of real numbers:
where the factor is written out explicitly (not via any named definition) as
In , the coefficient is real subtraction on the coerced value of , while the exponent in is again truncated natural subtraction, and the power is a natural-number power of the possibly negative base . Note that is algebraically the same as .
Well-definedness and the algebraic content. All divisions are total real division (division by zero would yield rather than being undefined), but under the hypotheses no such degeneracy occurs on either side: and give , so the left-hand quotient is a genuine ratio; ; since ; and makes genuine. Expanding the definitions, the left-hand side simplifies to , so the equality asserts, for every admissible choice of the parameters, that the recursively defined quantity may be replaced by the explicit expression — except that the replacement is only forced where the multiplier is nonzero.
Degenerate and boundary cases silently included.
- : the index is and ; both sides equal , so the assertion is an identity with no content at this value.
- : every and ; both sides again reduce to .
- (permitted by ): the factor alternates in sign, and .
- : the multiplier of vanishes and the equality holds for trivial reasons regardless of .
- is excluded by hypothesis; had it been admitted, the left-hand side would be a division by .
- The hypotheses are jointly satisfiable (for instance , , , ), so the statement is not vacuous.
Unused context. The imported bundle also defines quantities named for hit probabilities, a closed form for the hit sequence, runtime (as opposed to cost) analogues, depth-focused runtime and cost expressions, and confidence-aware breadth objectives; none of these appear in this statement. Only the sequence , and are referenced.
Confirmed by the mission captain (proposal self-audit).