Provedunbiased-attentionrandomized-algorithmssoftmaxhardness
OV gadget NO case: all ⟨a,b⟩ ≥ 1 and C ≥ 2 log(4n) force attention output ≤ 1/4
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 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 → ℕ) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - <Less than
- 0 is strictly smaller than n. (
0 < n) - ≤At most
- 2 · log(4 · n) is less than or equal to C. (
2 * Real.log (4 * n) ≤ C) - ∀For all
- The statement after the comma holds for every k. (
∀ k, 1 ≤ ip k) - ∑Summation
- Add up exp(−C · ip(k)) for every k. (
∑ k, Real.exp (-C * ip k)) - 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)) - eˣExponential function
- e raised to the power −C · ip(k), where e ≈ 2.718. (
Real.exp (-C * ip k)) - ·Multiplication
- 4 times n. (
4 * n) - −xNegation
- The negative of C. (
-C) - +Addition
- exp(−C/2) plus ∑ k, exp(−C · ip(k)). (
Real.exp (-C / 2) + ∑ k, Real.exp (-C *…) - a/bDivision
- −C divided by 2. In Lean, dividing by 0 gives 0. (
-C / 2)
theorem ua-ov-gadget-no {n : ℕ} (ip : Fin n → ℕ) (C : ℝ) (hn : 0 < n) (hC : 2 * Real.log (4 * n) ≤ C) (hno : ∀ k, 1 ≤ ip k) :
(∑ k, Real.exp (-C * ip k)) / (Real.exp (-C / 2) + ∑ k, Real.exp (-C * ip k)) ≤ 1 / 4If no orthogonal partner exists every key weight is ≤ e^{−C}, so S ≤ n e^{−C} and the output is ≤ n e^{−C/2} ≤ 1/4. Together with the YES case this is a constant gap on a single attention row. 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
- 42 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.