proofs
Provedunbiased-attentionrandomized-algorithmssoftmaxhardness

Whole-instance reduction: NO (all x ≤ s) ⇒ every row ≤ 1/4; YES (some x = 1) ⇒ some row ≥ 1/2

For all m,n∈N\htmlData{mx=1}{m, n \in \htmlData{mx=0}{\mathbb{N}}}, x:Fin⁡ m→Fin⁡ n→R\htmlData{mx=9}{x : \htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fin}}\,\htmlData{mx=1}{m}} \mathrel{\htmlData{mx=8}{\to}} \htmlData{mx=5}{\htmlData{mx=3}{\operatorname{Fin}}\,\htmlData{mx=4}{n}} \mathrel{\htmlData{mx=7}{\to}} \htmlData{mx=6}{\mathbb{R}}} and s∈R\htmlData{mx=1}{s \in \htmlData{mx=0}{\mathbb{R}}}, if 0<n0 \mathrel{\htmlData{mx=1}{<}} \htmlData{mx=0}{n} and s<1\htmlData{mx=0}{s} \mathrel{\htmlData{mx=1}{<}} 1, then

((∀i,k, x(i,k)≤s)  ⟹  ∀i,∑kelog⁡(4n)1−s⋅x(i,k)elog⁡(4n)1−s+∑kelog⁡(4n)1−s⋅x(i,k)≤14)∧((∃i,k, x(i,k)=1)  ⟹  ∃i,12≤∑kelog⁡(4n)1−s⋅x(i,k)elog⁡(4n)1−s+∑kelog⁡(4n)1−s⋅x(i,k))\begin{aligned} & \left(\right. (\htmlData{mx=8}{\forall i, k,\ \htmlData{mx=5}{\htmlData{mx=2}{x}(\htmlData{mx=3}{i}, \htmlData{mx=4}{k})} \mathrel{\htmlData{mx=7}{\leq}} \htmlData{mx=6}{s}}) \\ & \htmlData{mx=1}{\implies} \htmlData{mx=9}{\forall} i, \\ & \quad \htmlData{mx=45}{\frac{\htmlData{mx=23}{\sum_{k} \htmlData{mx=22}{e^{\htmlData{mx=21}{\htmlData{mx=16}{\frac{\htmlData{mx=13}{\log (\htmlData{mx=12}{4\htmlData{mx=11}{n}})}}{\htmlData{mx=15}{1 - \htmlData{mx=14}{s}}}} \cdot \htmlData{mx=20}{\htmlData{mx=17}{x}(\htmlData{mx=18}{i}, \htmlData{mx=19}{k})}}}}}}{\htmlData{mx=44}{\htmlData{mx=30}{e^{\htmlData{mx=29}{\frac{\htmlData{mx=26}{\log (\htmlData{mx=25}{4\htmlData{mx=24}{n}})}}{\htmlData{mx=28}{1 - \htmlData{mx=27}{s}}}}}} + \htmlData{mx=43}{\sum_{k} \htmlData{mx=42}{e^{\htmlData{mx=41}{\htmlData{mx=36}{\frac{\htmlData{mx=33}{\log (\htmlData{mx=32}{4\htmlData{mx=31}{n}})}}{\htmlData{mx=35}{1 - \htmlData{mx=34}{s}}}} \cdot \htmlData{mx=40}{\htmlData{mx=37}{x}(\htmlData{mx=38}{i}, \htmlData{mx=39}{k})}}}}}}}} \\ & \quad \quad \htmlData{mx=10}{\leq} \htmlData{mx=46}{\frac{1}{4}} \left.\right) \\ & \htmlData{mx=0}{\land} \left(\right. (\htmlData{mx=53}{\exists i, k,\ \htmlData{mx=51}{\htmlData{mx=48}{x}(\htmlData{mx=49}{i}, \htmlData{mx=50}{k})} \mathrel{\htmlData{mx=52}{=}} 1}) \\ & \htmlData{mx=47}{\implies} \htmlData{mx=54}{\exists} i, \\ & \quad \htmlData{mx=56}{\frac{1}{2}} \\ & \quad \quad \htmlData{mx=55}{\leq} \htmlData{mx=91}{\frac{\htmlData{mx=69}{\sum_{k} \htmlData{mx=68}{e^{\htmlData{mx=67}{\htmlData{mx=62}{\frac{\htmlData{mx=59}{\log (\htmlData{mx=58}{4\htmlData{mx=57}{n}})}}{\htmlData{mx=61}{1 - \htmlData{mx=60}{s}}}} \cdot \htmlData{mx=66}{\htmlData{mx=63}{x}(\htmlData{mx=64}{i}, \htmlData{mx=65}{k})}}}}}}{\htmlData{mx=90}{\htmlData{mx=76}{e^{\htmlData{mx=75}{\frac{\htmlData{mx=72}{\log (\htmlData{mx=71}{4\htmlData{mx=70}{n}})}}{\htmlData{mx=74}{1 - \htmlData{mx=73}{s}}}}}} + \htmlData{mx=89}{\sum_{k} \htmlData{mx=88}{e^{\htmlData{mx=87}{\htmlData{mx=82}{\frac{\htmlData{mx=79}{\log (\htmlData{mx=78}{4\htmlData{mx=77}{n}})}}{\htmlData{mx=81}{1 - \htmlData{mx=80}{s}}}} \cdot \htmlData{mx=86}{\htmlData{mx=83}{x}(\htmlData{mx=84}{i}, \htmlData{mx=85}{k})}}}}}}}} \left.\right) \end{aligned}
What the notation means · or point at any symbol
NNatural numbers
The natural numbers 0, 1, 2, …. In Lean they start at 0. (ℕ)
x ∈ TVariables
m, n range over natural numbers: the statement must hold for every choice. ((m n : ℕ))
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 m. Lean writes f x; papers write f(x). (Fin m)
<Less than
0 is strictly smaller than n. (0 < n)
∧And
Both hold: (∀ i, k, x(i, k) ≤ s) → (∀ i, (∑ k, exp(log(4 · n)/(1 − s)…, and (∃ i, k, x(i, k) = 1) → (∃ i, 1/2 ≤ (∑ k, exp(log(4 · n)/(…. (((∀ i k, x i k ≤ s) → ∀ i, (∑ k, Real.e…)
∀For all
The statement after the comma holds for every i, k. (∀ i k, x i k ≤ s)
⟹Implies
If Fin(n), then ℝ. (Between types, A → B is the type of functions from A to B.) (Fin n → ℝ)
≤At most
x(i, k) is less than or equal to s. (x i k ≤ s)
RReal numbers
The real numbers: every point on the number line. (ℝ)
∑Summation
Add up exp(log(4 · n)/(1 − s) · x(i, k)) for every k. (∑ k, Real.exp (Real.log (4 * n) / (1 - …)
eˣExponential function
e raised to the power log(4 · n)/(1 − s) · x(i, k), where e ≈ 2.718. (Real.exp (Real.log (4 * n) / (1 - s) * …)
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))
a/bDivision
log(4 · n) divided by 1 − s. In Lean, dividing by 0 gives 0. (Real.log (4 * n) / (1 - s))
·Multiplication
4 times n. (4 * n)
-Subtraction
1 minus s. On ℕ, Lean's subtraction stops at 0: 2 − 5 = 0. (1 - s)
+Addition
exp(log(4 · n)/(1 − s)) plus ∑ k, exp(log(4 · n)/(1 − s) · x(i, k)). (Real.exp (Real.log (4 * n) / (1 - s)) +…)
∃There exists
At least one i, k makes the statement after the comma true. (∃ i k, x i k = 1)
=Equality
x(i, k) and 1 are the same. (x i k = 1)

For an instance with rows i and keys k, normalized inner products x i k, baseline at β = log(4n)/(1−s): the YES/NO promise transfers to the attention outputs of all rows at once. Part of 'Unbiased randomized attention: cost x variance thresholds', round 9 (true derivative, whole-instance reduction, compositions).

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

More proved statements