You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library holds the finitely supported laws on which the random systems are built:
distributions and probability distributions, kernels, the statistical distance, couplings and the
$n$-ary maximal coupling, expectation, and the counting behind collision bounds. Citations refer
to the numbered references at the end; [1]–[3] are those of
THEORY.md.
A distribution is a finitely supported function to $\mathbb R$, and a
probability distribution one that is nonnegative with weight one.
Distributions have masses of events, pushforwards, products of two
laws and of families, and uniform laws. The
heterogeneous finite product assigns the product mass to a dependent family of
coordinate outcomes. The alphabets may be infinite; only the index set and each support are
finite. ProbDist.pi and ProbDist.piDep
construct normalized independent families directly, carrying the coordinate normalization
proofs into the product.
ProbDist.map_piDep_comp selects distinct coordinates of a dependent product, preserving each
coordinate's outcome type and law; ProbDist.map_piDep_comp_comp
factors a tuple selection through an injective map, and
ProbDist.map_piDep_comp_eq_of_eq_iff equates tuple laws
of independent tables with one entry law whenever the same indices coincide.
For example, ProbDist.pi (fun _ : Fin q => ν) is the law of q independent samples from ν.
A kernel$f$ is a conditional distribution [3, §3.6.1]; mixed over a law $\mu$
it gives $\sum_a \mu(a)\, f(a)$:
mixtures compose, a pushforward
is the point kernel of its function, and an independent product
disintegrates at a coordinate. Probability laws have
pushforwards and sequential compositions; a
constant probability kernel returns its law.
Successive maps compose, and independent maps satisfy
$(f_*P) \times (g_*Q) = (f \times g)_*(P \times Q)$.
The identity map leaves a law unchanged, so $g=\mathrm{id}$ or
$f=\mathrm{id}$ gives the left and
right one-coordinate forms.
Independent uniform coordinates form a uniform pair.
A joint law retains both successive draws:
$J_{\mu,K}(h,z)=\mu(h)K(h,z)$, with first marginal$\mu$. For
arbitrary maps $d_H, d_Z$ with $(d_H)_*\mu'=\mu$ and $(d_Z)_*K'(h)=K(d_H h)$,
ProbDist.jointLaw_map gives
$(d_H\times d_Z)_*J_{\mu',K'}=J_{\mu,K}$. The outcome types are arbitrary; each law has finite
support. For a nonnegative mass function $X$, normalizeOr is
$\lvert X\rvert^{-1}X$ at nonzero weight and an explicit fallback law at weight zero. Its
identity $\lvert X\rvert\,\operatorname{normalizeOr}(X)=X$ also holds at zero weight, where
the fallback is multiplied by zero.
Conditioning on an observation then disintegrates a law into its
normalized fibers. ProbDist.uniformOn E fallback names the normalized uniform restriction
to E, using the explicit fallback at an empty event. Symmetries preserving a conditioning event preserve its restricted uniform
law; equal masses on that event identify the normalized uniform restriction.
The notation 𝒰[A] denotes the normalized uniform law of type
Distribution.ProbDist A, with mass $1/\lvert A \rvert$ at each point of a finite nonempty
$A$; its underlying raw distribution 𝒰[A].1 is Distribution.uniform A.
For a finite group $G$ with $\gcd(|G|,e)=1$, blinding sends a uniform
$r$ to a uniform $yr^e$. ProbDist.bind_uniform_mul_pow transports any output kernel
through this map. ProbDist.blindRootSolver unblinds the returned root with the same multiplier;
ProbDist.rootSuccessLaw observes success, rejecting failure. For commutative groups,
ProbDist.blinding_success_eq equates this success law at a fixed challenge with the original
solver's uniform-challenge success law.
statDist_fTransform_le_expect_of_ratio combines
data processing [1, Lemma 3] with the expectation method [4, Lemma 2.2.1] after any common
function $f$:
$$(1-\varepsilon(a))Q(a)\le P(a)\ \text{for all } a,\quad \varepsilon\ge0
\quad\Longrightarrow\quad
\delta(f_*P,f_*Q)\le\delta(P,Q)\le\mathbb E_Q[\varepsilon].$$
Here $P,Q$ have equal total weight, $Q$ is nonnegative and $P$ may be signed; the
nonnegative loss $\varepsilon$ may exceed one. Systems specialize $P,Q$ to probability laws
and $f$ to a transcript projection, then take a supremum over environments.
Couplings, expectation and counting
For a coupling of $X$ and $Y$,
the distance is at most the off-diagonal mass,
$\delta(X, Y) \le \Pr[X \ne Y]$, and some coupling attains it.
For the $n$-ary maximal coupling [2, Theorem 2.29], the largest agreement of $n$
laws of one weight is the weight of their overlap.
Expectation is linear in the distribution and
in the function, with Markov's,
the Cauchy–Schwarz and Jensen's
inequalities. Collision bounds count the functions $X \to Y$
agreeing with a map on a finite set $S$: there are $\lvert Y \rvert^{\lvert X \rvert - \lvert S \rvert}$.
For a uniform function table, a consistent query transcript
fixes one independent value per distinct input; repeated inputs add no factor. Two query
families with the same equality pattern have the
same output law, even when their table domains have different sizes. The index type may be
infinite; the finite table domains keep both query images finite.
A batch $\mathrm{next}(b) : I \to X$ may also be chosen from the revealed base values
$b = F \circ \mathrm{base}$. If base and selected coordinates are jointly injective whenever
$\mathrm{good}(b)$ holds, then the joint mass is
$$\Pr\big[\mathrm{good}(b) \wedge F \circ \mathrm{next}(b) = v\big]
= \Pr\big[\mathrm{good}(b)\big] \cdot \lvert Y \rvert^{-\lvert I \rvert} .$$
Outside the good event, coordinates may repeat, and the good event may have probability zero.
An event that ignores one table coordinate [factors from its fresh value]
uniform_mass_fresh_eval_eq. A symmetric pair union bound
counts each unordered pair once; uniform-table collisions
therefore cost at most $\binom{|S|}{2}/|Y|$ on a fixed queried set $S$.
A uniform-preserving projection of a fresh full reply
remains uniform after a transcript event that ignores its coordinate. The
projected collision bound keeps the full
reply table and charges only the visible output alphabet. The
distinct-input form charges d / |Y| after d
distinct tested inputs, and zero for a repeat on a collision-free history.
Disjoint finite table restrictions factor for arbitrary
events on their respective output tuples. The [base-set form]
uniform_mass_fresh_outputs_eq applies when an event depends only on a named finite set
of coordinates and the other outputs lie outside it.
For an adaptive evaluator whose complete output tuple pins its queried sites,
uniform_mass_replay_public_eq counts the joint replay/public table fiber.
uniform_replay_public_good_factor factors an event over the good output
tuples from fixed public values. Both retain the explicit pinned-fiber equivalence and
injectivity of all replay and public sites; neither asserts independence on bad runs.
For list-structured transcripts, Probability.List translates list splits into
bounded position quantifiers (List.exists_eq_append_cons_iff,
List.forall_prefix_concat_iff_forall_take), lifts splits through filterMap and filter
(List.exists_split_of_filterMap_eq, List.exists_split_of_filter_eq), and checks predicates
against a running foldl state (List.ForallScan, List.ForallScan.append,
List.ForallScan.of_append_cons).
References
D. Lanzenberger and U. Maurer. Coupling of Random Systems. In Theory of Cryptography
(TCC 2020), Springer, 2020. Cryptology ePrint Archive, Paper 2020/1187.
D. Lanzenberger. A Theory of Random Systems, Games, and Hardness Amplification. Doctoral
thesis, ETH Zurich.
U. Maurer. Cryptography Foundations. Lecture notes, ETH Zurich, Spring 2018.