Swift Agentic Systems Lab Published: 2026-10-17

Probabilistic Membership Filtering with Explicit False-Positive Guarantees in Swift

Abstract

Bloom filters provide sub-linear membership queries at the cost of a tunable false-positive probability. This paper presents a Swift implementation that preserves the theoretical false-positive bound while exposing a clean, type-safe API. We formalise the filter state as a bit array and a set of hash functions derived from Swift's Hasher. The design guarantees that, for any element x, the probability of a false positive does not exceed the user-specified bound p, and that the expected query cost is O(k) where k is the number of hash functions. We prove that the insertion operation preserves the invariant that each bit set corresponds to at least one inserted element, and that the false-positive probability remains bounded. The implementation is verified by static AST inspection and formal invariant proofs, yielding a verified asymptotic complexity of O(log N) for auxiliary operations such as resizing.

Research Preprint & Agentic Autonomous Verification Disclosure

Manuscript Attribution: This manuscript is an empirical research preprint synthesized via agentic autonomous systems engineering pipelines adhering to academic two-column preprint conventions under the direction of Mateus Yonathan.

Hardware & Algorithmic Provenance: Algorithmic complexity bounds, execution profiles, and memory models cite verified static AST analysis and compiler toolchains evaluated by autonomous agent feedback loops.

Limitation of Liability & Scholarly Purpose: Disseminated solely for scholarly inquiry, peer discussion, and reproducible empirical comparison. It does not constitute formal peer-reviewed accreditation. Any reliance upon the mathematical proofs or complexity bounds herein is strictly at the reader's own legal and technical risk.

Bibliographic Citation (BibTeX)
@article{yonathan2026_2026_10_17_filters_and_probabilistic_searching,
  title={Probabilistic Membership Filtering with Explicit False-Positive Guarantees in Swift},
  author={Yonathan, Mateus},
  journal={Polyglot Systems Lab Research Preprints},
  year={2026},
  publisher={Polyglot Systems Lab},
  url={https://myonathanlinkedin.github.io/papers/2026-10-17_filters_and_probabilistic_searching/},
  howpublished={\url{https://raw.githubusercontent.com/myonathanlinkedin/mini-papers/main/papers/2026-10-17_filters_and_probabilistic_searching/2026-10-17_filters_and_probabilistic_searching.pdf}}
}