proofs
Provedquery-cover-lawdecode-attentionsoftmaxkv-cache

The greedy snapshot rule keeps centres η-separated

For all α∈Type⁡\htmlData{mx=1}{\alpha \in \htmlData{mx=0}{\operatorname{Type}}}, dist:α→α→R\htmlData{mx=5}{\mathit{dist} : \htmlData{mx=0}{\alpha} \mathrel{\htmlData{mx=4}{\to}} \htmlData{mx=1}{\alpha} \mathrel{\htmlData{mx=3}{\to}} \htmlData{mx=2}{\mathbb{R}}}, C∈Finset⁡ α\htmlData{mx=3}{C \in \htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Finset}}\,\htmlData{mx=1}{\alpha}}}, q∈α\htmlData{mx=1}{q \in \htmlData{mx=0}{\alpha}} and η∈R\htmlData{mx=1}{\eta \in \htmlData{mx=0}{\mathbb{R}}}, if ∀x,y, dist(x,y)=dist(y,x)\htmlData{mx=9}{\forall x, y,\ \htmlData{mx=3}{\htmlData{mx=0}{\mathit{dist}}(\htmlData{mx=1}{x}, \htmlData{mx=2}{y})} \mathrel{\htmlData{mx=8}{=}} \htmlData{mx=7}{\htmlData{mx=4}{\mathit{dist}}(\htmlData{mx=5}{y}, \htmlData{mx=6}{x})}}, ∀c∈C, η<dist(q,c)\htmlData{mx=7}{\forall c \in \htmlData{mx=6}{C},\ \htmlData{mx=0}{\eta} \mathrel{\htmlData{mx=5}{<}} \htmlData{mx=4}{\htmlData{mx=1}{\mathit{dist}}(\htmlData{mx=2}{q}, \htmlData{mx=3}{c})}} and ∀x∈C, ∀y∈C, x≠y  ⟹  η<dist(x,y)\htmlData{mx=13}{\forall x \in \htmlData{mx=12}{C},\ \htmlData{mx=11}{\forall y \in \htmlData{mx=10}{C},\ \htmlData{mx=0}{x} \mathrel{\htmlData{mx=2}{\neq}} \htmlData{mx=1}{y} \mathrel{\htmlData{mx=9}{\implies}} \htmlData{mx=3}{\eta} \mathrel{\htmlData{mx=8}{<}} \htmlData{mx=7}{\htmlData{mx=4}{\mathit{dist}}(\htmlData{mx=5}{x}, \htmlData{mx=6}{y})}}} (given DecidableEq⁡ α\htmlData{mx=2}{\htmlData{mx=0}{\operatorname{DecidableEq}}\,\htmlData{mx=1}{\alpha}}), then

∀x∈insert⁡(q,C), ∀y∈insert⁡(q,C), x≠y  ⟹  η<dist(x,y)\htmlData{mx=19}{\forall x \in \htmlData{mx=18}{\htmlData{mx=15}{\operatorname{insert}}(\htmlData{mx=16}{q}, \htmlData{mx=17}{C})},\ \htmlData{mx=14}{\forall y \in \htmlData{mx=13}{\htmlData{mx=10}{\operatorname{insert}}(\htmlData{mx=11}{q}, \htmlData{mx=12}{C})},\ \htmlData{mx=0}{x} \mathrel{\htmlData{mx=2}{\neq}} \htmlData{mx=1}{y} \mathrel{\htmlData{mx=9}{\implies}} \htmlData{mx=3}{\eta} \mathrel{\htmlData{mx=8}{<}} \htmlData{mx=7}{\htmlData{mx=4}{\mathit{dist}}(\htmlData{mx=5}{x}, \htmlData{mx=6}{y})}}}
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)
DecidableEq
DecidableEq: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (DecidableEq)
f(x)Function application
DecidableEq applied to α. Lean writes f x; papers write f(x). (DecidableEq α)
∀For all
The statement after the comma holds for every x, y. (∀ x y, dist x y = dist y x)
Finset
Finset: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (Finset)
⟹Implies
If α, then ℝ. (Between types, A → B is the type of functions from A to B.) (α → ℝ)
=Equality
dist(x, y) and dist(y, x) are the same. (dist x y = dist y x)
RReal numbers
The real numbers: every point on the number line. (ℝ)
<Less than
η is strictly smaller than dist(q, c). (η < dist q c)
≠Not equal
x and y are different. (x ≠ y)
insert
insert: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (insert)

A new snapshot is opened only when the query is more than η from every existing centre; by induction all centres stay pairwise more than η apart, feeding the cover comparison. Part of 'The Query-Cover Law: decode attention cost is set by where the queries go, not by how long the context is'.

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

More proved statements