Provedsampleability-lawgrouped-query-attentiondecode
GQA sharing penalty, lower: for H probability rows, |H| ≤ (Σ_j √(Σ_h π_hj²))², so the shared cost per head is at least that of an exact proposal
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
- H, J range over Type: the statement must hold for every choice. (
(H J : 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 H. Lean writes f x; papers write f(x). (
Fintype H) - 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) - ∀For all
- The statement after the comma holds for every h, j. (
∀ h j, 0 ≤ π h j) - (x : T)As real numbers
- card(H) read as an element of real numbers. Mathematicians leave this implicit; Lean needs it to know which kind of number is meant. (
(Fintype.card H : ℝ)) - card
- Fintype.card: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Fintype.card) - ⟹Implies
- If J, then ℝ. (Between types, A → B is the type of functions from A to B.) (
J → ℝ) - ∑Summation
- Add up π(h, j) for every j. (
∑ j, π h j) - =Equality
- ∑ j, π(h, j) and 1 are the same. (
∑ j, π h j = 1) - ≤At most
- 0 is less than or equal to π(h, j). (
0 ≤ π h j) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - πPi
- The ratio of a circle's circumference to its diameter, ≈ 3.14159. (
π) - √Square root
- The non-negative number whose square is ∑ h, π(h, j)^2. (
Real.sqrt (∑ h, π h j ^ 2)) - aᵇPower
- π(h, j) raised to the power 2. (
π h j ^ 2)
theorem gs-sharing-penalty-lower {H J : Type} [Fintype H] [Fintype J] [Nonempty H] (π : H → J → ℝ) (hπ : ∀ h j, 0 ≤ π h j) (hrow : ∀ h, ∑ j, π h j = 1) :
(Fintype.card H : ℝ) ≤ (∑ j, Real.sqrt (∑ h, π h j ^ 2)) ^ 2Per column, Σ_h π_hj ≤ √|H| ‖π_·j‖₂; summing over keys gives A ≥ √|H|. The sharing penalty ρ = A²/|H| is ≥ 1, with equality exactly when the group's rows coincide. Part of 'The Sampleability Law' (GQA decode-traffic extension).
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
- 35 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.