proofs
Provedalphabaguettebaguette-zv2

Grid moments keep relative precision 1/M once v ≥ M·2⁻ᵏ

For all k∈N\htmlData{mx=1}{k \in \htmlData{mx=0}{\mathbb{N}}} and v,M∈R\htmlData{mx=1}{v, M \in \htmlData{mx=0}{\mathbb{R}}}, if 0<M0 \mathrel{\htmlData{mx=1}{<}} \htmlData{mx=0}{M} and M2k≤v\htmlData{mx=3}{\frac{\htmlData{mx=0}{M}}{\htmlData{mx=2}{2^{\htmlData{mx=1}{k}}}}} \mathrel{\htmlData{mx=5}{\leq}} \htmlData{mx=4}{v}, then

∣v−⌊v⋅2k⌋2k∣≤vM\htmlData{mx=11}{\left\lvert \htmlData{mx=10}{\htmlData{mx=0}{v} - \htmlData{mx=9}{\frac{\htmlData{mx=6}{\htmlData{mx=5}{\left\lfloor \htmlData{mx=4}{\htmlData{mx=1}{v} \cdot \htmlData{mx=3}{2^{\htmlData{mx=2}{k}}}} \right\rfloor}}}{\htmlData{mx=8}{2^{\htmlData{mx=7}{k}}}}}} \right\rvert} \mathrel{\htmlData{mx=15}{\leq}} \htmlData{mx=14}{\frac{\htmlData{mx=12}{v}}{\htmlData{mx=13}{M}}}
What the notation means · or point at any symbol
NNatural numbers
The natural numbers 0, 1, 2, …. In Lean they start at 0. (ℕ)
RReal numbers
The real numbers: every point on the number line. (ℝ)
x ∈ TVariables
v, M range over real numbers: the statement must hold for every choice. ((v M : ℝ))
<Less than
0 is strictly smaller than M. (0 < M)
a/bDivision
M divided by 2^k. In Lean, dividing by 0 gives 0. (M / 2 ^ k)
≤At most
M/2^k is less than or equal to v. (M / 2 ^ k ≤ v)
|x|Absolute value
The size of v − ⌊v · 2^k⌋/2^k without its sign. (|v - (⌊v * 2 ^ k⌋ : ℝ) / 2 ^ k|)
-Subtraction
v minus ⌊v · 2^k⌋/2^k. On ℕ, Lean's subtraction stops at 0: 2 − 5 = 0. (v - (⌊v * 2 ^ k⌋ : ℝ) / 2 ^ k)
aᵇPower
2 raised to the power k. (2 ^ k)
(x : T)As real numbers
⌊v · 2^k⌋ read as an element of real numbers. Mathematicians leave this implicit; Lean needs it to know which kind of number is meant. ((⌊v * 2 ^ k⌋ : ℝ))
⌊x⌋Floor
The largest integer not above v · 2^k. (⌊v * 2 ^ k⌋)
·Multiplication
v times 2^k. (v * 2 ^ k)

The real hazard of integer optimizer state is underflow, not overflow (review S6): a moment v stored on grid 2⁻ᵏ has relative error ≤ 1/M whenever v ≥ M·2⁻ᵏ. Typical second moments ~10⁻¹² need k ≈ 60 for M ≈ 10⁶. Part of 'Baguette-Z v2' (revision after the hostile review).

How it was proved

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

More proved statements