Provedunbiased-attentiongradientone-pass
IID product space: E[U(X_i)K(X_i)] = E[UK] and E[U(X_i)K(X_j)] = E[U]E[K] for i ≠ j
For all , , and , if and (given ), 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) - 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 Ω) - NNatural numbers
- The natural numbers 0, 1, 2, …. In Lean they start at 0. (
ℕ) - ⟹Implies
- If Ω, then ℝ. (Between types, A → B is the type of functions from A to B.) (
Ω → ℝ) - x : TVariables
- w, U, K range over Ω → ℝ: the statement must hold for every choice. (
(w U K : Ω → ℝ)) - ∑Summation
- Add up w(ω) for every ω. (
∑ ω, w ω) - =Equality
- ∑ ω, w(ω) and 1 are the same. (
∑ ω, w ω = 1) - 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) - x ∈ TVariables
- i, j range over Fin N: the statement must hold for every choice. (
(i j : Fin N)) - ≠Not equal
- i and j are different. (
i ≠ j) - ∧And
- Both hold: (∑ f, (∏ m, w(f(m))) · (U(f(i)) · K(f(i)))) = (∑ ω, w(ω) ·…, and (∑ f, (∏ m, w(f(m))) · (U(f(i)) · K(f(j)))) = (∑ ω, w(ω) ·…. (
(∑ f : Fin N → Ω, (∏ m, w (f m)) * (U (…) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - ∏Product
- Multiply together w(f(m)) for every m. (
∏ m, w (f m)) - ·Multiplication
- U(f(i)) times K(f(i)). (
U (f i) * K (f i))
theorem op-iid-coordinate-means {Ω : Type} [Fintype Ω] {N : ℕ} (w U K : Ω → ℝ) (hsum : ∑ ω, w ω = 1) (i j : Fin N) (hij : i ≠ j) :
(∑ f : Fin N → Ω, (∏ m, w (f m)) * (U (f i) * K (f i)) = ∑ ω, w ω * (U ω * K ω)) ∧ (∑ f : Fin N → Ω, (∏ m, w (f m)) * (U (f i) * K (f j)) = (∑ ω, w ω * U ω) * (∑ ω, w ω * K ω))Coordinate expectations on the exact product space Fin N → Ω with weights Π w(f m), via Fintype.prod_sum. The building block of the one-pass gradient estimator. Part of 'Unbiased randomized attention', gradient round.
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
- 41 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.