Evaluation Distributions of Computations with map #
File for lemmas about evalDist and support involving the monadic map.
Note: we focus on lemmas that don't hold naively when reducing <$> to >>= using monad laws,
since map_eq_bind_pure_comp can be applied to use bind lemmas fairly easily.
Instead we focus on the cases like f <$> mx for injective f, which allow stronger statements.
More generally we can consier f with InjOn f (support mx) and get good lemmas.
TODO: many lemmas should probably have mirrored bind_pure versions.
Write the probability of an output after mapping the result of a computation as a sum over all outputs such that they map to the correct final output, using subtypes. This lemma notably doesn't require decidable equality on the final type, unlike most lemmas about probability when mapping a computation.