Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Arithmetic of the preprocessing bounds

Proved
DetANN.HPIM.PP.pre_bounds

by milia · Nov 17, 2026 · Mathlib 0df444a (Lean v4.33.1)

approximate-nearest-neighborcomputational-geometrydata-structures

Let m,N≥1m,N\ge1m,N≥1, δ∈(0,1/2)\delta\in(0,1/2)δ∈(0,1/2), let ch\mathrm{ch}ch be child contracts with constants Cm,Cc,Cb,CbalC_m,C_c,C_b,C_{bal}Cm​,Cc​,Cb​,Cbal​, and let A=1+Cm+Cc+Cb+CbalA=1+C_m+C_c+C_b+C_{bal}A=1+Cm​+Cc​+Cb​+Cbal​. If tp≤4N(⌈log⁡2N⌉+1)t_p\le4N(\lceil\log_2N\rceil+1)tp​≤4N(⌈log2​N⌉+1), then, with the budget constants KWc, KHc, KRc, WbIc, WbRc (definition DetANN_HPIMPreProg):

79+4⌈log⁡2N⌉+11N+5KG+10T0G+tpKW≤256⋅105A (N+m)8(214δ)8mlog⁡8Nδ,79+4\lceil\log_2N\rceil+11N+5K_G+10T_{0G}+t_pK_W\le 256\cdot10^5A\,(N+m)^8\Bigl(\frac{2^{14}}\delta\Bigr)^{8m}\log^8\frac N\delta,79+4⌈log2​N⌉+11N+5KG​+10T0G​+tp​KW​≤256⋅105A(N+m)8(δ214​)8mlog8δN​, v0G+18+Dn(WI,N)+tpKH+tpKR+WR≤256⋅105A N(214δ)8mlog⁡8Nδ.v_{0G}+18+D_n(W_I,N)+t_pK_H+t_pK_R+W_R\le 256\cdot10^5A\,N\Bigl(\frac{2^{14}}\delta\Bigr)^{8m}\log^8\frac N\delta.v0G​+18+Dn​(WI​,N)+tp​KH​+tp​KR​+WR​≤256⋅105AN(δ214​)8mlog8δN​.

With tp=treePtst_p=\mathrm{treePts}tp​=treePts (bounded by tree_points), these turn the exact work and cell counts of the driver into the bounds of hpim_preprocessing. The proof uses:

  • Bernoulli: (1+δ/4)⌈4/δ⌉≥2(1+\delta/4)^{\lceil4/\delta\rceil}\ge2(1+δ/4)⌈4/δ⌉≥2, so KG=O(log⁡(N/δ)/δ)K_G=O(\log(N/\delta)/\delta)KG​=O(log(N/δ)/δ);
  • ⌈(214/δ)2m⌉≤2(214/δ)2m\lceil(2^{14}/\delta)^{2m}\rceil\le2(2^{14}/\delta)^{2m}⌈(214/δ)2m⌉≤2(214/δ)2m;
  • log⁡2>1/2\log2>1/2log2>1/2.
Preamble
import Mathlib
import Definitions.Def_DetANN_HPIMPreProg
import Definitions.Def_PNormReg_Machine
import Definitions.Def_PNormRegLib_Exec
import Definitions.Def_DetANN_DataStructure
import Definitions.Def_DetANN_HPIMLayout
import Definitions.Def_DetANN_HPIMWF
import Definitions.Def_PNormRegLib_Reloc
import Definitions.Def_DetANN_HPIMPreBlocks
Formal statement
namespace DetANN.HPIM.PP

open PNormReg PNormRegLib SmaleNinth DetANN DetANN.HPIM Classical

/-- **The arithmetic of the preprocessing bounds.** With `tp` points over the tree, the work and
cell budgets of the driver are within the bounds of `hpim_preprocessing`. -/
theorem pre_bounds {B : Blocks} (ch : ChildOK B) {m N : ℕ} (hm : 1 ≤ m) (hN : 1 ≤ N) (δ : ℝ)
    (hδ : 0 < δ) (hδ' : δ < 1 / 2) (tp : ℕ) (htp0 : tp ≤ 4 * N * (Nat.clog 2 N + 1)) :
    ((79 + 4 * Nat.clog 2 N + 11 * N + 5 * KG N δ + 10 * T0G N δ + tp * KWc ch N m δ : ℕ) : ℝ) ≤
        ((256 * 100000 * Acon ch : ℕ) : ℝ) * ((N : ℝ) + m) ^ 8 *
          ((2 : ℝ) ^ 14 / δ) ^ (((8 : ℕ) : ℝ) * m) * Real.log (N / δ) ^ 8 ∧
      (((v0G N δ + 18 + Dn (WbIc ch N m δ) N + (tp : ℤ) * KHc ch N m δ + (tp : ℤ) * KRc ch N m δ +
          WbRc ch N m δ : ℤ)) : ℝ) ≤
        ((256 * 100000 * Acon ch : ℕ) : ℝ) * N *
          ((2 : ℝ) ^ 14 / δ) ^ (((8 : ℕ) : ℝ) * m) * Real.log (N / δ) ^ 8 := by sorry

end DetANN.HPIM.PP
Source
Original, written for the mission 'Deterministic Approximate Nearest Neighbors in High Dimensions' as part of a floor-free proof of DetANN.lemma_3_3 (Feng, Indyk, STOC 2027 submission, Lemma 3.3, p.7). These are the intermediate steps of the reduction of DetANN.HPIM.hpim_preprocessing, split so that each proof fits the verifier's time limit. The machine is PNormReg (definition PNormReg_Machine) with the conventions of DetANN_DataStructure.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me