proofs
Provedunbiased-attentionrandomized-algorithmssoftmaxaggregate

A factor-2 estimate separates totals that differ by a factor 4

For all Z,zhat,T∈R\htmlData{mx=1}{Z, \mathit{zhat}, T \in \htmlData{mx=0}{\mathbb{R}}}, if 0<T0 \mathrel{\htmlData{mx=1}{<}} \htmlData{mx=0}{T} and Z2≤zhat∧zhat≤2Z\htmlData{mx=1}{\frac{\htmlData{mx=0}{Z}}{2}} \mathrel{\htmlData{mx=3}{\leq}} \htmlData{mx=2}{\mathit{zhat}} \mathbin{\htmlData{mx=8}{\land}} \htmlData{mx=4}{\mathit{zhat}} \mathrel{\htmlData{mx=7}{\leq}} \htmlData{mx=6}{2\htmlData{mx=5}{Z}}, then

(4T≤Z  ⟹  2T≤zhat)∧(Z≤T  ⟹  zhat≤2T)(\htmlData{mx=1}{4\htmlData{mx=0}{T}} \mathrel{\htmlData{mx=3}{\leq}} \htmlData{mx=2}{Z} \mathrel{\htmlData{mx=8}{\implies}} \htmlData{mx=5}{2\htmlData{mx=4}{T}} \mathrel{\htmlData{mx=7}{\leq}} \htmlData{mx=6}{\mathit{zhat}}) \mathbin{\htmlData{mx=17}{\land}} (\htmlData{mx=9}{Z} \mathrel{\htmlData{mx=11}{\leq}} \htmlData{mx=10}{T} \mathrel{\htmlData{mx=16}{\implies}} \htmlData{mx=12}{\mathit{zhat}} \mathrel{\htmlData{mx=15}{\leq}} \htmlData{mx=14}{2\htmlData{mx=13}{T}})
What the notation means · or point at any symbol
RReal numbers
The real numbers: every point on the number line. (ℝ)
x ∈ TVariables
Z, zhat, T range over real numbers: the statement must hold for every choice. ((Z zhat T : ℝ))
<Less than
0 is strictly smaller than T. (0 < T)
a/bDivision
Z divided by 2. In Lean, dividing by 0 gives 0. (Z / 2)
≤At most
Z/2 is less than or equal to zhat. (Z / 2 ≤ zhat)
∧And
Both hold: Z/2 ≤ zhat, and zhat ≤ 2 · Z. (Z / 2 ≤ zhat ∧ zhat ≤ 2 * Z)
⟹Implies
If 4 · T ≤ Z, then 2 · T ≤ zhat. (Between types, A → B is the type of functions from A to B.) (4 * T ≤ Z → 2 * T ≤ zhat)
·Multiplication
2 times Z. (2 * Z)

Z/2 ≤ ẑ ≤ 2Z: YES (Z ≥ 4T) gives ẑ ≥ 2T, NO (Z ≤ T) gives ẑ ≤ 2T, with the threshold T computable from n, β, s. Part of 'Unbiased randomized attention: cost x variance thresholds', round 13 (aggregate / batch partition function).

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

More proved statements