Provedalphabaguettealgorithm-ideab4
Skipping attention mass ≤ δ of the total changes the output by at most 2δM
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, 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)
theorem tile-skip-output-error {m k : ℕ} (a x : Fin m → ℝ) (b y : Fin k → ℝ) (δ M : ℝ) (hM : 0 ≤ M) (ha : ∀ i, 0 ≤ a i) (hb : ∀ j, 0 ≤ b j) (hA : 0 < ∑ i, a i) (hδ : ∑ j, b j ≤ δ * (∑ i, a i + ∑ j, b j)) (hx : ∀ i, |x i| ≤ M) (hy : ∀ j, |y j| ≤ M) :
|(∑ i, a i * x i + ∑ j, b j * y j) / (∑ i, a i + ∑ j, b j) - (∑ i, a i * x i) / ∑ i, a i| ≤ 2 * δ * MIdea 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.