proofs
Provedunbiased-gradientsmlmctrainingheadline-theorem

Exactly unbiased Lipschitz functionals of the dense computation: finite-terminal MLMC with E‖X_ℓ − x⋆‖² ≤ c/2^ℓ and X_L = x⋆ gives E[Z] = Φ(x⋆), MSE ≤ (2+12L)Lip²c, work ≤ 3L

For all L,dim∈N\htmlData{mx=1}{L, \mathit{dim} \in \htmlData{mx=0}{\mathbb{N}}}, Ω∈Type⁡\htmlData{mx=1}{\Omega \in \htmlData{mx=0}{\operatorname{Type}}}, w:Ω→R\htmlData{mx=3}{w : \htmlData{mx=0}{\Omega} \mathrel{\htmlData{mx=2}{\to}} \htmlData{mx=1}{\mathbb{R}}}, X:N→Ω→Fin⁡ dim→R\htmlData{mx=9}{X : \htmlData{mx=0}{\mathbb{N}} \mathrel{\htmlData{mx=8}{\to}} \htmlData{mx=1}{\Omega} \mathrel{\htmlData{mx=7}{\to}} \htmlData{mx=4}{\htmlData{mx=2}{\operatorname{Fin}}\,\htmlData{mx=3}{\mathit{dim}}} \mathrel{\htmlData{mx=6}{\to}} \htmlData{mx=5}{\mathbb{R}}}, xstar:Fin⁡ dim→R\htmlData{mx=5}{\mathit{xstar} : \htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fin}}\,\htmlData{mx=1}{\mathit{dim}}} \mathrel{\htmlData{mx=4}{\to}} \htmlData{mx=3}{\mathbb{R}}}, Φ:(Fin⁡ dim→R)→R\htmlData{mx=7}{\Phi : (\htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fin}}\,\htmlData{mx=1}{\mathit{dim}}} \mathrel{\htmlData{mx=4}{\to}} \htmlData{mx=3}{\mathbb{R}}) \mathrel{\htmlData{mx=6}{\to}} \htmlData{mx=5}{\mathbb{R}}}, Lip,c,S∈R\htmlData{mx=1}{\mathit{Lip}, c, S \in \htmlData{mx=0}{\mathbb{R}}}, p,cost:N→R\htmlData{mx=3}{p, \mathit{cost} : \htmlData{mx=0}{\mathbb{N}} \mathrel{\htmlData{mx=2}{\to}} \htmlData{mx=1}{\mathbb{R}}}, Y:N→Ω→R\htmlData{mx=5}{Y : \htmlData{mx=0}{\mathbb{N}} \mathrel{\htmlData{mx=4}{\to}} \htmlData{mx=1}{\Omega} \mathrel{\htmlData{mx=3}{\to}} \htmlData{mx=2}{\mathbb{R}}} and o∈R\htmlData{mx=1}{o \in \htmlData{mx=0}{\mathbb{R}}}, if 1≤L1 \mathrel{\htmlData{mx=1}{\leq}} \htmlData{mx=0}{L}, ∀ω, 0≤w(ω)\htmlData{mx=4}{\forall \omega,\ 0 \mathrel{\htmlData{mx=3}{\leq}} \htmlData{mx=2}{\htmlData{mx=0}{w}(\htmlData{mx=1}{\omega})}}, ∑ωw(ω)=1\htmlData{mx=3}{\sum_{\omega} \htmlData{mx=2}{\htmlData{mx=0}{w}(\htmlData{mx=1}{\omega})}} \mathrel{\htmlData{mx=4}{=}} 1, ∀ω, X(L,ω)=xstar\htmlData{mx=6}{\forall \omega,\ \htmlData{mx=3}{\htmlData{mx=0}{X}(\htmlData{mx=1}{L}, \htmlData{mx=2}{\omega})} \mathrel{\htmlData{mx=5}{=}} \htmlData{mx=4}{\mathit{xstar}}}, ∀l, l<L  ⟹  ∑ωw(ω)⋅∑i(X(l,ω,i)−xstar(i))2≤c2l\htmlData{mx=25}{\forall l,\ \htmlData{mx=0}{l} \mathrel{\htmlData{mx=2}{<}} \htmlData{mx=1}{L} \mathrel{\htmlData{mx=24}{\implies}} \htmlData{mx=18}{\sum_{\omega} \htmlData{mx=17}{\htmlData{mx=5}{\htmlData{mx=3}{w}(\htmlData{mx=4}{\omega})} \cdot \htmlData{mx=16}{\sum_{i} \htmlData{mx=15}{(\htmlData{mx=14}{\htmlData{mx=10}{\htmlData{mx=6}{X}(\htmlData{mx=7}{l}, \htmlData{mx=8}{\omega}, \htmlData{mx=9}{i})} - \htmlData{mx=13}{\htmlData{mx=11}{\mathit{xstar}}(\htmlData{mx=12}{i})}})^{2}}}}} \mathrel{\htmlData{mx=23}{\leq}} \htmlData{mx=22}{\frac{\htmlData{mx=19}{c}}{\htmlData{mx=21}{2^{\htmlData{mx=20}{l}}}}}}, ∀x,y, (Φ(x)−Φ(y))2≤Lip2⋅∑i(x(i)−y(i))2\htmlData{mx=21}{\forall x, y,\ \htmlData{mx=7}{(\htmlData{mx=6}{\htmlData{mx=2}{\htmlData{mx=0}{\Phi}(\htmlData{mx=1}{x})} - \htmlData{mx=5}{\htmlData{mx=3}{\Phi}(\htmlData{mx=4}{y})}})^{2}} \mathrel{\htmlData{mx=20}{\leq}} \htmlData{mx=19}{\htmlData{mx=9}{\htmlData{mx=8}{\mathit{Lip}}^{2}} \cdot \htmlData{mx=18}{\sum_{i} \htmlData{mx=17}{(\htmlData{mx=16}{\htmlData{mx=12}{\htmlData{mx=10}{x}(\htmlData{mx=11}{i})} - \htmlData{mx=15}{\htmlData{mx=13}{y}(\htmlData{mx=14}{i})}})^{2}}}}}, S=∑k=0L−112k\htmlData{mx=0}{S} \mathrel{\htmlData{mx=7}{=}} \htmlData{mx=6}{\sum_{k=0}^{\htmlData{mx=1}{L} - 1} \htmlData{mx=5}{\htmlData{mx=3}{\htmlData{mx=2}{\frac{1}{2}}}^{\htmlData{mx=4}{k}}}}, ∀l, p(l)=12lS\htmlData{mx=10}{\forall l,\ \htmlData{mx=2}{\htmlData{mx=0}{p}(\htmlData{mx=1}{l})} \mathrel{\htmlData{mx=9}{=}} \htmlData{mx=8}{\frac{\htmlData{mx=6}{\htmlData{mx=4}{\htmlData{mx=3}{\frac{1}{2}}}^{\htmlData{mx=5}{l}}}}{\htmlData{mx=7}{S}}}}, ∀l, l≤L  ⟹  cost(l)≤2l\htmlData{mx=10}{\forall l,\ \htmlData{mx=0}{l} \mathrel{\htmlData{mx=2}{\leq}} \htmlData{mx=1}{L} \mathrel{\htmlData{mx=9}{\implies}} \htmlData{mx=5}{\htmlData{mx=3}{\mathit{cost}}(\htmlData{mx=4}{l})} \mathrel{\htmlData{mx=8}{\leq}} \htmlData{mx=7}{2^{\htmlData{mx=6}{l}}}}, ∀l,ω, Y(l,ω)=Φ(X(l,ω))\htmlData{mx=11}{\forall l, \omega,\ \htmlData{mx=3}{\htmlData{mx=0}{Y}(\htmlData{mx=1}{l}, \htmlData{mx=2}{\omega})} \mathrel{\htmlData{mx=10}{=}} \htmlData{mx=9}{\htmlData{mx=4}{\Phi}(\htmlData{mx=8}{\htmlData{mx=5}{X}(\htmlData{mx=6}{l}, \htmlData{mx=7}{\omega})})}} and o=Φ(xstar)\htmlData{mx=0}{o} \mathrel{\htmlData{mx=4}{=}} \htmlData{mx=3}{\htmlData{mx=1}{\Phi}(\htmlData{mx=2}{\mathit{xstar}})} (given Fintype⁡ Ω\htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fintype}}\,\htmlData{mx=1}{\Omega}}), then

(∑l=0L−1∑ωp(l)⋅w(ω)⋅(Y(0,ω)+Y(l+1,ω)−Y(l,ω)p(l))=o)∧(∑l=0L−1∑ωp(l)⋅w(ω)⋅(Y(0,ω)+Y(l+1,ω)−Y(l,ω)p(l)−o)2≤(2+12L)⋅(Lip2⋅c))∧(∑l=0L−1p(l)⋅(cost(l)+cost(l+1))≤3L)\begin{aligned} & \left(\right. \htmlData{mx=30}{\sum_{l=0}^{\htmlData{mx=2}{L} - 1} \htmlData{mx=29}{\sum_{\omega} \htmlData{mx=28}{\htmlData{mx=9}{\htmlData{mx=5}{\htmlData{mx=3}{p}(\htmlData{mx=4}{l})} \cdot \htmlData{mx=8}{\htmlData{mx=6}{w}(\htmlData{mx=7}{\omega})}} \cdot \left(\htmlData{mx=27}{\htmlData{mx=12}{\htmlData{mx=10}{Y}(0, \htmlData{mx=11}{\omega})} + \htmlData{mx=26}{\frac{\htmlData{mx=22}{\htmlData{mx=17}{\htmlData{mx=13}{Y}(\htmlData{mx=15}{\htmlData{mx=14}{l} + 1}, \htmlData{mx=16}{\omega})} - \htmlData{mx=21}{\htmlData{mx=18}{Y}(\htmlData{mx=19}{l}, \htmlData{mx=20}{\omega})}}}{\htmlData{mx=25}{\htmlData{mx=23}{p}(\htmlData{mx=24}{l})}}}}\right)}}} \\ & \quad \htmlData{mx=1}{=} \htmlData{mx=31}{o} \left.\right) \\ & \htmlData{mx=0}{\land} \left(\right. \htmlData{mx=64}{\sum_{l=0}^{\htmlData{mx=33}{L} - 1} \htmlData{mx=63}{\sum_{\omega} \htmlData{mx=62}{\htmlData{mx=40}{\htmlData{mx=36}{\htmlData{mx=34}{p}(\htmlData{mx=35}{l})} \cdot \htmlData{mx=39}{\htmlData{mx=37}{w}(\htmlData{mx=38}{\omega})}} \cdot \htmlData{mx=61}{\left(\htmlData{mx=60}{\htmlData{mx=58}{\htmlData{mx=43}{\htmlData{mx=41}{Y}(0, \htmlData{mx=42}{\omega})} + \htmlData{mx=57}{\frac{\htmlData{mx=53}{\htmlData{mx=48}{\htmlData{mx=44}{Y}(\htmlData{mx=46}{\htmlData{mx=45}{l} + 1}, \htmlData{mx=47}{\omega})} - \htmlData{mx=52}{\htmlData{mx=49}{Y}(\htmlData{mx=50}{l}, \htmlData{mx=51}{\omega})}}}{\htmlData{mx=56}{\htmlData{mx=54}{p}(\htmlData{mx=55}{l})}}}} - \htmlData{mx=59}{o}}\right)^{2}}}}} \\ & \quad \htmlData{mx=32}{\leq} \htmlData{mx=72}{(\htmlData{mx=67}{2 + \htmlData{mx=66}{12\htmlData{mx=65}{L}}}) \cdot (\htmlData{mx=71}{\htmlData{mx=69}{\htmlData{mx=68}{\mathit{Lip}}^{2}} \cdot \htmlData{mx=70}{c}})} \left.\right) \\ & \htmlData{mx=0}{\land} \left(\htmlData{mx=86}{\sum_{l=0}^{\htmlData{mx=73}{L} - 1} \htmlData{mx=85}{\htmlData{mx=76}{\htmlData{mx=74}{p}(\htmlData{mx=75}{l})} \cdot (\htmlData{mx=84}{\htmlData{mx=79}{\htmlData{mx=77}{\mathit{cost}}(\htmlData{mx=78}{l})} + \htmlData{mx=83}{\htmlData{mx=80}{\mathit{cost}}(\htmlData{mx=82}{\htmlData{mx=81}{l} + 1})}})}} \mathrel{\htmlData{mx=89}{\leq}} \htmlData{mx=88}{3\htmlData{mx=87}{L}}\right) \end{aligned}
What the notation means · or point at any symbol
NNatural numbers
The natural numbers 0, 1, 2, …. In Lean they start at 0. (ℕ)
x ∈ TVariables
L, dim range over natural numbers: the statement must hold for every choice. ((L dim : ℕ))
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 Ω)
≤At most
1 is less than or equal to L. (1 ≤ L)
⟹Implies
If Ω, then ℝ. (Between types, A → B is the type of functions from A to B.) (Ω → ℝ)
∀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)
x : TVariables
p, cost range over ℕ → ℝ: the statement must hold for every choice. ((p cost : ℕ → ℝ))
RReal numbers
The real numbers: every point on the number line. (ℝ)
<Less than
l is strictly smaller than L. (l < L)
Fin
Fin: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (Fin)
·Multiplication
w(ω) times ∑ i, (X(l, ω, i) − xstar(i))^2. (w ω * ∑ i, (X l ω i - xstar i) ^ 2)
(x : T)As real numbers
1/2 read as an element of real numbers. Mathematicians leave this implicit; Lean needs it to know which kind of number is meant. ((1 / 2 : ℝ))
aᵇPower
X(l, ω, i) − xstar(i) raised to the power 2. ((X l ω i - xstar i) ^ 2)
-Subtraction
X(l, ω, i) minus xstar(i). On ℕ, Lean's subtraction stops at 0: 2 − 5 = 0. (X l ω i - xstar i)
+Addition
l plus 1. (l + 1)
a/bDivision
c divided by 2^l. In Lean, dividing by 0 gives 0. (c / 2 ^ l)
∧And
Both hold: (∑ l, ∑ ω, p(l) · w(ω) · (Y(0, ω) + (Y(l + 1, ω) − Y(l, ω)…, and (∑ l, p(l) · (cost(l) + cost(l + 1))) ≤ 3 · L. ((∑ l ∈ Finset.range L, ∑ ω, p l * w ω *…)

The positive training theorem. Let X_ℓ be vector-valued level estimates of a dense quantity x⋆ (the vector of all attention outputs of a network at sample budget 2^ℓ per head), coupled on one probability space, with the exact dense computation as the last level, and let Φ be any Lip-Lipschitz functional (a coordinate of the dense loss gradient, as a function of the attention outputs, on a bounded domain). The randomised telescope over Φ(X_ℓ) is exactly unbiased for Φ(x⋆), with mean squared error ≤ (2+12L)·Lip²c and expected cost of the sampled level pair ≤ 3L. So exactly unbiased gradients of the DENSE objective are possible with sampled attention, at an expected overhead of O(log n) samples per head and a dense pass with probability Θ(1/n), with a variance price Lip²·(2+12L). Counterpart to the sample-reuse counterexample, which shows the naive route is biased. First-principles reformulation, 2026-10-05.

How it was proved

Proved
5 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
127 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.

More proved statements