proofs
Provedunbiased-attentionrandomized-algorithmssoftmaxhardness

Range-aware gap, NO: every key ≤ baseline − g with g ≥ log(4n) forces output ≤ 1/4

For all n∈N\htmlData{mx=1}{n \in \htmlData{mx=0}{\mathbb{N}}}, s:Fin⁡ n→R\htmlData{mx=5}{s : \htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fin}}\,\htmlData{mx=1}{n}} \mathrel{\htmlData{mx=4}{\to}} \htmlData{mx=3}{\mathbb{R}}} and b,g∈R\htmlData{mx=1}{b, g \in \htmlData{mx=0}{\mathbb{R}}}, if 0<n0 \mathrel{\htmlData{mx=1}{<}} \htmlData{mx=0}{n}, log⁡(4n)≤g\htmlData{mx=2}{\log (\htmlData{mx=1}{4\htmlData{mx=0}{n}})} \mathrel{\htmlData{mx=4}{\leq}} \htmlData{mx=3}{g} and ∀k, s(k)≤b−g\htmlData{mx=7}{\forall k,\ \htmlData{mx=2}{\htmlData{mx=0}{s}(\htmlData{mx=1}{k})} \mathrel{\htmlData{mx=6}{\leq}} \htmlData{mx=5}{\htmlData{mx=3}{b} - \htmlData{mx=4}{g}}}, then

∑kes(k)eb+∑kes(k)≤14\htmlData{mx=13}{\frac{\htmlData{mx=4}{\sum_{k} \htmlData{mx=3}{e^{\htmlData{mx=2}{\htmlData{mx=0}{s}(\htmlData{mx=1}{k})}}}}}{\htmlData{mx=12}{\htmlData{mx=6}{e^{\htmlData{mx=5}{b}}} + \htmlData{mx=11}{\sum_{k} \htmlData{mx=10}{e^{\htmlData{mx=9}{\htmlData{mx=7}{s}(\htmlData{mx=8}{k})}}}}}}} \mathrel{\htmlData{mx=15}{\leq}} \htmlData{mx=14}{\frac{1}{4}}
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 n. Lean writes f x; papers write f(x). (Fin n)
⟹Implies
If Fin(n), then ℝ. (Between types, A → B is the type of functions from A to B.) (Fin n → ℝ)
x ∈ TVariables
b, g range over real numbers: the statement must hold for every choice. ((b g : ℝ))
<Less than
0 is strictly smaller than n. (0 < n)
logNatural logarithm
The logarithm of 4 · n to base e: the power e must be raised to to give 4 · n. (Real.log (4 * n))
≤At most
log(4 · n) is less than or equal to g. (Real.log (4 * n) ≤ g)
∀For all
The statement after the comma holds for every k. (∀ k, s k ≤ b - g)
a/bDivision
∑ k, exp(s(k)) divided by exp(b) + (∑ k, exp(s(k))). In Lean, dividing by 0 gives 0. ((∑ k, Real.exp (s k)) / (Real.exp b + ∑…)
∑Summation
Add up exp(s(k)) for every k. (∑ k, Real.exp (s k))
eˣExponential function
e raised to the power s(k), where e ≈ 2.718. (Real.exp (s k))
RReal numbers
The real numbers: every point on the number line. (ℝ)
·Multiplication
4 times n. (4 * n)
-Subtraction
b minus g. On ℕ, Lean's subtraction stops at 0: 2 − 5 = 0. (b - g)
+Addition
exp(b) plus ∑ k, exp(s(k)). (Real.exp b + ∑ k, Real.exp (s k))

If all n value-1 keys score ≤ b − g and g ≥ ln(4n), the output is ≤ 1/4. With the YES case, a score gap of 2 ln(4n) between close and far keys gives a constant output gap: this is what lets a multiplicative Hamming gap give hardness at score range Θ(log n) instead of Θ(log² n). Part of 'Unbiased randomized attention: cost x variance thresholds' (open theory problem), round 2.

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

More proved statements