Provedunbiased-attentionrandomized-algorithmssoftmaxdebiasing
Single-term randomized MLMC is exactly unbiased: Σ p_l·(ΔY_l/p_l) = Y_L − Y_0
For all and , if , then
What the notation means · or point at any symbol
- NNatural numbers
- The natural numbers 0, 1, 2, …. In Lean they start at 0. (
ℕ) - ⟹Implies
- If ℕ, then ℝ. (Between types, A → B is the type of functions from A to B.) (
ℕ → ℝ) - x : TVariables
- Y, p range over ℕ → ℝ: the statement must hold for every choice. (
(Y p : ℕ → ℝ)) - ∀For all
- The statement after the comma holds for every l. (
∀ l < L, p l ≠ 0) - ∑Summation
- Add up p(l) · ((Y(l + 1) − Y(l))/p(l)) for l = 0, 1, …, L − 1. (
∑ l ∈ Finset.range L, p l * ((Y (l + 1)…) - =Equality
- ∑ l, p(l) · ((Y(l + 1) − Y(l))/p(l)) and Y(L) − Y(0) are the same. (
∑ l ∈ Finset.range L, p l * ((Y (l + 1)…) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - f(x)Function application
- p applied to l. Lean writes f x; papers write f(x). (
p l) - ≠Not equal
- p(l) and 0 are different. (
p l ≠ 0) - ·Multiplication
- p(l) times (Y(l + 1) − Y(l))/p(l). (
p l * ((Y (l + 1) - Y l) / p l)) - 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) - -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)
theorem ua-mlmc-single-term-unbiased {L : ℕ} (Y p : ℕ → ℝ) (hp : ∀ l < L, p l ≠ 0) :
∑ l ∈ Finset.range L, p l * ((Y (l + 1) - Y l) / p l) = Y L - Y 0Draw a level l with probability p_l, return (Y_{l+1} − Y_l)/p_l. Its mean telescopes to Y_L − Y_0 for ANY positive level law: the finite Rhee–Glynn identity behind exact debiasing of a self-normalized attention estimate over nested key sets of size 2^l. Part of 'Unbiased randomized attention: cost x variance thresholds' (open theory problem).
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
- 13 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.