proofs
Provedchi-squareproposalhashingheadline-theorem

Square-root law: the proposal r ∝ √π has cost factor (Σ√π)(Σπ^{3/2}) and its square is at most n·Σπ², the blind cost

For all n∈N\htmlData{mx=1}{n \in \htmlData{mx=0}{\mathbb{N}}} and π:Fin⁡ n→R\htmlData{mx=5}{\pi : \htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fin}}\,\htmlData{mx=1}{n}} \mathrel{\htmlData{mx=4}{\to}} \htmlData{mx=3}{\mathbb{R}}}, if ∀j, 0<π(j)\htmlData{mx=4}{\forall j,\ 0 \mathrel{\htmlData{mx=3}{<}} \htmlData{mx=2}{\htmlData{mx=0}{\pi}(\htmlData{mx=1}{j})}} and ∑jπ(j)=1\htmlData{mx=3}{\sum_{j} \htmlData{mx=2}{\htmlData{mx=0}{\pi}(\htmlData{mx=1}{j})}} \mathrel{\htmlData{mx=4}{=}} 1, then

∑jπ(j)2π(j)∑kπ(k)=(∑kπ(k))⋅∑jπ(j)⋅π(j)∧(∑jπ(j)2π(j)∑kπ(k))2≤n⋅∑jπ(j)2\begin{aligned} & \htmlData{mx=17}{\sum_{j} \htmlData{mx=16}{\frac{\htmlData{mx=5}{\htmlData{mx=4}{\htmlData{mx=2}{\pi}(\htmlData{mx=3}{j})}^{2}}}{\htmlData{mx=15}{\frac{\htmlData{mx=9}{\sqrt{\htmlData{mx=8}{\htmlData{mx=6}{\pi}(\htmlData{mx=7}{j})}}}}{\htmlData{mx=14}{\sum_{k} \htmlData{mx=13}{\sqrt{\htmlData{mx=12}{\htmlData{mx=10}{\pi}(\htmlData{mx=11}{k})}}}}}}}}} \\ & \quad \htmlData{mx=1}{=} \htmlData{mx=32}{\left(\htmlData{mx=22}{\sum_{k} \htmlData{mx=21}{\sqrt{\htmlData{mx=20}{\htmlData{mx=18}{\pi}(\htmlData{mx=19}{k})}}}}\right) \cdot \htmlData{mx=31}{\sum_{j} \htmlData{mx=30}{\htmlData{mx=25}{\htmlData{mx=23}{\pi}(\htmlData{mx=24}{j})} \cdot \htmlData{mx=29}{\sqrt{\htmlData{mx=28}{\htmlData{mx=26}{\pi}(\htmlData{mx=27}{j})}}}}}} \\ & \htmlData{mx=0}{\land} \htmlData{mx=49}{\left(\htmlData{mx=48}{\sum_{j} \htmlData{mx=47}{\frac{\htmlData{mx=36}{\htmlData{mx=35}{\htmlData{mx=33}{\pi}(\htmlData{mx=34}{j})}^{2}}}{\htmlData{mx=46}{\frac{\htmlData{mx=40}{\sqrt{\htmlData{mx=39}{\htmlData{mx=37}{\pi}(\htmlData{mx=38}{j})}}}}{\htmlData{mx=45}{\sum_{k} \htmlData{mx=44}{\sqrt{\htmlData{mx=43}{\htmlData{mx=41}{\pi}(\htmlData{mx=42}{k})}}}}}}}}}\right)^{2}} \mathrel{\htmlData{mx=58}{\leq}} \htmlData{mx=57}{\htmlData{mx=51}{\htmlData{mx=50}{n}} \cdot \htmlData{mx=56}{\sum_{j} \htmlData{mx=55}{\htmlData{mx=54}{\htmlData{mx=52}{\pi}(\htmlData{mx=53}{j})}^{2}}}} \end{aligned}
What the notation means · or point at any symbol
NNatural numbers
The natural numbers 0, 1, 2, …. In Lean they start at 0. (ℕ)
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 ℝ. (Between types, A → B is the type of functions from A to B.) (Fin n → ℝ)
∀For all
The statement after the comma holds for every j. (∀ j, 0 < π j)
∑Summation
Add up π(j) for every j. (∑ j, π j)
=Equality
∑ j, π(j) and 1 are the same. (∑ j, π j = 1)
∧And
Both hold: (∑ j, π(j)^2/(√(π(j))/(∑ k, √(π(k))))) = (∑ k, √(π(k))) · …, and (∑ j, π(j)^2/(√(π(j))/(∑ k, √(π(k)))))^2 ≤ n · (∑ j, π(j)^2). (∑ j, π j ^ 2 / (Real.sqrt (π j) / ∑ k, …)
<Less than
0 is strictly smaller than π(j). (0 < π j)
aᵇPower
π(j) raised to the power 2. (π j ^ 2)
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 π(j). (Real.sqrt (π j))
a/bDivision
√(π(j)) divided by ∑ k, √(π(k)). In Lean, dividing by 0 gives 0. (Real.sqrt (π j) / ∑ k, Real.sqrt (π k))
·Multiplication
π(j) times √(π(j)). (π j * Real.sqrt (π j))
≤At most
(∑ j, π(j)^2/(√(π(j))/(∑ k, √(π(k)))))^2 is less than or equal to n · (∑ j, π(j)^2). ((∑ j, π j ^ 2 / (Real.sqrt (π j) / ∑ k,…)
(x : T)As real numbers
n read as an element of real numbers. Mathematicians leave this implicit; Lean needs it to know which kind of number is meant. ((n : ℝ))

Blind (uniform) sampling costs n·Σπ² per row. The square-root proposal costs at most the square root of that: C(π‖√π)² ≤ n·Σπ², by two applications of Cauchy–Schwarz. For the planted family (m hot keys among n) this is √(n/m) against n/m. Hashing-based estimators sample from (approximately) this proposal for hashable kernels, so preprocessing on the keys buys exactly a square root. This corrects the programme's earlier candidate threshold n^{min(1+α,2)}: with hashing the exponent at score range α ln n is at most 1 + α/2 for hashable kernels. First-principles reformulation, 2026-10-05.

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