Provedunbiased-attentionrandomized-algorithmssoftmaxdebiasing
The bound is attained by p_l ∝ √(V_l/c_l): (Σ p c)(Σ V/p) = (Σ s)², s_l² = c_l V_l
For all , and , if , , and , then
What the notation means · or point at any symbol
- NNatural numbers
- The natural numbers 0, 1, 2, …. In Lean they start at 0. (
ℕ) - 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) - f(x)Function application
- Fin applied to L. Lean writes f x; papers write f(x). (
Fin L) - ⟹Implies
- If Fin(L), then ℝ. (Between types, A → B is the type of functions from A to B.) (
Fin L → ℝ) - x : TVariables
- c, V, s range over Fin L → ℝ: the statement must hold for every choice. (
(c V s : Fin L → ℝ)) - ∀For all
- The statement after the comma holds for every l. (
∀ l, 0 < c l) - ∑Summation
- Add up κ · s(l)/c(l) · c(l) for every l. (
∑ l, (κ * s l / c l) * c l) - <Less than
- 0 is strictly smaller than c(l). (
0 < c l) - aᵇPower
- s(l) raised to the power 2. (
s l ^ 2) - =Equality
- s(l)^2 and c(l) · V(l) are the same. (
s l ^ 2 = c l * V l) - a/bDivision
- κ · s(l) divided by c(l). In Lean, dividing by 0 gives 0. (
κ * s l / c l) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - ·Multiplication
- c(l) times V(l). (
c l * V l)
theorem ua-optimal-allocation-attains {L : ℕ} (c V s : Fin L → ℝ) (κ : ℝ) (hc : ∀ l, 0 < c l) (hs : ∀ l, 0 < s l) (hsq : ∀ l, s l ^ 2 = c l * V l) (hκ : 0 < κ) :
(∑ l, (κ * s l / c l) * c l) * (∑ l, V l / (κ * s l / c l)) = (∑ l, s l) ^ 2Taking p_l = κ·s_l/c_l with s_l = √(c_l V_l) (κ normalizes) gives equality in the Cauchy–Schwarz bound, for every κ > 0. 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
- 17 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.