Event probabilities of discrete distributions #
The probability p.toOuterMeasure s of an event under a discrete distribution is finite and at
most one (toOuterMeasure_ne_top, toOuterMeasure_le_one); on a finite type its real value is the
sum of the masses of the event's members (toOuterMeasure_apply_toReal), and an event and its
complement have total probability one (toOuterMeasure_toReal_add_compl). Conditioning keeps the
event's masses and divides them by its probability (filter_apply_toReal).
After a random first stage, an event's probability is the average of its conditional
probabilities (toOuterMeasure_bind_toReal). Failure and success bounds compose without
independence: a randomized continuation fails because its precondition already failed or because
it fails from a valid input (toOuterMeasure_bind_failure_le), lower bounds on a first stage and
on its continuation from supported members multiply (toOuterMeasure_bind_ge_mul), and average
bias turns into the probability of good first stages (toOuterMeasure_rate_ge). The real-valued
masses of true and false under a Boolean distribution sum to one
(toReal_true_add_toReal_false).
Main results #
Cslib.Probability.PMF.toOuterMeasure_ne_top,Cslib.Probability.PMF.toOuterMeasure_le_one: events have probability at most one.Cslib.Probability.PMF.toOuterMeasure_abs_sub_ge_le,Cslib.Probability.PMF.toOuterMeasure_abs_sub_ge_toReal_le: two-sided tail bounds from upper and lower tails.Cslib.Probability.PMF.toOuterMeasure_apply_toReal,Cslib.Probability.PMF.toOuterMeasure_toReal_add_compl,Cslib.Probability.PMF.toOuterMeasure_toReal_pos_iff: real-valued event probabilities.Cslib.Probability.PMF.filter_apply_toReal: conditioned masses.Cslib.Probability.PMF.toOuterMeasure_bind_toReal: averaging over a first stage.Cslib.Probability.PMF.toOuterMeasure_bind_failure_le,Cslib.Probability.PMF.toOuterMeasure_bind_failure_toReal_le,Cslib.Probability.PMF.toOuterMeasure_bind_ge_mul: composing failure and success bounds.Cslib.Probability.PMF.toOuterMeasure_rate_ge: average bias as the probability of good inputs.Cslib.Probability.PMF.toReal_true_add_toReal_false,Cslib.Probability.PMF.toReal_false_eq_one_sub,Cslib.Probability.PMF.toReal_true_eq_one_sub: Boolean outcome masses.Cslib.Probability.PMF.map_true_mono,Cslib.Probability.PMF.map_true_le_add,Cslib.Probability.PMF.map_any_range_true_le_sum,Cslib.Probability.PMF.map_not_true: monotonicity, union bounds, and complementation for Boolean predicates pushed forward alongPMF.map.
References #
Adapted in part from Probability/PMF.lean on the cslib crypto branch at
5ff69ca93402e7c947208dc56396d6d86203ccd8.
Every event has finite probability, including on an infinite ambient type.
Adapted from the cslib crypto branch at 5ff69ca.
An event has probability at most one.
The event that f a deviates from m by at least ε is covered by the upper tail
m + ε ≤ f a and the lower tail f a ≤ m - ε.
In real-valued probabilities, the two-sided tail ε ≤ |f a - m| is bounded by the sum of
the upper tail m + ε ≤ f a and the lower tail f a ≤ m - ε.
An event and its complement have total probability one, in real-valued probability units.
Event probability after a finite random choice is the average conditional probability.
A randomized continuation can fail because its precondition was already false or because it fails from a valid input. No independence or finite-state assumption is needed.
The real-valued error rule for a randomized continuation.
If a first stage p lands in pre with probability at least s₁ and for every supported
a ∈ pre the continuation kernel a lands in event with probability at least s₂, then
p.bind kernel lands in event with probability at least s₁ * s₂.
If a randomized test beats a threshold on average, at least its excess probability mass consists of inputs whose conditional acceptance probability reaches that threshold.
Boolean distributions #
Union bound for List.any over List.range K pushed forward along p.map.