proofs
Provedhashingcounterexamplereview-response

Counterexample: buckets {1} and {1,2} (each w.p. 1/2) have inclusion probabilities (1, 1/2) = √(1, 1/4), yet uniform-in-bucket sampling returns key 1 w.p. 3/4, not 2/3

(12⋅1+12⋅(12)=34)∧(11+12=23)∧(34≠23)∧(1=1∧14=12)\begin{aligned} & \left(\htmlData{mx=7}{\htmlData{mx=3}{\htmlData{mx=2}{\htmlData{mx=1}{\frac{1}{2}}} \cdot 1} + \htmlData{mx=6}{\htmlData{mx=4}{\frac{1}{2}} \cdot \left(\htmlData{mx=5}{\frac{1}{2}}\right)}} \mathrel{\htmlData{mx=9}{=}} \htmlData{mx=8}{\frac{3}{4}}\right) \\ & \htmlData{mx=0}{\land} \left(\htmlData{mx=13}{\frac{\htmlData{mx=10}{1}}{\htmlData{mx=12}{1 + \htmlData{mx=11}{\frac{1}{2}}}}} \mathrel{\htmlData{mx=15}{=}} \htmlData{mx=14}{\frac{2}{3}}\right) \\ & \htmlData{mx=0}{\land} \left(\htmlData{mx=17}{\htmlData{mx=16}{\frac{3}{4}}} \mathrel{\htmlData{mx=19}{\neq}} \htmlData{mx=18}{\frac{2}{3}}\right) \\ & \htmlData{mx=0}{\land} \left(\htmlData{mx=20}{\sqrt{1}} \mathrel{\htmlData{mx=22}{=}} \htmlData{mx=21}{1} \mathbin{\htmlData{mx=28}{\land}} \htmlData{mx=24}{\sqrt{\htmlData{mx=23}{\frac{1}{4}}}} \mathrel{\htmlData{mx=27}{=}} \htmlData{mx=26}{\htmlData{mx=25}{\frac{1}{2}}}\right) \end{aligned}
What the notation means · or point at any symbol
(x : T)As real numbers
1/2 read as an element of real numbers. Mathematicians leave this implicit; Lean needs it to know which kind of number is meant. ((1 / 2 : ℝ))
·Multiplication
1/2 times 1. ((1 / 2 : ℝ) * 1)
+Addition
1/2 · 1 plus 1/2 · (1/2). ((1 / 2 : ℝ) * 1 + (1 / 2) * (1 / 2))
=Equality
1/2 · 1 + 1/2 · (1/2) and 3/4 are the same. ((1 / 2 : ℝ) * 1 + (1 / 2) * (1 / 2) = 3…)
a/bDivision
1 divided by 2. In Lean, dividing by 0 gives 0. (1 / 2)
≠Not equal
3/4 and 2/3 are different. ((3 / 4 : ℝ) ≠ 2 / 3)
√Square root
The non-negative number whose square is 1. (Real.sqrt 1)
∧And
Both hold: √(1) = 1, and √(1/4) = 1/2. (Real.sqrt 1 = (1 : ℝ) ∧ Real.sqrt (1 / …)

Machine-checked instance of the external reviewer's point (2026-10-05): the sampled index of a hashing-based estimator (random bucket, then a uniform element of it) does not follow the proposal proportional to inclusion probabilities. So 'hashing samples from r ∝ √π' is false as stated; the hashing-to-attention transfer must analyse the actual bucket estimator and its correction weights.

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

More proved statements