This repository formalizes four estimator results from Solo et al., arXiv:2602.03730v2, in namespace ScoRe:
- SCOPE is unbiased.
- REACH is unbiased.
- REACH is the conditional expectation of the two-stage Monte Carlo estimator, given the outcome-free timelines (i.e., a Rao-Blackwellization).
- REACH has variance at most ordinary Monte Carlo. The proof uses result 3, followed by Mathlib's law of total variance.
Every estimator result covers every positive finite sample count. The vocabulary has both Countable V and Infinite V instances, so it is countably infinite. There is no bound on timeline length and no finite-mean stopping-time assumption. Both variances are proved finite.
A model assigns a probability mass function M.next h to every complete token history h. A prefix predicate M.stop determines when generation stops; it is false on the empty history. This permits stopping after accumulated time, a terminal token, or any other prefix-observable condition. No Markov assumption is made.
The sample space consists of finite token lists of all finite lengths. Only lists ending at their first stopping prefix receive nonzero mass. The original mass is the product of original next-token probabilities. The avoiding mass is the product of the same probabilities with the outcome token removed and the remaining probabilities renormalized. The original sampler continues to its actual threshold even if the outcome has already occurred.
The hypotheses IsProbabilityMeasure (originalLaw M) and IsProbabilityMeasure (avoidingLaw M) assert that the respective sums of terminal path masses equal one. This is the stopped-path formulation of almost-sure termination. The latter assumption is needed for REACH. It does not follow from termination of the original sampler.
T_E is the first stopping-prefix length, with infinity when no prefix stops; T_O is the first outcome position, numbered from one, with infinity if absent. The development proves IsStoppingTime (prefixFiltration V) (T_E M) and almost-sure finiteness under each path law. The filtration reveals exactly the first k tokens at time k.
The target is P(T_O < T_E). As in the paper and the Prove2Me mission, the main results assume T_O ≠ T_E almost surely under the original law. This matters because the formulas include the threshold step. The maintainer expressly confirmed this convention and termination under both samplers.
For a terminal list x, with h_t = P(O | x₁,…,xₜ₋₁):
- SCOPE sums
h_tthroughmin(T_E,T_O), including the first outcome step. It is not clipped. - REACH is
1 − ∏_{t=1}^{T_E}(1−h_t), evaluated on an outcome-free timeline. - Monte Carlo is the indicator of
T_O < T_E.
𝒮, ℛ, and M₀ are the averages of these scores over the indexed sample pool.
First sample outcome-free timelines using the avoiding law. Conditional on their complete indexed pool, sample independent Bernoulli trials at each position using the original model's hazards. trialMean counts the fraction of timelines with a successful trial. timelineInformation retains the entire indexed pool and forgets just those trials.
reach_raoBlackwell uses Mathlib's actual conditional expectation to prove
ℛ = E[trialMean | timelineInformation] almost surely.
equal_probabilities proves the Appendix C connection to the original strict target event. monteCarlo_one_identDistrib strengthens that bridge to equality in distribution of the one-sample indicators. The comparison is on this coupled two-stage space; it is not a claim that outcome-free backbones are directly observable from an unaugmented original Monte Carlo sample.
For result 4, reachScore_variance_via_raoBlackwell invokes reach_raoBlackwell M 1, identifies the backbone marginal, and applies conditional-expectation variance contraction proved from integral_condVar_add_variance_condExp. Both independent averages then acquire the same factor 1/n. The old moment-expansion comparison from the reference development is not used.
| File | Purpose |
|---|---|
Challenge.lean |
The self-contained, Mathlib-only statement of record; its deliberate theorem holes are expected by Palomar. |
Solution.lean |
Entry point for the complete proved development. |
ScoRe/Definitions.lean |
Model, explicit sampling laws, times, estimators and conditioning information. |
ScoRe/Stopping.lean |
Natural prefix filtration and the stopping-time proof. |
ScoRe/Support.lean |
Attributed supporting probability and integrability proofs adapted from Prove2Me. |
ScoRe/Results.lean |
Unbiasedness and Rao–Blackwell identity. |
ScoRe/Variance.lean |
The variance proof through Rao–Blackwellization. |
ScoRe/Bridge.lean |
Equal probabilities and the identical-distribution bridge. |
formalization.yaml |
Palomar metadata, authorship, assumptions, automation and review disclosure. |
comparator.json |
The ten declarations to verify. Definitions are fully specified in both environments. |
PROVENANCE.md |
Exact reuse and model-attribution boundaries. |
reports/VERIFICATION.md |
Completed verification, tool versions and limitations. |
SUBMIT.md |
Publication and submission instructions. |
The project pins Lean 4.33.1 and Mathlib commit 0df444a360eaa60ab8c11dca51a86af692955474. A committed manifest pins the complete dependency graph. A fresh checkout needs network access to obtain those public dependencies; no Prove2Me account or API key is required.
lake exe cache get
./scripts/check.shThe only expected Lean warnings concern the ten deliberate theorem holes in Challenge.lean. The proved development contains no sorry, custom axiom, or native_decide. The allowed foundational axioms are propext, Classical.choice, and Quot.sound.
This is a source-based formalization, adapting the Prove2Me mission. Its supporting proof code is included locally and credited explicitly. Astra is the sole model used in the current Codex development session; this does not reattribute the earlier supporting proofs to astra. No subagents or external proof-generation services were used. See PROVENANCE.md.
Not included: the empirical findings, comparison with SCOPE's variance, concentration or efficiency bounds, or the general importance-sampling extension in Appendix R. The development models stopped paths directly rather than constructing an infinite-stream measure and then pushing it forward. Probability-law normalization is an explicit termination hypothesis, not a proved termination theorem for arbitrary models.
All six paper authors are credited as requested by the maintainer. The metadata records this human review as author-verified. The prior mission's review history is separate from this author verification.
The package is intended for the Palomar submission form, following Palomar's submission instructions. A public GitHub repository and its pushed 40-character commit SHA are required. Nothing has been submitted or published by preparing this local folder.
Apache-2.0; see LICENSE and NOTICE. This license covers this repository, not the cited paper or external dependencies.