From 24c9aaa1324fd7dcb9235ea365368b000f0a9e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Degenne?= Date: Wed, 21 Feb 2024 14:19:40 +0000 Subject: [PATCH] feat: add `kernel.(co)map_id` (#10801) --- Mathlib/Probability/Kernel/Basic.lean | 4 ++++ Mathlib/Probability/Kernel/Composition.lean | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/Mathlib/Probability/Kernel/Basic.lean b/Mathlib/Probability/Kernel/Basic.lean index 2cb4478f5b971..32c5f7edd7705 100644 --- a/Mathlib/Probability/Kernel/Basic.lean +++ b/Mathlib/Probability/Kernel/Basic.lean @@ -608,6 +608,10 @@ theorem comapRight_apply' (κ : kernel α β) (hf : MeasurableEmbedding f) (a : Measure.comap_apply _ hf.injective (fun s => hf.measurableSet_image.mpr) _ ht] #align probability_theory.kernel.comap_right_apply' ProbabilityTheory.kernel.comapRight_apply' +@[simp] +lemma comapRight_id (κ : kernel α β) : comapRight κ MeasurableEmbedding.id = κ := by + ext _ _ hs; rw [comapRight_apply' _ _ _ hs]; simp + theorem IsMarkovKernel.comapRight (κ : kernel α β) (hf : MeasurableEmbedding f) (hκ : ∀ a, κ a (Set.range f) = 1) : IsMarkovKernel (comapRight κ hf) := by refine' ⟨fun a => ⟨_⟩⟩ diff --git a/Mathlib/Probability/Kernel/Composition.lean b/Mathlib/Probability/Kernel/Composition.lean index 03cfeed68e94b..0afa83e67c486 100644 --- a/Mathlib/Probability/Kernel/Composition.lean +++ b/Mathlib/Probability/Kernel/Composition.lean @@ -588,6 +588,12 @@ theorem map_apply' (κ : kernel α β) (hf : Measurable f) (a : α) {s : Set γ} lemma map_zero (hf : Measurable f) : kernel.map (0 : kernel α β) f hf = 0 := by ext; rw [kernel.map_apply]; simp +@[simp] +lemma map_id (κ : kernel α β) : map κ id measurable_id = κ := by ext a; rw [map_apply]; simp + +@[simp] +lemma map_id' (κ : kernel α β) : map κ (fun a ↦ a) measurable_id = κ := map_id κ + nonrec theorem lintegral_map (κ : kernel α β) (hf : Measurable f) (a : α) {g' : γ → ℝ≥0∞} (hg : Measurable g') : ∫⁻ b, g' b ∂map κ f hf a = ∫⁻ a, g' (f a) ∂κ a := by rw [map_apply _ hf, lintegral_map hg hf] @@ -646,6 +652,12 @@ theorem comap_apply' (κ : kernel α β) (hg : Measurable g) (c : γ) (s : Set lemma comap_zero (hg : Measurable g) : kernel.comap (0 : kernel α β) g hg = 0 := by ext; rw [kernel.comap_apply]; simp +@[simp] +lemma comap_id (κ : kernel α β) : comap κ id measurable_id = κ := by ext a; rw [comap_apply]; simp + +@[simp] +lemma comap_id' (κ : kernel α β) : comap κ (fun a ↦ a) measurable_id = κ := comap_id κ + theorem lintegral_comap (κ : kernel α β) (hg : Measurable g) (c : γ) (g' : β → ℝ≥0∞) : ∫⁻ b, g' b ∂comap κ g hg c = ∫⁻ b, g' b ∂κ (g c) := rfl