Evaluation Distributions of Computations with Bind #
File for lemmas about evalDist and support involving the monadic pure and bind.
Fallback when we don't have decidable equality.
Fallback when we don't have decidable equality.
Version of probOutput_bind_eq_tsum that sums only over the subtype given by the support
of the first computation. This can be useful to avoid looking at edge cases that can't actually
happen in practice after the first computation. A common example is if the first computation
does some error handling to avoids returning malformed outputs.
If Pr[q | my x] ≤ ε for every x in the support of mx, then the bound also
holds for the bind.
Write the probability of mx >>= my failing given that my has constant failure chance over
the possible outputs in support mx as a fixed expression without any sums.
Version of probFailure_bind_le_of_forall with that allows a manual Pr[⊥ | mx] value.
Version of probFailure_bind_le_of_forall when mx never fails.
Union bound for bind: if Pr[ ¬p | mx] ≤ ε₁ and Pr[ ¬q | my x] ≤ ε₂ for all x satisfying
p, then Pr[ ¬q | mx >>= my] ≤ ε₁ + ε₂. Useful for sequential composition of error bounds.
probEvent version of probEvent_bind_mono with additive error bound.
Swapping two independent random draws preserves probability of any event.
Swapping two independent random draws preserves the probability of any fixed output.
Union bound for finset-indexed events: the probability that some event in s holds
is at most the sum of the individual event probabilities.