Event Probability for Unary Computations #
This file defines the probability of events for single computations, bridging pHL judgments to actual probability bounds.
Main definitions #
prEvent d E- Probability that eventEholds under sub-distributiondprEventComp c h₀ E- Probability that eventEholds for computationcstarting from heaph₀
Main results #
prEvent_le_mass- Event probability is at most the total massprEvent_complement- Complementary event probabilities sum to 1 (when mass = 1)prEvent_union_le- Union bound: Pr[E₁ ∨ E₂] ≤ Pr[E₁] + Pr[E₂]prEvent_mono- Monotonicity of event probabilityprEvent_of_pHoare- If all outcomes satisfy E, then Pr[E] = massprEvent_zero_of_pHoare_neg- If no outcome satisfies E, then Pr[E] = 0
References #
- EasyCrypt pHL (unary probabilistic Hoare logic)
- CatCrypt.Unary.Judgment (pHL judgment definition)
Probability of an event E under a sub-distribution over (value, heap) pairs. This sums the probability of all outcomes satisfying the predicate.
Equations
- CatCrypt.Unary.prEvent d E = ∑' (p : α × CatCrypt.Core.Heap), if E p.1 p.2 then d (some p) else 0
Instances For
Probability of an event for a computation from a given initial heap
Equations
- CatCrypt.Unary.prEventComp c h₀ E = CatCrypt.Unary.prEvent (c h₀) E
Instances For
Event probability is at most the total mass. This holds because prEvent sums over a subset of outcomes (those satisfying E), while mass sums over all outcomes.
Complementary events: if mass = 1, Pr[E] + Pr[not E] = 1. Every outcome satisfies exactly one of E or not E, so their probabilities partition the total mass.
Union bound: Pr[E₁ ∨ E₂] ≤ Pr[E₁] + Pr[E₂]. Standard inclusion-exclusion upper bound.
False event has probability 0
If pHoare says all outcomes satisfy E (and computation is lossless), Pr[E] = mass. When every nonzero-probability outcome satisfies E, the filtered sum equals the unfiltered sum.
If pHoare says no outcomes satisfy E, Pr[E] = 0. Every term in the sum is 0: either E doesn't hold (if-branch gives 0) or the probability is 0 (by the pHoare hypothesis).