Provedunbiased-attentionend-to-endsoftmaxeasy-side
Vector-valued SNIS: coordinates |v_jc| ≤ F, one set of N i.i.d. draws for all d coordinates ⇒ Σ_c MSE_c ≤ d · 16F²(Σπ²/r)/N
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
- n, N, d range over natural numbers: the statement must hold for every choice. (
(n N d : ℕ)) - <Less than
- 0 is strictly smaller than N. (
0 < 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 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
- r, π range over Fin n → ℝ: the statement must hold for every choice. (
(r π : Fin n → ℝ)) - ∀For all
- The statement after the comma holds for every j. (
∀ j, 0 < r j) - ∑Summation
- Add up r(j) for every j. (
∑ j, r j) - =Equality
- ∑ j, r(j) and 1 are the same. (
∑ j, r j = 1) - |x|Absolute value
- The size of v(j, c) without its sign. (
|v j c|) - ≤At most
- |v(j, c)| is less than or equal to F. (
|v j c| ≤ F) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - πPi
- The ratio of a circle's circumference to its diameter, ≈ 3.14159. (
π) - ∏Product
- Multiply together r(f(k)) for every k. (
∏ k, r (f k)) - aᵇPower
- (∑ i, π(f(i))/r(f(i)) · v(f(i), c))/(∑ i, π(f(i))/r(f(i)))… raised to the power 2. (
((∑ i, π (f i) / r (f i) * v (f i) c) /…) - -Subtraction
- (∑ i, π(f(i))/r(f(i)) · v(f(i), c))/(∑ i, π(f(i))/r(f(i))) minus ∑ j, π(j) · v(j, c). On ℕ, Lean's subtraction stops at 0: 2 − 5 = 0. (
(∑ i, π (f i) / r (f i) * v (f i) c) / …) - a/bDivision
- π(f(i)) divided by r(f(i)). In Lean, dividing by 0 gives 0. (
π (f i) / r (f i)) - ·Multiplication
- π(f(i))/r(f(i)) times v(f(i), c). (
π (f i) / r (f i) * v (f i) c)
theorem ua-snis-mse-bound-vector {n N d : ℕ} (hN : 0 < N) (r π : Fin n → ℝ) (v : Fin n → Fin d → ℝ) (F : ℝ) (hr : ∀ j, 0 < r j) (hrs : ∑ j, r j = 1) (hπ : ∀ j, 0 < π j) (hπs : ∑ j, π j = 1) (hv : ∀ j c, |v j c| ≤ F) :
∑ c, ∑ f : Fin N → Fin n, (∏ k, r (f k)) * ((∑ i, π (f i) / r (f i) * v (f i) c) / (∑ i, π (f i) / r (f i)) - ∑ j, π j * v j c) ^ 2 ≤ d * (16 * F ^ 2 * (∑ j, π j ^ 2 / r j) / N)Closes the external review's 'the SNIS bound is scalar' item: the same draws serve every value coordinate, and the summed squared error over d coordinates is at most d times the scalar bound (a per-coordinate application of ua-snis-mse-bound, inlined). With a Euclidean norm bound ‖v_j‖₂ ≤ F the factor d can be removed by the same argument with F_c² summing to F²; stated here in the per-coordinate form. Part of 'Unbiased randomized attention: cost x variance thresholds' (end-to-end composition round).
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
- 171 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.