chore(measure_theory/function/uniform_integrable): replace `ℕ` by a type verifying enough assumptions (#12242)
This PR does not generalize the results of the `uniform_integrable` file much, but using a generic type instead of `ℕ` makes clear where we need assumptions like `encodable`.