Skip to content

Commit 0d84e87

Browse files
feat(MeasureTheory): add MeasurableEmbedding.natCast (leanprover-community#34521)
This PR adds a lemma stating that the coercion from `ℕ` is a measurable embedding. This is useful for proving properties about discrete probability distributions on `ℕ` by lifting them to `ℝ` and will be used in leanprover-community#34435. Co-authored-by: Hanzhang Cheng <viannacheng@163.com>
1 parent 2a8445b commit 0d84e87

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Mathlib/MeasureTheory/MeasurableSpace/Embedding.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,15 @@ theorem measurable_comp_iff (hg : MeasurableEmbedding g) : Measurable (g ∘ f)
123123
rwa [(rightInverse_rangeSplitting hg.injective).comp_eq_id] at this
124124
exact hg.measurable_rangeSplitting.comp H.subtype_mk
125125

126+
lemma natCast {α : Type*} [MeasurableSpace α]
127+
[MeasurableSingletonClass α] [AddMonoidWithOne α] [CharZero α] :
128+
MeasurableEmbedding (Nat.cast : ℕ → α) where
129+
injective := Nat.cast_injective
130+
measurable := measurable_from_nat
131+
measurableSet_image' := fun _ _ =>
132+
((Set.countable_range (Nat.cast : ℕ → α)).mono
133+
(Set.image_subset_range _ _)).measurableSet
134+
126135
end MeasurableEmbedding
127136

128137
section gluing

0 commit comments

Comments
 (0)