Provedunbiased-attentionproposalgqareview-response
Cost-aware proposal optimum: (Σ r_j c_j)(Σ A_j/r_j) ≥ (Σ √(A_j c_j))², attained by r_j ∝ √(A_j/c_j)
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) - 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 J. Lean writes f x; papers write f(x). (
Fintype J) - Nonempty
- Nonempty: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Nonempty) - ⟹Implies
- If J, then ℝ. (Between types, A → B is the type of functions from A to B.) (
J → ℝ) - x : TVariables
- A, c, r range over J → ℝ: the statement must hold for every choice. (
(A c r : J → ℝ)) - ∀For all
- The statement after the comma holds for every j. (
∀ j, 0 ≤ A j) - aᵇPower
- ∑ j, √(A(j) · c(j)) raised to the power 2. (
(∑ j, Real.sqrt (A j * c j)) ^ 2) - ∧And
- Both hold: (∑ j, √(A(j) · c(j)))^2 ≤ (∑ j, r(j) · c(j)) · (∑ j, A(j)/…, and (∀ j, 0 < A(j)) → (∑ j, √(A(j)/c(j))/(∑ k, √(A(k)/c(k))) ·…. (
(∑ j, Real.sqrt (A j * c j)) ^ 2 ≤ (∑ j…) - ∑Summation
- Add up √(A(j) · c(j)) for every j. (
∑ j, Real.sqrt (A j * c j)) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - ≤At most
- 0 is less than or equal to A(j). (
0 ≤ A j) - <Less than
- 0 is strictly smaller than c(j). (
0 < c j) - √Square root
- The non-negative number whose square is A(j) · c(j). (
Real.sqrt (A j * c j)) - ·Multiplication
- A(j) times c(j). (
A j * c j) - a/bDivision
- A(j) divided by r(j). In Lean, dividing by 0 gives 0. (
A j / r j) - =Equality
- (∑ j, √(A(j)/c(j))/(∑ k, √(A(k)/c(k))) · c(j)) · (∑ j, A(j… and (∑ j, √(A(j) · c(j)))^2 are the same. (
(∑ j, (Real.sqrt (A j / c j) / ∑ k, Rea…)
theorem pp-cost-aware-proposal-optimum {J : Type} [Fintype J] [Nonempty J] (A c r : J → ℝ) (hA : ∀ j, 0 ≤ A j) (hc : ∀ j, 0 < c j) (hr : ∀ j, 0 < r j) :
(∑ j, Real.sqrt (A j * c j)) ^ 2 ≤ (∑ j, r j * c j) * ∑ j, A j / r j ∧ ((∀ j, 0 < A j) → (∑ j, (Real.sqrt (A j / c j) / ∑ k, Real.sqrt (A k / c k)) * c j) * ∑ j, A j / (Real.sqrt (A j / c j) / ∑ k, Real.sqrt (A k / c k)) = (∑ j, Real.sqrt (A j * c j)) ^ 2)Expected per-sample access cost times the importance-sampling second moment, with residual mass A_j = π_j²‖v_j − g_j‖² (or Σ_h λ_h π_hj²‖e_hj‖² for a shared GQA proposal) and per-item cost c_j. Cauchy–Schwarz gives the lower bound and r ∝ √(A/c) attains it when all A_j > 0. Generalises gs-shared-proposal-lower-bound/attained (A_j = Σ_h π_hj², c ≡ 1). Classical in importance sampling; formalised after an external review (2026-10-05) proposed value- and cost-aware proposals.
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
- 43 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.