Proved
Finite certified attention from constructed polynomial moments
For all , , and , if , , , , , and , then
What the notation means · or point at any symbol
- NNatural numbers
- The natural numbers 0, 1, 2, …. In Lean they start at 0. (
ℕ) - <Less than
- 0 is strictly smaller than m. (
0<m) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - x ∈ TVariables
- q, R, F, epsilon range over real numbers: the statement must hold for every choice. (
(q R F epsilon : ℝ)) - ≤At most
- 0 is less than or equal to q. (
0≤q) - 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 + 1. Lean writes f x; papers write f(x). (
Fin (n+1)) - ⟹Implies
- If Fin(n + 1), then ℝ. (Between types, A → B is the type of functions from A to B.) (
Fin (n+1) → ℝ) - x : TVariables
- k, v range over Fin (n+1) → ℝ: the statement must hold for every choice. (
(k v : Fin (n+1) → ℝ)) - ∀For all
- The statement after the comma holds for every j. (
∀ j,0≤k j ∧ k j≤1) - let
- let: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
let) - ∧And
- Both hold: 0 ≤ k(j), and k(j) ≤ 1. (
0≤k j ∧ k j≤1) - |x|Absolute value
- The size of v(j) without its sign. (
|v j|) - +Addition
- n plus 1. (
n+1)
theorem attention-precision-constructed-moment-state {n : ℕ} (m : ℕ) (hm : 0<m)
(q R F epsilon : ℝ) (hq : 0≤q) (hqR : q≤R) (hF : 0≤F) (he : 0<epsilon)
(k v : Fin (n+1) → ℝ) (hk : ∀ j,0≤k j ∧ k j≤1) (hv : ∀ j,|v j|≤F) :
(let D:=polynomialDeadline n R
let H:=polynomialCopies m R F epsilon
let r:=uniformRow n
let a:=polynomialAccept q R k
let b:=polynomialSurrogate m q R k
let U:=1+polynomialResidual m R
let o:=softmaxOutput q k v
let y:=finiteAccepted (scaledAccepted a b v (storedPolynomialControl m q
(momentSums m (List.ofFn (fun j : Fin (n+1) => (k j,v j))))) (1/U)) o D
let law:=rejectionWeight r a D
(∀ z,0≤copiesWeight law H z) ∧ (∑ z,copiesWeight law H z)=1 ∧
mean (copiesWeight law H) (average y H)=o ∧
mse (copiesWeight law H) (average y H) o≤epsilon^2 ∧
mean (copiesWeight law H) (polynomialQueryWork m H D)≤
12*(m : ℝ)+4+(H : ℝ)*(6*Real.exp R+10*(m : ℝ)+22))Starts from actual key/value arrays and constructed moment state. Derives certificate, finite law, original-softmax mean, MSE, copy count, deadline and explicit charged work; exact real arithmetic.
How it was proved
- Proved
- 8 October 2026
- By
- Ajax
- 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
- 26 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.
More proved statements
- GQA sharing penalty, lower: for H probability rows, |H| ≤ (Σ_j √(Σ_h π_hj²))², so the shared cost per head…
- Drift Law lower bound (snapshot model): uniform snapshot, m of n keys drifting by x = e^{ct}: reuse cost =…
- Counterexample: buckets {1} and {1,2} (each w.p. 1/2) have inclusion probabilities (1, 1/2) = √(1, 1/4), yet…