Proofs: Learned Bloom filter
These are the human proofs of Learned Bloom filter, at full length.
A learned Bloom filter has no false negatives full
This proof shows: correctness, invariant, termination.
Fix the classifier , the threshold and the set . BUILD and QUERY consist of a finite number of classifier evaluations and Bloom filter steps, so they end. Let . We use one fact about a Bloom filter: it accepts every key it holds, and under ideal hashing it accepts each fixed key that it does not hold with a probability, its per-key rate, that is the same for all such keys.
Theorem 1 (no false negatives). QUERY returns true for each .
Proof. If there is an initial filter, it holds by line L1, so it accepts and line L4 does not return false. If , line L5 returns true. Otherwise by line L2, the backup filter holds by line L3, and line L6 returns true.
Model. Let be a distribution on . Assume ideal and independent hash functions for and , chosen independently of , , and . Let be the per-key rate of (with if there is no initial filter), that of , and .
Theorem 2 (rate on the query distribution). For , independent of the hash functions,
Proof. Fix . Then , since . Let be the event that accepts (always true without an initial filter) and the event that accepts . By lines L4 to L6,
The value is fixed. depends only on the hash functions of and only on those of , which are independent, with and because is held by neither filter. So
Averaging over , which is independent of the hash functions, replaces by and by .
Remark (no per-key bound). For a fixed with , the proof gives , which is 1 without an initial filter. So the filter has no per-key rate better than , and the bound of Theorem 2 holds only on average over .