proofs
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 H,J∈Type⁡\htmlData{mx=1}{H, J \in \htmlData{mx=0}{\operatorname{Type}}} and π:H→J→R\htmlData{mx=5}{\pi : \htmlData{mx=0}{H} \mathrel{\htmlData{mx=4}{\to}} \htmlData{mx=1}{J} \mathrel{\htmlData{mx=3}{\to}} \htmlData{mx=2}{\mathbb{R}}}, if ∀h,j, 0≤π(h,j)\htmlData{mx=5}{\forall h, j,\ 0 \mathrel{\htmlData{mx=4}{\leq}} \htmlData{mx=3}{\htmlData{mx=0}{\pi}(\htmlData{mx=1}{h}, \htmlData{mx=2}{j})}} and ∀h, ∑jπ(h,j)=1\htmlData{mx=6}{\forall h,\ \htmlData{mx=4}{\sum_{j} \htmlData{mx=3}{\htmlData{mx=0}{\pi}(\htmlData{mx=1}{h}, \htmlData{mx=2}{j})}} \mathrel{\htmlData{mx=5}{=}} 1} (given Fintype⁡ H\htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fintype}}\,\htmlData{mx=1}{H}}, Fintype⁡ J\htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fintype}}\,\htmlData{mx=1}{J}} and Nonempty⁡ H\htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Nonempty}}\,\htmlData{mx=1}{H}}), then

card⁡(H)≤(∑j∑hπ(h,j)2)2\htmlData{mx=3}{\htmlData{mx=2}{\htmlData{mx=0}{\operatorname{card}}(\htmlData{mx=1}{H})}} \mathrel{\htmlData{mx=13}{\leq}} \htmlData{mx=12}{\left(\htmlData{mx=11}{\sum_{j} \htmlData{mx=10}{\sqrt{\htmlData{mx=9}{\sum_{h} \htmlData{mx=8}{\htmlData{mx=7}{\htmlData{mx=4}{\pi}(\htmlData{mx=5}{h}, \htmlData{mx=6}{j})}^{2}}}}}}\right)^{2}}
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)

Per 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.

More proved statements