Provedunbiased-attentionrandomized-algorithmssoftmaxdebiasing
Second moment of the single-term estimator is Σ M_l / p_l
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
- M, p range over ℕ → ℝ: the statement must hold for every choice. (
(M p : ℕ → ℝ)) - ∀For all
- The statement after the comma holds for every l. (
∀ l < L, p l ≠ 0) - ∑Summation
- Add up p(l) · (M(l)/p(l)^2) for l = 0, 1, …, L − 1. (
∑ l ∈ Finset.range L, p l * (M l / p l …) - =Equality
- ∑ l, p(l) · (M(l)/p(l)^2) and ∑ l, M(l)/p(l) are the same. (
∑ l ∈ Finset.range L, p l * (M l / p l …) - 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 M(l)/p(l)^2. (
p l * (M l / p l ^ 2)) - a/bDivision
- M(l) divided by p(l)^2. In Lean, dividing by 0 gives 0. (
M l / p l ^ 2) - aᵇPower
- p(l) raised to the power 2. (
p l ^ 2)
theorem ua-mlmc-second-moment {L : ℕ} (M p : ℕ → ℝ) (hp : ∀ l < L, p l ≠ 0) :
∑ l ∈ Finset.range L, p l * (M l / p l ^ 2) = ∑ l ∈ Finset.range L, M l / p lWith M_l = E[(ΔY_l)²], E[Z²] = Σ p_l·M_l/p_l² = Σ M_l/p_l. This is the quantity the level law must control. 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.