proofs
Provedunbiased-attentiongradient-hardnesssampler-lower-bound

Peaked-row gradient bound: if the row puts mass ≥ 1−δ on one key, |Cov_π(u,k)| ≤ 8 F K δ for |u| ≤ F, |k| ≤ K

For all n∈N\htmlData{mx=1}{n \in \htmlData{mx=0}{\mathbb{N}}}, π,u,k:Fin⁡ n→R\htmlData{mx=5}{\pi, u, k : \htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fin}}\,\htmlData{mx=1}{n}} \mathrel{\htmlData{mx=4}{\to}} \htmlData{mx=3}{\mathbb{R}}}, j0∈Fin⁡ n\htmlData{mx=3}{j_{0} \in \htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fin}}\,\htmlData{mx=1}{n}}} and δ,F,K∈R\htmlData{mx=1}{\delta, F, K \in \htmlData{mx=0}{\mathbb{R}}}, if ∀j, 0≤π(j)\htmlData{mx=4}{\forall j,\ 0 \mathrel{\htmlData{mx=3}{\leq}} \htmlData{mx=2}{\htmlData{mx=0}{\pi}(\htmlData{mx=1}{j})}}, ∑jπ(j)=1\htmlData{mx=3}{\sum_{j} \htmlData{mx=2}{\htmlData{mx=0}{\pi}(\htmlData{mx=1}{j})}} \mathrel{\htmlData{mx=4}{=}} 1, 1−δ≤π(j0)\htmlData{mx=1}{1 - \htmlData{mx=0}{\delta}} \mathrel{\htmlData{mx=5}{\leq}} \htmlData{mx=4}{\htmlData{mx=2}{\pi}(\htmlData{mx=3}{j_{0}})}, 0≤δ0 \mathrel{\htmlData{mx=1}{\leq}} \htmlData{mx=0}{\delta}, δ≤1\htmlData{mx=0}{\delta} \mathrel{\htmlData{mx=1}{\leq}} 1, ∀j, ∣u(j)∣≤F\htmlData{mx=6}{\forall j,\ \htmlData{mx=3}{\left\lvert \htmlData{mx=2}{\htmlData{mx=0}{u}(\htmlData{mx=1}{j})} \right\rvert} \mathrel{\htmlData{mx=5}{\leq}} \htmlData{mx=4}{F}} and ∀j, ∣k(j)∣≤K\htmlData{mx=6}{\forall j,\ \htmlData{mx=3}{\left\lvert \htmlData{mx=2}{\htmlData{mx=0}{k}(\htmlData{mx=1}{j})} \right\rvert} \mathrel{\htmlData{mx=5}{\leq}} \htmlData{mx=4}{K}}, then

∣∑jπ(j)⋅(u(j)⋅k(j))−(∑jπ(j)⋅u(j))⋅(∑jπ(j)⋅k(j))∣≤8F⋅K⋅δ\begin{aligned} & \htmlData{mx=31}{\left\lvert \htmlData{mx=30}{\htmlData{mx=12}{\sum_{j} \htmlData{mx=11}{\htmlData{mx=3}{\htmlData{mx=1}{\pi}(\htmlData{mx=2}{j})} \cdot (\htmlData{mx=10}{\htmlData{mx=6}{\htmlData{mx=4}{u}(\htmlData{mx=5}{j})} \cdot \htmlData{mx=9}{\htmlData{mx=7}{k}(\htmlData{mx=8}{j})}})}} - \htmlData{mx=29}{\left(\htmlData{mx=20}{\sum_{j} \htmlData{mx=19}{\htmlData{mx=15}{\htmlData{mx=13}{\pi}(\htmlData{mx=14}{j})} \cdot \htmlData{mx=18}{\htmlData{mx=16}{u}(\htmlData{mx=17}{j})}}}\right) \cdot \left(\htmlData{mx=28}{\sum_{j} \htmlData{mx=27}{\htmlData{mx=23}{\htmlData{mx=21}{\pi}(\htmlData{mx=22}{j})} \cdot \htmlData{mx=26}{\htmlData{mx=24}{k}(\htmlData{mx=25}{j})}}}\right)}} \right\rvert} \\ & \quad \htmlData{mx=0}{\leq} \htmlData{mx=37}{\htmlData{mx=35}{\htmlData{mx=33}{8\htmlData{mx=32}{F}} \cdot \htmlData{mx=34}{K}} \cdot \htmlData{mx=36}{\delta}} \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. (ℕ)
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
π, u, k range over Fin n → ℝ: the statement must hold for every choice. ((π u k : Fin n → ℝ))
x ∈ TVariables
δ, F, K range over real numbers: the statement must hold for every choice. ((δ F K : ℝ))
∀For all
The statement after the comma holds for every j. (∀ j, 0 ≤ π j)
∑Summation
Add up π(j) for every j. (∑ j, π j)
=Equality
∑ j, π(j) and 1 are the same. (∑ j, π j = 1)
-Subtraction
1 minus δ. On ℕ, Lean's subtraction stops at 0: 2 − 5 = 0. (1 - δ)
≤At most
0 is less than or equal to π(j). (0 ≤ π j)
|x|Absolute value
The size of u(j) without its sign. (|u j|)
RReal numbers
The real numbers: every point on the number line. (ℝ)
πPi
The ratio of a circle's circumference to its diameter, ≈ 3.14159. (π)
·Multiplication
u(j) times k(j). (u j * k j)

The query-gradient coordinate of a peaked (retrieval) head is O(δ) in the off-peak mass: covariance is shift-invariant, so subtracting the peak's values makes every remaining term carry the off-peak mass. Consequence: retrieval heads, the expensive ones for the forward pass, have small gradients; with an exact sampler their gradient variance is O(δ) as well, so the sample count for a fixed absolute target scales with δ, while the per-sample cost (e^R under a uniform proposal) scales with 1/δ: no free lunch, the Retrieval–Speed Duality holds for gradients with the same cost. Part of 'Unbiased randomized attention: cost x variance thresholds', gradient-hardness round: the unconditional sampler lower bound transferred to the query gradient.

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

More proved statements