Provedunbiased-attentionrandomized-algorithmssoftmaxhardness
Whole-instance reduction: NO (all x ≤ s) ⇒ every row ≤ 1/4; YES (some x = 1) ⇒ some row ≥ 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. (
ℕ) - 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)
theorem ua-reduction-all-rows {m n : ℕ} (x : Fin m → Fin n → ℝ) (s : ℝ) (hn : 0 < n) (hs : s < 1) :
((∀ i k, x i k ≤ s) → ∀ i, (∑ k, Real.exp (Real.log (4 * n) / (1 - s) * x i k)) / (Real.exp (Real.log (4 * n) / (1 - s)) + ∑ k, Real.exp (Real.log (4 * n) / (1 - s) * x i k)) ≤ 1 / 4) ∧ ((∃ i k, x i k = 1) → ∃ i, 1 / 2 ≤ (∑ k, Real.exp (Real.log (4 * n) / (1 - s) * x i k)) / (Real.exp (Real.log (4 * n) / (1 - s)) + ∑ k, Real.exp (Real.log (4 * n) / (1 - s) * x i k)))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.