Provedunbiased-attentiongradient-hardnesssampler-lower-bound
Gradient in one statement: three independent unbiased estimators A, B, C give G = A − B·C unbiased for Cov = E[uk] − E[u]E[k], with Var G ≤ 2Va + 2(VbVc + b²Vc + c²Vb)
For all , , , , , , and , if , , , , , , , , , , and (given , and ), then
What the notation means · or point at any symbol
- Type
- Type: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Type) - x ∈ TVariables
- Ω₁, Ω₂, Ω₃ range over Type: the statement must hold for every choice. (
(Ω₁ Ω₂ Ω₃ : Type)) - Fintype
- Fintype: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Fintype) - f(x)Function application
- Fintype applied to Ω₁. Lean writes f x; papers write f(x). (
Fintype Ω₁) - ⟹Implies
- If Ω₁, then ℝ. (Between types, A → B is the type of functions from A to B.) (
Ω₁ → ℝ) - ∀For all
- The statement after the comma holds for every x. (
∀ x, 0 ≤ w₁ x) - ∑Summation
- Add up w₁(x) for every x. (
∑ x, w₁ x) - =Equality
- ∑ x, w₁(x) and 1 are the same. (
∑ x, w₁ x = 1) - ∧And
- Both hold: (∑ x, ∑ y, ∑ z, w₁(x) · w₂(y) · w₃(z) · (A(x) − B(y) · C(z…, and (∑ x, ∑ y, ∑ z, w₁(x) · w₂(y) · w₃(z) · (A(x) − B(y) · C(z…. (
(∑ x, ∑ y, ∑ z, w₁ x * w₂ y * w₃ z * (A…) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - ≤At most
- 0 is less than or equal to w₁(x). (
0 ≤ w₁ x) - ·Multiplication
- w₁(x) times A(x). (
w₁ x * A x) - aᵇPower
- A(x) − a raised to the power 2. (
(A x - a) ^ 2) - -Subtraction
- A(x) minus a. On ℕ, Lean's subtraction stops at 0: 2 − 5 = 0. (
A x - a) - +Addition
- Vb · Vc plus b^2 · Vc. (
Vb * Vc + b ^ 2 * Vc)
theorem ug-covariance-estimator {Ω₁ Ω₂ Ω₃ : Type} [Fintype Ω₁] [Fintype Ω₂] [Fintype Ω₃] (w₁ : Ω₁ → ℝ) (w₂ : Ω₂ → ℝ) (w₃ : Ω₃ → ℝ) (A : Ω₁ → ℝ) (B : Ω₂ → ℝ) (C : Ω₃ → ℝ) (a b c Va Vb Vc : ℝ) (hw1 : ∀ x, 0 ≤ w₁ x) (hs1 : ∑ x, w₁ x = 1) (hs2 : ∑ y, w₂ y = 1) (hs3 : ∑ z, w₃ z = 1) (hA : ∑ x, w₁ x * A x = a) (hB : ∑ y, w₂ y * B y = b) (hC : ∑ z, w₃ z * C z = c) (hVa : ∑ x, w₁ x * (A x - a) ^ 2 = Va) (hVb : ∑ y, w₂ y * (B y - b) ^ 2 = Vb) (hVc : ∑ z, w₃ z * (C z - c) ^ 2 = Vc) (hw2 : ∀ y, 0 ≤ w₂ y) (hw3 : ∀ z, 0 ≤ w₃ z) :
(∑ x, ∑ y, ∑ z, w₁ x * w₂ y * w₃ z * (A x - B y * C z) = a - b * c) ∧ (∑ x, ∑ y, ∑ z, w₁ x * w₂ y * w₃ z * (A x - B y * C z - (a - b * c)) ^ 2 ≤ 2 * Va + 2 * (Vb * Vc + b ^ 2 * Vc + c ^ 2 * Vb))The conditional positive result for gradients as a single Lean statement on the product space: the query gradient is a covariance of three attention expectations, so three debiased forward calls through the same proposal give an unbiased gradient with variance a fixed polynomial of the forward variances. Gradient cost = O(forward cost) under any proposal; combined with the sampler lower bound (ug-planted-gradient-gap) the gradient side of the law is matched above and below on the unconditional axis. 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
- 5 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
- 63 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.