These are the human proofs of E2LSH, at full length.
E2LSH answers the (c, r)-near neighbor query with constant probability full
This proof shows: correctness.
Let P⊆Rd with ∣P∣=n≥1, r>0, c>1 and w>0. A function of the family is h(v)=⌊(a⋅v+b)/w⌋ with a a vector of d independent N(0,1) entries and b uniform in [0,w), independent of a.
Lemma 1. For ∥x−y∥=u>0, Pr[h(x)=h(y)]=p(u):=E[max(0,1−u∣Z∣/w)] with Z∼N(0,1).
Proof. The random variable a⋅(x−y)=∑iai(xi−yi) is a sum of independent normal variables, so it is normal with mean 0 and variance ∑i(xi−yi)2=u2; it has the law of uZ. Fix a and let α=a⋅x, β=a⋅y, s=∣α−β∣. Then h(x)=h(y) if and only if the half-open interval between α+b and β+b (of length s) contains no multiple of w. Since b is uniform on [0,w), the set {α+b} modulo w is uniform on [0,w). If s≥w, the interval always contains a multiple of w. If s<w, it contains one exactly when (min(α,β)+b)modw lies in a set of length s, which has probability s/w. So Pr[h(x)=h(y)∣a]=max(0,1−s/w), and taking the expectation over a gives the lemma. □
Lemma 2.p is strictly decreasing on (0,∞), and with t=w/u,
p(u)=1−2Φ(−t)−2πt2(1−e−t2/2).
Proof. For each value of Z, max(0,1−u∣Z∣/w) is nonincreasing in u, and strictly decreasing when ∣Z∣<w/u, an event of positive probability. So the expectation is strictly decreasing. For the closed form, ∣Z∣ has density 2φ(z) on z≥0, with φ(z)=e−z2/2/2π, and the integrand is 0 for z≥t. So
using ∫0tzφ(z)dz=φ(0)−φ(t) and 2Φ(t)−1=1−2Φ(−t). □
So the family is (r,cr,p1,p2)-sensitive with p1=p(r)>p2=p(cr): points within r collide with probability at least p(r), and points beyond cr with probability less than p(cr).
Theorem. Let ρ=ln(1/p1)/ln(1/p2), k=⌈lnn/ln(1/p2)⌉ and L=⌈nρ/p1⌉, and fix q with some p∗∈P, ∥q−p∗∥≤r. Then E2LSH-QUERY(q,c,r) returns a point within cr with probability at least 2/3−1/e, and it never returns a point beyond cr.
Proof. Only line L6 returns a point, after the test ∥q−x∥≤cr, so no far point is returned. The kL functions are independent, so for one table Pr[gj(p∗)=gj(q)]≥p1k and Pr[gj(x)=gj(q)]≤p2k≤1/n for each x with ∥q−x∥>cr.
Event E1: p∗ collides with q in some table. Since k<lnn/ln(1/p2)+1, p1k≥p1⋅e−lnn⋅ln(1/p1)/ln(1/p2)=p1n−ρ, so Lp1k≥1 and Pr[not E1]≤(1−p1k)L≤e−Lp1k≤1/e.
Event E2: fewer than 3L pairs (j,x) with x beyond cr and gj(x)=gj(q). Their expected number is at most L⋅n⋅(1/n)=L, so by Markov's inequality Pr[not E2]≤1/3.
Both events give an answer. If the query returned none, every counted pair failed line L6, so every counted pair is far, and the count stays below 3L by E2. Then line L7 never fires, the loop visits all buckets of q, and by E1 it meets p∗, which passes line L6, a contradiction.
By the union bound, Pr[E1∩E2]≥1−1/e−1/3=2/3−1/e. ■