proofs
Provedproposal-principleattentionunifiedtraining

Permuted-tile sampling is unbiased: pick one of K key tiles uniformly and scale its sum by K

For all n,K∈N\htmlData{mx=1}{n, K \in \htmlData{mx=0}{\mathbb{N}}}, tile:Fin⁡ n→Fin⁡ K\htmlData{mx=7}{\mathit{tile} : \htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fin}}\,\htmlData{mx=1}{n}} \mathrel{\htmlData{mx=6}{\to}} \htmlData{mx=5}{\htmlData{mx=3}{\operatorname{Fin}}\,\htmlData{mx=4}{K}}} and x:Fin⁡ n→R\htmlData{mx=5}{x : \htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fin}}\,\htmlData{mx=1}{n}} \mathrel{\htmlData{mx=4}{\to}} \htmlData{mx=3}{\mathbb{R}}}, if 0<K0 \mathrel{\htmlData{mx=1}{<}} \htmlData{mx=0}{K}, then

∑b1K⋅(K⋅∑j∈filter⁡(j↦tile(j)=b)x(j))=∑jx(j)\htmlData{mx=19}{\sum_{b} \htmlData{mx=18}{\htmlData{mx=2}{\frac{1}{\htmlData{mx=1}{\htmlData{mx=0}{K}}}} \cdot \left(\htmlData{mx=17}{\htmlData{mx=4}{\htmlData{mx=3}{K}} \cdot \htmlData{mx=16}{\sum_{j \in \htmlData{mx=12}{\htmlData{mx=5}{\operatorname{filter}}(\htmlData{mx=11}{j \mapsto \htmlData{mx=8}{\htmlData{mx=6}{\mathit{tile}}(\htmlData{mx=7}{j})} \mathrel{\htmlData{mx=10}{=}} \htmlData{mx=9}{b}})}} \htmlData{mx=15}{\htmlData{mx=13}{x}(\htmlData{mx=14}{j})}}}\right)}} \mathrel{\htmlData{mx=24}{=}} \htmlData{mx=23}{\sum_{j} \htmlData{mx=22}{\htmlData{mx=20}{x}(\htmlData{mx=21}{j})}}
What the notation means · or point at any symbol
NNatural numbers
The natural numbers 0, 1, 2, …. In Lean they start at 0. (ℕ)
x ∈ TVariables
n, K range over natural numbers: the statement must hold for every choice. ((n K : ℕ))
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)
f(x)Function application
Fin applied to n. Lean writes f x; papers write f(x). (Fin n)
⟹Implies
If Fin(n), then Fin(K). (Between types, A → B is the type of functions from A to B.) (Fin n → Fin K)
<Less than
0 is strictly smaller than K. (0 < K)
a/bDivision
1 divided by K. In Lean, dividing by 0 gives 0. (1 / (K : ℝ))
RReal numbers
The real numbers: every point on the number line. (ℝ)
(x : T)As real numbers
K read as an element of real numbers. Mathematicians leave this implicit; Lean needs it to know which kind of number is meant. ((K : ℝ))
·Multiplication
K times ∑ j, x(j). ((K : ℝ) * ∑ j ∈ Finset.univ.filter (fun…)
∑Summation
Add up x(j) for each j in filter(j ↦ tile(j) = b). (∑ j ∈ Finset.univ.filter (fun j => tile…)
filter
Finset.univ.filter: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (Finset.univ.filter)
x ↦ f(x)Function (λ-abstraction)
The function sending j to tile(j) = b. Lean writes fun x => …; papers write x ↦ …. (fun j => tile j = b)
=Equality
tile(j) and b are the same. (tile j = b)

Energy-aware proposal for GPUs (Disproval Loop 2): permute keys once, sample contiguous 64-key tiles. Coalesced reads make the random-access penalty γ ≈ 1 while the estimator stays unbiased. Part of 'The Proposal Principle: attention complexity is proposal complexity'.

How it was proved

Proved
4 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
14 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.

More proved statements