Proofs: Stable Bloom filter
These are the human proofs of Stable Bloom filter, at full length.
The stable fraction of zero cells full
This proof shows: complexity.
Model. At each step , the set is a uniform random -subset of the cells and is a uniform random -subset, and all these sets are independent. This holds under ideal hashing for a stream of distinct elements. Assume and .
Theorem 1. For each cell ,
Proof. Fix . At each step , let be the event , a set, and the event and , a pure decrement. Then and, by the independence of and , . Steps are independent.
By the invariant (D) of the correctness proof, exactly when either no step is a set, or the last set is followed by at least Max pure decrements in the steps (a step that is both a set and a decrement counts as a set, since line L4 runs after line L3).
Look at the steps in this order, and keep only the relevant steps, those that are a set or a pure decrement. Since the steps are independent and identically distributed, each relevant step is, independently of the others, a pure decrement with probability
and a set otherwise. The cell is 0 at time if and only if the first Max relevant steps in this backward order are all pure decrements, or there are fewer than Max relevant steps and none is a set.
Let be the number of relevant steps among . Given , the first event has probability exactly and the second is impossible. So
Each step is relevant with probability , independently, so as .
Theorem 2 (time and space). PROCESS takes time, given time for each random cell and each hash value, and the array has bits.
Proof. Line L2 reads cells, line L3 chooses and updates cells, and line L4 writes cells.
The cells of a stable Bloom filter record the decay since the last set full
This proof shows: correctness, invariant, termination.
Write for the array after step , and for the set of cells chosen at line L3 of step . Each step does checks, decrements and sets, so it ends.
Lemma 1 (invariant (D)). For each and each cell , let , if it exists. Then , and if does not exist.
Proof. By induction on . At all cells are 0 by line L1, and no element has arrived. Consider step and cell . If , then , there are no later decrements, and line L4 sets , after line L3. Otherwise is unchanged. If , the count of decrements grows by 1, and line L3 lowers the cell by 1 if it is above 0, which is the change of when grows by 1; and if does not exist the cell stays 0. If , nothing changes.
Theorem 1 (what is reported). PROCESS returns true exactly when every was set at some step and had fewer than Max decrements in the steps , where is the last such step.
Proof. Line L2 reads before the decrements and sets of step . By Lemma 1, exactly when exists and fewer than Max of the steps chose .
Corollary 1. If , PROCESS returns true. More generally, if with , and no cell of was chosen Max times in the steps , then PROCESS returns true.
Proof. Each was set at step , so its last set satisfies , and it had at most as many decrements after as after . For there are no steps in between. Theorem 1 gives the claim.