proofs
Provedalphabaguettealgorithm-ideab4

Skipping attention mass ≤ δ of the total changes the output by at most 2δM

For all m,k∈N\htmlData{mx=1}{m, k \in \htmlData{mx=0}{\mathbb{N}}}, a,x:Fin⁡ m→R\htmlData{mx=5}{a, x : \htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fin}}\,\htmlData{mx=1}{m}} \mathrel{\htmlData{mx=4}{\to}} \htmlData{mx=3}{\mathbb{R}}}, b,y:Fin⁡ k→R\htmlData{mx=5}{b, y : \htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fin}}\,\htmlData{mx=1}{k}} \mathrel{\htmlData{mx=4}{\to}} \htmlData{mx=3}{\mathbb{R}}} and δ,M∈R\htmlData{mx=1}{\delta, M \in \htmlData{mx=0}{\mathbb{R}}}, if 0≤M0 \mathrel{\htmlData{mx=1}{\leq}} \htmlData{mx=0}{M}, ∀i, 0≤a(i)\htmlData{mx=4}{\forall i,\ 0 \mathrel{\htmlData{mx=3}{\leq}} \htmlData{mx=2}{\htmlData{mx=0}{a}(\htmlData{mx=1}{i})}}, ∀j, 0≤b(j)\htmlData{mx=4}{\forall j,\ 0 \mathrel{\htmlData{mx=3}{\leq}} \htmlData{mx=2}{\htmlData{mx=0}{b}(\htmlData{mx=1}{j})}}, 0<∑ia(i)0 \mathrel{\htmlData{mx=4}{<}} \htmlData{mx=3}{\sum_{i} \htmlData{mx=2}{\htmlData{mx=0}{a}(\htmlData{mx=1}{i})}}, ∑jb(j)≤δ⋅(∑ia(i)+∑jb(j))\htmlData{mx=3}{\sum_{j} \htmlData{mx=2}{\htmlData{mx=0}{b}(\htmlData{mx=1}{j})}} \mathrel{\htmlData{mx=15}{\leq}} \htmlData{mx=14}{\htmlData{mx=4}{\delta} \cdot \left(\htmlData{mx=13}{\htmlData{mx=8}{\sum_{i} \htmlData{mx=7}{\htmlData{mx=5}{a}(\htmlData{mx=6}{i})}} + \htmlData{mx=12}{\sum_{j} \htmlData{mx=11}{\htmlData{mx=9}{b}(\htmlData{mx=10}{j})}}}\right)}, ∀i, ∣x(i)∣≤M\htmlData{mx=6}{\forall i,\ \htmlData{mx=3}{\left\lvert \htmlData{mx=2}{\htmlData{mx=0}{x}(\htmlData{mx=1}{i})} \right\rvert} \mathrel{\htmlData{mx=5}{\leq}} \htmlData{mx=4}{M}} and ∀j, ∣y(j)∣≤M\htmlData{mx=6}{\forall j,\ \htmlData{mx=3}{\left\lvert \htmlData{mx=2}{\htmlData{mx=0}{y}(\htmlData{mx=1}{j})} \right\rvert} \mathrel{\htmlData{mx=5}{\leq}} \htmlData{mx=4}{M}}, then

∣∑ia(i)⋅x(i)+∑jb(j)⋅y(j)∑ia(i)+∑jb(j)−∑ia(i)⋅x(i)∑ia(i)∣≤2δ⋅M\begin{aligned} & \htmlData{mx=42}{\left\lvert \htmlData{mx=41}{\htmlData{mx=27}{\frac{\htmlData{mx=17}{\htmlData{mx=8}{\sum_{i} \htmlData{mx=7}{\htmlData{mx=3}{\htmlData{mx=1}{a}(\htmlData{mx=2}{i})} \cdot \htmlData{mx=6}{\htmlData{mx=4}{x}(\htmlData{mx=5}{i})}}} + \htmlData{mx=16}{\sum_{j} \htmlData{mx=15}{\htmlData{mx=11}{\htmlData{mx=9}{b}(\htmlData{mx=10}{j})} \cdot \htmlData{mx=14}{\htmlData{mx=12}{y}(\htmlData{mx=13}{j})}}}}}{\htmlData{mx=26}{\htmlData{mx=21}{\sum_{i} \htmlData{mx=20}{\htmlData{mx=18}{a}(\htmlData{mx=19}{i})}} + \htmlData{mx=25}{\sum_{j} \htmlData{mx=24}{\htmlData{mx=22}{b}(\htmlData{mx=23}{j})}}}}} - \htmlData{mx=40}{\frac{\htmlData{mx=35}{\sum_{i} \htmlData{mx=34}{\htmlData{mx=30}{\htmlData{mx=28}{a}(\htmlData{mx=29}{i})} \cdot \htmlData{mx=33}{\htmlData{mx=31}{x}(\htmlData{mx=32}{i})}}}}{\htmlData{mx=39}{\sum_{i} \htmlData{mx=38}{\htmlData{mx=36}{a}(\htmlData{mx=37}{i})}}}}} \right\rvert} \\ & \quad \htmlData{mx=0}{\leq} \htmlData{mx=46}{\htmlData{mx=44}{2\htmlData{mx=43}{\delta}} \cdot \htmlData{mx=45}{M}} \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. (ℕ)
x ∈ TVariables
m, k range over natural numbers: the statement must hold for every choice. ((m k : ℕ))
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)
⟹Implies
If Fin(m), then ℝ. (Between types, A → B is the type of functions from A to B.) (Fin m → ℝ)
x : TVariables
a, x range over Fin m → ℝ: the statement must hold for every choice. ((a x : Fin m → ℝ))
≤At most
0 is less than or equal to M. (0 ≤ M)
∀For all
The statement after the comma holds for every i. (∀ i, 0 ≤ a i)
<Less than
0 is strictly smaller than ∑ i, a(i). (0 < ∑ i, a i)
a/bDivision
(∑ i, a(i) · x(i)) + (∑ j, b(j) · y(j)) divided by (∑ i, a(i)) + (∑ j, b(j)). In Lean, dividing by 0 gives 0. ((∑ i, a i * x i + ∑ j, b j * y j) / (∑ …)
-Subtraction
((∑ i, a(i) · x(i)) + (∑ j, b(j) · y(j)))/((∑ i, a(i)) + (… minus (∑ i, a(i) · x(i))/(∑ i, a(i)). On ℕ, Lean's subtraction stops at 0: 2 − 5 = 0. ((∑ i, a i * x i + ∑ j, b j * y j) / (∑ …)
∑Summation
Add up a(i) for every i. (∑ i, a i)
|x|Absolute value
The size of x(i) without its sign. (|x i|)
RReal numbers
The real numbers: every point on the number line. (ℝ)
·Multiplication
δ times (∑ i, a(i)) + (∑ j, b(j)). (δ * (∑ i, a i + ∑ j, b j))
+Addition
∑ i, a(i) plus ∑ j, b(j). (∑ i, a i + ∑ j, b j)

Idea B4. Kept keys have nonnegative weights aᵢ (e^{score}) and values xᵢ; skipped keys have weights bⱼ and values yⱼ, all |values| ≤ M. If the skipped mass is at most δ of the total, the attention output computed from the kept keys alone is within 2δM of the full output. With δ below half a BF16 ulp the skip is invisible at BF16 resolution up to the factor 2M.

How it was proved

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

More proved statements