Verification of the CVM Algorithm with a Functional Probabilistic Invariant

Page view(s)
0
Checked on
Verification of the CVM Algorithm with a Functional Probabilistic Invariant
Title:
Verification of the CVM Algorithm with a Functional Probabilistic Invariant
Journal Title:
International Conference on Interactive Theorem Proving (ITP)
Publication Date:
22 September 2025
Citation:
Emin Karayel, Seng Joe Watt, Derek Khu, Kuldeep S. Meel, and Yong Kiam Tan. Verification of the CVM Algorithm with a Functional Probabilistic Invariant. In 16th International Conference on Interactive Theorem Proving (ITP 2025). Leibniz International Proceedings in Informatics (LIPIcs), Volume 352, pp. 34:1-34:20, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2025) https://doi.org/10.4230/LIPIcs.ITP.2025.34
Abstract:
Estimating the number of distinct elements in a data stream is a classic problem with numerous applications in computer science. We formalize a recent, remarkably simple, randomized algorithm for this problem due to Chakraborty, Vinodchandran, and Meel (called the CVM algorithm). Their algorithm deviated considerably from the state of the art, due to its avoidance of intricate derandomization techniques, while still maintaining a close-to-optimal logarithmic space complexity. Central to our formalization is a new proof technique based on functional probabilistic invariants, which allows us to derive concentration bounds using the Cramér-Chernoff method without relying on independence. This simplifies the formal analysis considerably compared to the original proof by Chakraborty et al. Moreover, our technique opens up the possible algorithm design space; we demonstrate this by introducing and verifying a new variant of the CVM algorithm that is both total and unbiased - neither of which is a property of the original algorithm. In this paper, we introduce the proof technique, describe its use in mechanizing both versions of the CVM algorithm in Isabelle/HOL, and present a supporting formalized library on negatively associated random variables used to verify the latter variant.
License type:
Attribution 4.0 International (CC BY 4.0)
Funding Info:
This research / project is supported by the National Research Foundation - Singapore NRF Fellowship Programme
Grant Reference no. : NRF-NRFF16-2024-0002

This research / project is supported by the Natural Sciences and Engineering Research Council of Canada (NSERC) - NA
Grant Reference no. : Funding reference [RGPIN-2024-05956]
Description:
ISBN:
10.4230/LIPIcs.ITP.2025.34