Evaluation Distributions of Computations with Bind #
File for lemmas about evalDist and support involving the monadic pure and bind.
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.
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.
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.