Proofs: Spectral Bloom filter
These are the human proofs of Spectral Bloom filter, at full length.
The error probability of a spectral Bloom filter full
This proof shows: complexity.
Model. Assume ideal hashing: the values for all and all keys are independent and uniform on . Fix the sequence of operations, so that the multiset does not depend on the hash values; neither rule reads a hash value to decide which key to update. Fix a key , let be the set of keys with , , and .
Theorem 1. Under either rule, . In particular it is at most up to the gap between the exact and the classical Bloom filter formulas, and it does not depend on the counts.
Proof. By Theorems 1 and 2 of the correctness proof, , and only if every lies in . So for both rules the error implies . The set is a function of the hash values of the keys in , which are independent of . Given , each lies in with probability , independently, so
This is exactly the probability that a Bloom filter with the same and , built from the keys of , accepts , its false positive rate. Its classical estimate is .
Theorem 2 (time and space). Each operation evaluates hash functions and reads or writes at most counters, so it takes time on the word RAM when a counter fits in a word. The array takes counters.
A spectral Bloom filter never underestimates full
This proof shows: correctness, invariant, termination.
Fix the hash functions and a sequence of operations. Write for the multiset after the first operations, for the counters of minimum selection and for the counters of minimal increase on the same sequence of inserts. Each operation loops over at most positions, so it ends.
Lemma 1 (invariant (M)). Under minimum selection, after each operation for each , provided every DELETE has before it.
Proof. At the start both sides are 0. INSERT adds to , which adds to the right side exactly for the , and line L3 adds to exactly these counters, once each, since is a set. DELETE is the same with .
Theorem 1 (minimum selection). For each , . So , with equality exactly when some lies in for no with .
Proof. By Lemma 1, for the counter is , and line L7 takes the minimum over . The sums have nonnegative terms, so the minimum is 0 exactly when one of them has no positive term.
Theorem 2 (minimal increase). If all operations are inserts and minimal increase is used, then after each insert, for each key and each ,
Hence for each .
Proof. By induction over the inserts. At the start all values are 0. Consider INSERT, and let , and be the values after it.
Lower bound. Let , the value of line L4. By the induction hypothesis . Line L5 sets for each . For , and no counter decreases, so for .
Upper bound. For nothing changes. For , line L3 gives . If , then . Otherwise , since for each .
The estimates are minima over the same set of values that satisfy the bounds pointwise, which gives the last claim.