Proofs: Bloomier filter
These are the human proofs of Bloomier filter, at full length.
The false positive rate of a Bloomier filter full
This proof shows: complexity.
Model. Assume ideal hashing: for a key , the cells and the mask are independent of each other, uniform on their ranges, and independent of the hash values of the keys of . The arrays and are functions of the hash values of the keys of and of only.
Theorem. For each , .
Proof. Fix , and the cells of , and let , a fixed -bit value. Then . The map is a bijection on -bit values, and is uniform and independent of , so is uniform on the values. LOOKUP returns a value exactly when , which has probability for . Averaging over , and the cells keeps this value.
Space. The two arrays take bits. With the rate is at most , and with the space is bits.
Time. LOOKUP and SET compute one hash, read three cells of and one of , and take time on the word RAM with . One attempt of BUILD computes hashes, runs PEEL in steps and the assignment in steps. The number of attempts depends on the peeling threshold, which is a result of Molloy (2005) and is not proved here.
A Bloomier filter returns the stored value of each key of the set full
This proof shows: correctness, invariant, termination.
Let BUILD succeed with the peeling order , and write . The three cells are in different thirds of the table, so they are distinct. All arithmetic on is bitwise exclusive or on -bit values.
Lemma 1 (the peeling order). PEEL returns a sequence of all keys in which each key appears once, , and for each .
Proof. Let be the set of keys not yet in the order when the -th pair is appended, so and . Line L13 picks with exactly one key of having as a cell, and that key is . Each later key , , lies in and is not , so . A removed key is never chosen again, so each key appears at most once, and line L14 checks that all keys appear.
Lemma 2 (cells written). In the loop of lines L4 to L7, the iteration for writes only and . The cells are distinct, and is 0 just before the iteration for .
Proof. The first claim is lines L6 and L7. If with , then , against Lemma 1. Before the iteration for only the cells with have been written, and these differ from .
Lemma 3 (invariant (E) after BUILD). For each ,
where .
Proof. Right after the iteration for , line L6 gives , and xoring both sides with gives the first equation at that moment. Line L5 chose with . The later iterations are for , and by Lemma 2 they write only the cells . By Lemma 1, none of them is in . So the cells of in do not change again, and is written only in the iteration for , by the distinctness of Lemma 2.
Theorem. After BUILD and any sequence of SET operations on keys of , LOOKUP returns the current value for each . Each operation ends, and BUILD ends with probability 1.
Proof. By Lemma 3, line L8 computes for each , so line L9 returns , which is after BUILD. SET computes the same and writes to , the own cell of . It writes no cell of , so the equations of Lemma 3 stay true for all keys. Its write to is at the own cell of , which by Lemma 2 is not the own cell of another key, so the values of other keys do not change. LOOKUP and SET take constant time and PEEL takes steps, since each key is removed once and each cell enters the queue at most once per decrease of its count. Each attempt of line L1 uses new random hash functions; after each 10 failures the table grows by 10 percent, so after finitely many failures . A table with peels with positive probability: with positive probability the values of the keys are distinct, and then each key has a cell of its own. This probability only grows with , so each attempt from then on succeeds with at least a fixed positive probability, and BUILD ends with probability 1.