Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

Statistics

175 missions · 103 completed

The mathematical discipline of drawing inferences from data under uncertainty: estimation, hypothesis testing, prediction, and the quantification of confidence. Grounded in probability, it spans classical and Bayesian inference, experimental design, and modern high-dimensional and nonparametric theory, asking what data can reveal and with what guarantees.

Missions

Open72Completed103All175
🏆Completed
Captain: burkh4rt

Formalized SCOPE and REACH estimatorsResearch Paper

Motivation

A foundation model trained on tokenized electronic health record (EHR) timelines can be used to predict clinical outcomes without ever being finetuned for a specific prediction task: condition the model on a patient's observed timeline, autoregressively sample many possible futures, and report the fraction of sampled futures in which the outcome of interest occurs. This generative approach to inference powers a growing family of EHR foundation models— including Event Stream GPT (McDermott et al., 2023), Foresight (Kraljevic et al., 2024), ETHOS (Renc et al., 2024), and Curiosity (Waxler et al., 2025)—and it is attractive for its zero-shot approach to predicting a variety of outcomes.

It is also expensive. Reproducing one published pipeline required more than 150015001500 A100 GPU-hours of inference. Worse, the estimator built from nnn sampled futures takes values in {0,1/n,…,1}\{0, 1/n, \dots, 1\}{0,1/n,…,1}, so its resolution is tied to the sampling budget: for an outcome of prevalence 1/10,0001/10{,}0001/10,000, 100100100 sampled futures fail more than 90%90\%90% of the time to rank a patient at ten times average risk above an average one. The most consequential clinical decisions turn on exactly such low-prevalence, high-impact outcomes.

Solo et al. (arXiv:2602.03730) observe that Monte Carlo discards almost everything the model produces: at every step the model emits a full next-token distribution and the sampler keeps only the token it drew. The paper introduces two estimators that consume the discarded probabilities instead, and proves that doing so costs no bias and—for one of them—never costs variance.

Setting and estimators

Let PPP generate token sequences from a countable vocabulary VVV, with designated outcome token OOO. The next-token probabilities may depend on the complete preceding history. The time threshold is initially unexceeded. Its crossing may depend on several kinds of time-spacing tokens and on their accumulated duration.

For a sampled timeline XXX, TO(X)T_O(X)TO​(X) is the first position occupied by OOO, or ∞\infty∞ if it never appears. The time TE(X)T_E(X)TE​(X) is the first position at which the threshold has been exceeded. Assume TO≠TET_O\ne T_ETO​=TE​ almost surely. Timelines are retained through the actual threshold crossing, even if the outcome appears earlier. Thus TET_ETE​ is not reassigned after an outcome.

The threshold is reached almost surely, but the number of tokens required may be arbitrarily large. No deterministic bound or finite expected token count is assumed. For REACH, assume also that removing the outcome token and renormalizing defines a sampler that reaches the same threshold almost surely.

For n≥1n\ge1n≥1 independent original timelines, the Monte Carlo estimator is

M0=1n∑i=1n1{TO(X(i))<TE(X(i))}.M_0=\frac1n\sum_{i=1}^n 1_{\{T_O(X^{(i)})<T_E(X^{(i)})\}}.M0​=n1​i=1∑n​1{TO​(X(i))<TE​(X(i))}​.

The SCOPE estimator is

S=1n∑i=1n∑t=1min⁡{TE(X(i)),TO(X(i))}P(Xt=O∣X1:t−1(i)).\mathcal S=\frac1n\sum_{i=1}^n\sum_{t=1}^{\min\{T_E(X^{(i)}),T_O(X^{(i)})\}}P(X_t=O\mid X_{1:t-1}^{(i)}).S=n1​i=1∑n​t=1∑min{TE​(X(i)),TO​(X(i))}​P(Xt​=O∣X1:t−1(i)​).

For REACH, sample independent outcome-free timelines by setting the next-token probability of OOO to zero and renormalizing the probabilities of the other tokens. Using the original model probabilities along those timelines, define

R=1n∑i=1n[1−∏t=1TE(X^(i))(1−P(Xt=O∣X^1:t−1(i)))].\mathcal R=\frac1n\sum_{i=1}^n\left[1-\prod_{t=1}^{T_E(\hat X^{(i)})}\left(1-P(X_t=O\mid\hat X_{1:t-1}^{(i)})\right)\right].R=n1​i=1∑n​​1−t=1∏TE​(X^(i))​(1−P(Xt​=O∣X^1:t−1(i)​))​.

Formalization targets

The targets are:

  1. SCOPE unbiasedness: E[S]=P(TO<TE)\mathbb E[\mathcal S]=P(T_O<T_E)E[S]=P(TO​<TE​).
  2. Equal probabilities milestone: P(A)=P(B)P(A)=P(B)P(A)=P(B) from Appendix C, where AAA is the original outcome-before-threshold event and BBB is at least one successful Bernoulli trial along an outcome-free timeline.
  3. REACH unbiasedness: E[R]=P(TO<TE)\mathbb E[\mathcal R]=P(T_O<T_E)E[R]=P(TO​<TE​).
  4. Rao–Blackwell identity: for every positive sample count, conditioning the average of the two-stage event indicators on the entire pool of outcome-free timelines equals R\mathcal RR almost surely.
  5. Main goal: Var⁡(R)≤Var⁡(M0)\operatorname{Var}(\mathcal R)\le\operatorname{Var}(M_0)Var(R)≤Var(M0​) at the same positive sample count, with finite second moments for both estimators.

Expectations and variances use each estimator's specified sampling law.

What the formalization establishes

The claims concern the probability assigned by the generative model. They provide unbiasedness and a comparison of sampling variance. SCOPE is kept unclipped, as in the paper's unbiasedness result. All five target statements have accompanying local Lean proofs.

Main mathematical difficulty

A pathwise finite stopping time need not have a common finite bound or a finite mean. An expectation involving the stopped SCOPE sum therefore needs justification beyond finite-sum linearity. REACH uses a different sampling law, so its unbiasedness and variance comparison also require a proved connection between the original event and the two-stage experiment. The equal-probabilities milestone records that connection explicitly.

Formalization scope

Lean represents each sampled timeline by a finite list ending at its first threshold crossing. Arbitrary finite lengths are included in the same sample space. Path probabilities are products of next-token probabilities, and the laws are countable sums of these path masses. Requiring each law to have total mass one expresses almost-sure termination of that sampler; it is not a uniform length bound. The vocabulary can be finite or countably infinite.

The stopping predicate examines a complete prefix and is not restricted to a single terminal token. The original law continues through outcomes until the threshold. A separate almost-everywhere hypothesis excludes equal outcome and threshold times. The code proves that the actual threshold time is finite almost surely and that the strict event TO<TET_O<T_ETO​<TE​ is the event used by the internal calculations.

The two-stage experiment explicitly samples conditionally independent Bernoulli trials using the original hazards. Its conditioning information retains the complete indexed pool of outcome-free timelines. The Rao–Blackwell target uses Mathlib's conditional expectation. The variance target uses Mathlib's variance, and proves square integrability rather than assuming it.

Selected references

  • Luke Solo, Matthew B. A. McDermott, William F. Parker, Bashar Ramadan, Michael C. Burkhart, Brett K. Beaulieu-Jones, Efficient Generative Prediction for EHR Foundation Models: The SCOPE and REACH Estimators, 2026. arXiv:2602.03730
  • M. B. A. McDermott, B. Nestor, P. Argaw, I. S. Kohane, Event Stream GPT: A Data Pre-processing and Modeling Library for Generative, Pre-trained Transformers over Continuous-time Sequences of Complex Events, Advances in Neural Information Processing Systems 36, pp. 24322–24334, 2023. arXiv:2306.11547
  • Z. Kraljevic, D. Bean, A. Shek, R. Bendayan, H. Hemingway, J. A. Yeung, A. Deng, A. Baston, J. Ross, E. Idowu, J. T. Teo, R. J. B. Dobson, Foresight—a generative pretrained transformer for modelling of patient timelines using electronic health records: a retrospective modelling study, Lancet Digital Health 6(4), pp. e281–e290, 2024. doi:10.1016/S2589-7500(24)00025-6
  • P. Renc, Y. Jia, A. E. Samir, J. Was, Q. Li, D. W. Bates, A. Sitek, Zero shot health trajectory prediction using transformer, npj Digital Medicine 7(1), p. 256, 2024. doi:10.1038/s41746-024-01235-0
  • S. Waxler, P. Blazek, D. White, D. Sneider, K. Chung, M. Nagarathnam, P. Williams, H. Voeller, K. Wong, M. Swanhorst, S. Zhang, N. Usuyama, C. Wong, T. Naumann, H. Poon, A. Loza, D. Meeker, S. Hain, R. Shah, Generative medical event models improve with scale, 2025. Introduces the Curiosity model family. arXiv:2508.12104
9 thms1 active userReviewed
🏆Completed
Machine LearningProbability·Captain: willma

Don't Label Twice: Game, Set, MatchOpen Problem

The problem

(a) In a tennis match, you are the favorite, and win each point independently with probability q∈(1/2,1)q\in(1/2,1)q∈(1/2,1). Let n,mn,mn,m be odd positive integers greater than 111. You have the choice between playing a best-of-nmnmnm (i.e., you play nmnmnm points and whoever wins the majority of points wins the match), or a best-of-nnn of best-of-mmm's (i.e., the match is won by winning the majority of nnn "sets", and each "set" is won by winning the majority of mmm points). Prove that your probability of winning the match is strictly greater by playing the best-of-nmnmnm.

(b) We now consider two generalizations: m1,…,mkm_1,\ldots,m_km1​,…,mk​ are odd positive integers, while nnn is any positive integer, with all integers being greater than 111. You have the choice between playing a best-of-nm1⋯mknm_1\cdots m_knm1​⋯mk​, or a best-of-nnn of "sets", which are best-of-m1m_1m1​'s of "games", …, which are best-of-mkm_kmk​'s of "points". In both cases, now that nnn may be even, it is possible for the players to tie, in which case the match winner is determined by an independent fair coin. Prove again that your probability of winning the match is strictly greater by playing the best-of-nm1⋯mknm_1\cdots m_knm1​⋯mk​.

(c) We consider a further generalization where each completed "set" counts toward the match score in an independently random way:

  • with probability aaa, the winner gains 111 in the match score, as usual;
  • with probability bbb, the set is ignored and does not count toward the match score;
  • with probability ccc, the loser gains 111 in the match score;

with a+b+c=1a+b+c=1a+b+c=1 and a>ca>ca>c, so players are still incentivized to win sets (previously we had a=1a=1a=1, b=c=0b=c=0b=c=0). This random scoring rule is applied once per completed set, at the outermost layer only: the games and points inside a set are decided by plain majorities, with no randomness, and only the set's final result is scored. If you choose to play the best-of-nm1⋯mknm_1\cdots m_knm1​⋯mk​, then each individual point counts as a set and is subject to the same randomness with probabilities a,b,ca,b,ca,b,c. Prove that your probability of winning the match is still strictly greater by playing the best-of-nm1⋯mknm_1\cdots m_knm1​⋯mk​ (the fair-coin-on-ties convention continues).

(d) Continue from part (c), but change the fair-coin-on-ties convention so that you only win the match if you have a strictly greater match score than your opponent. Assuming b≥1/2b\ge1/2b≥1/2, prove that your probability of winning the match is strictly greater by playing the best-of-nm1⋯mknm_1\cdots m_knm1​⋯mk​.

Source and connection to Dorner–Hardt

Florian E. Dorner and Moritz Hardt, Don't Label Twice: Quantity Beats Quality when Comparing Binary Classifiers on a Budget, ICML 2024. arXiv:2402.02249 (v3, 8 April 2026).

The paper asks how to spend a fixed budget of noisy crowdworker labels when comparing two binary classifiers: one label each for many data points, or several labels per data point aggregated by majority vote. It proves, via Cramér's theorem, that one label each is asymptotically optimal, and states the finite-sample version as an open conjecture (Section 5, Conjecture 1), still open in the April 2026 revision. Its Section 3 displays the finite-sample inequality for the independent, homogeneous-label case and verifies it numerically over about five billion parameter settings.

Part (d) of this mission with one level of sets is that Section 3 inequality in tennis language. A point is a single crowdworker label being correct (qqq is the label accuracy); a set is a data point, whose test label is the majority of its mmm labels; and the scoring rule is what the two classifiers do with that label. Writing ppp for the worse classifier's accuracy and p+ϵp+\epsilonp+ϵ for the better one's, a set is scored to its winner when the better classifier alone matches the test label, ignored when the two classifiers agree, and scored to its loser when the worse classifier alone matches:

a=(p+ϵ)(1−p),c=p(1−p−ϵ),b=1−a−c,a=(p+\epsilon)(1-p),\qquad c=p(1-p-\epsilon),\qquad b=1-a-c,a=(p+ϵ)(1−p),c=p(1−p−ϵ),b=1−a−c,

so that a−c=ϵ>0a-c=\epsilon>0a−c=ϵ>0, and b≥1/2b\ge1/2b≥1/2 always holds because two classifiers of accuracy at least 1/21/21/2 agree on at least half the data. Substituting into the paper's Proposition 1 recovers its gap-indicator probabilities exactly: Pr⁡(+1)=qϵ+p(1−p−ϵ)\Pr(+1)=q\epsilon+p(1-p-\epsilon)Pr(+1)=qϵ+p(1−p−ϵ), Pr⁡(−1)=(1−q)ϵ+p(1−p−ϵ)\Pr(-1)=(1-q)\epsilon+p(1-p-\epsilon)Pr(−1)=(1−q)ϵ+p(1−p−ϵ). The paper's inequality also allows n=1n=1n=1 and q=1q=1q=1, which parts (c)–(d) exclude only because the inequality can fail to be strict at b=0b=0b=0 there; for b≥1/2b\ge1/2b≥1/2 the same argument covers those edge cases. The paper's Conjecture 1 as literally stated concerns a correlated-error setting (its Section 3.2) and is not claimed here.

Parts (a)–(c) go beyond the paper's setting: arbitrary nesting depth, a fair-coin tie rule, and no constraint on the ignore rate bbb. The hypothesis b≥1/2b\ge1/2b≥1/2 in part (d) cannot be dropped: with one level, (a,b,c)=(0.9,0.1,0)(a,b,c)=(0.9,0.1,0)(a,b,c)=(0.9,0.1,0), q=0.6q=0.6q=0.6, m=3m=3m=3, n=1n=1n=1, the single best-of-3 finishes strictly ahead with probability 0.58320.58320.5832 while three single points do so with probability 0.57610.57610.5761.

Timeline

  • Feb 2024 — arXiv v1; ICML 2024. Asymptotic theorem via Cramér; finite-sample statement conjectured; ~5·10⁹-configuration numerical sweep.
  • Oct 2024 — arXiv v2.
  • Apr 2026 — arXiv v3; conjecture still stated as open.
  • Aug 2026 — private proof of the Section 3 inequality (strict win, b≥1/2b\ge1/2b≥1/2, one level) via exponential tilting of the tie probability.
  • Sep 2026 — private proof of the fair-coin version with no constraint on bbb (Bernstein degree elevation and a hypergeometric parity argument), then of the full four-part statement via a pairing lemma for player-symmetric rules. This mission formalizes that proof.

Conventions in the formal statement

"Greater than 111" is read as n≥2n\ge2n≥2 and each mi≥3m_i\ge3mi​≥3 odd; the list of set sizes in (b)–(d) is nonempty. Laws are functions Z→R\mathbb Z\to\mathbb RZ→R and every probability is a finite sum — no measure theory. The goal theorem is the conjunction of the four parts.

39 thms1 active userReviewed
🏆Completed
Functional AnalysisOperations ResearchOptimization+1·Captain: Shuze Chen

Vector Space Methods II: Gauss–Markov EstimationTextbook

Motivation

Chapter 4 of Luenberger's Optimization by Vector Space Methods (Wiley, 1969) develops linear least-squares estimation as an application of the Hilbert space projection theorem formalized in Mission I of this series. The chapter's centerpiece is the classical Gauss–Markov theorem: among all linear unbiased estimators of an unknown parameter vector from noisy linear measurements, the estimator (W⊤Q−1W)−1W⊤Q−1y(W^\top Q^{-1} W)^{-1} W^\top Q^{-1} y(W⊤Q−1W)−1W⊤Q−1y has minimum variance — componentwise, not merely in trace. This result is foundational for statistics and econometrics, and its Hilbert-space derivation is the cleanest known.

Setting

Measurements are modeled as y=Wβ+εy = W\beta + \varepsilony=Wβ+ε, where yyy is an mmm-dimensional data vector, WWW a known m×nm \times nm×n matrix (n<mn < mn<m) with linearly independent columns, β\betaβ an unknown nnn-dimensional parameter vector, and ε\varepsilonε a random mmm-vector of measurement errors with Eε=0E\varepsilon = 0Eε=0 and covariance E[εε⊤]=QE[\varepsilon\varepsilon^\top] = QE[εε⊤]=Q, positive definite. A linear estimate is β^=Ky\hat\beta = Kyβ^​=Ky for a constant n×mn \times mn×m matrix KKK; it is unbiased when Eβ^=βE\hat\beta = \betaEβ^​=β for every β\betaβ, which holds iff KW=IKW = IKW=I. The optimality criterion is the error second moment E∥β^−β∥2E\|\hat\beta - \beta\|^2E∥β^​−β∥2, and the book's key observation (p. 85) is that the problem splits into nnn independent minimum norm problems, one per component, each solvable by the dual approximation theorem of Mission I.

Formally, randomness is carried by an abstract probability space: a measure space (Ω,μ)(\Omega, \mu)(Ω,μ) with μ\muμ a probability measure, random vectors as functions Ω→Rm\Omega \to \mathbb{R}^mΩ→Rm with explicit integrability hypotheses for all first and second moments, and E[⋅]=∫⋅ dμE[\cdot] = \int \cdot \, d\muE[⋅]=∫⋅dμ.

Formalization targets

The goal is §4.4 Theorem 1 (Gauss–Markov): with K0=(W⊤Q−1W)−1W⊤Q−1K_0 = (W^\top Q^{-1} W)^{-1} W^\top Q^{-1}K0​=(W⊤Q−1W)−1W⊤Q−1,

K0W=I,E[(K0y−β)i2]≤E[(Ky−β)i2]for every i and every K with KW=I,K_0 W = I, \qquad E\big[(K_0 y - \beta)_i^2\big] \le E\big[(K y - \beta)_i^2\big] \quad \text{for every } i \text{ and every } K \text{ with } KW = I,K0​W=I,E[(K0​y−β)i2​]≤E[(Ky−β)i2​]for every i and every K with KW=I,

with error covariance

E[(K0y−β)(K0y−β)⊤]=(W⊤Q−1W)−1.E\big[(K_0 y - \beta)(K_0 y - \beta)^\top\big] = (W^\top Q^{-1} W)^{-1}.E[(K0​y−β)(K0​y−β)⊤]=(W⊤Q−1W)−1.

Milestones: the deterministic least-squares estimate β^=(W⊤W)−1W⊤y\hat\beta = (W^\top W)^{-1} W^\top yβ^​=(W⊤W)−1W⊤y (§4.3 Theorem 1); the book's deterministic reduction — minimize the diagonal entries of KQK⊤KQK^\topKQK⊤ subject to KW=IKW = IKW=I (p. 85); the minimum-variance estimate β^=E[βy⊤](E[yy⊤])−1y\hat\beta = E[\beta y^\top] (E[y y^\top])^{-1} yβ^​=E[βy⊤](E[yy⊤])−1y for random β\betaβ (§4.5 Theorem 1); and the information-form identities RW⊤(WRW⊤+Q)−1=(W⊤Q−1W+R−1)−1W⊤Q−1RW^\top(WRW^\top + Q)^{-1} = (W^\top Q^{-1}W + R^{-1})^{-1}W^\top Q^{-1}RW⊤(WRW⊤+Q)−1=(W⊤Q−1W+R−1)−1W⊤Q−1 and R−RW⊤(WRW⊤+Q)−1WR=(W⊤Q−1W+R−1)−1R - RW^\top(WRW^\top+Q)^{-1}WR = (W^\top Q^{-1}W + R^{-1})^{-1}R−RW⊤(WRW⊤+Q)−1WR=(W⊤Q−1W+R−1)−1 (§4.5 Corollary 2).

Significance

The Gauss–Markov theorem justifies weighted least squares as the optimal linear unbiased procedure and is the standard benchmark against which biased and nonlinear estimators are measured. The minimum-variance estimate of §4.5 is the Bayesian counterpart with prior covariance RRR; the information-form identities connect the two and exhibit Gauss–Markov as the limit R−1→0R^{-1} \to 0R−1→0. Mission III builds the recursive (Kalman) estimator directly on these results.

All results are classical and proved in the source. Mathlib has mature measure-theoretic integration but, to date, no Gauss–Markov theorem and no linear estimation theory; the matrix milestones (trace reduction, information form) are also absent as stated. The probabilistic statements here are deliberately phrased with elementary integrals of products of real-valued components — no Bochner integration of vector-valued maps — so they are approachable with MeasureTheory.integral alone.

Difficulty

The subtlety is bookkeeping, not depth. Unbiasedness must be encoded as the algebraic constraint KW=IKW = IKW=I (the book proves the equivalence with Eβ^=βE\hat\beta = \betaEβ^​=β for all β\betaβ); the componentwise variance claim is strictly stronger than the trace claim and requires the per-component minimum norm argument, not a single matrix inequality. Positive definiteness of QQQ enters through invertibility of W⊤Q−1WW^\top Q^{-1} WW⊤Q−1W, which itself needs the linear independence of the columns of WWW — dropping either hypothesis makes the goal false. In the probabilistic statements every integral needs an integrability hypothesis; the drafts supply integrability of all pairwise products of components, from which integrability of every derived expression follows.

Formalization scope

Random vectors are plain functions Ω → Fin m → ℝ on a MeasurableSpace Ω with a probability measure μ; second moments are hypotheses of the form ∫ ω, ε ω i * ε ω j ∂μ = Q i j with explicit Integrable assumptions; no independence, Gaussianity, or distributional assumptions are used anywhere. Matrices are Matrix (Fin m) (Fin n) ℝ with Mathlib's Matrix.PosDef, nonconstructive inverse ⁻¹, and mulVec. Norms on parameter space are written as explicit finite sums of squares, avoiding any ambiguity between Euclidean and supremum norms on pi types. The estimators under comparison are strictly linear (β^=Ky\hat\beta = Kyβ^​=Ky, no affine offset), exactly as in the source; §4.5's affine extension (its Problem 6) is out of scope.

Selected references

  • David G. Luenberger, Optimization by Vector Space Methods, John Wiley & Sons, 1969. Chapter 4, pp. 78–102. ISBN 0-471-55359-X.
  • A. C. Aitken, On least squares and linear combination of observations, Proc. Roy. Soc. Edinburgh 55 (1935), 42–48 (the weighted-least-squares form of Gauss–Markov).
8 thms1 active userReviewed
PreviousPage 5 of 5Next

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