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 , , 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
- π, 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)
theorem ug-peaked-gradient-bound {n : ℕ} (π u k : Fin n → ℝ) (j₀ : Fin n) (δ F K : ℝ) (hπ : ∀ j, 0 ≤ π j) (hπs : ∑ j, π j = 1) (hpeak : 1 - δ ≤ π j₀) (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) (hu : ∀ j, |u j| ≤ F) (hk : ∀ j, |k j| ≤ K) :
|∑ j, π j * (u j * k j) - (∑ j, π j * u j) * (∑ j, π j * k j)| ≤ 8 * F * K * δ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