Provedunbiased-attentionend-to-endsoftmaxdebiasing
END-TO-END debiasing: single-term MLMC Z = Y₀ + (Y_{ℓ+1} − Y_ℓ)/p_ℓ (level ℓ ~ p independent of the sample draw) is exactly unbiased for m_L and E(Z − m_L)² ≤ 2E(Y₀ − m₀)² + 2Σ_ℓ D_ℓ/p_ℓ
For all , , , , and , if , , , , and (given ), then
What the notation means · or point at any symbol
- NNatural numbers
- The natural numbers 0, 1, 2, …. In Lean they start at 0. (
ℕ) - Type
- Type: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Type) - Fintype
- Fintype: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Fintype) - f(x)Function application
- Fintype applied to Ω. Lean writes f x; papers write f(x). (
Fintype Ω) - ⟹Implies
- If Ω, then ℝ. (Between types, A → B is the type of functions from A to B.) (
Ω → ℝ) - x : TVariables
- m, D range over ℕ → ℝ: the statement must hold for every choice. (
(m D : ℕ → ℝ)) - ∀For all
- The statement after the comma holds for every ω. (
∀ ω, 0 ≤ w ω) - ∑Summation
- Add up w(ω) for every ω. (
∑ ω, w ω) - =Equality
- ∑ ω, w(ω) and 1 are the same. (
∑ ω, w ω = 1) - ∧And
- Both hold: (∑ l, ∑ ω, p(l) · w(ω) · (Y(0, ω) + (Y(l + 1, ω) − Y(l, ω)…, and (∑ l, ∑ ω, p(l) · w(ω) · (Y(0, ω) + (Y(l + 1, ω) − Y(l, ω)…. (
(∑ l ∈ Finset.range L, ∑ ω, p l * w ω *…) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - ≤At most
- 0 is less than or equal to w(ω). (
0 ≤ w ω) - <Less than
- l is strictly smaller than L. (
l < L) - ·Multiplication
- w(ω) times Y(l, ω). (
w ω * Y l ω) - aᵇPower
- Y(l + 1, ω) − Y(l, ω) raised to the power 2. (
(Y (l + 1) ω - Y l ω) ^ 2) - -Subtraction
- Y(l + 1, ω) minus Y(l, ω). On ℕ, Lean's subtraction stops at 0: 2 − 5 = 0. (
Y (l + 1) ω - Y l ω) - +Addition
- l plus 1. (
l + 1) - a/bDivision
- Y(l + 1, ω) − Y(l, ω) divided by p(l). In Lean, dividing by 0 gives 0. (
(Y (l + 1) ω - Y l ω) / p l)
theorem ua-end-to-end-mlmc {L : ℕ} {Ω : Type} [Fintype Ω] (w : Ω → ℝ) (p : ℕ → ℝ) (Y : ℕ → Ω → ℝ) (m D : ℕ → ℝ) (hw : ∀ ω, 0 ≤ w ω) (hsum : ∑ ω, w ω = 1) (hp : ∀ l, l < L → 0 < p l) (hps : ∑ l ∈ Finset.range L, p l = 1) (hm : ∀ l, l ≤ L → ∑ ω, w ω * Y l ω = m l) (hD : ∀ l, l < L → ∑ ω, w ω * (Y (l + 1) ω - Y l ω) ^ 2 ≤ D l) :
(∑ l ∈ Finset.range L, ∑ ω, p l * w ω * (Y 0 ω + (Y (l + 1) ω - Y l ω) / p l) = m L) ∧ (∑ l ∈ Finset.range L, ∑ ω, p l * w ω * (Y 0 ω + (Y (l + 1) ω - Y l ω) / p l - m L) ^ 2 ≤ 2 * ∑ ω, w ω * (Y 0 ω - m 0) ^ 2 + 2 * ∑ l ∈ Finset.range L, D l / p l)Second single-statement composition (external review asked for end-to-end claims): unbiasedness AND the variance bound of the randomized multilevel estimator in one theorem over the exact finite product space (levels × sample draws). With Y_ℓ the SNIS estimates at 2^ℓ draws (D_ℓ ≤ 2(MSE_{ℓ+1}+MSE_ℓ) from ua-level-difference-bound and ua-end-to-end-uniform-snis) and Y_L exact, this is the unbiased easy side of the sharp threshold. Part of 'Unbiased randomized attention: cost x variance thresholds' (end-to-end composition round).
How it was proved
- Proved
- 4 October 2026
- By
- Ajax, with the agent “Baguette math & proofs (Claude Code, 2026-10-03)”
- Checked by
- Lean's kernel (Lean 4.33.1, with Mathlib); the proof is signed and replays offline
- Axioms
- Classical.choice, Quot.sound, propext
- Proof
- 76 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.