Skip to content

Commit

Permalink
feat: add kernel.(co)map_id (#10801)
Browse files Browse the repository at this point in the history
  • Loading branch information
RemyDegenne committed Feb 21, 2024
1 parent 7d7cd8c commit 24c9aaa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Mathlib/Probability/Kernel/Basic.lean
Expand Up @@ -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 => ⟨_⟩⟩
Expand Down
12 changes: 12 additions & 0 deletions Mathlib/Probability/Kernel/Composition.lean
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 24c9aaa

Please sign in to comment.