Provedunbiased-attentionrandomized-algorithmssoftmaxhardness
Augmented embedding: q·k_c − q·k_base = −(β/d)(dist(a,c) − θ)
For all , and , if , 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 d. Lean writes f x; papers write f(x). (
Fin d) - ⟹Implies
- If Fin(d), then ℝ. (Between types, A → B is the type of functions from A to B.) (
Fin d → ℝ) - x : TVariables
- a, c range over Fin d → ℝ: the statement must hold for every choice. (
(a c : Fin d → ℝ)) - x ∈ TVariables
- β, θ range over real numbers: the statement must hold for every choice. (
(β θ : ℝ)) - (x : T)As real numbers
- d read as an element of real numbers. Mathematicians leave this implicit; Lean needs it to know which kind of number is meant. (
(d : ℝ)) - ≠Not equal
- d and 0 are different. (
(d : ℝ) ≠ 0) - -Subtraction
- (∑ i, 2 · β/d · a(i) · c(i)) + β/d · −(∑ i, c(i)) + β · (∑… minus (∑ i, 2 · β/d · a(i) · 0) + β/d · −θ + β · (∑ i, a(i))/d · 1. On ℕ, Lean's subtraction stops at 0: 2 − 5 = 0. (
(∑ i, (2 * β / d * a i) * c i + (β / d)…) - =Equality
- (∑ i, 2 · β/d · a(i) · c(i)) + β/d · −(∑ i, c(i)) + β · (∑… and −(β/d) · ((∑ i, a(i)) + (∑ i, c(i)) − 2 · (∑ i, a(i) · c(i… are the same. (
(∑ i, (2 * β / d * a i) * c i + (β / d)…) - ∑Summation
- Add up 2 · β/d · a(i) · c(i) for every i. (
∑ i, (2 * β / d * a i) * c i) - +Addition
- ∑ i, 2 · β/d · a(i) · c(i) plus β/d · −(∑ i, c(i)). (
∑ i, (2 * β / d * a i) * c i + (β / d) …) - ·Multiplication
- 2 times β. (
2 * β) - a/bDivision
- 2 · β divided by d. In Lean, dividing by 0 gives 0. (
2 * β / d) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - −xNegation
- The negative of ∑ i, c(i). (
-(∑ i, c i))
theorem ua-augmented-scores {d : ℕ} (a c : Fin d → ℝ) (β θ : ℝ) (hd : (d : ℝ) ≠ 0) :
(∑ i, (2 * β / d * a i) * c i + (β / d) * (-(∑ i, c i)) + (β * (∑ i, a i) / d) * 0) - ((∑ i, (2 * β / d * a i) * 0) + (β / d) * (-θ) + (β * (∑ i, a i) / d) * 1) = -(β / d) * ((∑ i, a i + ∑ i, c i - 2 * ∑ i, a i * c i) - θ)With q = (2β/d·a, β/d, β|a|/d), k_c = (c, −|c|, 0), k_base = (0, −θ, 1), the score of key c relative to the shared baseline key is exactly −(β/d)(Hamming(a,c) − θ). Feeding a (1+ε)-gap Hamming closest-pair instance (Rubinstein 2018) with θ = (1+ε/2)t and β ε t/(2d) ≥ ln(4n) into the range-aware gap lemmas gives score range ≤ β = O(log n / (ε·t/d)). 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
- 15 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.