Provedunbiased-attentionrandomized-algorithmssoftmaxhardness
Range-aware gap, YES: one key scoring ≥ baseline + g (g ≥ 0) forces output ≥ 1/2
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 → ℝ) - x ∈ TVariables
- b, g range over real numbers: the statement must hold for every choice. (
(b g : ℝ)) - ≤At most
- 0 is less than or equal to g. (
0 ≤ g) - +Addition
- b plus g. (
b + g) - a/bDivision
- 1 divided by 2. In Lean, dividing by 0 gives 0. (
1 / 2) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - ∑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))
theorem ua-gap-general-yes {n : ℕ} (s : Fin n → ℝ) (b g : ℝ) (hg : 0 ≤ g) (j : Fin n) (hj : b + g ≤ s j) :
1 / 2 ≤ (∑ k, Real.exp (s k)) / (Real.exp b + ∑ k, Real.exp (s k))Generalizes the OV gadget to arbitrary real scores: value-1 keys s_k, a value-0 baseline key at score b. If some s_j ≥ b + g with g ≥ 0, the output Σe^{s}/(e^b + Σe^{s}) is ≥ 1/2. Only the gap g matters, not the absolute range. 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
- 16 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.