Proofs: Binary fuse filter
These are the human proofs of Binary fuse filter, at full length.
The false positive rate and the cost of a binary fuse filter full
This proof shows: complexity.
Model. Assume ideal hashing: in each try, the start segment, the three offsets and the fingerprint of every key are independent and uniform, and different tries use independent functions.
Theorem 1. For each key , .
Proof. Whether a try succeeds depends only on the cells of the keys of in that try, so the final try is independent of the values of the functions at . Given and all values on , the table is fixed, and the cells and the fingerprint of in try are still independent and uniform. So is independent of , and .
Theorem 2 (time and space). QUERY takes time. Each try of BUILD takes time, which is for the size rule, and the table has bits.
Proof. A query computes one set of hash values and reads three cells. In PEEL, each cell enters the queue at most once at line L8 and once for each key that leaves it, so the queue handles at most entries, each in constant time; lines L4 and L5 take steps. For the size rule, , and is , while capacity is since the factor is at most . So the table has cells. The expected number of tries is , and the expected build time is whenever is bounded below by a constant, as the experiments of Graf and Lemire and the threshold results of Dietzfelbinger and Walzer indicate for this size factor.
A binary fuse filter accepts every key of its set full
This proof shows: correctness, invariant, termination.
Let be a set of distinct keys and write . Since lies in segment , the three cells are distinct, and they lie in because .
Lemma 1 (peeling order). If PEEL succeeds, the order lists each key once, and for each , and for each .
Proof. Lines L7 and L10 keep, for each cell, the count and the xor of the indices of the keys that are not yet in the order and use it. When line L9 takes a cell with count 1, the xor is the index of the only such key, and the keys appended later were not yet in the order at that time, so they do not use the cell.
Lemma 2. In the loop of lines L4 and L5, cell is written only at step , and after step no cell of is written.
Proof. Step writes only . For , , so . The steps after step are those with , and by Lemma 1, since .
Theorem 1 (invariant (X)). After BUILD, for each , so QUERY returns true on .
Proof. For with other cells , line L5 makes , and by Lemma 2 none of the three cells changes later.
Lemma 3 (room). If and follow the size rule, then .
Proof. The rule gives , where is the size factor. If , then , so and , since for . If , then and , so .
Theorem 2 (termination). Under ideal hashing, with independent hash functions in each try, and (true by Lemma 3 for the size rule and , and trivial for , where at most one key has three cells of count 1), BUILD ends with probability 1, after a geometric number of tries.
Proof. Each try succeeds with the same probability , independently, so it suffices to show . Reserve cell of each segment as a spare. The other cells can be given to the keys as distinct private cells. For a key with private cell in segment , choose its start segment ; then , because . Let its cell in segment be and its cells in the other two segments of its window be their spares. Every private cell then has count 1, so every key is peeled from its private cell. This choice of the hash values has positive probability, so . Each try has steps, as for the xor filter.