Skip to content

refactor(Probability): define statistical distance on arbitrary types - #1065

Open
SamuelSchlesinger wants to merge 3 commits into
samschles/crypto-pr-01-pmf-real-sumsfrom
samschles/crypto-pr-03-statistical-distance-tsum
Open

SamuelSchlesinger wants to merge 3 commits into
samschles/crypto-pr-01-pmf-real-sumsfrom
samschles/crypto-pr-03-statistical-distance-tsum

Conversation

@SamuelSchlesinger

@SamuelSchlesinger SamuelSchlesinger commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Extends statistical distance and its postprocessing bounds from finite types to arbitrary PMFs using an absolutely summable infinite sum. The scoped MetricSpace (PMF α) instance and StatisticallyClose API now apply to outcomes such as List Bool. dist_eq retains the finite-sum formula, while dist_eq_tsum gives the general formula.

This also removes the finite-commitment requirement from StatisticallyHiding. The perfect hiding/binding impossibility theorem becomes a corollary of the statistical version, with a test using commitments in ℕ. Callers passing the removed finiteness instances explicitly need to drop them, and dist_eq no longer holds by rfl.

Depends on #1062.

Composed with Claude Code; reviewed and rebased with Codex.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to stack #1064 October 4, 2026 22:07
@SamuelSchlesinger
SamuelSchlesinger force-pushed the samschles/crypto-pr-03-statistical-distance-tsum branch from 6028aca to d892828 Compare October 4, 2026 23:03
@SamuelSchlesinger
SamuelSchlesinger force-pushed the samschles/crypto-pr-03-statistical-distance-tsum branch 2 times, most recently from 5342fca to 29ccc5b Compare October 5, 2026 20:01
@SamuelSchlesinger
SamuelSchlesinger removed this pull request from stack #1064 October 5, 2026 20:06
@SamuelSchlesinger
SamuelSchlesinger changed the base branch from samschles/crypto-pr-02-pmf-maps-products to samschles/crypto-pr-01-pmf-real-sums October 5, 2026 20:06
@SamuelSchlesinger
SamuelSchlesinger added this pull request to stack #1076 October 5, 2026 20:07
Defines statistical distance as `(1/2) * ∑' a, |p a - q a|` instead of a finite sum. Absolute summability follows from unit mass, so the `MetricSpace (PMF α)` instance and the `StatisticallyClose` API now apply to PMFs on any type, such as `List Bool`. On finite types, `dist_eq` still gives the finite-sum formula; the general formula is `dist_eq_tsum`.

This removes `[Fintype α]` from the metric instance, `dist_le_one`, `dist_eq_one_of_disjoint_support`, `dist_bind_le`, `dist_map_le`, and the `StatisticallyClose` lemmas, and `[Fintype Commitment]` from `StatisticallyHiding` and its theorems. Callers that pass these instances explicitly need to drop them, and `dist_eq` no longer holds by `rfl`.

The private `sum_toReal` and `bind_apply_toReal` copies in this file are replaced by the public lemmas from #1062. The perfect hiding/binding impossibility for commitments is now a corollary of the statistical version, and the test instantiates it with commitments in `ℕ`.
@SamuelSchlesinger
SamuelSchlesinger force-pushed the samschles/crypto-pr-03-statistical-distance-tsum branch from 29ccc5b to bed2b64 Compare October 5, 2026 20:56
@SamuelSchlesinger
SamuelSchlesinger removed this pull request from stack #1076 October 5, 2026 20:56
@SamuelSchlesinger
SamuelSchlesinger added this pull request to stack #1084 October 5, 2026 20:57
@SamuelSchlesinger
SamuelSchlesinger removed this pull request from stack #1084 October 5, 2026 21:02
@SamuelSchlesinger
SamuelSchlesinger added this pull request to stack #1085 October 5, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant