probability.kernel.composition
⟷
Mathlib.Probability.Kernel.Composition
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -297,7 +297,7 @@ theorem ae_kernel_lt_top (a : α) (h2s : (κ ⊗ₖ η) a s ≠ ∞) :
have h2t : (κ ⊗ₖ η) a t ≠ ∞ := by rwa [measure_to_measurable]
have ht_lt_top : ∀ᵐ b ∂κ a, η (a, b) (Prod.mk b ⁻¹' t) < ∞ :=
by
- rw [kernel.comp_prod_apply _ _ _ ht] at h2t
+ rw [kernel.comp_prod_apply _ _ _ ht] at h2t
exact ae_lt_top (kernel.measurable_kernel_prod_mk_left' ht a) h2t
filter_upwards [ht_lt_top] with b hb
exact (this b).trans_lt hb
@@ -319,7 +319,7 @@ theorem ae_null_of_compProd_null (h : (κ ⊗ₖ η) a s = 0) :
(fun b => η (a, b) (Prod.mk b ⁻¹' s)) =ᵐ[κ a] 0 :=
by
obtain ⟨t, hst, mt, ht⟩ := exists_measurable_superset_of_null h
- simp_rw [comp_prod_null a mt] at ht
+ simp_rw [comp_prod_null a mt] at ht
rw [Filter.eventuallyLE_antisymm_iff]
exact
⟨Filter.EventuallyLE.trans_eq
@@ -397,7 +397,7 @@ theorem lintegral_compProd' (κ : kernel α β) [IsSFiniteKernel κ] (η : kerne
let F : ℕ → simple_func (β × γ) ℝ≥0∞ := simple_func.eapprox (Function.uncurry f)
have h : ∀ a, (⨆ n, F n a) = Function.uncurry f a :=
simple_func.supr_eapprox_apply (Function.uncurry f) hf
- simp only [Prod.forall, Function.uncurry_apply_pair] at h
+ simp only [Prod.forall, Function.uncurry_apply_pair] at h
simp_rw [← h, Prod.mk.eta]
have h_mono : Monotone F := fun i j hij b =>
simple_func.monotone_eapprox (Function.uncurry f) hij _
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -357,6 +357,11 @@ theorem compProd_restrict {s : Set β} {t : Set γ} (hs : MeasurableSet s) (ht :
by
intro b
classical
+ rw [Set.indicator_apply]
+ split_ifs with h
+ · simp only [h, true_and_iff]
+ rfl
+ · simp only [h, false_and_iff, and_false_iff, Set.setOf_false, measure_empty]
simp_rw [this]
rw [lintegral_indicator _ hs]
#align probability_theory.kernel.comp_prod_restrict ProbabilityTheory.kernel.compProd_restrict
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -357,11 +357,6 @@ theorem compProd_restrict {s : Set β} {t : Set γ} (hs : MeasurableSet s) (ht :
by
intro b
classical
- rw [Set.indicator_apply]
- split_ifs with h
- · simp only [h, true_and_iff]
- rfl
- · simp only [h, false_and_iff, and_false_iff, Set.setOf_false, measure_empty]
simp_rw [this]
rw [lintegral_indicator _ hs]
#align probability_theory.kernel.comp_prod_restrict ProbabilityTheory.kernel.compProd_restrict
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -1091,13 +1091,13 @@ noncomputable def prod (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α
scoped[ProbabilityTheory] infixl:100 " ×ₖ " => ProbabilityTheory.kernel.prod
-#print ProbabilityTheory.kernel.prod_apply /-
-theorem prod_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsSFiniteKernel η] (a : α)
- {s : Set (β × γ)} (hs : MeasurableSet s) :
+#print ProbabilityTheory.kernel.prod_apply' /-
+theorem prod_apply' (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsSFiniteKernel η]
+ (a : α) {s : Set (β × γ)} (hs : MeasurableSet s) :
(κ ×ₖ η) a s = ∫⁻ b : β, (η a) {c : γ | (b, c) ∈ s} ∂κ a := by
simp_rw [Prod, comp_prod_apply _ _ _ hs, swap_left_apply _ _, prod_mk_left_apply,
Prod.swap_prod_mk]
-#align probability_theory.kernel.prod_apply ProbabilityTheory.kernel.prod_apply
+#align probability_theory.kernel.prod_apply ProbabilityTheory.kernel.prod_apply'
-/
#print ProbabilityTheory.kernel.lintegral_prod /-
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,7 +3,7 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
-import Mathbin.Probability.Kernel.MeasurableIntegral
+import Probability.Kernel.MeasurableIntegral
#align_import probability.kernel.composition from "leanprover-community/mathlib"@"2a0ce625dbb0ffbc7d1316597de0b25c1ec75303"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,14 +2,11 @@
Copyright (c) 2023 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-
-! This file was ported from Lean 3 source module probability.kernel.composition
-! leanprover-community/mathlib commit 2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Probability.Kernel.MeasurableIntegral
+#align_import probability.kernel.composition from "leanprover-community/mathlib"@"2a0ce625dbb0ffbc7d1316597de0b25c1ec75303"
+
/-!
# Product and composition of kernels
mathlib commit https://github.com/leanprover-community/mathlib/commit/2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
@@ -348,7 +348,7 @@ variable {κ : kernel α β} [IsSFiniteKernel κ] {η : kernel (α × β) γ} [I
theorem compProd_restrict {s : Set β} {t : Set γ} (hs : MeasurableSet s) (ht : MeasurableSet t) :
kernel.restrict κ hs ⊗ₖ kernel.restrict η ht = kernel.restrict (κ ⊗ₖ η) (hs.Prod ht) :=
by
- ext (a u hu) : 2
+ ext a u hu : 2
rw [comp_prod_apply _ _ _ hu, restrict_apply' _ _ _ hu,
comp_prod_apply _ _ _ (hu.inter (hs.prod ht))]
simp only [kernel.restrict_apply, measure.restrict_apply' ht, Set.mem_inter_iff,
@@ -532,7 +532,7 @@ theorem compProd_eq_tsum_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η :
#print ProbabilityTheory.kernel.compProd_eq_sum_compProd /-
theorem compProd_eq_sum_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] : κ ⊗ₖ η = kernel.sum fun n => kernel.sum fun m => seq κ n ⊗ₖ seq η m := by
- ext (a s hs) : 2; simp_rw [kernel.sum_apply' _ a hs]; rw [comp_prod_eq_tsum_comp_prod κ η a hs]
+ ext a s hs : 2; simp_rw [kernel.sum_apply' _ a hs]; rw [comp_prod_eq_tsum_comp_prod κ η a hs]
#align probability_theory.kernel.comp_prod_eq_sum_comp_prod ProbabilityTheory.kernel.compProd_eq_sum_compProd
-/
@@ -647,7 +647,7 @@ theorem lintegral_map (κ : kernel α β) (hf : Measurable f) (a : α) {g' : γ
theorem sum_map_seq (κ : kernel α β) [IsSFiniteKernel κ] (hf : Measurable f) :
(kernel.sum fun n => map (seq κ n) f hf) = map κ f hf :=
by
- ext (a s hs) : 2
+ ext a s hs : 2
rw [kernel.sum_apply, map_apply' κ hf a hs, measure.sum_apply _ hs, ← measure_sum_seq κ,
measure.sum_apply _ (hf hs)]
simp_rw [map_apply' _ hf _ hs]
@@ -714,7 +714,7 @@ theorem lintegral_comap (κ : kernel α β) (hg : Measurable g) (c : γ) (g' :
theorem sum_comap_seq (κ : kernel α β) [IsSFiniteKernel κ] (hg : Measurable g) :
(kernel.sum fun n => comap (seq κ n) g hg) = comap κ g hg :=
by
- ext (a s hs) : 2
+ ext a s hs : 2
rw [kernel.sum_apply, comap_apply' κ hg a s, measure.sum_apply _ hs, ← measure_sum_seq κ,
measure.sum_apply _ hs]
simp_rw [comap_apply' _ hg _ s]
@@ -1013,7 +1013,7 @@ theorem comp_apply' (η : kernel β γ) (κ : kernel α β) (a : α) {s : Set γ
theorem comp_eq_snd_compProd (η : kernel β γ) [IsSFiniteKernel η] (κ : kernel α β)
[IsSFiniteKernel κ] : η ∘ₖ κ = snd (κ ⊗ₖ prodMkLeft α η) :=
by
- ext (a s hs) : 2
+ ext a s hs : 2
rw [comp_apply' _ _ _ hs, snd_apply' _ _ hs, comp_prod_apply]
swap; · exact measurable_snd hs
simp only [Set.mem_setOf_eq, Set.setOf_mem_eq, prod_mk_left_apply' _ _ s]
@@ -1059,7 +1059,7 @@ theorem comp_assoc {δ : Type _} {mδ : MeasurableSpace δ} (ξ : kernel γ δ)
theorem deterministic_comp_eq_map (hf : Measurable f) (κ : kernel α β) :
deterministic f hf ∘ₖ κ = map κ f hf :=
by
- ext (a s hs) : 2
+ ext a s hs : 2
simp_rw [map_apply' _ _ _ hs, comp_apply' _ _ _ hs, deterministic_apply' hf _ hs,
lintegral_indicator_const_comp hf hs, one_mul]
#align probability_theory.kernel.deterministic_comp_eq_map ProbabilityTheory.kernel.deterministic_comp_eq_map
@@ -1069,7 +1069,7 @@ theorem deterministic_comp_eq_map (hf : Measurable f) (κ : kernel α β) :
theorem comp_deterministic_eq_comap (κ : kernel α β) (hg : Measurable g) :
κ ∘ₖ deterministic g hg = comap κ g hg :=
by
- ext (a s hs) : 2
+ ext a s hs : 2
simp_rw [comap_apply' _ _ _ s, comp_apply' _ _ _ hs, deterministic_apply hg a,
lintegral_dirac' _ (kernel.measurable_coe κ hs)]
#align probability_theory.kernel.comp_deterministic_eq_comap ProbabilityTheory.kernel.comp_deterministic_eq_comap
mathlib commit https://github.com/leanprover-community/mathlib/commit/2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
@@ -87,6 +87,7 @@ We define a kernel composition-product
variable {γ : Type _} {mγ : MeasurableSpace γ} {s : Set (β × γ)}
+#print ProbabilityTheory.kernel.compProdFun /-
/-- Auxiliary function for the definition of the composition-product of two kernels.
For all `a : α`, `comp_prod_fun κ η a` is a countably additive function with value zero on the empty
set, and the composition-product of kernels is defined in `kernel.comp_prod` through
@@ -95,13 +96,17 @@ noncomputable def compProdFun (κ : kernel α β) (η : kernel (α × β) γ) (a
ℝ≥0∞ :=
∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a
#align probability_theory.kernel.comp_prod_fun ProbabilityTheory.kernel.compProdFun
+-/
+#print ProbabilityTheory.kernel.compProdFun_empty /-
theorem compProdFun_empty (κ : kernel α β) (η : kernel (α × β) γ) (a : α) :
compProdFun κ η a ∅ = 0 := by
simp only [comp_prod_fun, Set.mem_empty_iff_false, Set.setOf_false, measure_empty,
MeasureTheory.lintegral_const, MulZeroClass.zero_mul]
#align probability_theory.kernel.comp_prod_fun_empty ProbabilityTheory.kernel.compProdFun_empty
+-/
+#print ProbabilityTheory.kernel.compProdFun_iUnion /-
theorem compProdFun_iUnion (κ : kernel α β) (η : kernel (α × β) γ) [IsSFiniteKernel η] (a : α)
(f : ℕ → Set (β × γ)) (hf_meas : ∀ i, MeasurableSet (f i))
(hf_disj : Pairwise (Disjoint on f)) :
@@ -135,7 +140,9 @@ theorem compProdFun_iUnion (κ : kernel α β) (η : kernel (α × β) γ) [IsSF
measurable_fst.snd.prod_mk measurable_snd (hf_meas i)
exact ((measurable_kernel_prod_mk_left hm).comp measurable_prod_mk_left).AEMeasurable
#align probability_theory.kernel.comp_prod_fun_Union ProbabilityTheory.kernel.compProdFun_iUnion
+-/
+#print ProbabilityTheory.kernel.compProdFun_tsum_right /-
theorem compProdFun_tsum_right (κ : kernel α β) (η : kernel (α × β) γ) [IsSFiniteKernel η] (a : α)
(hs : MeasurableSet s) : compProdFun κ η a s = ∑' n, compProdFun κ (seq η n) a s :=
by
@@ -153,19 +160,25 @@ theorem compProdFun_tsum_right (κ : kernel α β) (η : kernel (α × β) γ) [
((measurable_kernel_prod_mk_left ((measurable_fst.snd.prod_mk measurable_snd) hs)).comp
measurable_prod_mk_left).AEMeasurable
#align probability_theory.kernel.comp_prod_fun_tsum_right ProbabilityTheory.kernel.compProdFun_tsum_right
+-/
+#print ProbabilityTheory.kernel.compProdFun_tsum_left /-
theorem compProdFun_tsum_left (κ : kernel α β) (η : kernel (α × β) γ) [IsSFiniteKernel κ] (a : α)
(s : Set (β × γ)) : compProdFun κ η a s = ∑' n, compProdFun (seq κ n) η a s := by
simp_rw [comp_prod_fun, (measure_sum_seq κ _).symm, lintegral_sum_measure]
#align probability_theory.kernel.comp_prod_fun_tsum_left ProbabilityTheory.kernel.compProdFun_tsum_left
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (n m) -/
+#print ProbabilityTheory.kernel.compProdFun_eq_tsum /-
theorem compProdFun_eq_tsum (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
compProdFun κ η a s = ∑' (n) (m), compProdFun (seq κ n) (seq η m) a s := by
simp_rw [comp_prod_fun_tsum_left κ η a s, comp_prod_fun_tsum_right _ η a hs]
#align probability_theory.kernel.comp_prod_fun_eq_tsum ProbabilityTheory.kernel.compProdFun_eq_tsum
+-/
+#print ProbabilityTheory.kernel.measurable_compProdFun_of_finite /-
/-- Auxiliary lemma for `measurable_comp_prod_fun`. -/
theorem measurable_compProdFun_of_finite (κ : kernel α β) [IsFiniteKernel κ] (η : kernel (α × β) γ)
[IsFiniteKernel η] (hs : MeasurableSet s) : Measurable fun a => compProdFun κ η a s :=
@@ -184,7 +197,9 @@ theorem measurable_compProdFun_of_finite (κ : kernel α β) [IsFiniteKernel κ]
exact measurable_kernel_prod_mk_left (measurable_fst.snd.prod_mk measurable_snd hs)
exact h_meas.lintegral_kernel_prod_right
#align probability_theory.kernel.measurable_comp_prod_fun_of_finite ProbabilityTheory.kernel.measurable_compProdFun_of_finite
+-/
+#print ProbabilityTheory.kernel.measurable_compProdFun /-
theorem measurable_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (hs : MeasurableSet s) : Measurable fun a => compProdFun κ η a s :=
by
@@ -204,7 +219,9 @@ theorem measurable_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : ke
exact measurable_kernel_prod_mk_left (measurable_fst.snd.prod_mk measurable_snd hs)
exact h_meas.lintegral_kernel_prod_right
#align probability_theory.kernel.measurable_comp_prod_fun ProbabilityTheory.kernel.measurable_compProdFun
+-/
+#print ProbabilityTheory.kernel.compProd /-
/-- Composition-Product of kernels. It verifies
`∫⁻ bc, f bc ∂(comp_prod κ η a) = ∫⁻ b, ∫⁻ c, f (b, c) ∂(η (a, b)) ∂(κ a)`
(see `lintegral_comp_prod`). -/
@@ -225,9 +242,11 @@ noncomputable def compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel
rw [this]
exact measurable_comp_prod_fun κ η hs
#align probability_theory.kernel.comp_prod ProbabilityTheory.kernel.compProd
+-/
scoped[ProbabilityTheory] infixl:100 " ⊗ₖ " => ProbabilityTheory.kernel.compProd
+#print ProbabilityTheory.kernel.compProd_apply_eq_compProdFun /-
theorem compProd_apply_eq_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) : (κ ⊗ₖ η) a s = compProdFun κ η a s :=
by
@@ -239,13 +258,17 @@ theorem compProd_apply_eq_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (
rw [measure.of_measurable_apply _ hs]
rfl
#align probability_theory.kernel.comp_prod_apply_eq_comp_prod_fun ProbabilityTheory.kernel.compProd_apply_eq_compProdFun
+-/
+#print ProbabilityTheory.kernel.compProd_apply /-
theorem compProd_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
(κ ⊗ₖ η) a s = ∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a :=
compProd_apply_eq_compProdFun κ η a hs
#align probability_theory.kernel.comp_prod_apply ProbabilityTheory.kernel.compProd_apply
+-/
+#print ProbabilityTheory.kernel.le_compProd_apply /-
theorem le_compProd_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) (s : Set (β × γ)) :
∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a ≤ (κ ⊗ₖ η) a s :=
@@ -257,6 +280,7 @@ theorem le_compProd_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel
(kernel.compProd_apply_eq_compProdFun κ η a (measurableSet_toMeasurable _ _)).symm
_ = (κ ⊗ₖ η) a s := measure_toMeasurable s
#align probability_theory.kernel.le_comp_prod_apply ProbabilityTheory.kernel.le_compProd_apply
+-/
section Ae
@@ -265,6 +289,7 @@ section Ae
variable {κ : kernel α β} [IsSFiniteKernel κ] {η : kernel (α × β) γ} [IsSFiniteKernel η] {a : α}
+#print ProbabilityTheory.kernel.ae_kernel_lt_top /-
theorem ae_kernel_lt_top (a : α) (h2s : (κ ⊗ₖ η) a s ≠ ∞) :
∀ᵐ b ∂κ a, η (a, b) (Prod.mk b ⁻¹' s) < ∞ :=
by
@@ -280,7 +305,9 @@ theorem ae_kernel_lt_top (a : α) (h2s : (κ ⊗ₖ η) a s ≠ ∞) :
filter_upwards [ht_lt_top] with b hb
exact (this b).trans_lt hb
#align probability_theory.kernel.ae_kernel_lt_top ProbabilityTheory.kernel.ae_kernel_lt_top
+-/
+#print ProbabilityTheory.kernel.compProd_null /-
theorem compProd_null (a : α) (hs : MeasurableSet s) :
(κ ⊗ₖ η) a s = 0 ↔ (fun b => η (a, b) (Prod.mk b ⁻¹' s)) =ᵐ[κ a] 0 :=
by
@@ -288,7 +315,9 @@ theorem compProd_null (a : α) (hs : MeasurableSet s) :
· rfl
· exact kernel.measurable_kernel_prod_mk_left' hs a
#align probability_theory.kernel.comp_prod_null ProbabilityTheory.kernel.compProd_null
+-/
+#print ProbabilityTheory.kernel.ae_null_of_compProd_null /-
theorem ae_null_of_compProd_null (h : (κ ⊗ₖ η) a s = 0) :
(fun b => η (a, b) (Prod.mk b ⁻¹' s)) =ᵐ[κ a] 0 :=
by
@@ -300,11 +329,14 @@ theorem ae_null_of_compProd_null (h : (κ ⊗ₖ η) a s = 0) :
(Filter.eventually_of_forall fun x => (measure_mono (Set.preimage_mono hst) : _)) ht,
Filter.eventually_of_forall fun x => zero_le _⟩
#align probability_theory.kernel.ae_null_of_comp_prod_null ProbabilityTheory.kernel.ae_null_of_compProd_null
+-/
+#print ProbabilityTheory.kernel.ae_ae_of_ae_compProd /-
theorem ae_ae_of_ae_compProd {p : β × γ → Prop} (h : ∀ᵐ bc ∂(κ ⊗ₖ η) a, p bc) :
∀ᵐ b ∂κ a, ∀ᵐ c ∂η (a, b), p (b, c) :=
ae_null_of_compProd_null h
#align probability_theory.kernel.ae_ae_of_ae_comp_prod ProbabilityTheory.kernel.ae_ae_of_ae_compProd
+-/
end Ae
@@ -312,6 +344,7 @@ section Restrict
variable {κ : kernel α β} [IsSFiniteKernel κ] {η : kernel (α × β) γ} [IsSFiniteKernel η] {a : α}
+#print ProbabilityTheory.kernel.compProd_restrict /-
theorem compProd_restrict {s : Set β} {t : Set γ} (hs : MeasurableSet s) (ht : MeasurableSet t) :
kernel.restrict κ hs ⊗ₖ kernel.restrict η ht = kernel.restrict (κ ⊗ₖ η) (hs.Prod ht) :=
by
@@ -335,16 +368,21 @@ theorem compProd_restrict {s : Set β} {t : Set γ} (hs : MeasurableSet s) (ht :
simp_rw [this]
rw [lintegral_indicator _ hs]
#align probability_theory.kernel.comp_prod_restrict ProbabilityTheory.kernel.compProd_restrict
+-/
+#print ProbabilityTheory.kernel.compProd_restrict_left /-
theorem compProd_restrict_left {s : Set β} (hs : MeasurableSet s) :
kernel.restrict κ hs ⊗ₖ η = kernel.restrict (κ ⊗ₖ η) (hs.Prod MeasurableSet.univ) := by
rw [← comp_prod_restrict]; congr; exact kernel.restrict_univ.symm
#align probability_theory.kernel.comp_prod_restrict_left ProbabilityTheory.kernel.compProd_restrict_left
+-/
+#print ProbabilityTheory.kernel.compProd_restrict_right /-
theorem compProd_restrict_right {t : Set γ} (ht : MeasurableSet t) :
κ ⊗ₖ kernel.restrict η ht = kernel.restrict (κ ⊗ₖ η) (MeasurableSet.univ.Prod ht) := by
rw [← comp_prod_restrict]; congr; exact kernel.restrict_univ.symm
#align probability_theory.kernel.comp_prod_restrict_right ProbabilityTheory.kernel.compProd_restrict_right
+-/
end Restrict
@@ -353,8 +391,9 @@ section Lintegral
/-! ### Lebesgue integral -/
+#print ProbabilityTheory.kernel.lintegral_compProd' /-
/-- Lebesgue integral against the composition-product of two kernels. -/
-theorem lintegral_comp_prod' (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
+theorem lintegral_compProd' (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) {f : β → γ → ℝ≥0∞} (hf : Measurable (Function.uncurry f)) :
∫⁻ bc, f bc.1 bc.2 ∂(κ ⊗ₖ η) a = ∫⁻ b, ∫⁻ c, f b c ∂η (a, b) ∂κ a :=
by
@@ -415,8 +454,10 @@ theorem lintegral_comp_prod' (κ : kernel α β) [IsSFiniteKernel κ] (η : kern
swap; · exact h_some_meas_integral f
congr with b
rw [← lintegral_add_left ((simple_func.measurable _).comp measurable_prod_mk_left)]
-#align probability_theory.kernel.lintegral_comp_prod' ProbabilityTheory.kernel.lintegral_comp_prod'
+#align probability_theory.kernel.lintegral_comp_prod' ProbabilityTheory.kernel.lintegral_compProd'
+-/
+#print ProbabilityTheory.kernel.lintegral_compProd /-
/-- Lebesgue integral against the composition-product of two kernels. -/
theorem lintegral_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f) :
@@ -428,9 +469,11 @@ theorem lintegral_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel
· simp_rw [g, Function.curry_apply, Prod.mk.eta]
· simp_rw [g, Function.uncurry_curry]; exact hf
#align probability_theory.kernel.lintegral_comp_prod ProbabilityTheory.kernel.lintegral_compProd
+-/
+#print ProbabilityTheory.kernel.lintegral_compProd₀ /-
/-- Lebesgue integral against the composition-product of two kernels. -/
-theorem lintegral_comp_prod₀ (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
+theorem lintegral_compProd₀ (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : AEMeasurable f ((κ ⊗ₖ η) a)) :
∫⁻ z, f z ∂(κ ⊗ₖ η) a = ∫⁻ x, ∫⁻ y, f (x, y) ∂η (a, x) ∂κ a :=
by
@@ -441,9 +484,11 @@ theorem lintegral_comp_prod₀ (κ : kernel α β) [IsSFiniteKernel κ] (η : ke
filter_upwards [ae_ae_of_ae_comp_prod hf.ae_eq_mk] with _ ha using lintegral_congr_ae ha
rw [A, B, lintegral_comp_prod]
exact hf.measurable_mk
-#align probability_theory.kernel.lintegral_comp_prod₀ ProbabilityTheory.kernel.lintegral_comp_prod₀
+#align probability_theory.kernel.lintegral_comp_prod₀ ProbabilityTheory.kernel.lintegral_compProd₀
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print ProbabilityTheory.kernel.set_lintegral_compProd /-
theorem set_lintegral_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f) {s : Set β} {t : Set γ}
(hs : MeasurableSet s) (ht : MeasurableSet t) :
@@ -451,37 +496,47 @@ theorem set_lintegral_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : ke
simp_rw [← kernel.restrict_apply (κ ⊗ₖ η) (hs.prod ht), ← comp_prod_restrict,
lintegral_comp_prod _ _ _ hf, kernel.restrict_apply]
#align probability_theory.kernel.set_lintegral_comp_prod ProbabilityTheory.kernel.set_lintegral_compProd
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print ProbabilityTheory.kernel.set_lintegral_compProd_univ_right /-
theorem set_lintegral_compProd_univ_right (κ : kernel α β) [IsSFiniteKernel κ]
(η : kernel (α × β) γ) [IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f)
{s : Set β} (hs : MeasurableSet s) :
∫⁻ z in s ×ˢ Set.univ, f z ∂(κ ⊗ₖ η) a = ∫⁻ x in s, ∫⁻ y, f (x, y) ∂η (a, x) ∂κ a := by
simp_rw [set_lintegral_comp_prod κ η a hf hs MeasurableSet.univ, measure.restrict_univ]
#align probability_theory.kernel.set_lintegral_comp_prod_univ_right ProbabilityTheory.kernel.set_lintegral_compProd_univ_right
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print ProbabilityTheory.kernel.set_lintegral_compProd_univ_left /-
theorem set_lintegral_compProd_univ_left (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f) {t : Set γ}
(ht : MeasurableSet t) :
∫⁻ z in Set.univ ×ˢ t, f z ∂(κ ⊗ₖ η) a = ∫⁻ x, ∫⁻ y in t, f (x, y) ∂η (a, x) ∂κ a := by
simp_rw [set_lintegral_comp_prod κ η a hf MeasurableSet.univ ht, measure.restrict_univ]
#align probability_theory.kernel.set_lintegral_comp_prod_univ_left ProbabilityTheory.kernel.set_lintegral_compProd_univ_left
+-/
end Lintegral
/- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (n m) -/
+#print ProbabilityTheory.kernel.compProd_eq_tsum_compProd /-
theorem compProd_eq_tsum_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
(κ ⊗ₖ η) a s = ∑' (n : ℕ) (m : ℕ), (seq κ n ⊗ₖ seq η m) a s := by
simp_rw [comp_prod_apply_eq_comp_prod_fun _ _ _ hs]; exact comp_prod_fun_eq_tsum κ η a hs
#align probability_theory.kernel.comp_prod_eq_tsum_comp_prod ProbabilityTheory.kernel.compProd_eq_tsum_compProd
+-/
+#print ProbabilityTheory.kernel.compProd_eq_sum_compProd /-
theorem compProd_eq_sum_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] : κ ⊗ₖ η = kernel.sum fun n => kernel.sum fun m => seq κ n ⊗ₖ seq η m := by
ext (a s hs) : 2; simp_rw [kernel.sum_apply' _ a hs]; rw [comp_prod_eq_tsum_comp_prod κ η a hs]
#align probability_theory.kernel.comp_prod_eq_sum_comp_prod ProbabilityTheory.kernel.compProd_eq_sum_compProd
+-/
+#print ProbabilityTheory.kernel.compProd_eq_sum_compProd_left /-
theorem compProd_eq_sum_compProd_left (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] : κ ⊗ₖ η = kernel.sum fun n => seq κ n ⊗ₖ η :=
by
@@ -490,7 +545,9 @@ theorem compProd_eq_sum_compProd_left (κ : kernel α β) [IsSFiniteKernel κ] (
simp_rw [kernel.sum_apply' _ _ hs, comp_prod_apply_eq_comp_prod_fun _ _ _ hs,
comp_prod_fun_tsum_right _ η a hs]
#align probability_theory.kernel.comp_prod_eq_sum_comp_prod_left ProbabilityTheory.kernel.compProd_eq_sum_compProd_left
+-/
+#print ProbabilityTheory.kernel.compProd_eq_sum_compProd_right /-
theorem compProd_eq_sum_compProd_right (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] : κ ⊗ₖ η = kernel.sum fun n => κ ⊗ₖ seq η n :=
by
@@ -498,7 +555,9 @@ theorem compProd_eq_sum_compProd_right (κ : kernel α β) [IsSFiniteKernel κ]
simp_rw [comp_prod_eq_sum_comp_prod_left κ _]
rw [kernel.sum_comm]
#align probability_theory.kernel.comp_prod_eq_sum_comp_prod_right ProbabilityTheory.kernel.compProd_eq_sum_compProd_right
+-/
+#print ProbabilityTheory.kernel.IsMarkovKernel.compProd /-
instance IsMarkovKernel.compProd (κ : kernel α β) [IsMarkovKernel κ] (η : kernel (α × β) γ)
[IsMarkovKernel η] : IsMarkovKernel (κ ⊗ₖ η) :=
⟨fun a =>
@@ -506,7 +565,9 @@ instance IsMarkovKernel.compProd (κ : kernel α β) [IsMarkovKernel κ] (η : k
rw [comp_prod_apply κ η a MeasurableSet.univ]
simp only [Set.mem_univ, Set.setOf_true, measure_univ, lintegral_one]⟩⟩
#align probability_theory.kernel.is_markov_kernel.comp_prod ProbabilityTheory.kernel.IsMarkovKernel.compProd
+-/
+#print ProbabilityTheory.kernel.compProd_apply_univ_le /-
theorem compProd_apply_univ_le (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsFiniteKernel η] (a : α) : (κ ⊗ₖ η) a Set.univ ≤ κ a Set.univ * IsFiniteKernel.bound η :=
by
@@ -519,7 +580,9 @@ theorem compProd_apply_univ_le (κ : kernel α β) [IsSFiniteKernel κ] (η : ke
_ = Cη * κ a Set.univ := (MeasureTheory.lintegral_const Cη)
_ = κ a Set.univ * Cη := mul_comm _ _
#align probability_theory.kernel.comp_prod_apply_univ_le ProbabilityTheory.kernel.compProd_apply_univ_le
+-/
+#print ProbabilityTheory.kernel.IsFiniteKernel.compProd /-
instance IsFiniteKernel.compProd (κ : kernel α β) [IsFiniteKernel κ] (η : kernel (α × β) γ)
[IsFiniteKernel η] : IsFiniteKernel (κ ⊗ₖ η) :=
⟨⟨IsFiniteKernel.bound κ * IsFiniteKernel.bound η,
@@ -529,13 +592,16 @@ instance IsFiniteKernel.compProd (κ : kernel α β) [IsFiniteKernel κ] (η : k
_ ≤ IsFiniteKernel.bound κ * IsFiniteKernel.bound η :=
mul_le_mul (measure_le_bound κ a Set.univ) le_rfl (zero_le _) (zero_le _)⟩⟩
#align probability_theory.kernel.is_finite_kernel.comp_prod ProbabilityTheory.kernel.IsFiniteKernel.compProd
+-/
+#print ProbabilityTheory.kernel.IsSFiniteKernel.compProd /-
instance IsSFiniteKernel.compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] : IsSFiniteKernel (κ ⊗ₖ η) :=
by
rw [comp_prod_eq_sum_comp_prod]
exact kernel.is_s_finite_kernel_sum fun n => kernel.is_s_finite_kernel_sum inferInstance
#align probability_theory.kernel.is_s_finite_kernel.comp_prod ProbabilityTheory.kernel.IsSFiniteKernel.compProd
+-/
end CompositionProduct
@@ -546,6 +612,7 @@ section MapComap
variable {γ : Type _} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α}
+#print ProbabilityTheory.kernel.map /-
/-- The pushforward of a kernel along a measurable function.
We include measurability in the assumptions instead of using junk values
to make sure that typeclass inference can infer that the `map` of a Markov kernel
@@ -555,20 +622,28 @@ noncomputable def map (κ : kernel α β) (f : β → γ) (hf : Measurable f) :
val a := (κ a).map f
property := (Measure.measurable_map _ hf).comp (kernel.measurable κ)
#align probability_theory.kernel.map ProbabilityTheory.kernel.map
+-/
+#print ProbabilityTheory.kernel.map_apply /-
theorem map_apply (κ : kernel α β) (hf : Measurable f) (a : α) : map κ f hf a = (κ a).map f :=
rfl
#align probability_theory.kernel.map_apply ProbabilityTheory.kernel.map_apply
+-/
+#print ProbabilityTheory.kernel.map_apply' /-
theorem map_apply' (κ : kernel α β) (hf : Measurable f) (a : α) {s : Set γ} (hs : MeasurableSet s) :
map κ f hf a s = κ a (f ⁻¹' s) := by rw [map_apply, measure.map_apply hf hs]
#align probability_theory.kernel.map_apply' ProbabilityTheory.kernel.map_apply'
+-/
+#print ProbabilityTheory.kernel.lintegral_map /-
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]
#align probability_theory.kernel.lintegral_map ProbabilityTheory.kernel.lintegral_map
+-/
+#print ProbabilityTheory.kernel.sum_map_seq /-
theorem sum_map_seq (κ : kernel α β) [IsSFiniteKernel κ] (hf : Measurable f) :
(kernel.sum fun n => map (seq κ n) f hf) = map κ f hf :=
by
@@ -577,12 +652,16 @@ theorem sum_map_seq (κ : kernel α β) [IsSFiniteKernel κ] (hf : Measurable f)
measure.sum_apply _ (hf hs)]
simp_rw [map_apply' _ hf _ hs]
#align probability_theory.kernel.sum_map_seq ProbabilityTheory.kernel.sum_map_seq
+-/
+#print ProbabilityTheory.kernel.IsMarkovKernel.map /-
instance IsMarkovKernel.map (κ : kernel α β) [IsMarkovKernel κ] (hf : Measurable f) :
IsMarkovKernel (map κ f hf) :=
⟨fun a => ⟨by rw [map_apply' κ hf a MeasurableSet.univ, Set.preimage_univ, measure_univ]⟩⟩
#align probability_theory.kernel.is_markov_kernel.map ProbabilityTheory.kernel.IsMarkovKernel.map
+-/
+#print ProbabilityTheory.kernel.IsFiniteKernel.map /-
instance IsFiniteKernel.map (κ : kernel α β) [IsFiniteKernel κ] (hf : Measurable f) :
IsFiniteKernel (map κ f hf) :=
by
@@ -590,12 +669,16 @@ instance IsFiniteKernel.map (κ : kernel α β) [IsFiniteKernel κ] (hf : Measur
rw [map_apply' κ hf a MeasurableSet.univ]
exact measure_le_bound κ a _
#align probability_theory.kernel.is_finite_kernel.map ProbabilityTheory.kernel.IsFiniteKernel.map
+-/
+#print ProbabilityTheory.kernel.IsSFiniteKernel.map /-
instance IsSFiniteKernel.map (κ : kernel α β) [IsSFiniteKernel κ] (hf : Measurable f) :
IsSFiniteKernel (map κ f hf) :=
⟨⟨fun n => map (seq κ n) f hf, inferInstance, (sum_map_seq κ hf).symm⟩⟩
#align probability_theory.kernel.is_s_finite_kernel.map ProbabilityTheory.kernel.IsSFiniteKernel.map
+-/
+#print ProbabilityTheory.kernel.comap /-
/-- Pullback of a kernel, such that for each set s `comap κ g hg c s = κ (g c) s`.
We include measurability in the assumptions instead of using junk values
to make sure that typeclass inference can infer that the `comap` of a Markov kernel
@@ -605,21 +688,29 @@ def comap (κ : kernel α β) (g : γ → α) (hg : Measurable g) : kernel γ β
val a := κ (g a)
property := (kernel.measurable κ).comp hg
#align probability_theory.kernel.comap ProbabilityTheory.kernel.comap
+-/
+#print ProbabilityTheory.kernel.comap_apply /-
theorem comap_apply (κ : kernel α β) (hg : Measurable g) (c : γ) : comap κ g hg c = κ (g c) :=
rfl
#align probability_theory.kernel.comap_apply ProbabilityTheory.kernel.comap_apply
+-/
+#print ProbabilityTheory.kernel.comap_apply' /-
theorem comap_apply' (κ : kernel α β) (hg : Measurable g) (c : γ) (s : Set β) :
comap κ g hg c s = κ (g c) s :=
rfl
#align probability_theory.kernel.comap_apply' ProbabilityTheory.kernel.comap_apply'
+-/
+#print ProbabilityTheory.kernel.lintegral_comap /-
theorem lintegral_comap (κ : kernel α β) (hg : Measurable g) (c : γ) (g' : β → ℝ≥0∞) :
∫⁻ b, g' b ∂comap κ g hg c = ∫⁻ b, g' b ∂κ (g c) :=
rfl
#align probability_theory.kernel.lintegral_comap ProbabilityTheory.kernel.lintegral_comap
+-/
+#print ProbabilityTheory.kernel.sum_comap_seq /-
theorem sum_comap_seq (κ : kernel α β) [IsSFiniteKernel κ] (hg : Measurable g) :
(kernel.sum fun n => comap (seq κ n) g hg) = comap κ g hg :=
by
@@ -628,12 +719,16 @@ theorem sum_comap_seq (κ : kernel α β) [IsSFiniteKernel κ] (hg : Measurable
measure.sum_apply _ hs]
simp_rw [comap_apply' _ hg _ s]
#align probability_theory.kernel.sum_comap_seq ProbabilityTheory.kernel.sum_comap_seq
+-/
+#print ProbabilityTheory.kernel.IsMarkovKernel.comap /-
instance IsMarkovKernel.comap (κ : kernel α β) [IsMarkovKernel κ] (hg : Measurable g) :
IsMarkovKernel (comap κ g hg) :=
⟨fun a => ⟨by rw [comap_apply' κ hg a Set.univ, measure_univ]⟩⟩
#align probability_theory.kernel.is_markov_kernel.comap ProbabilityTheory.kernel.IsMarkovKernel.comap
+-/
+#print ProbabilityTheory.kernel.IsFiniteKernel.comap /-
instance IsFiniteKernel.comap (κ : kernel α β) [IsFiniteKernel κ] (hg : Measurable g) :
IsFiniteKernel (comap κ g hg) :=
by
@@ -641,11 +736,14 @@ instance IsFiniteKernel.comap (κ : kernel α β) [IsFiniteKernel κ] (hg : Meas
rw [comap_apply' κ hg a Set.univ]
exact measure_le_bound κ _ _
#align probability_theory.kernel.is_finite_kernel.comap ProbabilityTheory.kernel.IsFiniteKernel.comap
+-/
+#print ProbabilityTheory.kernel.IsSFiniteKernel.comap /-
instance IsSFiniteKernel.comap (κ : kernel α β) [IsSFiniteKernel κ] (hg : Measurable g) :
IsSFiniteKernel (comap κ g hg) :=
⟨⟨fun n => comap (seq κ n) g hg, inferInstance, (sum_comap_seq κ hg).symm⟩⟩
#align probability_theory.kernel.is_s_finite_kernel.comap ProbabilityTheory.kernel.IsSFiniteKernel.comap
+-/
end MapComap
@@ -653,160 +751,230 @@ open scoped ProbabilityTheory
section FstSnd
+#print ProbabilityTheory.kernel.prodMkLeft /-
/-- Define a `kernel (γ × α) β` from a `kernel α β` by taking the comap of the projection. -/
def prodMkLeft (γ : Type _) [MeasurableSpace γ] (κ : kernel α β) : kernel (γ × α) β :=
comap κ Prod.snd measurable_snd
#align probability_theory.kernel.prod_mk_left ProbabilityTheory.kernel.prodMkLeft
+-/
variable {γ : Type _} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α}
+#print ProbabilityTheory.kernel.prodMkLeft_apply /-
theorem prodMkLeft_apply (κ : kernel α β) (ca : γ × α) : prodMkLeft γ κ ca = κ ca.snd :=
rfl
#align probability_theory.kernel.prod_mk_left_apply ProbabilityTheory.kernel.prodMkLeft_apply
+-/
+#print ProbabilityTheory.kernel.prodMkLeft_apply' /-
theorem prodMkLeft_apply' (κ : kernel α β) (ca : γ × α) (s : Set β) :
prodMkLeft γ κ ca s = κ ca.snd s :=
rfl
#align probability_theory.kernel.prod_mk_left_apply' ProbabilityTheory.kernel.prodMkLeft_apply'
+-/
+#print ProbabilityTheory.kernel.lintegral_prodMkLeft /-
theorem lintegral_prodMkLeft (κ : kernel α β) (ca : γ × α) (g : β → ℝ≥0∞) :
∫⁻ b, g b ∂prodMkLeft γ κ ca = ∫⁻ b, g b ∂κ ca.snd :=
rfl
#align probability_theory.kernel.lintegral_prod_mk_left ProbabilityTheory.kernel.lintegral_prodMkLeft
+-/
+#print ProbabilityTheory.kernel.IsMarkovKernel.prodMkLeft /-
instance IsMarkovKernel.prodMkLeft (κ : kernel α β) [IsMarkovKernel κ] :
IsMarkovKernel (prodMkLeft γ κ) := by rw [prod_mk_left]; infer_instance
#align probability_theory.kernel.is_markov_kernel.prod_mk_left ProbabilityTheory.kernel.IsMarkovKernel.prodMkLeft
+-/
+#print ProbabilityTheory.kernel.IsFiniteKernel.prodMkLeft /-
instance IsFiniteKernel.prodMkLeft (κ : kernel α β) [IsFiniteKernel κ] :
IsFiniteKernel (prodMkLeft γ κ) := by rw [prod_mk_left]; infer_instance
#align probability_theory.kernel.is_finite_kernel.prod_mk_left ProbabilityTheory.kernel.IsFiniteKernel.prodMkLeft
+-/
+#print ProbabilityTheory.kernel.IsSFiniteKernel.prodMkLeft /-
instance IsSFiniteKernel.prodMkLeft (κ : kernel α β) [IsSFiniteKernel κ] :
IsSFiniteKernel (prodMkLeft γ κ) := by rw [prod_mk_left]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.prod_mk_left ProbabilityTheory.kernel.IsSFiniteKernel.prodMkLeft
+-/
+#print ProbabilityTheory.kernel.swapLeft /-
/-- Define a `kernel (β × α) γ` from a `kernel (α × β) γ` by taking the comap of `prod.swap`. -/
def swapLeft (κ : kernel (α × β) γ) : kernel (β × α) γ :=
comap κ Prod.swap measurable_swap
#align probability_theory.kernel.swap_left ProbabilityTheory.kernel.swapLeft
+-/
+#print ProbabilityTheory.kernel.swapLeft_apply /-
theorem swapLeft_apply (κ : kernel (α × β) γ) (a : β × α) : swapLeft κ a = κ a.symm :=
rfl
#align probability_theory.kernel.swap_left_apply ProbabilityTheory.kernel.swapLeft_apply
+-/
+#print ProbabilityTheory.kernel.swapLeft_apply' /-
theorem swapLeft_apply' (κ : kernel (α × β) γ) (a : β × α) (s : Set γ) :
swapLeft κ a s = κ a.symm s :=
rfl
#align probability_theory.kernel.swap_left_apply' ProbabilityTheory.kernel.swapLeft_apply'
+-/
+#print ProbabilityTheory.kernel.lintegral_swapLeft /-
theorem lintegral_swapLeft (κ : kernel (α × β) γ) (a : β × α) (g : γ → ℝ≥0∞) :
∫⁻ c, g c ∂swapLeft κ a = ∫⁻ c, g c ∂κ a.symm := by
rw [swap_left, lintegral_comap _ measurable_swap a]
#align probability_theory.kernel.lintegral_swap_left ProbabilityTheory.kernel.lintegral_swapLeft
+-/
+#print ProbabilityTheory.kernel.IsMarkovKernel.swapLeft /-
instance IsMarkovKernel.swapLeft (κ : kernel (α × β) γ) [IsMarkovKernel κ] :
IsMarkovKernel (swapLeft κ) := by rw [swap_left]; infer_instance
#align probability_theory.kernel.is_markov_kernel.swap_left ProbabilityTheory.kernel.IsMarkovKernel.swapLeft
+-/
+#print ProbabilityTheory.kernel.IsFiniteKernel.swapLeft /-
instance IsFiniteKernel.swapLeft (κ : kernel (α × β) γ) [IsFiniteKernel κ] :
IsFiniteKernel (swapLeft κ) := by rw [swap_left]; infer_instance
#align probability_theory.kernel.is_finite_kernel.swap_left ProbabilityTheory.kernel.IsFiniteKernel.swapLeft
+-/
+#print ProbabilityTheory.kernel.IsSFiniteKernel.swapLeft /-
instance IsSFiniteKernel.swapLeft (κ : kernel (α × β) γ) [IsSFiniteKernel κ] :
IsSFiniteKernel (swapLeft κ) := by rw [swap_left]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.swap_left ProbabilityTheory.kernel.IsSFiniteKernel.swapLeft
+-/
+#print ProbabilityTheory.kernel.swapRight /-
/-- Define a `kernel α (γ × β)` from a `kernel α (β × γ)` by taking the map of `prod.swap`. -/
noncomputable def swapRight (κ : kernel α (β × γ)) : kernel α (γ × β) :=
map κ Prod.swap measurable_swap
#align probability_theory.kernel.swap_right ProbabilityTheory.kernel.swapRight
+-/
+#print ProbabilityTheory.kernel.swapRight_apply /-
theorem swapRight_apply (κ : kernel α (β × γ)) (a : α) : swapRight κ a = (κ a).map Prod.swap :=
rfl
#align probability_theory.kernel.swap_right_apply ProbabilityTheory.kernel.swapRight_apply
+-/
+#print ProbabilityTheory.kernel.swapRight_apply' /-
theorem swapRight_apply' (κ : kernel α (β × γ)) (a : α) {s : Set (γ × β)} (hs : MeasurableSet s) :
swapRight κ a s = κ a {p | p.symm ∈ s} := by
rw [swap_right_apply, measure.map_apply measurable_swap hs]; rfl
#align probability_theory.kernel.swap_right_apply' ProbabilityTheory.kernel.swapRight_apply'
+-/
+#print ProbabilityTheory.kernel.lintegral_swapRight /-
theorem lintegral_swapRight (κ : kernel α (β × γ)) (a : α) {g : γ × β → ℝ≥0∞} (hg : Measurable g) :
∫⁻ c, g c ∂swapRight κ a = ∫⁻ bc : β × γ, g bc.symm ∂κ a := by
rw [swap_right, lintegral_map _ measurable_swap a hg]
#align probability_theory.kernel.lintegral_swap_right ProbabilityTheory.kernel.lintegral_swapRight
+-/
+#print ProbabilityTheory.kernel.IsMarkovKernel.swapRight /-
instance IsMarkovKernel.swapRight (κ : kernel α (β × γ)) [IsMarkovKernel κ] :
IsMarkovKernel (swapRight κ) := by rw [swap_right]; infer_instance
#align probability_theory.kernel.is_markov_kernel.swap_right ProbabilityTheory.kernel.IsMarkovKernel.swapRight
+-/
+#print ProbabilityTheory.kernel.IsFiniteKernel.swapRight /-
instance IsFiniteKernel.swapRight (κ : kernel α (β × γ)) [IsFiniteKernel κ] :
IsFiniteKernel (swapRight κ) := by rw [swap_right]; infer_instance
#align probability_theory.kernel.is_finite_kernel.swap_right ProbabilityTheory.kernel.IsFiniteKernel.swapRight
+-/
+#print ProbabilityTheory.kernel.IsSFiniteKernel.swapRight /-
instance IsSFiniteKernel.swapRight (κ : kernel α (β × γ)) [IsSFiniteKernel κ] :
IsSFiniteKernel (swapRight κ) := by rw [swap_right]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.swap_right ProbabilityTheory.kernel.IsSFiniteKernel.swapRight
+-/
+#print ProbabilityTheory.kernel.fst /-
/-- Define a `kernel α β` from a `kernel α (β × γ)` by taking the map of the first projection. -/
noncomputable def fst (κ : kernel α (β × γ)) : kernel α β :=
map κ Prod.fst measurable_fst
#align probability_theory.kernel.fst ProbabilityTheory.kernel.fst
+-/
+#print ProbabilityTheory.kernel.fst_apply /-
theorem fst_apply (κ : kernel α (β × γ)) (a : α) : fst κ a = (κ a).map Prod.fst :=
rfl
#align probability_theory.kernel.fst_apply ProbabilityTheory.kernel.fst_apply
+-/
+#print ProbabilityTheory.kernel.fst_apply' /-
theorem fst_apply' (κ : kernel α (β × γ)) (a : α) {s : Set β} (hs : MeasurableSet s) :
fst κ a s = κ a {p | p.1 ∈ s} := by rw [fst_apply, measure.map_apply measurable_fst hs]; rfl
#align probability_theory.kernel.fst_apply' ProbabilityTheory.kernel.fst_apply'
+-/
+#print ProbabilityTheory.kernel.lintegral_fst /-
theorem lintegral_fst (κ : kernel α (β × γ)) (a : α) {g : β → ℝ≥0∞} (hg : Measurable g) :
∫⁻ c, g c ∂fst κ a = ∫⁻ bc : β × γ, g bc.fst ∂κ a := by
rw [fst, lintegral_map _ measurable_fst a hg]
#align probability_theory.kernel.lintegral_fst ProbabilityTheory.kernel.lintegral_fst
+-/
+#print ProbabilityTheory.kernel.IsMarkovKernel.fst /-
instance IsMarkovKernel.fst (κ : kernel α (β × γ)) [IsMarkovKernel κ] : IsMarkovKernel (fst κ) := by
rw [fst]; infer_instance
#align probability_theory.kernel.is_markov_kernel.fst ProbabilityTheory.kernel.IsMarkovKernel.fst
+-/
+#print ProbabilityTheory.kernel.IsFiniteKernel.fst /-
instance IsFiniteKernel.fst (κ : kernel α (β × γ)) [IsFiniteKernel κ] : IsFiniteKernel (fst κ) := by
rw [fst]; infer_instance
#align probability_theory.kernel.is_finite_kernel.fst ProbabilityTheory.kernel.IsFiniteKernel.fst
+-/
+#print ProbabilityTheory.kernel.IsSFiniteKernel.fst /-
instance IsSFiniteKernel.fst (κ : kernel α (β × γ)) [IsSFiniteKernel κ] : IsSFiniteKernel (fst κ) :=
by rw [fst]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.fst ProbabilityTheory.kernel.IsSFiniteKernel.fst
+-/
+#print ProbabilityTheory.kernel.snd /-
/-- Define a `kernel α γ` from a `kernel α (β × γ)` by taking the map of the second projection. -/
noncomputable def snd (κ : kernel α (β × γ)) : kernel α γ :=
map κ Prod.snd measurable_snd
#align probability_theory.kernel.snd ProbabilityTheory.kernel.snd
+-/
+#print ProbabilityTheory.kernel.snd_apply /-
theorem snd_apply (κ : kernel α (β × γ)) (a : α) : snd κ a = (κ a).map Prod.snd :=
rfl
#align probability_theory.kernel.snd_apply ProbabilityTheory.kernel.snd_apply
+-/
+#print ProbabilityTheory.kernel.snd_apply' /-
theorem snd_apply' (κ : kernel α (β × γ)) (a : α) {s : Set γ} (hs : MeasurableSet s) :
snd κ a s = κ a {p | p.2 ∈ s} := by rw [snd_apply, measure.map_apply measurable_snd hs]; rfl
#align probability_theory.kernel.snd_apply' ProbabilityTheory.kernel.snd_apply'
+-/
+#print ProbabilityTheory.kernel.lintegral_snd /-
theorem lintegral_snd (κ : kernel α (β × γ)) (a : α) {g : γ → ℝ≥0∞} (hg : Measurable g) :
∫⁻ c, g c ∂snd κ a = ∫⁻ bc : β × γ, g bc.snd ∂κ a := by
rw [snd, lintegral_map _ measurable_snd a hg]
#align probability_theory.kernel.lintegral_snd ProbabilityTheory.kernel.lintegral_snd
+-/
+#print ProbabilityTheory.kernel.IsMarkovKernel.snd /-
instance IsMarkovKernel.snd (κ : kernel α (β × γ)) [IsMarkovKernel κ] : IsMarkovKernel (snd κ) := by
rw [snd]; infer_instance
#align probability_theory.kernel.is_markov_kernel.snd ProbabilityTheory.kernel.IsMarkovKernel.snd
+-/
+#print ProbabilityTheory.kernel.IsFiniteKernel.snd /-
instance IsFiniteKernel.snd (κ : kernel α (β × γ)) [IsFiniteKernel κ] : IsFiniteKernel (snd κ) := by
rw [snd]; infer_instance
#align probability_theory.kernel.is_finite_kernel.snd ProbabilityTheory.kernel.IsFiniteKernel.snd
+-/
+#print ProbabilityTheory.kernel.IsSFiniteKernel.snd /-
instance IsSFiniteKernel.snd (κ : kernel α (β × γ)) [IsSFiniteKernel κ] : IsSFiniteKernel (snd κ) :=
by rw [snd]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.snd ProbabilityTheory.kernel.IsSFiniteKernel.snd
+-/
end FstSnd
@@ -817,24 +985,31 @@ section Comp
variable {γ : Type _} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α}
+#print ProbabilityTheory.kernel.comp /-
/-- Composition of two s-finite kernels. -/
noncomputable def comp (η : kernel β γ) (κ : kernel α β) : kernel α γ
where
val a := (κ a).bind η
property := (Measure.measurable_bind' (kernel.measurable _)).comp (kernel.measurable _)
#align probability_theory.kernel.comp ProbabilityTheory.kernel.comp
+-/
scoped[ProbabilityTheory] infixl:100 " ∘ₖ " => ProbabilityTheory.kernel.comp
+#print ProbabilityTheory.kernel.comp_apply /-
theorem comp_apply (η : kernel β γ) (κ : kernel α β) (a : α) : (η ∘ₖ κ) a = (κ a).bind η :=
rfl
#align probability_theory.kernel.comp_apply ProbabilityTheory.kernel.comp_apply
+-/
+#print ProbabilityTheory.kernel.comp_apply' /-
theorem comp_apply' (η : kernel β γ) (κ : kernel α β) (a : α) {s : Set γ} (hs : MeasurableSet s) :
(η ∘ₖ κ) a s = ∫⁻ b, η b s ∂κ a := by
rw [comp_apply, measure.bind_apply hs (kernel.measurable _)]
#align probability_theory.kernel.comp_apply' ProbabilityTheory.kernel.comp_apply'
+-/
+#print ProbabilityTheory.kernel.comp_eq_snd_compProd /-
theorem comp_eq_snd_compProd (η : kernel β γ) [IsSFiniteKernel η] (κ : kernel α β)
[IsSFiniteKernel κ] : η ∘ₖ κ = snd (κ ⊗ₖ prodMkLeft α η) :=
by
@@ -843,24 +1018,34 @@ theorem comp_eq_snd_compProd (η : kernel β γ) [IsSFiniteKernel η] (κ : kern
swap; · exact measurable_snd hs
simp only [Set.mem_setOf_eq, Set.setOf_mem_eq, prod_mk_left_apply' _ _ s]
#align probability_theory.kernel.comp_eq_snd_comp_prod ProbabilityTheory.kernel.comp_eq_snd_compProd
+-/
+#print ProbabilityTheory.kernel.lintegral_comp /-
theorem lintegral_comp (η : kernel β γ) (κ : kernel α β) (a : α) {g : γ → ℝ≥0∞}
(hg : Measurable g) : ∫⁻ c, g c ∂(η ∘ₖ κ) a = ∫⁻ b, ∫⁻ c, g c ∂η b ∂κ a := by
rw [comp_apply, measure.lintegral_bind (kernel.measurable _) hg]
#align probability_theory.kernel.lintegral_comp ProbabilityTheory.kernel.lintegral_comp
+-/
+#print ProbabilityTheory.kernel.IsMarkovKernel.comp /-
instance IsMarkovKernel.comp (η : kernel β γ) [IsMarkovKernel η] (κ : kernel α β)
[IsMarkovKernel κ] : IsMarkovKernel (η ∘ₖ κ) := by rw [comp_eq_snd_comp_prod]; infer_instance
#align probability_theory.kernel.is_markov_kernel.comp ProbabilityTheory.kernel.IsMarkovKernel.comp
+-/
+#print ProbabilityTheory.kernel.IsFiniteKernel.comp /-
instance IsFiniteKernel.comp (η : kernel β γ) [IsFiniteKernel η] (κ : kernel α β)
[IsFiniteKernel κ] : IsFiniteKernel (η ∘ₖ κ) := by rw [comp_eq_snd_comp_prod]; infer_instance
#align probability_theory.kernel.is_finite_kernel.comp ProbabilityTheory.kernel.IsFiniteKernel.comp
+-/
+#print ProbabilityTheory.kernel.IsSFiniteKernel.comp /-
instance IsSFiniteKernel.comp (η : kernel β γ) [IsSFiniteKernel η] (κ : kernel α β)
[IsSFiniteKernel κ] : IsSFiniteKernel (η ∘ₖ κ) := by rw [comp_eq_snd_comp_prod]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.comp ProbabilityTheory.kernel.IsSFiniteKernel.comp
+-/
+#print ProbabilityTheory.kernel.comp_assoc /-
/-- Composition of kernels is associative. -/
theorem comp_assoc {δ : Type _} {mδ : MeasurableSpace δ} (ξ : kernel γ δ) [IsSFiniteKernel ξ]
(η : kernel β γ) (κ : kernel α β) : ξ ∘ₖ η ∘ₖ κ = ξ ∘ₖ (η ∘ₖ κ) :=
@@ -868,7 +1053,9 @@ theorem comp_assoc {δ : Type _} {mδ : MeasurableSpace δ} (ξ : kernel γ δ)
refine' ext_fun fun a f hf => _
simp_rw [lintegral_comp _ _ _ hf, lintegral_comp _ _ _ hf.lintegral_kernel]
#align probability_theory.kernel.comp_assoc ProbabilityTheory.kernel.comp_assoc
+-/
+#print ProbabilityTheory.kernel.deterministic_comp_eq_map /-
theorem deterministic_comp_eq_map (hf : Measurable f) (κ : kernel α β) :
deterministic f hf ∘ₖ κ = map κ f hf :=
by
@@ -876,7 +1063,9 @@ theorem deterministic_comp_eq_map (hf : Measurable f) (κ : kernel α β) :
simp_rw [map_apply' _ _ _ hs, comp_apply' _ _ _ hs, deterministic_apply' hf _ hs,
lintegral_indicator_const_comp hf hs, one_mul]
#align probability_theory.kernel.deterministic_comp_eq_map ProbabilityTheory.kernel.deterministic_comp_eq_map
+-/
+#print ProbabilityTheory.kernel.comp_deterministic_eq_comap /-
theorem comp_deterministic_eq_comap (κ : kernel α β) (hg : Measurable g) :
κ ∘ₖ deterministic g hg = comap κ g hg :=
by
@@ -884,6 +1073,7 @@ theorem comp_deterministic_eq_comap (κ : kernel α β) (hg : Measurable g) :
simp_rw [comap_apply' _ _ _ s, comp_apply' _ _ _ hs, deterministic_apply hg a,
lintegral_dirac' _ (kernel.measurable_coe κ hs)]
#align probability_theory.kernel.comp_deterministic_eq_comap ProbabilityTheory.kernel.comp_deterministic_eq_comap
+-/
end Comp
@@ -894,39 +1084,51 @@ section Prod
variable {γ : Type _} {mγ : MeasurableSpace γ}
+#print ProbabilityTheory.kernel.prod /-
/-- Product of two s-finite kernels. -/
noncomputable def prod (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsSFiniteKernel η] :
kernel α (β × γ) :=
κ ⊗ₖ swapLeft (prodMkLeft β η)
#align probability_theory.kernel.prod ProbabilityTheory.kernel.prod
+-/
scoped[ProbabilityTheory] infixl:100 " ×ₖ " => ProbabilityTheory.kernel.prod
+#print ProbabilityTheory.kernel.prod_apply /-
theorem prod_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsSFiniteKernel η] (a : α)
{s : Set (β × γ)} (hs : MeasurableSet s) :
(κ ×ₖ η) a s = ∫⁻ b : β, (η a) {c : γ | (b, c) ∈ s} ∂κ a := by
simp_rw [Prod, comp_prod_apply _ _ _ hs, swap_left_apply _ _, prod_mk_left_apply,
Prod.swap_prod_mk]
#align probability_theory.kernel.prod_apply ProbabilityTheory.kernel.prod_apply
+-/
+#print ProbabilityTheory.kernel.lintegral_prod /-
theorem lintegral_prod (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsSFiniteKernel η]
(a : α) {g : β × γ → ℝ≥0∞} (hg : Measurable g) :
∫⁻ c, g c ∂(κ ×ₖ η) a = ∫⁻ b, ∫⁻ c, g (b, c) ∂η a ∂κ a := by
simp_rw [Prod, lintegral_comp_prod _ _ _ hg, swap_left_apply, prod_mk_left_apply,
Prod.swap_prod_mk]
#align probability_theory.kernel.lintegral_prod ProbabilityTheory.kernel.lintegral_prod
+-/
+#print ProbabilityTheory.kernel.IsMarkovKernel.prod /-
instance IsMarkovKernel.prod (κ : kernel α β) [IsMarkovKernel κ] (η : kernel α γ)
[IsMarkovKernel η] : IsMarkovKernel (κ ×ₖ η) := by rw [Prod]; infer_instance
#align probability_theory.kernel.is_markov_kernel.prod ProbabilityTheory.kernel.IsMarkovKernel.prod
+-/
+#print ProbabilityTheory.kernel.IsFiniteKernel.prod /-
instance IsFiniteKernel.prod (κ : kernel α β) [IsFiniteKernel κ] (η : kernel α γ)
[IsFiniteKernel η] : IsFiniteKernel (κ ×ₖ η) := by rw [Prod]; infer_instance
#align probability_theory.kernel.is_finite_kernel.prod ProbabilityTheory.kernel.IsFiniteKernel.prod
+-/
+#print ProbabilityTheory.kernel.IsSFiniteKernel.prod /-
instance IsSFiniteKernel.prod (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ)
[IsSFiniteKernel η] : IsSFiniteKernel (κ ×ₖ η) := by rw [Prod]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.prod ProbabilityTheory.kernel.IsSFiniteKernel.prod
+-/
end Prod
mathlib commit https://github.com/leanprover-community/mathlib/commit/2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
! This file was ported from Lean 3 source module probability.kernel.composition
-! leanprover-community/mathlib commit 3b92d54a05ee592aa2c6181a4e76b1bb7cc45d0b
+! leanprover-community/mathlib commit 2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -13,6 +13,9 @@ import Mathbin.Probability.Kernel.MeasurableIntegral
/-!
# Product and composition of kernels
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
We define
* the composition-product `κ ⊗ₖ η` of two s-finite kernels `κ : kernel α β` and
`η : kernel (α × β) γ`, a kernel from `α` to `β × γ`.
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -72,8 +72,6 @@ namespace Kernel
variable {α β ι : Type _} {mα : MeasurableSpace α} {mβ : MeasurableSpace β}
-include mα mβ
-
section CompositionProduct
/-!
@@ -86,8 +84,6 @@ We define a kernel composition-product
variable {γ : Type _} {mγ : MeasurableSpace γ} {s : Set (β × γ)}
-include mγ
-
/-- Auxiliary function for the definition of the composition-product of two kernels.
For all `a : α`, `comp_prod_fun κ η a` is a countably additive function with value zero on the empty
set, and the composition-product of kernels is defined in `kernel.comp_prod` through
@@ -227,7 +223,6 @@ noncomputable def compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel
exact measurable_comp_prod_fun κ η hs
#align probability_theory.kernel.comp_prod ProbabilityTheory.kernel.compProd
--- mathport name: kernel.comp_prod
scoped[ProbabilityTheory] infixl:100 " ⊗ₖ " => ProbabilityTheory.kernel.compProd
theorem compProd_apply_eq_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
@@ -548,8 +543,6 @@ section MapComap
variable {γ : Type _} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α}
-include mγ
-
/-- The pushforward of a kernel along a measurable function.
We include measurability in the assumptions instead of using junk values
to make sure that typeclass inference can infer that the `map` of a Markov kernel
@@ -664,8 +657,6 @@ def prodMkLeft (γ : Type _) [MeasurableSpace γ] (κ : kernel α β) : kernel (
variable {γ : Type _} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α}
-include mγ
-
theorem prodMkLeft_apply (κ : kernel α β) (ca : γ × α) : prodMkLeft γ κ ca = κ ca.snd :=
rfl
#align probability_theory.kernel.prod_mk_left_apply ProbabilityTheory.kernel.prodMkLeft_apply
@@ -823,8 +814,6 @@ section Comp
variable {γ : Type _} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α}
-include mγ
-
/-- Composition of two s-finite kernels. -/
noncomputable def comp (η : kernel β γ) (κ : kernel α β) : kernel α γ
where
@@ -832,7 +821,6 @@ noncomputable def comp (η : kernel β γ) (κ : kernel α β) : kernel α γ
property := (Measure.measurable_bind' (kernel.measurable _)).comp (kernel.measurable _)
#align probability_theory.kernel.comp ProbabilityTheory.kernel.comp
--- mathport name: kernel.comp
scoped[ProbabilityTheory] infixl:100 " ∘ₖ " => ProbabilityTheory.kernel.comp
theorem comp_apply (η : kernel β γ) (κ : kernel α β) (a : α) : (η ∘ₖ κ) a = (κ a).bind η :=
@@ -903,15 +891,12 @@ section Prod
variable {γ : Type _} {mγ : MeasurableSpace γ}
-include mγ
-
/-- Product of two s-finite kernels. -/
noncomputable def prod (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsSFiniteKernel η] :
kernel α (β × γ) :=
κ ⊗ₖ swapLeft (prodMkLeft β η)
#align probability_theory.kernel.prod ProbabilityTheory.kernel.prod
--- mathport name: kernel.prod
scoped[ProbabilityTheory] infixl:100 " ×ₖ " => ProbabilityTheory.kernel.prod
theorem prod_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsSFiniteKernel η] (a : α)
mathlib commit https://github.com/leanprover-community/mathlib/commit/a3e83f0fa4391c8740f7d773a7a9b74e311ae2a3
@@ -142,7 +142,7 @@ theorem compProdFun_tsum_right (κ : kernel α β) (η : kernel (α × β) γ) [
by
simp_rw [comp_prod_fun, (measure_sum_seq η _).symm]
have :
- (∫⁻ b, measure.sum (fun n => seq η n (a, b)) {c : γ | (b, c) ∈ s} ∂κ a) =
+ ∫⁻ b, measure.sum (fun n => seq η n (a, b)) {c : γ | (b, c) ∈ s} ∂κ a =
∫⁻ b, ∑' n, seq η n (a, b) {c : γ | (b, c) ∈ s} ∂κ a :=
by
congr
@@ -250,9 +250,9 @@ theorem compProd_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α
theorem le_compProd_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) (s : Set (β × γ)) :
- (∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a) ≤ (κ ⊗ₖ η) a s :=
+ ∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a ≤ (κ ⊗ₖ η) a s :=
calc
- (∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a) ≤
+ ∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a ≤
∫⁻ b, η (a, b) {c | (b, c) ∈ toMeasurable ((κ ⊗ₖ η) a) s} ∂κ a :=
lintegral_mono fun b => measure_mono fun _ h_mem => subset_toMeasurable _ _ h_mem
_ = (κ ⊗ₖ η) a (toMeasurable ((κ ⊗ₖ η) a) s) :=
@@ -358,7 +358,7 @@ section Lintegral
/-- Lebesgue integral against the composition-product of two kernels. -/
theorem lintegral_comp_prod' (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) {f : β → γ → ℝ≥0∞} (hf : Measurable (Function.uncurry f)) :
- (∫⁻ bc, f bc.1 bc.2 ∂(κ ⊗ₖ η) a) = ∫⁻ b, ∫⁻ c, f b c ∂η (a, b) ∂κ a :=
+ ∫⁻ bc, f bc.1 bc.2 ∂(κ ⊗ₖ η) a = ∫⁻ b, ∫⁻ c, f b c ∂η (a, b) ∂κ a :=
by
let F : ℕ → simple_func (β × γ) ℝ≥0∞ := simple_func.eapprox (Function.uncurry f)
have h : ∀ a, (⨆ n, F n a) = Function.uncurry f a :=
@@ -368,7 +368,7 @@ theorem lintegral_comp_prod' (κ : kernel α β) [IsSFiniteKernel κ] (η : kern
have h_mono : Monotone F := fun i j hij b =>
simple_func.monotone_eapprox (Function.uncurry f) hij _
rw [lintegral_supr (fun n => (F n).Measurable) h_mono]
- have : ∀ b, (∫⁻ c, ⨆ n, F n (b, c) ∂η (a, b)) = ⨆ n, ∫⁻ c, F n (b, c) ∂η (a, b) :=
+ have : ∀ b, ∫⁻ c, ⨆ n, F n (b, c) ∂η (a, b) = ⨆ n, ∫⁻ c, F n (b, c) ∂η (a, b) :=
by
intro a
rw [lintegral_supr]
@@ -411,7 +411,7 @@ theorem lintegral_comp_prod' (κ : kernel α β) [IsSFiniteKernel κ] (η : kern
· intro f f' h_disj hf_eq hf'_eq
simp_rw [simple_func.coe_add, Pi.add_apply]
change
- (∫⁻ x, (f : β × γ → ℝ≥0∞) x + f' x ∂(κ ⊗ₖ η) a) =
+ ∫⁻ x, (f : β × γ → ℝ≥0∞) x + f' x ∂(κ ⊗ₖ η) a =
∫⁻ b, ∫⁻ c : γ, f (b, c) + f' (b, c) ∂η (a, b) ∂κ a
rw [lintegral_add_left (simple_func.measurable _), hf_eq, hf'_eq, ← lintegral_add_left]
swap; · exact h_some_meas_integral f
@@ -422,10 +422,10 @@ theorem lintegral_comp_prod' (κ : kernel α β) [IsSFiniteKernel κ] (η : kern
/-- Lebesgue integral against the composition-product of two kernels. -/
theorem lintegral_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f) :
- (∫⁻ bc, f bc ∂(κ ⊗ₖ η) a) = ∫⁻ b, ∫⁻ c, f (b, c) ∂η (a, b) ∂κ a :=
+ ∫⁻ bc, f bc ∂(κ ⊗ₖ η) a = ∫⁻ b, ∫⁻ c, f (b, c) ∂η (a, b) ∂κ a :=
by
let g := Function.curry f
- change (∫⁻ bc, f bc ∂(κ ⊗ₖ η) a) = ∫⁻ b, ∫⁻ c, g b c ∂η (a, b) ∂κ a
+ change ∫⁻ bc, f bc ∂(κ ⊗ₖ η) a = ∫⁻ b, ∫⁻ c, g b c ∂η (a, b) ∂κ a
rw [← lintegral_comp_prod']
· simp_rw [g, Function.curry_apply, Prod.mk.eta]
· simp_rw [g, Function.uncurry_curry]; exact hf
@@ -434,10 +434,10 @@ theorem lintegral_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel
/-- Lebesgue integral against the composition-product of two kernels. -/
theorem lintegral_comp_prod₀ (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : AEMeasurable f ((κ ⊗ₖ η) a)) :
- (∫⁻ z, f z ∂(κ ⊗ₖ η) a) = ∫⁻ x, ∫⁻ y, f (x, y) ∂η (a, x) ∂κ a :=
+ ∫⁻ z, f z ∂(κ ⊗ₖ η) a = ∫⁻ x, ∫⁻ y, f (x, y) ∂η (a, x) ∂κ a :=
by
- have A : (∫⁻ z, f z ∂(κ ⊗ₖ η) a) = ∫⁻ z, hf.mk f z ∂(κ ⊗ₖ η) a := lintegral_congr_ae hf.ae_eq_mk
- have B : (∫⁻ x, ∫⁻ y, f (x, y) ∂η (a, x) ∂κ a) = ∫⁻ x, ∫⁻ y, hf.mk f (x, y) ∂η (a, x) ∂κ a :=
+ have A : ∫⁻ z, f z ∂(κ ⊗ₖ η) a = ∫⁻ z, hf.mk f z ∂(κ ⊗ₖ η) a := lintegral_congr_ae hf.ae_eq_mk
+ have B : ∫⁻ x, ∫⁻ y, f (x, y) ∂η (a, x) ∂κ a = ∫⁻ x, ∫⁻ y, hf.mk f (x, y) ∂η (a, x) ∂κ a :=
by
apply lintegral_congr_ae
filter_upwards [ae_ae_of_ae_comp_prod hf.ae_eq_mk] with _ ha using lintegral_congr_ae ha
@@ -449,7 +449,7 @@ theorem lintegral_comp_prod₀ (κ : kernel α β) [IsSFiniteKernel κ] (η : ke
theorem set_lintegral_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f) {s : Set β} {t : Set γ}
(hs : MeasurableSet s) (ht : MeasurableSet t) :
- (∫⁻ z in s ×ˢ t, f z ∂(κ ⊗ₖ η) a) = ∫⁻ x in s, ∫⁻ y in t, f (x, y) ∂η (a, x) ∂κ a := by
+ ∫⁻ z in s ×ˢ t, f z ∂(κ ⊗ₖ η) a = ∫⁻ x in s, ∫⁻ y in t, f (x, y) ∂η (a, x) ∂κ a := by
simp_rw [← kernel.restrict_apply (κ ⊗ₖ η) (hs.prod ht), ← comp_prod_restrict,
lintegral_comp_prod _ _ _ hf, kernel.restrict_apply]
#align probability_theory.kernel.set_lintegral_comp_prod ProbabilityTheory.kernel.set_lintegral_compProd
@@ -458,7 +458,7 @@ theorem set_lintegral_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : ke
theorem set_lintegral_compProd_univ_right (κ : kernel α β) [IsSFiniteKernel κ]
(η : kernel (α × β) γ) [IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f)
{s : Set β} (hs : MeasurableSet s) :
- (∫⁻ z in s ×ˢ Set.univ, f z ∂(κ ⊗ₖ η) a) = ∫⁻ x in s, ∫⁻ y, f (x, y) ∂η (a, x) ∂κ a := by
+ ∫⁻ z in s ×ˢ Set.univ, f z ∂(κ ⊗ₖ η) a = ∫⁻ x in s, ∫⁻ y, f (x, y) ∂η (a, x) ∂κ a := by
simp_rw [set_lintegral_comp_prod κ η a hf hs MeasurableSet.univ, measure.restrict_univ]
#align probability_theory.kernel.set_lintegral_comp_prod_univ_right ProbabilityTheory.kernel.set_lintegral_compProd_univ_right
@@ -466,7 +466,7 @@ theorem set_lintegral_compProd_univ_right (κ : kernel α β) [IsSFiniteKernel
theorem set_lintegral_compProd_univ_left (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f) {t : Set γ}
(ht : MeasurableSet t) :
- (∫⁻ z in Set.univ ×ˢ t, f z ∂(κ ⊗ₖ η) a) = ∫⁻ x, ∫⁻ y in t, f (x, y) ∂η (a, x) ∂κ a := by
+ ∫⁻ z in Set.univ ×ˢ t, f z ∂(κ ⊗ₖ η) a = ∫⁻ x, ∫⁻ y in t, f (x, y) ∂η (a, x) ∂κ a := by
simp_rw [set_lintegral_comp_prod κ η a hf MeasurableSet.univ ht, measure.restrict_univ]
#align probability_theory.kernel.set_lintegral_comp_prod_univ_left ProbabilityTheory.kernel.set_lintegral_compProd_univ_left
@@ -516,7 +516,7 @@ theorem compProd_apply_univ_le (κ : kernel α β) [IsSFiniteKernel κ] (η : ke
simp only [Set.mem_univ, Set.setOf_true]
let Cη := is_finite_kernel.bound η
calc
- (∫⁻ b, η (a, b) Set.univ ∂κ a) ≤ ∫⁻ b, Cη ∂κ a :=
+ ∫⁻ b, η (a, b) Set.univ ∂κ a ≤ ∫⁻ b, Cη ∂κ a :=
lintegral_mono fun b => measure_le_bound η (a, b) Set.univ
_ = Cη * κ a Set.univ := (MeasureTheory.lintegral_const Cη)
_ = κ a Set.univ * Cη := mul_comm _ _
@@ -569,7 +569,7 @@ theorem map_apply' (κ : kernel α β) (hf : Measurable f) (a : α) {s : Set γ}
#align probability_theory.kernel.map_apply' ProbabilityTheory.kernel.map_apply'
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
+ (hg : Measurable g') : ∫⁻ b, g' b ∂map κ f hf a = ∫⁻ a, g' (f a) ∂κ a := by
rw [map_apply _ hf, lintegral_map hg hf]
#align probability_theory.kernel.lintegral_map ProbabilityTheory.kernel.lintegral_map
@@ -620,7 +620,7 @@ theorem comap_apply' (κ : kernel α β) (hg : Measurable g) (c : γ) (s : Set
#align probability_theory.kernel.comap_apply' ProbabilityTheory.kernel.comap_apply'
theorem lintegral_comap (κ : kernel α β) (hg : Measurable g) (c : γ) (g' : β → ℝ≥0∞) :
- (∫⁻ b, g' b ∂comap κ g hg c) = ∫⁻ b, g' b ∂κ (g c) :=
+ ∫⁻ b, g' b ∂comap κ g hg c = ∫⁻ b, g' b ∂κ (g c) :=
rfl
#align probability_theory.kernel.lintegral_comap ProbabilityTheory.kernel.lintegral_comap
@@ -676,7 +676,7 @@ theorem prodMkLeft_apply' (κ : kernel α β) (ca : γ × α) (s : Set β) :
#align probability_theory.kernel.prod_mk_left_apply' ProbabilityTheory.kernel.prodMkLeft_apply'
theorem lintegral_prodMkLeft (κ : kernel α β) (ca : γ × α) (g : β → ℝ≥0∞) :
- (∫⁻ b, g b ∂prodMkLeft γ κ ca) = ∫⁻ b, g b ∂κ ca.snd :=
+ ∫⁻ b, g b ∂prodMkLeft γ κ ca = ∫⁻ b, g b ∂κ ca.snd :=
rfl
#align probability_theory.kernel.lintegral_prod_mk_left ProbabilityTheory.kernel.lintegral_prodMkLeft
@@ -707,7 +707,7 @@ theorem swapLeft_apply' (κ : kernel (α × β) γ) (a : β × α) (s : Set γ)
#align probability_theory.kernel.swap_left_apply' ProbabilityTheory.kernel.swapLeft_apply'
theorem lintegral_swapLeft (κ : kernel (α × β) γ) (a : β × α) (g : γ → ℝ≥0∞) :
- (∫⁻ c, g c ∂swapLeft κ a) = ∫⁻ c, g c ∂κ a.symm := by
+ ∫⁻ c, g c ∂swapLeft κ a = ∫⁻ c, g c ∂κ a.symm := by
rw [swap_left, lintegral_comap _ measurable_swap a]
#align probability_theory.kernel.lintegral_swap_left ProbabilityTheory.kernel.lintegral_swapLeft
@@ -738,7 +738,7 @@ theorem swapRight_apply' (κ : kernel α (β × γ)) (a : α) {s : Set (γ × β
#align probability_theory.kernel.swap_right_apply' ProbabilityTheory.kernel.swapRight_apply'
theorem lintegral_swapRight (κ : kernel α (β × γ)) (a : α) {g : γ × β → ℝ≥0∞} (hg : Measurable g) :
- (∫⁻ c, g c ∂swapRight κ a) = ∫⁻ bc : β × γ, g bc.symm ∂κ a := by
+ ∫⁻ c, g c ∂swapRight κ a = ∫⁻ bc : β × γ, g bc.symm ∂κ a := by
rw [swap_right, lintegral_map _ measurable_swap a hg]
#align probability_theory.kernel.lintegral_swap_right ProbabilityTheory.kernel.lintegral_swapRight
@@ -768,7 +768,7 @@ theorem fst_apply' (κ : kernel α (β × γ)) (a : α) {s : Set β} (hs : Measu
#align probability_theory.kernel.fst_apply' ProbabilityTheory.kernel.fst_apply'
theorem lintegral_fst (κ : kernel α (β × γ)) (a : α) {g : β → ℝ≥0∞} (hg : Measurable g) :
- (∫⁻ c, g c ∂fst κ a) = ∫⁻ bc : β × γ, g bc.fst ∂κ a := by
+ ∫⁻ c, g c ∂fst κ a = ∫⁻ bc : β × γ, g bc.fst ∂κ a := by
rw [fst, lintegral_map _ measurable_fst a hg]
#align probability_theory.kernel.lintegral_fst ProbabilityTheory.kernel.lintegral_fst
@@ -798,7 +798,7 @@ theorem snd_apply' (κ : kernel α (β × γ)) (a : α) {s : Set γ} (hs : Measu
#align probability_theory.kernel.snd_apply' ProbabilityTheory.kernel.snd_apply'
theorem lintegral_snd (κ : kernel α (β × γ)) (a : α) {g : γ → ℝ≥0∞} (hg : Measurable g) :
- (∫⁻ c, g c ∂snd κ a) = ∫⁻ bc : β × γ, g bc.snd ∂κ a := by
+ ∫⁻ c, g c ∂snd κ a = ∫⁻ bc : β × γ, g bc.snd ∂κ a := by
rw [snd, lintegral_map _ measurable_snd a hg]
#align probability_theory.kernel.lintegral_snd ProbabilityTheory.kernel.lintegral_snd
@@ -854,7 +854,7 @@ theorem comp_eq_snd_compProd (η : kernel β γ) [IsSFiniteKernel η] (κ : kern
#align probability_theory.kernel.comp_eq_snd_comp_prod ProbabilityTheory.kernel.comp_eq_snd_compProd
theorem lintegral_comp (η : kernel β γ) (κ : kernel α β) (a : α) {g : γ → ℝ≥0∞}
- (hg : Measurable g) : (∫⁻ c, g c ∂(η ∘ₖ κ) a) = ∫⁻ b, ∫⁻ c, g c ∂η b ∂κ a := by
+ (hg : Measurable g) : ∫⁻ c, g c ∂(η ∘ₖ κ) a = ∫⁻ b, ∫⁻ c, g c ∂η b ∂κ a := by
rw [comp_apply, measure.lintegral_bind (kernel.measurable _) hg]
#align probability_theory.kernel.lintegral_comp ProbabilityTheory.kernel.lintegral_comp
@@ -923,7 +923,7 @@ theorem prod_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ)
theorem lintegral_prod (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsSFiniteKernel η]
(a : α) {g : β × γ → ℝ≥0∞} (hg : Measurable g) :
- (∫⁻ c, g c ∂(κ ×ₖ η) a) = ∫⁻ b, ∫⁻ c, g (b, c) ∂η a ∂κ a := by
+ ∫⁻ c, g c ∂(κ ×ₖ η) a = ∫⁻ b, ∫⁻ c, g (b, c) ∂η a ∂κ a := by
simp_rw [Prod, lintegral_comp_prod _ _ _ hg, swap_left_apply, prod_mk_left_apply,
Prod.swap_prod_mk]
#align probability_theory.kernel.lintegral_prod ProbabilityTheory.kernel.lintegral_prod
mathlib commit https://github.com/leanprover-community/mathlib/commit/7e5137f579de09a059a5ce98f364a04e221aabf0
@@ -258,7 +258,6 @@ theorem le_compProd_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel
_ = (κ ⊗ₖ η) a (toMeasurable ((κ ⊗ₖ η) a) s) :=
(kernel.compProd_apply_eq_compProdFun κ η a (measurableSet_toMeasurable _ _)).symm
_ = (κ ⊗ₖ η) a s := measure_toMeasurable s
-
#align probability_theory.kernel.le_comp_prod_apply ProbabilityTheory.kernel.le_compProd_apply
section Ae
@@ -521,7 +520,6 @@ theorem compProd_apply_univ_le (κ : kernel α β) [IsSFiniteKernel κ] (η : ke
lintegral_mono fun b => measure_le_bound η (a, b) Set.univ
_ = Cη * κ a Set.univ := (MeasureTheory.lintegral_const Cη)
_ = κ a Set.univ * Cη := mul_comm _ _
-
#align probability_theory.kernel.comp_prod_apply_univ_le ProbabilityTheory.kernel.compProd_apply_univ_le
instance IsFiniteKernel.compProd (κ : kernel α β) [IsFiniteKernel κ] (η : kernel (α × β) γ)
@@ -531,8 +529,7 @@ instance IsFiniteKernel.compProd (κ : kernel α β) [IsFiniteKernel κ] (η : k
calc
(κ ⊗ₖ η) a Set.univ ≤ κ a Set.univ * IsFiniteKernel.bound η := compProd_apply_univ_le κ η a
_ ≤ IsFiniteKernel.bound κ * IsFiniteKernel.bound η :=
- mul_le_mul (measure_le_bound κ a Set.univ) le_rfl (zero_le _) (zero_le _)
- ⟩⟩
+ mul_le_mul (measure_le_bound κ a Set.univ) le_rfl (zero_le _) (zero_le _)⟩⟩
#align probability_theory.kernel.is_finite_kernel.comp_prod ProbabilityTheory.kernel.IsFiniteKernel.compProd
instance IsSFiniteKernel.compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
mathlib commit https://github.com/leanprover-community/mathlib/commit/31c24aa72e7b3e5ed97a8412470e904f82b81004
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
! This file was ported from Lean 3 source module probability.kernel.composition
-! leanprover-community/mathlib commit c0d694db494dd4f9aa57f2714b6e4c82b4ebc113
+! leanprover-community/mathlib commit 3b92d54a05ee592aa2c6181a4e76b1bb7cc45d0b
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -17,8 +17,8 @@ We define
* the composition-product `κ ⊗ₖ η` of two s-finite kernels `κ : kernel α β` and
`η : kernel (α × β) γ`, a kernel from `α` to `β × γ`.
* the map and comap of a kernel along a measurable function.
-* the composition `η ∘ₖ κ` of s-finite kernels `κ : kernel α β` and `η : kernel β γ`,
- a kernel from `α` to `γ`.
+* the composition `η ∘ₖ κ` of kernels `κ : kernel α β` and `η : kernel β γ`, kernel from `α` to
+ `γ`.
* the product `κ ×ₖ η` of s-finite kernels `κ : kernel α β` and `η : kernel α γ`,
a kernel from `α` to `β × γ`.
@@ -38,7 +38,7 @@ Kernels built from other kernels:
`∫⁻ c, g c ∂(map κ f hf a) = ∫⁻ b, g (f b) ∂(κ a)`
* `comap (κ : kernel α β) (f : γ → α) (hf : measurable f) : kernel γ β`
`∫⁻ b, g b ∂(comap κ f hf c) = ∫⁻ b, g b ∂(κ (f c))`
-* `comp (η : kernel β γ) (κ : kernel α β) : kernel α γ`: composition of 2 s-finite kernels.
+* `comp (η : kernel β γ) (κ : kernel α β) : kernel α γ`: composition of 2 kernels.
We define a notation `η ∘ₖ κ = comp η κ`.
`∫⁻ c, g c ∂((η ∘ₖ κ) a) = ∫⁻ b, ∫⁻ c, g c ∂(η b) ∂(κ a)`
* `prod (κ : kernel α β) (η : kernel α γ) : kernel α (β × γ)`: product of 2 s-finite kernels.
@@ -829,66 +829,71 @@ variable {γ : Type _} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α
include mγ
/-- Composition of two s-finite kernels. -/
-noncomputable def comp (η : kernel β γ) [IsSFiniteKernel η] (κ : kernel α β) [IsSFiniteKernel κ] :
- kernel α γ :=
- snd (κ ⊗ₖ prodMkLeft α η)
+noncomputable def comp (η : kernel β γ) (κ : kernel α β) : kernel α γ
+ where
+ val a := (κ a).bind η
+ property := (Measure.measurable_bind' (kernel.measurable _)).comp (kernel.measurable _)
#align probability_theory.kernel.comp ProbabilityTheory.kernel.comp
-- mathport name: kernel.comp
scoped[ProbabilityTheory] infixl:100 " ∘ₖ " => ProbabilityTheory.kernel.comp
-theorem comp_apply (η : kernel β γ) [IsSFiniteKernel η] (κ : kernel α β) [IsSFiniteKernel κ] (a : α)
- {s : Set γ} (hs : MeasurableSet s) : (η ∘ₖ κ) a s = ∫⁻ b, η b s ∂κ a :=
+theorem comp_apply (η : kernel β γ) (κ : kernel α β) (a : α) : (η ∘ₖ κ) a = (κ a).bind η :=
+ rfl
+#align probability_theory.kernel.comp_apply ProbabilityTheory.kernel.comp_apply
+
+theorem comp_apply' (η : kernel β γ) (κ : kernel α β) (a : α) {s : Set γ} (hs : MeasurableSet s) :
+ (η ∘ₖ κ) a s = ∫⁻ b, η b s ∂κ a := by
+ rw [comp_apply, measure.bind_apply hs (kernel.measurable _)]
+#align probability_theory.kernel.comp_apply' ProbabilityTheory.kernel.comp_apply'
+
+theorem comp_eq_snd_compProd (η : kernel β γ) [IsSFiniteKernel η] (κ : kernel α β)
+ [IsSFiniteKernel κ] : η ∘ₖ κ = snd (κ ⊗ₖ prodMkLeft α η) :=
by
- rw [comp, snd_apply' _ _ hs, comp_prod_apply]
+ ext (a s hs) : 2
+ rw [comp_apply' _ _ _ hs, snd_apply' _ _ hs, comp_prod_apply]
swap; · exact measurable_snd hs
simp only [Set.mem_setOf_eq, Set.setOf_mem_eq, prod_mk_left_apply' _ _ s]
-#align probability_theory.kernel.comp_apply ProbabilityTheory.kernel.comp_apply
+#align probability_theory.kernel.comp_eq_snd_comp_prod ProbabilityTheory.kernel.comp_eq_snd_compProd
-theorem lintegral_comp (η : kernel β γ) [IsSFiniteKernel η] (κ : kernel α β) [IsSFiniteKernel κ]
- (a : α) {g : γ → ℝ≥0∞} (hg : Measurable g) :
- (∫⁻ c, g c ∂(η ∘ₖ κ) a) = ∫⁻ b, ∫⁻ c, g c ∂η b ∂κ a :=
- by
- rw [comp, lintegral_snd _ _ hg]
- change
- (∫⁻ bc, (fun a b => g b) bc.fst bc.snd ∂(κ ⊗ₖ prod_mk_left α η) a) = ∫⁻ b, ∫⁻ c, g c ∂η b ∂κ a
- exact lintegral_comp_prod _ _ _ (hg.comp measurable_snd)
+theorem lintegral_comp (η : kernel β γ) (κ : kernel α β) (a : α) {g : γ → ℝ≥0∞}
+ (hg : Measurable g) : (∫⁻ c, g c ∂(η ∘ₖ κ) a) = ∫⁻ b, ∫⁻ c, g c ∂η b ∂κ a := by
+ rw [comp_apply, measure.lintegral_bind (kernel.measurable _) hg]
#align probability_theory.kernel.lintegral_comp ProbabilityTheory.kernel.lintegral_comp
instance IsMarkovKernel.comp (η : kernel β γ) [IsMarkovKernel η] (κ : kernel α β)
- [IsMarkovKernel κ] : IsMarkovKernel (η ∘ₖ κ) := by rw [comp]; infer_instance
+ [IsMarkovKernel κ] : IsMarkovKernel (η ∘ₖ κ) := by rw [comp_eq_snd_comp_prod]; infer_instance
#align probability_theory.kernel.is_markov_kernel.comp ProbabilityTheory.kernel.IsMarkovKernel.comp
instance IsFiniteKernel.comp (η : kernel β γ) [IsFiniteKernel η] (κ : kernel α β)
- [IsFiniteKernel κ] : IsFiniteKernel (η ∘ₖ κ) := by rw [comp]; infer_instance
+ [IsFiniteKernel κ] : IsFiniteKernel (η ∘ₖ κ) := by rw [comp_eq_snd_comp_prod]; infer_instance
#align probability_theory.kernel.is_finite_kernel.comp ProbabilityTheory.kernel.IsFiniteKernel.comp
instance IsSFiniteKernel.comp (η : kernel β γ) [IsSFiniteKernel η] (κ : kernel α β)
- [IsSFiniteKernel κ] : IsSFiniteKernel (η ∘ₖ κ) := by rw [comp]; infer_instance
+ [IsSFiniteKernel κ] : IsSFiniteKernel (η ∘ₖ κ) := by rw [comp_eq_snd_comp_prod]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.comp ProbabilityTheory.kernel.IsSFiniteKernel.comp
/-- Composition of kernels is associative. -/
theorem comp_assoc {δ : Type _} {mδ : MeasurableSpace δ} (ξ : kernel γ δ) [IsSFiniteKernel ξ]
- (η : kernel β γ) [IsSFiniteKernel η] (κ : kernel α β) [IsSFiniteKernel κ] :
- ξ ∘ₖ η ∘ₖ κ = ξ ∘ₖ (η ∘ₖ κ) :=
+ (η : kernel β γ) (κ : kernel α β) : ξ ∘ₖ η ∘ₖ κ = ξ ∘ₖ (η ∘ₖ κ) :=
by
refine' ext_fun fun a f hf => _
simp_rw [lintegral_comp _ _ _ hf, lintegral_comp _ _ _ hf.lintegral_kernel]
#align probability_theory.kernel.comp_assoc ProbabilityTheory.kernel.comp_assoc
-theorem deterministic_comp_eq_map (hf : Measurable f) (κ : kernel α β) [IsSFiniteKernel κ] :
+theorem deterministic_comp_eq_map (hf : Measurable f) (κ : kernel α β) :
deterministic f hf ∘ₖ κ = map κ f hf :=
by
ext (a s hs) : 2
- simp_rw [map_apply' _ _ _ hs, comp_apply _ _ _ hs, deterministic_apply' hf _ hs,
+ simp_rw [map_apply' _ _ _ hs, comp_apply' _ _ _ hs, deterministic_apply' hf _ hs,
lintegral_indicator_const_comp hf hs, one_mul]
#align probability_theory.kernel.deterministic_comp_eq_map ProbabilityTheory.kernel.deterministic_comp_eq_map
-theorem comp_deterministic_eq_comap (κ : kernel α β) [IsSFiniteKernel κ] (hg : Measurable g) :
+theorem comp_deterministic_eq_comap (κ : kernel α β) (hg : Measurable g) :
κ ∘ₖ deterministic g hg = comap κ g hg :=
by
ext (a s hs) : 2
- simp_rw [comap_apply' _ _ _ s, comp_apply _ _ _ hs, deterministic_apply hg a,
+ simp_rw [comap_apply' _ _ _ s, comp_apply' _ _ _ hs, deterministic_apply hg a,
lintegral_dirac' _ (kernel.measurable_coe κ hs)]
#align probability_theory.kernel.comp_deterministic_eq_comap ProbabilityTheory.kernel.comp_deterministic_eq_comap
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -94,7 +94,7 @@ set, and the composition-product of kernels is defined in `kernel.comp_prod` thr
`measure.of_measurable`. -/
noncomputable def compProdFun (κ : kernel α β) (η : kernel (α × β) γ) (a : α) (s : Set (β × γ)) :
ℝ≥0∞ :=
- ∫⁻ b, η (a, b) { c | (b, c) ∈ s } ∂κ a
+ ∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a
#align probability_theory.kernel.comp_prod_fun ProbabilityTheory.kernel.compProdFun
theorem compProdFun_empty (κ : kernel α β) (η : kernel (α × β) γ) (a : α) :
@@ -109,8 +109,8 @@ theorem compProdFun_iUnion (κ : kernel α β) (η : kernel (α × β) γ) [IsSF
compProdFun κ η a (⋃ i, f i) = ∑' i, compProdFun κ η a (f i) :=
by
have h_Union :
- (fun b => η (a, b) { c : γ | (b, c) ∈ ⋃ i, f i }) = fun b =>
- η (a, b) (⋃ i, { c : γ | (b, c) ∈ f i }) :=
+ (fun b => η (a, b) {c : γ | (b, c) ∈ ⋃ i, f i}) = fun b =>
+ η (a, b) (⋃ i, {c : γ | (b, c) ∈ f i}) :=
by
ext1 b
congr with c
@@ -118,8 +118,8 @@ theorem compProdFun_iUnion (κ : kernel α β) (η : kernel (α × β) γ) [IsSF
rfl
rw [comp_prod_fun, h_Union]
have h_tsum :
- (fun b => η (a, b) (⋃ i, { c : γ | (b, c) ∈ f i })) = fun b =>
- ∑' i, η (a, b) { c : γ | (b, c) ∈ f i } :=
+ (fun b => η (a, b) (⋃ i, {c : γ | (b, c) ∈ f i})) = fun b =>
+ ∑' i, η (a, b) {c : γ | (b, c) ∈ f i} :=
by
ext1 b
rw [measure_Union]
@@ -132,7 +132,7 @@ theorem compProdFun_iUnion (κ : kernel α β) (η : kernel (α × β) γ) [IsSF
rw [h_tsum, lintegral_tsum]
· rfl
· intro i
- have hm : MeasurableSet { p : (α × β) × γ | (p.1.2, p.2) ∈ f i } :=
+ have hm : MeasurableSet {p : (α × β) × γ | (p.1.2, p.2) ∈ f i} :=
measurable_fst.snd.prod_mk measurable_snd (hf_meas i)
exact ((measurable_kernel_prod_mk_left hm).comp measurable_prod_mk_left).AEMeasurable
#align probability_theory.kernel.comp_prod_fun_Union ProbabilityTheory.kernel.compProdFun_iUnion
@@ -142,8 +142,8 @@ theorem compProdFun_tsum_right (κ : kernel α β) (η : kernel (α × β) γ) [
by
simp_rw [comp_prod_fun, (measure_sum_seq η _).symm]
have :
- (∫⁻ b, measure.sum (fun n => seq η n (a, b)) { c : γ | (b, c) ∈ s } ∂κ a) =
- ∫⁻ b, ∑' n, seq η n (a, b) { c : γ | (b, c) ∈ s } ∂κ a :=
+ (∫⁻ b, measure.sum (fun n => seq η n (a, b)) {c : γ | (b, c) ∈ s} ∂κ a) =
+ ∫⁻ b, ∑' n, seq η n (a, b) {c : γ | (b, c) ∈ s} ∂κ a :=
by
congr
ext1 b
@@ -172,11 +172,11 @@ theorem measurable_compProdFun_of_finite (κ : kernel α β) [IsFiniteKernel κ]
[IsFiniteKernel η] (hs : MeasurableSet s) : Measurable fun a => compProdFun κ η a s :=
by
simp only [comp_prod_fun]
- have h_meas : Measurable (Function.uncurry fun a b => η (a, b) { c : γ | (b, c) ∈ s }) :=
+ have h_meas : Measurable (Function.uncurry fun a b => η (a, b) {c : γ | (b, c) ∈ s}) :=
by
have :
- (Function.uncurry fun a b => η (a, b) { c : γ | (b, c) ∈ s }) = fun p =>
- η p { c : γ | (p.2, c) ∈ s } :=
+ (Function.uncurry fun a b => η (a, b) {c : γ | (b, c) ∈ s}) = fun p =>
+ η p {c : γ | (p.2, c) ∈ s} :=
by
ext1 p
have hp_eq_mk : p = (p.fst, p.snd) := prod.mk.eta.symm
@@ -192,11 +192,11 @@ theorem measurable_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : ke
simp_rw [comp_prod_fun_tsum_right κ η _ hs]
refine' Measurable.ennreal_tsum fun n => _
simp only [comp_prod_fun]
- have h_meas : Measurable (Function.uncurry fun a b => seq η n (a, b) { c : γ | (b, c) ∈ s }) :=
+ have h_meas : Measurable (Function.uncurry fun a b => seq η n (a, b) {c : γ | (b, c) ∈ s}) :=
by
have :
- (Function.uncurry fun a b => seq η n (a, b) { c : γ | (b, c) ∈ s }) = fun p =>
- seq η n p { c : γ | (p.2, c) ∈ s } :=
+ (Function.uncurry fun a b => seq η n (a, b) {c : γ | (b, c) ∈ s}) = fun p =>
+ seq η n p {c : γ | (p.2, c) ∈ s} :=
by
ext1 p
have hp_eq_mk : p = (p.fst, p.snd) := prod.mk.eta.symm
@@ -237,23 +237,23 @@ theorem compProd_apply_eq_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (
change
measure.of_measurable (fun s hs => comp_prod_fun κ η a s) (comp_prod_fun_empty κ η a)
(comp_prod_fun_Union κ η a) s =
- ∫⁻ b, η (a, b) { c | (b, c) ∈ s } ∂κ a
+ ∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a
rw [measure.of_measurable_apply _ hs]
rfl
#align probability_theory.kernel.comp_prod_apply_eq_comp_prod_fun ProbabilityTheory.kernel.compProd_apply_eq_compProdFun
theorem compProd_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
- (κ ⊗ₖ η) a s = ∫⁻ b, η (a, b) { c | (b, c) ∈ s } ∂κ a :=
+ (κ ⊗ₖ η) a s = ∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a :=
compProd_apply_eq_compProdFun κ η a hs
#align probability_theory.kernel.comp_prod_apply ProbabilityTheory.kernel.compProd_apply
theorem le_compProd_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) (s : Set (β × γ)) :
- (∫⁻ b, η (a, b) { c | (b, c) ∈ s } ∂κ a) ≤ (κ ⊗ₖ η) a s :=
+ (∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a) ≤ (κ ⊗ₖ η) a s :=
calc
- (∫⁻ b, η (a, b) { c | (b, c) ∈ s } ∂κ a) ≤
- ∫⁻ b, η (a, b) { c | (b, c) ∈ toMeasurable ((κ ⊗ₖ η) a) s } ∂κ a :=
+ (∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a) ≤
+ ∫⁻ b, η (a, b) {c | (b, c) ∈ toMeasurable ((κ ⊗ₖ η) a) s} ∂κ a :=
lintegral_mono fun b => measure_mono fun _ h_mem => subset_toMeasurable _ _ h_mem
_ = (κ ⊗ₖ η) a (toMeasurable ((κ ⊗ₖ η) a) s) :=
(kernel.compProd_apply_eq_compProdFun κ η a (measurableSet_toMeasurable _ _)).symm
@@ -280,7 +280,7 @@ theorem ae_kernel_lt_top (a : α) (h2s : (κ ⊗ₖ η) a s ≠ ∞) :
by
rw [kernel.comp_prod_apply _ _ _ ht] at h2t
exact ae_lt_top (kernel.measurable_kernel_prod_mk_left' ht a) h2t
- filter_upwards [ht_lt_top]with b hb
+ filter_upwards [ht_lt_top] with b hb
exact (this b).trans_lt hb
#align probability_theory.kernel.ae_kernel_lt_top ProbabilityTheory.kernel.ae_kernel_lt_top
@@ -325,16 +325,16 @@ theorem compProd_restrict {s : Set β} {t : Set γ} (hs : MeasurableSet s) (ht :
Set.prod_mk_mem_set_prod_eq]
have :
∀ b,
- η (a, b) { c : γ | (b, c) ∈ u ∧ b ∈ s ∧ c ∈ t } =
- s.indicator (fun b => η (a, b) ({ c : γ | (b, c) ∈ u } ∩ t)) b :=
+ η (a, b) {c : γ | (b, c) ∈ u ∧ b ∈ s ∧ c ∈ t} =
+ s.indicator (fun b => η (a, b) ({c : γ | (b, c) ∈ u} ∩ t)) b :=
by
intro b
classical
- rw [Set.indicator_apply]
- split_ifs with h
- · simp only [h, true_and_iff]
- rfl
- · simp only [h, false_and_iff, and_false_iff, Set.setOf_false, measure_empty]
+ rw [Set.indicator_apply]
+ split_ifs with h
+ · simp only [h, true_and_iff]
+ rfl
+ · simp only [h, false_and_iff, and_false_iff, Set.setOf_false, measure_empty]
simp_rw [this]
rw [lintegral_indicator _ hs]
#align probability_theory.kernel.comp_prod_restrict ProbabilityTheory.kernel.compProd_restrict
@@ -441,7 +441,7 @@ theorem lintegral_comp_prod₀ (κ : kernel α β) [IsSFiniteKernel κ] (η : ke
have B : (∫⁻ x, ∫⁻ y, f (x, y) ∂η (a, x) ∂κ a) = ∫⁻ x, ∫⁻ y, hf.mk f (x, y) ∂η (a, x) ∂κ a :=
by
apply lintegral_congr_ae
- filter_upwards [ae_ae_of_ae_comp_prod hf.ae_eq_mk]with _ ha using lintegral_congr_ae ha
+ filter_upwards [ae_ae_of_ae_comp_prod hf.ae_eq_mk] with _ ha using lintegral_congr_ae ha
rw [A, B, lintegral_comp_prod]
exact hf.measurable_mk
#align probability_theory.kernel.lintegral_comp_prod₀ ProbabilityTheory.kernel.lintegral_comp_prod₀
@@ -736,7 +736,7 @@ theorem swapRight_apply (κ : kernel α (β × γ)) (a : α) : swapRight κ a =
#align probability_theory.kernel.swap_right_apply ProbabilityTheory.kernel.swapRight_apply
theorem swapRight_apply' (κ : kernel α (β × γ)) (a : α) {s : Set (γ × β)} (hs : MeasurableSet s) :
- swapRight κ a s = κ a { p | p.symm ∈ s } := by
+ swapRight κ a s = κ a {p | p.symm ∈ s} := by
rw [swap_right_apply, measure.map_apply measurable_swap hs]; rfl
#align probability_theory.kernel.swap_right_apply' ProbabilityTheory.kernel.swapRight_apply'
@@ -767,7 +767,7 @@ theorem fst_apply (κ : kernel α (β × γ)) (a : α) : fst κ a = (κ a).map P
#align probability_theory.kernel.fst_apply ProbabilityTheory.kernel.fst_apply
theorem fst_apply' (κ : kernel α (β × γ)) (a : α) {s : Set β} (hs : MeasurableSet s) :
- fst κ a s = κ a { p | p.1 ∈ s } := by rw [fst_apply, measure.map_apply measurable_fst hs]; rfl
+ fst κ a s = κ a {p | p.1 ∈ s} := by rw [fst_apply, measure.map_apply measurable_fst hs]; rfl
#align probability_theory.kernel.fst_apply' ProbabilityTheory.kernel.fst_apply'
theorem lintegral_fst (κ : kernel α (β × γ)) (a : α) {g : β → ℝ≥0∞} (hg : Measurable g) :
@@ -797,7 +797,7 @@ theorem snd_apply (κ : kernel α (β × γ)) (a : α) : snd κ a = (κ a).map P
#align probability_theory.kernel.snd_apply ProbabilityTheory.kernel.snd_apply
theorem snd_apply' (κ : kernel α (β × γ)) (a : α) {s : Set γ} (hs : MeasurableSet s) :
- snd κ a s = κ a { p | p.2 ∈ s } := by rw [snd_apply, measure.map_apply measurable_snd hs]; rfl
+ snd κ a s = κ a {p | p.2 ∈ s} := by rw [snd_apply, measure.map_apply measurable_snd hs]; rfl
#align probability_theory.kernel.snd_apply' ProbabilityTheory.kernel.snd_apply'
theorem lintegral_snd (κ : kernel α (β × γ)) (a : α) {g : γ → ℝ≥0∞} (hg : Measurable g) :
@@ -914,7 +914,7 @@ scoped[ProbabilityTheory] infixl:100 " ×ₖ " => ProbabilityTheory.kernel.prod
theorem prod_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsSFiniteKernel η] (a : α)
{s : Set (β × γ)} (hs : MeasurableSet s) :
- (κ ×ₖ η) a s = ∫⁻ b : β, (η a) { c : γ | (b, c) ∈ s } ∂κ a := by
+ (κ ×ₖ η) a s = ∫⁻ b : β, (η a) {c : γ | (b, c) ∈ s} ∂κ a := by
simp_rw [Prod, comp_prod_apply _ _ _ hs, swap_left_apply _ _, prod_mk_left_apply,
Prod.swap_prod_mk]
#align probability_theory.kernel.prod_apply ProbabilityTheory.kernel.prod_apply
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -278,7 +278,7 @@ theorem ae_kernel_lt_top (a : α) (h2s : (κ ⊗ₖ η) a s ≠ ∞) :
have h2t : (κ ⊗ₖ η) a t ≠ ∞ := by rwa [measure_to_measurable]
have ht_lt_top : ∀ᵐ b ∂κ a, η (a, b) (Prod.mk b ⁻¹' t) < ∞ :=
by
- rw [kernel.comp_prod_apply _ _ _ ht] at h2t
+ rw [kernel.comp_prod_apply _ _ _ ht] at h2t
exact ae_lt_top (kernel.measurable_kernel_prod_mk_left' ht a) h2t
filter_upwards [ht_lt_top]with b hb
exact (this b).trans_lt hb
@@ -296,7 +296,7 @@ theorem ae_null_of_compProd_null (h : (κ ⊗ₖ η) a s = 0) :
(fun b => η (a, b) (Prod.mk b ⁻¹' s)) =ᵐ[κ a] 0 :=
by
obtain ⟨t, hst, mt, ht⟩ := exists_measurable_superset_of_null h
- simp_rw [comp_prod_null a mt] at ht
+ simp_rw [comp_prod_null a mt] at ht
rw [Filter.eventuallyLE_antisymm_iff]
exact
⟨Filter.EventuallyLE.trans_eq
@@ -341,12 +341,12 @@ theorem compProd_restrict {s : Set β} {t : Set γ} (hs : MeasurableSet s) (ht :
theorem compProd_restrict_left {s : Set β} (hs : MeasurableSet s) :
kernel.restrict κ hs ⊗ₖ η = kernel.restrict (κ ⊗ₖ η) (hs.Prod MeasurableSet.univ) := by
- rw [← comp_prod_restrict]; congr ; exact kernel.restrict_univ.symm
+ rw [← comp_prod_restrict]; congr; exact kernel.restrict_univ.symm
#align probability_theory.kernel.comp_prod_restrict_left ProbabilityTheory.kernel.compProd_restrict_left
theorem compProd_restrict_right {t : Set γ} (ht : MeasurableSet t) :
κ ⊗ₖ kernel.restrict η ht = kernel.restrict (κ ⊗ₖ η) (MeasurableSet.univ.Prod ht) := by
- rw [← comp_prod_restrict]; congr ; exact kernel.restrict_univ.symm
+ rw [← comp_prod_restrict]; congr; exact kernel.restrict_univ.symm
#align probability_theory.kernel.comp_prod_restrict_right ProbabilityTheory.kernel.compProd_restrict_right
end Restrict
@@ -364,7 +364,7 @@ theorem lintegral_comp_prod' (κ : kernel α β) [IsSFiniteKernel κ] (η : kern
let F : ℕ → simple_func (β × γ) ℝ≥0∞ := simple_func.eapprox (Function.uncurry f)
have h : ∀ a, (⨆ n, F n a) = Function.uncurry f a :=
simple_func.supr_eapprox_apply (Function.uncurry f) hf
- simp only [Prod.forall, Function.uncurry_apply_pair] at h
+ simp only [Prod.forall, Function.uncurry_apply_pair] at h
simp_rw [← h, Prod.mk.eta]
have h_mono : Monotone F := fun i j hij b =>
simple_func.monotone_eapprox (Function.uncurry f) hij _
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -64,7 +64,7 @@ Kernels built from other kernels:
open MeasureTheory
-open ENNReal
+open scoped ENNReal
namespace ProbabilityTheory
@@ -656,7 +656,7 @@ instance IsSFiniteKernel.comap (κ : kernel α β) [IsSFiniteKernel κ] (hg : Me
end MapComap
-open ProbabilityTheory
+open scoped ProbabilityTheory
section FstSnd
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -124,12 +124,8 @@ theorem compProdFun_iUnion (κ : kernel α β) (η : kernel (α × β) γ) [IsSF
ext1 b
rw [measure_Union]
· intro i j hij s hsi hsj c hcs
- have hbci : {(b, c)} ⊆ f i := by
- rw [Set.singleton_subset_iff]
- exact hsi hcs
- have hbcj : {(b, c)} ⊆ f j := by
- rw [Set.singleton_subset_iff]
- exact hsj hcs
+ have hbci : {(b, c)} ⊆ f i := by rw [Set.singleton_subset_iff]; exact hsi hcs
+ have hbcj : {(b, c)} ⊆ f j := by rw [Set.singleton_subset_iff]; exact hsj hcs
simpa only [Set.bot_eq_empty, Set.le_eq_subset, Set.singleton_subset_iff,
Set.mem_empty_iff_false] using hf_disj hij hbci hbcj
· exact fun i => (@measurable_prod_mk_left β γ _ _ b) _ (hf_meas i)
@@ -226,9 +222,7 @@ noncomputable def compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel
measure.of_measurable (fun s hs => comp_prod_fun κ η a s) (comp_prod_fun_empty κ η a)
(comp_prod_fun_Union κ η a) s) =
fun a => comp_prod_fun κ η a s :=
- by
- ext1 a
- rwa [measure.of_measurable_apply]
+ by ext1 a; rwa [measure.of_measurable_apply]
rw [this]
exact measurable_comp_prod_fun κ η hs
#align probability_theory.kernel.comp_prod ProbabilityTheory.kernel.compProd
@@ -346,19 +340,13 @@ theorem compProd_restrict {s : Set β} {t : Set γ} (hs : MeasurableSet s) (ht :
#align probability_theory.kernel.comp_prod_restrict ProbabilityTheory.kernel.compProd_restrict
theorem compProd_restrict_left {s : Set β} (hs : MeasurableSet s) :
- kernel.restrict κ hs ⊗ₖ η = kernel.restrict (κ ⊗ₖ η) (hs.Prod MeasurableSet.univ) :=
- by
- rw [← comp_prod_restrict]
- congr
- exact kernel.restrict_univ.symm
+ kernel.restrict κ hs ⊗ₖ η = kernel.restrict (κ ⊗ₖ η) (hs.Prod MeasurableSet.univ) := by
+ rw [← comp_prod_restrict]; congr ; exact kernel.restrict_univ.symm
#align probability_theory.kernel.comp_prod_restrict_left ProbabilityTheory.kernel.compProd_restrict_left
theorem compProd_restrict_right {t : Set γ} (ht : MeasurableSet t) :
- κ ⊗ₖ kernel.restrict η ht = kernel.restrict (κ ⊗ₖ η) (MeasurableSet.univ.Prod ht) :=
- by
- rw [← comp_prod_restrict]
- congr
- exact kernel.restrict_univ.symm
+ κ ⊗ₖ kernel.restrict η ht = kernel.restrict (κ ⊗ₖ η) (MeasurableSet.univ.Prod ht) := by
+ rw [← comp_prod_restrict]; congr ; exact kernel.restrict_univ.symm
#align probability_theory.kernel.comp_prod_restrict_right ProbabilityTheory.kernel.compProd_restrict_right
end Restrict
@@ -395,9 +383,7 @@ theorem lintegral_comp_prod' (κ : kernel α β) [IsSFiniteKernel κ] (η : kern
have :
(fun b => ∫⁻ c, f' (b, c) ∂η (a, b)) =
(fun ab => ∫⁻ c, f' (ab.2, c) ∂η ab) ∘ fun b => (a, b) :=
- by
- ext1 ab
- rfl
+ by ext1 ab; rfl
rw [this]
refine' Measurable.comp _ measurable_prod_mk_left
exact
@@ -414,7 +400,7 @@ theorem lintegral_comp_prod' (κ : kernel α β) [IsSFiniteKernel κ] (η : kern
simp only [simple_func.const_zero, simple_func.coe_piecewise, simple_func.coe_const,
simple_func.coe_zero, Set.piecewise_eq_indicator, lintegral_indicator_const hs]
rw [comp_prod_apply κ η _ hs, ← lintegral_const_mul c _]
- swap
+ swap;
·
exact
(measurable_kernel_prod_mk_left ((measurable_fst.snd.prod_mk measurable_snd) hs)).comp
@@ -429,8 +415,7 @@ theorem lintegral_comp_prod' (κ : kernel α β) [IsSFiniteKernel κ] (η : kern
(∫⁻ x, (f : β × γ → ℝ≥0∞) x + f' x ∂(κ ⊗ₖ η) a) =
∫⁻ b, ∫⁻ c : γ, f (b, c) + f' (b, c) ∂η (a, b) ∂κ a
rw [lintegral_add_left (simple_func.measurable _), hf_eq, hf'_eq, ← lintegral_add_left]
- swap
- · exact h_some_meas_integral f
+ swap; · exact h_some_meas_integral f
congr with b
rw [← lintegral_add_left ((simple_func.measurable _).comp measurable_prod_mk_left)]
#align probability_theory.kernel.lintegral_comp_prod' ProbabilityTheory.kernel.lintegral_comp_prod'
@@ -444,8 +429,7 @@ theorem lintegral_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel
change (∫⁻ bc, f bc ∂(κ ⊗ₖ η) a) = ∫⁻ b, ∫⁻ c, g b c ∂η (a, b) ∂κ a
rw [← lintegral_comp_prod']
· simp_rw [g, Function.curry_apply, Prod.mk.eta]
- · simp_rw [g, Function.uncurry_curry]
- exact hf
+ · simp_rw [g, Function.uncurry_curry]; exact hf
#align probability_theory.kernel.lintegral_comp_prod ProbabilityTheory.kernel.lintegral_compProd
/-- Lebesgue integral against the composition-product of two kernels. -/
@@ -492,18 +476,13 @@ end Lintegral
/- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (n m) -/
theorem compProd_eq_tsum_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
- (κ ⊗ₖ η) a s = ∑' (n : ℕ) (m : ℕ), (seq κ n ⊗ₖ seq η m) a s :=
- by
- simp_rw [comp_prod_apply_eq_comp_prod_fun _ _ _ hs]
- exact comp_prod_fun_eq_tsum κ η a hs
+ (κ ⊗ₖ η) a s = ∑' (n : ℕ) (m : ℕ), (seq κ n ⊗ₖ seq η m) a s := by
+ simp_rw [comp_prod_apply_eq_comp_prod_fun _ _ _ hs]; exact comp_prod_fun_eq_tsum κ η a hs
#align probability_theory.kernel.comp_prod_eq_tsum_comp_prod ProbabilityTheory.kernel.compProd_eq_tsum_compProd
theorem compProd_eq_sum_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
- [IsSFiniteKernel η] : κ ⊗ₖ η = kernel.sum fun n => kernel.sum fun m => seq κ n ⊗ₖ seq η m :=
- by
- ext (a s hs) : 2
- simp_rw [kernel.sum_apply' _ a hs]
- rw [comp_prod_eq_tsum_comp_prod κ η a hs]
+ [IsSFiniteKernel η] : κ ⊗ₖ η = kernel.sum fun n => kernel.sum fun m => seq κ n ⊗ₖ seq η m := by
+ ext (a s hs) : 2; simp_rw [kernel.sum_apply' _ a hs]; rw [comp_prod_eq_tsum_comp_prod κ η a hs]
#align probability_theory.kernel.comp_prod_eq_sum_comp_prod ProbabilityTheory.kernel.compProd_eq_sum_compProd
theorem compProd_eq_sum_compProd_left (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
@@ -705,21 +684,15 @@ theorem lintegral_prodMkLeft (κ : kernel α β) (ca : γ × α) (g : β → ℝ
#align probability_theory.kernel.lintegral_prod_mk_left ProbabilityTheory.kernel.lintegral_prodMkLeft
instance IsMarkovKernel.prodMkLeft (κ : kernel α β) [IsMarkovKernel κ] :
- IsMarkovKernel (prodMkLeft γ κ) := by
- rw [prod_mk_left]
- infer_instance
+ IsMarkovKernel (prodMkLeft γ κ) := by rw [prod_mk_left]; infer_instance
#align probability_theory.kernel.is_markov_kernel.prod_mk_left ProbabilityTheory.kernel.IsMarkovKernel.prodMkLeft
instance IsFiniteKernel.prodMkLeft (κ : kernel α β) [IsFiniteKernel κ] :
- IsFiniteKernel (prodMkLeft γ κ) := by
- rw [prod_mk_left]
- infer_instance
+ IsFiniteKernel (prodMkLeft γ κ) := by rw [prod_mk_left]; infer_instance
#align probability_theory.kernel.is_finite_kernel.prod_mk_left ProbabilityTheory.kernel.IsFiniteKernel.prodMkLeft
instance IsSFiniteKernel.prodMkLeft (κ : kernel α β) [IsSFiniteKernel κ] :
- IsSFiniteKernel (prodMkLeft γ κ) := by
- rw [prod_mk_left]
- infer_instance
+ IsSFiniteKernel (prodMkLeft γ κ) := by rw [prod_mk_left]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.prod_mk_left ProbabilityTheory.kernel.IsSFiniteKernel.prodMkLeft
/-- Define a `kernel (β × α) γ` from a `kernel (α × β) γ` by taking the comap of `prod.swap`. -/
@@ -742,21 +715,15 @@ theorem lintegral_swapLeft (κ : kernel (α × β) γ) (a : β × α) (g : γ
#align probability_theory.kernel.lintegral_swap_left ProbabilityTheory.kernel.lintegral_swapLeft
instance IsMarkovKernel.swapLeft (κ : kernel (α × β) γ) [IsMarkovKernel κ] :
- IsMarkovKernel (swapLeft κ) := by
- rw [swap_left]
- infer_instance
+ IsMarkovKernel (swapLeft κ) := by rw [swap_left]; infer_instance
#align probability_theory.kernel.is_markov_kernel.swap_left ProbabilityTheory.kernel.IsMarkovKernel.swapLeft
instance IsFiniteKernel.swapLeft (κ : kernel (α × β) γ) [IsFiniteKernel κ] :
- IsFiniteKernel (swapLeft κ) := by
- rw [swap_left]
- infer_instance
+ IsFiniteKernel (swapLeft κ) := by rw [swap_left]; infer_instance
#align probability_theory.kernel.is_finite_kernel.swap_left ProbabilityTheory.kernel.IsFiniteKernel.swapLeft
instance IsSFiniteKernel.swapLeft (κ : kernel (α × β) γ) [IsSFiniteKernel κ] :
- IsSFiniteKernel (swapLeft κ) := by
- rw [swap_left]
- infer_instance
+ IsSFiniteKernel (swapLeft κ) := by rw [swap_left]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.swap_left ProbabilityTheory.kernel.IsSFiniteKernel.swapLeft
/-- Define a `kernel α (γ × β)` from a `kernel α (β × γ)` by taking the map of `prod.swap`. -/
@@ -769,10 +736,8 @@ theorem swapRight_apply (κ : kernel α (β × γ)) (a : α) : swapRight κ a =
#align probability_theory.kernel.swap_right_apply ProbabilityTheory.kernel.swapRight_apply
theorem swapRight_apply' (κ : kernel α (β × γ)) (a : α) {s : Set (γ × β)} (hs : MeasurableSet s) :
- swapRight κ a s = κ a { p | p.symm ∈ s } :=
- by
- rw [swap_right_apply, measure.map_apply measurable_swap hs]
- rfl
+ swapRight κ a s = κ a { p | p.symm ∈ s } := by
+ rw [swap_right_apply, measure.map_apply measurable_swap hs]; rfl
#align probability_theory.kernel.swap_right_apply' ProbabilityTheory.kernel.swapRight_apply'
theorem lintegral_swapRight (κ : kernel α (β × γ)) (a : α) {g : γ × β → ℝ≥0∞} (hg : Measurable g) :
@@ -781,21 +746,15 @@ theorem lintegral_swapRight (κ : kernel α (β × γ)) (a : α) {g : γ × β
#align probability_theory.kernel.lintegral_swap_right ProbabilityTheory.kernel.lintegral_swapRight
instance IsMarkovKernel.swapRight (κ : kernel α (β × γ)) [IsMarkovKernel κ] :
- IsMarkovKernel (swapRight κ) := by
- rw [swap_right]
- infer_instance
+ IsMarkovKernel (swapRight κ) := by rw [swap_right]; infer_instance
#align probability_theory.kernel.is_markov_kernel.swap_right ProbabilityTheory.kernel.IsMarkovKernel.swapRight
instance IsFiniteKernel.swapRight (κ : kernel α (β × γ)) [IsFiniteKernel κ] :
- IsFiniteKernel (swapRight κ) := by
- rw [swap_right]
- infer_instance
+ IsFiniteKernel (swapRight κ) := by rw [swap_right]; infer_instance
#align probability_theory.kernel.is_finite_kernel.swap_right ProbabilityTheory.kernel.IsFiniteKernel.swapRight
instance IsSFiniteKernel.swapRight (κ : kernel α (β × γ)) [IsSFiniteKernel κ] :
- IsSFiniteKernel (swapRight κ) := by
- rw [swap_right]
- infer_instance
+ IsSFiniteKernel (swapRight κ) := by rw [swap_right]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.swap_right ProbabilityTheory.kernel.IsSFiniteKernel.swapRight
/-- Define a `kernel α β` from a `kernel α (β × γ)` by taking the map of the first projection. -/
@@ -808,10 +767,7 @@ theorem fst_apply (κ : kernel α (β × γ)) (a : α) : fst κ a = (κ a).map P
#align probability_theory.kernel.fst_apply ProbabilityTheory.kernel.fst_apply
theorem fst_apply' (κ : kernel α (β × γ)) (a : α) {s : Set β} (hs : MeasurableSet s) :
- fst κ a s = κ a { p | p.1 ∈ s } :=
- by
- rw [fst_apply, measure.map_apply measurable_fst hs]
- rfl
+ fst κ a s = κ a { p | p.1 ∈ s } := by rw [fst_apply, measure.map_apply measurable_fst hs]; rfl
#align probability_theory.kernel.fst_apply' ProbabilityTheory.kernel.fst_apply'
theorem lintegral_fst (κ : kernel α (β × γ)) (a : α) {g : β → ℝ≥0∞} (hg : Measurable g) :
@@ -819,22 +775,16 @@ theorem lintegral_fst (κ : kernel α (β × γ)) (a : α) {g : β → ℝ≥0
rw [fst, lintegral_map _ measurable_fst a hg]
#align probability_theory.kernel.lintegral_fst ProbabilityTheory.kernel.lintegral_fst
-instance IsMarkovKernel.fst (κ : kernel α (β × γ)) [IsMarkovKernel κ] : IsMarkovKernel (fst κ) :=
- by
- rw [fst]
- infer_instance
+instance IsMarkovKernel.fst (κ : kernel α (β × γ)) [IsMarkovKernel κ] : IsMarkovKernel (fst κ) := by
+ rw [fst]; infer_instance
#align probability_theory.kernel.is_markov_kernel.fst ProbabilityTheory.kernel.IsMarkovKernel.fst
-instance IsFiniteKernel.fst (κ : kernel α (β × γ)) [IsFiniteKernel κ] : IsFiniteKernel (fst κ) :=
- by
- rw [fst]
- infer_instance
+instance IsFiniteKernel.fst (κ : kernel α (β × γ)) [IsFiniteKernel κ] : IsFiniteKernel (fst κ) := by
+ rw [fst]; infer_instance
#align probability_theory.kernel.is_finite_kernel.fst ProbabilityTheory.kernel.IsFiniteKernel.fst
instance IsSFiniteKernel.fst (κ : kernel α (β × γ)) [IsSFiniteKernel κ] : IsSFiniteKernel (fst κ) :=
- by
- rw [fst]
- infer_instance
+ by rw [fst]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.fst ProbabilityTheory.kernel.IsSFiniteKernel.fst
/-- Define a `kernel α γ` from a `kernel α (β × γ)` by taking the map of the second projection. -/
@@ -847,10 +797,7 @@ theorem snd_apply (κ : kernel α (β × γ)) (a : α) : snd κ a = (κ a).map P
#align probability_theory.kernel.snd_apply ProbabilityTheory.kernel.snd_apply
theorem snd_apply' (κ : kernel α (β × γ)) (a : α) {s : Set γ} (hs : MeasurableSet s) :
- snd κ a s = κ a { p | p.2 ∈ s } :=
- by
- rw [snd_apply, measure.map_apply measurable_snd hs]
- rfl
+ snd κ a s = κ a { p | p.2 ∈ s } := by rw [snd_apply, measure.map_apply measurable_snd hs]; rfl
#align probability_theory.kernel.snd_apply' ProbabilityTheory.kernel.snd_apply'
theorem lintegral_snd (κ : kernel α (β × γ)) (a : α) {g : γ → ℝ≥0∞} (hg : Measurable g) :
@@ -858,22 +805,16 @@ theorem lintegral_snd (κ : kernel α (β × γ)) (a : α) {g : γ → ℝ≥0
rw [snd, lintegral_map _ measurable_snd a hg]
#align probability_theory.kernel.lintegral_snd ProbabilityTheory.kernel.lintegral_snd
-instance IsMarkovKernel.snd (κ : kernel α (β × γ)) [IsMarkovKernel κ] : IsMarkovKernel (snd κ) :=
- by
- rw [snd]
- infer_instance
+instance IsMarkovKernel.snd (κ : kernel α (β × γ)) [IsMarkovKernel κ] : IsMarkovKernel (snd κ) := by
+ rw [snd]; infer_instance
#align probability_theory.kernel.is_markov_kernel.snd ProbabilityTheory.kernel.IsMarkovKernel.snd
-instance IsFiniteKernel.snd (κ : kernel α (β × γ)) [IsFiniteKernel κ] : IsFiniteKernel (snd κ) :=
- by
- rw [snd]
- infer_instance
+instance IsFiniteKernel.snd (κ : kernel α (β × γ)) [IsFiniteKernel κ] : IsFiniteKernel (snd κ) := by
+ rw [snd]; infer_instance
#align probability_theory.kernel.is_finite_kernel.snd ProbabilityTheory.kernel.IsFiniteKernel.snd
instance IsSFiniteKernel.snd (κ : kernel α (β × γ)) [IsSFiniteKernel κ] : IsSFiniteKernel (snd κ) :=
- by
- rw [snd]
- infer_instance
+ by rw [snd]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.snd ProbabilityTheory.kernel.IsSFiniteKernel.snd
end FstSnd
@@ -915,24 +856,15 @@ theorem lintegral_comp (η : kernel β γ) [IsSFiniteKernel η] (κ : kernel α
#align probability_theory.kernel.lintegral_comp ProbabilityTheory.kernel.lintegral_comp
instance IsMarkovKernel.comp (η : kernel β γ) [IsMarkovKernel η] (κ : kernel α β)
- [IsMarkovKernel κ] : IsMarkovKernel (η ∘ₖ κ) :=
- by
- rw [comp]
- infer_instance
+ [IsMarkovKernel κ] : IsMarkovKernel (η ∘ₖ κ) := by rw [comp]; infer_instance
#align probability_theory.kernel.is_markov_kernel.comp ProbabilityTheory.kernel.IsMarkovKernel.comp
instance IsFiniteKernel.comp (η : kernel β γ) [IsFiniteKernel η] (κ : kernel α β)
- [IsFiniteKernel κ] : IsFiniteKernel (η ∘ₖ κ) :=
- by
- rw [comp]
- infer_instance
+ [IsFiniteKernel κ] : IsFiniteKernel (η ∘ₖ κ) := by rw [comp]; infer_instance
#align probability_theory.kernel.is_finite_kernel.comp ProbabilityTheory.kernel.IsFiniteKernel.comp
instance IsSFiniteKernel.comp (η : kernel β γ) [IsSFiniteKernel η] (κ : kernel α β)
- [IsSFiniteKernel κ] : IsSFiniteKernel (η ∘ₖ κ) :=
- by
- rw [comp]
- infer_instance
+ [IsSFiniteKernel κ] : IsSFiniteKernel (η ∘ₖ κ) := by rw [comp]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.comp ProbabilityTheory.kernel.IsSFiniteKernel.comp
/-- Composition of kernels is associative. -/
@@ -995,24 +927,15 @@ theorem lintegral_prod (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α
#align probability_theory.kernel.lintegral_prod ProbabilityTheory.kernel.lintegral_prod
instance IsMarkovKernel.prod (κ : kernel α β) [IsMarkovKernel κ] (η : kernel α γ)
- [IsMarkovKernel η] : IsMarkovKernel (κ ×ₖ η) :=
- by
- rw [Prod]
- infer_instance
+ [IsMarkovKernel η] : IsMarkovKernel (κ ×ₖ η) := by rw [Prod]; infer_instance
#align probability_theory.kernel.is_markov_kernel.prod ProbabilityTheory.kernel.IsMarkovKernel.prod
instance IsFiniteKernel.prod (κ : kernel α β) [IsFiniteKernel κ] (η : kernel α γ)
- [IsFiniteKernel η] : IsFiniteKernel (κ ×ₖ η) :=
- by
- rw [Prod]
- infer_instance
+ [IsFiniteKernel η] : IsFiniteKernel (κ ×ₖ η) := by rw [Prod]; infer_instance
#align probability_theory.kernel.is_finite_kernel.prod ProbabilityTheory.kernel.IsFiniteKernel.prod
instance IsSFiniteKernel.prod (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ)
- [IsSFiniteKernel η] : IsSFiniteKernel (κ ×ₖ η) :=
- by
- rw [Prod]
- infer_instance
+ [IsSFiniteKernel η] : IsSFiniteKernel (κ ×ₖ η) := by rw [Prod]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.prod ProbabilityTheory.kernel.IsSFiniteKernel.prod
end Prod
mathlib commit https://github.com/leanprover-community/mathlib/commit/8d33f09cd7089ecf074b4791907588245aec5d1b
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
! This file was ported from Lean 3 source module probability.kernel.composition
-! leanprover-community/mathlib commit 28b2a92f2996d28e580450863c130955de0ed398
+! leanprover-community/mathlib commit c0d694db494dd4f9aa57f2714b6e4c82b4ebc113
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -254,6 +254,120 @@ theorem compProd_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α
compProd_apply_eq_compProdFun κ η a hs
#align probability_theory.kernel.comp_prod_apply ProbabilityTheory.kernel.compProd_apply
+theorem le_compProd_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
+ [IsSFiniteKernel η] (a : α) (s : Set (β × γ)) :
+ (∫⁻ b, η (a, b) { c | (b, c) ∈ s } ∂κ a) ≤ (κ ⊗ₖ η) a s :=
+ calc
+ (∫⁻ b, η (a, b) { c | (b, c) ∈ s } ∂κ a) ≤
+ ∫⁻ b, η (a, b) { c | (b, c) ∈ toMeasurable ((κ ⊗ₖ η) a) s } ∂κ a :=
+ lintegral_mono fun b => measure_mono fun _ h_mem => subset_toMeasurable _ _ h_mem
+ _ = (κ ⊗ₖ η) a (toMeasurable ((κ ⊗ₖ η) a) s) :=
+ (kernel.compProd_apply_eq_compProdFun κ η a (measurableSet_toMeasurable _ _)).symm
+ _ = (κ ⊗ₖ η) a s := measure_toMeasurable s
+
+#align probability_theory.kernel.le_comp_prod_apply ProbabilityTheory.kernel.le_compProd_apply
+
+section Ae
+
+/-! ### `ae` filter of the composition-product -/
+
+
+variable {κ : kernel α β} [IsSFiniteKernel κ] {η : kernel (α × β) γ} [IsSFiniteKernel η] {a : α}
+
+theorem ae_kernel_lt_top (a : α) (h2s : (κ ⊗ₖ η) a s ≠ ∞) :
+ ∀ᵐ b ∂κ a, η (a, b) (Prod.mk b ⁻¹' s) < ∞ :=
+ by
+ let t := to_measurable ((κ ⊗ₖ η) a) s
+ have : ∀ b : β, η (a, b) (Prod.mk b ⁻¹' s) ≤ η (a, b) (Prod.mk b ⁻¹' t) := fun b =>
+ measure_mono (Set.preimage_mono (subset_to_measurable _ _))
+ have ht : MeasurableSet t := measurable_set_to_measurable _ _
+ have h2t : (κ ⊗ₖ η) a t ≠ ∞ := by rwa [measure_to_measurable]
+ have ht_lt_top : ∀ᵐ b ∂κ a, η (a, b) (Prod.mk b ⁻¹' t) < ∞ :=
+ by
+ rw [kernel.comp_prod_apply _ _ _ ht] at h2t
+ exact ae_lt_top (kernel.measurable_kernel_prod_mk_left' ht a) h2t
+ filter_upwards [ht_lt_top]with b hb
+ exact (this b).trans_lt hb
+#align probability_theory.kernel.ae_kernel_lt_top ProbabilityTheory.kernel.ae_kernel_lt_top
+
+theorem compProd_null (a : α) (hs : MeasurableSet s) :
+ (κ ⊗ₖ η) a s = 0 ↔ (fun b => η (a, b) (Prod.mk b ⁻¹' s)) =ᵐ[κ a] 0 :=
+ by
+ rw [kernel.comp_prod_apply _ _ _ hs, lintegral_eq_zero_iff]
+ · rfl
+ · exact kernel.measurable_kernel_prod_mk_left' hs a
+#align probability_theory.kernel.comp_prod_null ProbabilityTheory.kernel.compProd_null
+
+theorem ae_null_of_compProd_null (h : (κ ⊗ₖ η) a s = 0) :
+ (fun b => η (a, b) (Prod.mk b ⁻¹' s)) =ᵐ[κ a] 0 :=
+ by
+ obtain ⟨t, hst, mt, ht⟩ := exists_measurable_superset_of_null h
+ simp_rw [comp_prod_null a mt] at ht
+ rw [Filter.eventuallyLE_antisymm_iff]
+ exact
+ ⟨Filter.EventuallyLE.trans_eq
+ (Filter.eventually_of_forall fun x => (measure_mono (Set.preimage_mono hst) : _)) ht,
+ Filter.eventually_of_forall fun x => zero_le _⟩
+#align probability_theory.kernel.ae_null_of_comp_prod_null ProbabilityTheory.kernel.ae_null_of_compProd_null
+
+theorem ae_ae_of_ae_compProd {p : β × γ → Prop} (h : ∀ᵐ bc ∂(κ ⊗ₖ η) a, p bc) :
+ ∀ᵐ b ∂κ a, ∀ᵐ c ∂η (a, b), p (b, c) :=
+ ae_null_of_compProd_null h
+#align probability_theory.kernel.ae_ae_of_ae_comp_prod ProbabilityTheory.kernel.ae_ae_of_ae_compProd
+
+end Ae
+
+section Restrict
+
+variable {κ : kernel α β} [IsSFiniteKernel κ] {η : kernel (α × β) γ} [IsSFiniteKernel η] {a : α}
+
+theorem compProd_restrict {s : Set β} {t : Set γ} (hs : MeasurableSet s) (ht : MeasurableSet t) :
+ kernel.restrict κ hs ⊗ₖ kernel.restrict η ht = kernel.restrict (κ ⊗ₖ η) (hs.Prod ht) :=
+ by
+ ext (a u hu) : 2
+ rw [comp_prod_apply _ _ _ hu, restrict_apply' _ _ _ hu,
+ comp_prod_apply _ _ _ (hu.inter (hs.prod ht))]
+ simp only [kernel.restrict_apply, measure.restrict_apply' ht, Set.mem_inter_iff,
+ Set.prod_mk_mem_set_prod_eq]
+ have :
+ ∀ b,
+ η (a, b) { c : γ | (b, c) ∈ u ∧ b ∈ s ∧ c ∈ t } =
+ s.indicator (fun b => η (a, b) ({ c : γ | (b, c) ∈ u } ∩ t)) b :=
+ by
+ intro b
+ classical
+ rw [Set.indicator_apply]
+ split_ifs with h
+ · simp only [h, true_and_iff]
+ rfl
+ · simp only [h, false_and_iff, and_false_iff, Set.setOf_false, measure_empty]
+ simp_rw [this]
+ rw [lintegral_indicator _ hs]
+#align probability_theory.kernel.comp_prod_restrict ProbabilityTheory.kernel.compProd_restrict
+
+theorem compProd_restrict_left {s : Set β} (hs : MeasurableSet s) :
+ kernel.restrict κ hs ⊗ₖ η = kernel.restrict (κ ⊗ₖ η) (hs.Prod MeasurableSet.univ) :=
+ by
+ rw [← comp_prod_restrict]
+ congr
+ exact kernel.restrict_univ.symm
+#align probability_theory.kernel.comp_prod_restrict_left ProbabilityTheory.kernel.compProd_restrict_left
+
+theorem compProd_restrict_right {t : Set γ} (ht : MeasurableSet t) :
+ κ ⊗ₖ kernel.restrict η ht = kernel.restrict (κ ⊗ₖ η) (MeasurableSet.univ.Prod ht) :=
+ by
+ rw [← comp_prod_restrict]
+ congr
+ exact kernel.restrict_univ.symm
+#align probability_theory.kernel.comp_prod_restrict_right ProbabilityTheory.kernel.compProd_restrict_right
+
+end Restrict
+
+section Lintegral
+
+/-! ### Lebesgue integral -/
+
+
/-- Lebesgue integral against the composition-product of two kernels. -/
theorem lintegral_comp_prod' (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) {f : β → γ → ℝ≥0∞} (hf : Measurable (Function.uncurry f)) :
@@ -334,6 +448,47 @@ theorem lintegral_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel
exact hf
#align probability_theory.kernel.lintegral_comp_prod ProbabilityTheory.kernel.lintegral_compProd
+/-- Lebesgue integral against the composition-product of two kernels. -/
+theorem lintegral_comp_prod₀ (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
+ [IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : AEMeasurable f ((κ ⊗ₖ η) a)) :
+ (∫⁻ z, f z ∂(κ ⊗ₖ η) a) = ∫⁻ x, ∫⁻ y, f (x, y) ∂η (a, x) ∂κ a :=
+ by
+ have A : (∫⁻ z, f z ∂(κ ⊗ₖ η) a) = ∫⁻ z, hf.mk f z ∂(κ ⊗ₖ η) a := lintegral_congr_ae hf.ae_eq_mk
+ have B : (∫⁻ x, ∫⁻ y, f (x, y) ∂η (a, x) ∂κ a) = ∫⁻ x, ∫⁻ y, hf.mk f (x, y) ∂η (a, x) ∂κ a :=
+ by
+ apply lintegral_congr_ae
+ filter_upwards [ae_ae_of_ae_comp_prod hf.ae_eq_mk]with _ ha using lintegral_congr_ae ha
+ rw [A, B, lintegral_comp_prod]
+ exact hf.measurable_mk
+#align probability_theory.kernel.lintegral_comp_prod₀ ProbabilityTheory.kernel.lintegral_comp_prod₀
+
+/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+theorem set_lintegral_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
+ [IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f) {s : Set β} {t : Set γ}
+ (hs : MeasurableSet s) (ht : MeasurableSet t) :
+ (∫⁻ z in s ×ˢ t, f z ∂(κ ⊗ₖ η) a) = ∫⁻ x in s, ∫⁻ y in t, f (x, y) ∂η (a, x) ∂κ a := by
+ simp_rw [← kernel.restrict_apply (κ ⊗ₖ η) (hs.prod ht), ← comp_prod_restrict,
+ lintegral_comp_prod _ _ _ hf, kernel.restrict_apply]
+#align probability_theory.kernel.set_lintegral_comp_prod ProbabilityTheory.kernel.set_lintegral_compProd
+
+/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+theorem set_lintegral_compProd_univ_right (κ : kernel α β) [IsSFiniteKernel κ]
+ (η : kernel (α × β) γ) [IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f)
+ {s : Set β} (hs : MeasurableSet s) :
+ (∫⁻ z in s ×ˢ Set.univ, f z ∂(κ ⊗ₖ η) a) = ∫⁻ x in s, ∫⁻ y, f (x, y) ∂η (a, x) ∂κ a := by
+ simp_rw [set_lintegral_comp_prod κ η a hf hs MeasurableSet.univ, measure.restrict_univ]
+#align probability_theory.kernel.set_lintegral_comp_prod_univ_right ProbabilityTheory.kernel.set_lintegral_compProd_univ_right
+
+/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+theorem set_lintegral_compProd_univ_left (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
+ [IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f) {t : Set γ}
+ (ht : MeasurableSet t) :
+ (∫⁻ z in Set.univ ×ˢ t, f z ∂(κ ⊗ₖ η) a) = ∫⁻ x, ∫⁻ y in t, f (x, y) ∂η (a, x) ∂κ a := by
+ simp_rw [set_lintegral_comp_prod κ η a hf MeasurableSet.univ ht, measure.restrict_univ]
+#align probability_theory.kernel.set_lintegral_comp_prod_univ_left ProbabilityTheory.kernel.set_lintegral_compProd_univ_left
+
+end Lintegral
+
/- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (n m) -/
theorem compProd_eq_tsum_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/33c67ae661dd8988516ff7f247b0be3018cdd952
@@ -194,7 +194,7 @@ theorem measurable_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : ke
[IsSFiniteKernel η] (hs : MeasurableSet s) : Measurable fun a => compProdFun κ η a s :=
by
simp_rw [comp_prod_fun_tsum_right κ η _ hs]
- refine' Measurable.eNNReal_tsum fun n => _
+ refine' Measurable.ennreal_tsum fun n => _
simp only [comp_prod_fun]
have h_meas : Measurable (Function.uncurry fun a b => seq η n (a, b) { c : γ | (b, c) ∈ s }) :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/e3fb84046afd187b710170887195d50bada934ee
@@ -103,7 +103,7 @@ theorem compProdFun_empty (κ : kernel α β) (η : kernel (α × β) γ) (a :
MeasureTheory.lintegral_const, MulZeroClass.zero_mul]
#align probability_theory.kernel.comp_prod_fun_empty ProbabilityTheory.kernel.compProdFun_empty
-theorem compProdFun_unionᵢ (κ : kernel α β) (η : kernel (α × β) γ) [IsSFiniteKernel η] (a : α)
+theorem compProdFun_iUnion (κ : kernel α β) (η : kernel (α × β) γ) [IsSFiniteKernel η] (a : α)
(f : ℕ → Set (β × γ)) (hf_meas : ∀ i, MeasurableSet (f i))
(hf_disj : Pairwise (Disjoint on f)) :
compProdFun κ η a (⋃ i, f i) = ∑' i, compProdFun κ η a (f i) :=
@@ -114,7 +114,7 @@ theorem compProdFun_unionᵢ (κ : kernel α β) (η : kernel (α × β) γ) [Is
by
ext1 b
congr with c
- simp only [Set.mem_unionᵢ, Set.supᵢ_eq_unionᵢ, Set.mem_setOf_eq]
+ simp only [Set.mem_iUnion, Set.iSup_eq_iUnion, Set.mem_setOf_eq]
rfl
rw [comp_prod_fun, h_Union]
have h_tsum :
@@ -139,7 +139,7 @@ theorem compProdFun_unionᵢ (κ : kernel α β) (η : kernel (α × β) γ) [Is
have hm : MeasurableSet { p : (α × β) × γ | (p.1.2, p.2) ∈ f i } :=
measurable_fst.snd.prod_mk measurable_snd (hf_meas i)
exact ((measurable_kernel_prod_mk_left hm).comp measurable_prod_mk_left).AEMeasurable
-#align probability_theory.kernel.comp_prod_fun_Union ProbabilityTheory.kernel.compProdFun_unionᵢ
+#align probability_theory.kernel.comp_prod_fun_Union ProbabilityTheory.kernel.compProdFun_iUnion
theorem compProdFun_tsum_right (κ : kernel α β) (η : kernel (α × β) γ) [IsSFiniteKernel η] (a : α)
(hs : MeasurableSet s) : compProdFun κ η a s = ∑' n, compProdFun κ (seq η n) a s :=
@@ -218,7 +218,7 @@ noncomputable def compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel
where
val a :=
Measure.ofMeasurable (fun s hs => compProdFun κ η a s) (compProdFun_empty κ η a)
- (compProdFun_unionᵢ κ η a)
+ (compProdFun_iUnion κ η a)
property := by
refine' measure.measurable_of_measurable_coe _ fun s hs => _
have :
mathlib commit https://github.com/leanprover-community/mathlib/commit/28b2a92f2996d28e580450863c130955de0ed398
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
! This file was ported from Lean 3 source module probability.kernel.composition
-! leanprover-community/mathlib commit a9545e8a564bac7f24637443f52ae955474e4991
+! leanprover-community/mathlib commit 28b2a92f2996d28e580450863c130955de0ed398
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -138,7 +138,7 @@ theorem compProdFun_unionᵢ (κ : kernel α β) (η : kernel (α × β) γ) [Is
· intro i
have hm : MeasurableSet { p : (α × β) × γ | (p.1.2, p.2) ∈ f i } :=
measurable_fst.snd.prod_mk measurable_snd (hf_meas i)
- exact ((measurable_prod_mk_mem η hm).comp measurable_prod_mk_left).AEMeasurable
+ exact ((measurable_kernel_prod_mk_left hm).comp measurable_prod_mk_left).AEMeasurable
#align probability_theory.kernel.comp_prod_fun_Union ProbabilityTheory.kernel.compProdFun_unionᵢ
theorem compProdFun_tsum_right (κ : kernel α β) (η : kernel (α × β) γ) [IsSFiniteKernel η] (a : α)
@@ -155,7 +155,7 @@ theorem compProdFun_tsum_right (κ : kernel α β) (η : kernel (α × β) γ) [
exact measurable_prod_mk_left hs
rw [this, lintegral_tsum fun n : ℕ => _]
exact
- ((measurable_prod_mk_mem (seq η n) ((measurable_fst.snd.prod_mk measurable_snd) hs)).comp
+ ((measurable_kernel_prod_mk_left ((measurable_fst.snd.prod_mk measurable_snd) hs)).comp
measurable_prod_mk_left).AEMeasurable
#align probability_theory.kernel.comp_prod_fun_tsum_right ProbabilityTheory.kernel.compProdFun_tsum_right
@@ -186,8 +186,8 @@ theorem measurable_compProdFun_of_finite (κ : kernel α β) [IsFiniteKernel κ]
have hp_eq_mk : p = (p.fst, p.snd) := prod.mk.eta.symm
rw [hp_eq_mk, Function.uncurry_apply_pair]
rw [this]
- exact measurable_prod_mk_mem η (measurable_fst.snd.prod_mk measurable_snd hs)
- exact measurable_lintegral κ h_meas
+ exact measurable_kernel_prod_mk_left (measurable_fst.snd.prod_mk measurable_snd hs)
+ exact h_meas.lintegral_kernel_prod_right
#align probability_theory.kernel.measurable_comp_prod_fun_of_finite ProbabilityTheory.kernel.measurable_compProdFun_of_finite
theorem measurable_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
@@ -206,8 +206,8 @@ theorem measurable_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : ke
have hp_eq_mk : p = (p.fst, p.snd) := prod.mk.eta.symm
rw [hp_eq_mk, Function.uncurry_apply_pair]
rw [this]
- exact measurable_prod_mk_mem (seq η n) (measurable_fst.snd.prod_mk measurable_snd hs)
- exact measurable_lintegral κ h_meas
+ exact measurable_kernel_prod_mk_left (measurable_fst.snd.prod_mk measurable_snd hs)
+ exact h_meas.lintegral_kernel_prod_right
#align probability_theory.kernel.measurable_comp_prod_fun ProbabilityTheory.kernel.measurable_compProdFun
/-- Composition-Product of kernels. It verifies
@@ -287,7 +287,7 @@ theorem lintegral_comp_prod' (κ : kernel α β) [IsSFiniteKernel κ] (η : kern
rw [this]
refine' Measurable.comp _ measurable_prod_mk_left
exact
- measurable_lintegral η
+ Measurable.lintegral_kernel_prod_right
((simple_func.measurable _).comp (measurable_fst.snd.prod_mk measurable_snd))
rw [lintegral_supr]
rotate_left
@@ -303,7 +303,7 @@ theorem lintegral_comp_prod' (κ : kernel α β) [IsSFiniteKernel κ] (η : kern
swap
·
exact
- (measurable_prod_mk_mem η ((measurable_fst.snd.prod_mk measurable_snd) hs)).comp
+ (measurable_kernel_prod_mk_left ((measurable_fst.snd.prod_mk measurable_snd) hs)).comp
measurable_prod_mk_left
congr
ext1 b
@@ -786,7 +786,7 @@ theorem comp_assoc {δ : Type _} {mδ : MeasurableSpace δ} (ξ : kernel γ δ)
ξ ∘ₖ η ∘ₖ κ = ξ ∘ₖ (η ∘ₖ κ) :=
by
refine' ext_fun fun a f hf => _
- simp_rw [lintegral_comp _ _ _ hf, lintegral_comp _ _ _ (measurable_lintegral' ξ hf)]
+ simp_rw [lintegral_comp _ _ _ hf, lintegral_comp _ _ _ hf.lintegral_kernel]
#align probability_theory.kernel.comp_assoc ProbabilityTheory.kernel.comp_assoc
theorem deterministic_comp_eq_map (hf : Measurable f) (κ : kernel α β) [IsSFiniteKernel κ] :
mathlib commit https://github.com/leanprover-community/mathlib/commit/d4437c68c8d350fc9d4e95e1e174409db35e30d7
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
! This file was ported from Lean 3 source module probability.kernel.composition
-! leanprover-community/mathlib commit 483dd86cfec4a1380d22b1f6acd4c3dc53f501ff
+! leanprover-community/mathlib commit a9545e8a564bac7f24637443f52ae955474e4991
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -100,7 +100,7 @@ noncomputable def compProdFun (κ : kernel α β) (η : kernel (α × β) γ) (a
theorem compProdFun_empty (κ : kernel α β) (η : kernel (α × β) γ) (a : α) :
compProdFun κ η a ∅ = 0 := by
simp only [comp_prod_fun, Set.mem_empty_iff_false, Set.setOf_false, measure_empty,
- lintegral_const, MulZeroClass.zero_mul]
+ MeasureTheory.lintegral_const, MulZeroClass.zero_mul]
#align probability_theory.kernel.comp_prod_fun_empty ProbabilityTheory.kernel.compProdFun_empty
theorem compProdFun_unionᵢ (κ : kernel α β) (η : kernel (α × β) γ) [IsSFiniteKernel η] (a : α)
@@ -385,7 +385,7 @@ theorem compProd_apply_univ_le (κ : kernel α β) [IsSFiniteKernel κ] (η : ke
calc
(∫⁻ b, η (a, b) Set.univ ∂κ a) ≤ ∫⁻ b, Cη ∂κ a :=
lintegral_mono fun b => measure_le_bound η (a, b) Set.univ
- _ = Cη * κ a Set.univ := (lintegral_const Cη)
+ _ = Cη * κ a Set.univ := (MeasureTheory.lintegral_const Cη)
_ = κ a Set.univ * Cη := mul_comm _ _
#align probability_theory.kernel.comp_prod_apply_univ_le ProbabilityTheory.kernel.compProd_apply_univ_le
mathlib commit https://github.com/leanprover-community/mathlib/commit/08e1d8d4d989df3a6df86f385e9053ec8a372cc1
@@ -4,11 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
! This file was ported from Lean 3 source module probability.kernel.composition
-! leanprover-community/mathlib commit caf83ba4dfbf4e2f28e1ae6a0780cbafc3d19d6f
+! leanprover-community/mathlib commit 483dd86cfec4a1380d22b1f6acd4c3dc53f501ff
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
-import Mathbin.Probability.Kernel.Basic
+import Mathbin.Probability.Kernel.MeasurableIntegral
/-!
# Product and composition of kernels
mathlib commit https://github.com/leanprover-community/mathlib/commit/738054fa93d43512da144ec45ce799d18fd44248
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
! This file was ported from Lean 3 source module probability.kernel.composition
-! leanprover-community/mathlib commit 15e02bcd7f0487553848c8fa2fe8f9db6b2c5284
+! leanprover-community/mathlib commit caf83ba4dfbf4e2f28e1ae6a0780cbafc3d19d6f
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -527,7 +527,7 @@ open ProbabilityTheory
section FstSnd
/-- Define a `kernel (γ × α) β` from a `kernel α β` by taking the comap of the projection. -/
-def prodMkLeft (κ : kernel α β) (γ : Type _) [MeasurableSpace γ] : kernel (γ × α) β :=
+def prodMkLeft (γ : Type _) [MeasurableSpace γ] (κ : kernel α β) : kernel (γ × α) β :=
comap κ Prod.snd measurable_snd
#align probability_theory.kernel.prod_mk_left ProbabilityTheory.kernel.prodMkLeft
@@ -535,34 +535,34 @@ variable {γ : Type _} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α
include mγ
-theorem prodMkLeft_apply (κ : kernel α β) (ca : γ × α) : prodMkLeft κ γ ca = κ ca.snd :=
+theorem prodMkLeft_apply (κ : kernel α β) (ca : γ × α) : prodMkLeft γ κ ca = κ ca.snd :=
rfl
#align probability_theory.kernel.prod_mk_left_apply ProbabilityTheory.kernel.prodMkLeft_apply
theorem prodMkLeft_apply' (κ : kernel α β) (ca : γ × α) (s : Set β) :
- prodMkLeft κ γ ca s = κ ca.snd s :=
+ prodMkLeft γ κ ca s = κ ca.snd s :=
rfl
#align probability_theory.kernel.prod_mk_left_apply' ProbabilityTheory.kernel.prodMkLeft_apply'
theorem lintegral_prodMkLeft (κ : kernel α β) (ca : γ × α) (g : β → ℝ≥0∞) :
- (∫⁻ b, g b ∂prodMkLeft κ γ ca) = ∫⁻ b, g b ∂κ ca.snd :=
+ (∫⁻ b, g b ∂prodMkLeft γ κ ca) = ∫⁻ b, g b ∂κ ca.snd :=
rfl
#align probability_theory.kernel.lintegral_prod_mk_left ProbabilityTheory.kernel.lintegral_prodMkLeft
instance IsMarkovKernel.prodMkLeft (κ : kernel α β) [IsMarkovKernel κ] :
- IsMarkovKernel (prodMkLeft κ γ) := by
+ IsMarkovKernel (prodMkLeft γ κ) := by
rw [prod_mk_left]
infer_instance
#align probability_theory.kernel.is_markov_kernel.prod_mk_left ProbabilityTheory.kernel.IsMarkovKernel.prodMkLeft
instance IsFiniteKernel.prodMkLeft (κ : kernel α β) [IsFiniteKernel κ] :
- IsFiniteKernel (prodMkLeft κ γ) := by
+ IsFiniteKernel (prodMkLeft γ κ) := by
rw [prod_mk_left]
infer_instance
#align probability_theory.kernel.is_finite_kernel.prod_mk_left ProbabilityTheory.kernel.IsFiniteKernel.prodMkLeft
instance IsSFiniteKernel.prodMkLeft (κ : kernel α β) [IsSFiniteKernel κ] :
- IsSFiniteKernel (prodMkLeft κ γ) := by
+ IsSFiniteKernel (prodMkLeft γ κ) := by
rw [prod_mk_left]
infer_instance
#align probability_theory.kernel.is_s_finite_kernel.prod_mk_left ProbabilityTheory.kernel.IsSFiniteKernel.prodMkLeft
@@ -735,7 +735,7 @@ include mγ
/-- Composition of two s-finite kernels. -/
noncomputable def comp (η : kernel β γ) [IsSFiniteKernel η] (κ : kernel α β) [IsSFiniteKernel κ] :
kernel α γ :=
- snd (κ ⊗ₖ prodMkLeft η α)
+ snd (κ ⊗ₖ prodMkLeft α η)
#align probability_theory.kernel.comp ProbabilityTheory.kernel.comp
-- mathport name: kernel.comp
@@ -755,7 +755,7 @@ theorem lintegral_comp (η : kernel β γ) [IsSFiniteKernel η] (κ : kernel α
by
rw [comp, lintegral_snd _ _ hg]
change
- (∫⁻ bc, (fun a b => g b) bc.fst bc.snd ∂(κ ⊗ₖ prod_mk_left η α) a) = ∫⁻ b, ∫⁻ c, g c ∂η b ∂κ a
+ (∫⁻ bc, (fun a b => g b) bc.fst bc.snd ∂(κ ⊗ₖ prod_mk_left α η) a) = ∫⁻ b, ∫⁻ c, g c ∂η b ∂κ a
exact lintegral_comp_prod _ _ _ (hg.comp measurable_snd)
#align probability_theory.kernel.lintegral_comp ProbabilityTheory.kernel.lintegral_comp
@@ -790,7 +790,7 @@ theorem comp_assoc {δ : Type _} {mδ : MeasurableSpace δ} (ξ : kernel γ δ)
#align probability_theory.kernel.comp_assoc ProbabilityTheory.kernel.comp_assoc
theorem deterministic_comp_eq_map (hf : Measurable f) (κ : kernel α β) [IsSFiniteKernel κ] :
- deterministic hf ∘ₖ κ = map κ f hf :=
+ deterministic f hf ∘ₖ κ = map κ f hf :=
by
ext (a s hs) : 2
simp_rw [map_apply' _ _ _ hs, comp_apply _ _ _ hs, deterministic_apply' hf _ hs,
@@ -798,7 +798,7 @@ theorem deterministic_comp_eq_map (hf : Measurable f) (κ : kernel α β) [IsSFi
#align probability_theory.kernel.deterministic_comp_eq_map ProbabilityTheory.kernel.deterministic_comp_eq_map
theorem comp_deterministic_eq_comap (κ : kernel α β) [IsSFiniteKernel κ] (hg : Measurable g) :
- κ ∘ₖ deterministic hg = comap κ g hg :=
+ κ ∘ₖ deterministic g hg = comap κ g hg :=
by
ext (a s hs) : 2
simp_rw [comap_apply' _ _ _ s, comp_apply _ _ _ hs, deterministic_apply hg a,
@@ -819,7 +819,7 @@ include mγ
/-- Product of two s-finite kernels. -/
noncomputable def prod (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsSFiniteKernel η] :
kernel α (β × γ) :=
- κ ⊗ₖ swapLeft (prodMkLeft η β)
+ κ ⊗ₖ swapLeft (prodMkLeft β η)
#align probability_theory.kernel.prod ProbabilityTheory.kernel.prod
-- mathport name: kernel.prod
mathlib commit https://github.com/leanprover-community/mathlib/commit/92c69b77c5a7dc0f7eeddb552508633305157caa
@@ -138,7 +138,7 @@ theorem compProdFun_unionᵢ (κ : kernel α β) (η : kernel (α × β) γ) [Is
· intro i
have hm : MeasurableSet { p : (α × β) × γ | (p.1.2, p.2) ∈ f i } :=
measurable_fst.snd.prod_mk measurable_snd (hf_meas i)
- exact ((measurable_prod_mk_mem η hm).comp measurable_prod_mk_left).AeMeasurable
+ exact ((measurable_prod_mk_mem η hm).comp measurable_prod_mk_left).AEMeasurable
#align probability_theory.kernel.comp_prod_fun_Union ProbabilityTheory.kernel.compProdFun_unionᵢ
theorem compProdFun_tsum_right (κ : kernel α β) (η : kernel (α × β) γ) [IsSFiniteKernel η] (a : α)
@@ -156,7 +156,7 @@ theorem compProdFun_tsum_right (κ : kernel α β) (η : kernel (α × β) γ) [
rw [this, lintegral_tsum fun n : ℕ => _]
exact
((measurable_prod_mk_mem (seq η n) ((measurable_fst.snd.prod_mk measurable_snd) hs)).comp
- measurable_prod_mk_left).AeMeasurable
+ measurable_prod_mk_left).AEMeasurable
#align probability_theory.kernel.comp_prod_fun_tsum_right ProbabilityTheory.kernel.compProdFun_tsum_right
theorem compProdFun_tsum_left (κ : kernel α β) (η : kernel (α × β) γ) [IsSFiniteKernel κ] (a : α)
mathlib commit https://github.com/leanprover-community/mathlib/commit/92c69b77c5a7dc0f7eeddb552508633305157caa
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
! This file was ported from Lean 3 source module probability.kernel.composition
-! leanprover-community/mathlib commit 97d1aa955750bd57a7eeef91de310e633881670b
+! leanprover-community/mathlib commit 15e02bcd7f0487553848c8fa2fe8f9db6b2c5284
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -19,7 +19,7 @@ We define
* the map and comap of a kernel along a measurable function.
* the composition `η ∘ₖ κ` of s-finite kernels `κ : kernel α β` and `η : kernel β γ`,
a kernel from `α` to `γ`.
-* the product `prod κ η` of s-finite kernels `κ : kernel α β` and `η : kernel α γ`,
+* the product `κ ×ₖ η` of s-finite kernels `κ : kernel α β` and `η : kernel α γ`,
a kernel from `α` to `β × γ`.
A note on names:
@@ -42,7 +42,7 @@ Kernels built from other kernels:
We define a notation `η ∘ₖ κ = comp η κ`.
`∫⁻ c, g c ∂((η ∘ₖ κ) a) = ∫⁻ b, ∫⁻ c, g c ∂(η b) ∂(κ a)`
* `prod (κ : kernel α β) (η : kernel α γ) : kernel α (β × γ)`: product of 2 s-finite kernels.
- `∫⁻ bc, f bc ∂(prod κ η a) = ∫⁻ b, ∫⁻ c, f (b, c) ∂(η a) ∂(κ a)`
+ `∫⁻ bc, f bc ∂((κ ×ₖ η) a) = ∫⁻ b, ∫⁻ c, f (b, c) ∂(η a) ∂(κ a)`
## Main statements
@@ -57,6 +57,7 @@ Kernels built from other kernels:
* `κ ⊗ₖ η = probability_theory.kernel.comp_prod κ η`
* `η ∘ₖ κ = probability_theory.kernel.comp η κ`
+* `κ ×ₖ η = probability_theory.kernel.prod κ η`
-/
@@ -821,36 +822,39 @@ noncomputable def prod (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α
κ ⊗ₖ swapLeft (prodMkLeft η β)
#align probability_theory.kernel.prod ProbabilityTheory.kernel.prod
+-- mathport name: kernel.prod
+scoped[ProbabilityTheory] infixl:100 " ×ₖ " => ProbabilityTheory.kernel.prod
+
theorem prod_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsSFiniteKernel η] (a : α)
{s : Set (β × γ)} (hs : MeasurableSet s) :
- (prod κ η) a s = ∫⁻ b : β, (η a) { c : γ | (b, c) ∈ s } ∂κ a := by
+ (κ ×ₖ η) a s = ∫⁻ b : β, (η a) { c : γ | (b, c) ∈ s } ∂κ a := by
simp_rw [Prod, comp_prod_apply _ _ _ hs, swap_left_apply _ _, prod_mk_left_apply,
Prod.swap_prod_mk]
#align probability_theory.kernel.prod_apply ProbabilityTheory.kernel.prod_apply
theorem lintegral_prod (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsSFiniteKernel η]
(a : α) {g : β × γ → ℝ≥0∞} (hg : Measurable g) :
- (∫⁻ c, g c ∂(prod κ η) a) = ∫⁻ b, ∫⁻ c, g (b, c) ∂η a ∂κ a := by
+ (∫⁻ c, g c ∂(κ ×ₖ η) a) = ∫⁻ b, ∫⁻ c, g (b, c) ∂η a ∂κ a := by
simp_rw [Prod, lintegral_comp_prod _ _ _ hg, swap_left_apply, prod_mk_left_apply,
Prod.swap_prod_mk]
#align probability_theory.kernel.lintegral_prod ProbabilityTheory.kernel.lintegral_prod
instance IsMarkovKernel.prod (κ : kernel α β) [IsMarkovKernel κ] (η : kernel α γ)
- [IsMarkovKernel η] : IsMarkovKernel (prod κ η) :=
+ [IsMarkovKernel η] : IsMarkovKernel (κ ×ₖ η) :=
by
rw [Prod]
infer_instance
#align probability_theory.kernel.is_markov_kernel.prod ProbabilityTheory.kernel.IsMarkovKernel.prod
instance IsFiniteKernel.prod (κ : kernel α β) [IsFiniteKernel κ] (η : kernel α γ)
- [IsFiniteKernel η] : IsFiniteKernel (prod κ η) :=
+ [IsFiniteKernel η] : IsFiniteKernel (κ ×ₖ η) :=
by
rw [Prod]
infer_instance
#align probability_theory.kernel.is_finite_kernel.prod ProbabilityTheory.kernel.IsFiniteKernel.prod
instance IsSFiniteKernel.prod (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ)
- [IsSFiniteKernel η] : IsSFiniteKernel (prod κ η) :=
+ [IsSFiniteKernel η] : IsSFiniteKernel (κ ×ₖ η) :=
by
rw [Prod]
infer_instance
mathlib commit https://github.com/leanprover-community/mathlib/commit/da3fc4a33ff6bc75f077f691dc94c217b8d41559
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
! This file was ported from Lean 3 source module probability.kernel.composition
-! leanprover-community/mathlib commit 3180fab693e2cee3bff62675571264cb8778b212
+! leanprover-community/mathlib commit 97d1aa955750bd57a7eeef91de310e633881670b
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -418,7 +418,7 @@ variable {γ : Type _} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α
include mγ
-/-- The pushforward of a kernel along a measurable function.
+/-- The pushforward of a kernel along a measurable function.
We include measurability in the assumptions instead of using junk values
to make sure that typeclass inference can infer that the `map` of a Markov kernel
is again a Markov kernel. -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -99,7 +99,7 @@ noncomputable def compProdFun (κ : kernel α β) (η : kernel (α × β) γ) (a
theorem compProdFun_empty (κ : kernel α β) (η : kernel (α × β) γ) (a : α) :
compProdFun κ η a ∅ = 0 := by
simp only [comp_prod_fun, Set.mem_empty_iff_false, Set.setOf_false, measure_empty,
- lintegral_const, zero_mul]
+ lintegral_const, MulZeroClass.zero_mul]
#align probability_theory.kernel.comp_prod_fun_empty ProbabilityTheory.kernel.compProdFun_empty
theorem compProdFun_unionᵢ (κ : kernel α β) (η : kernel (α × β) γ) [IsSFiniteKernel η] (a : α)
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -361,12 +361,14 @@ theorem compProd_restrict {s : Set β} {t : Set γ} (hs : MeasurableSet s) (ht :
theorem compProd_restrict_left {s : Set β} (hs : MeasurableSet s) :
kernel.restrict κ hs ⊗ₖ η = kernel.restrict (κ ⊗ₖ η) (hs.prod MeasurableSet.univ) := by
- rw [← compProd_restrict]; congr; exact kernel.restrict_univ.symm
+ rw [← compProd_restrict]
+ · congr; exact kernel.restrict_univ.symm
#align probability_theory.kernel.comp_prod_restrict_left ProbabilityTheory.kernel.compProd_restrict_left
theorem compProd_restrict_right {t : Set γ} (ht : MeasurableSet t) :
κ ⊗ₖ kernel.restrict η ht = kernel.restrict (κ ⊗ₖ η) (MeasurableSet.univ.prod ht) := by
- rw [← compProd_restrict]; congr; exact kernel.restrict_univ.symm
+ rw [← compProd_restrict]
+ · congr; exact kernel.restrict_univ.symm
#align probability_theory.kernel.comp_prod_restrict_right ProbabilityTheory.kernel.compProd_restrict_right
end Restrict
Let κ : kernel α (β × Ω)
be a finite kernel, where Ω
is a standard Borel space. Then if α
is countable or β
has a countably generated σ-algebra (for example if it is standard Borel), then there exists a kernel (α × β) Ω
called conditional kernel and denoted by condKernel κ
such that κ = fst κ ⊗ₖ condKernel κ
.
Properties of integrals involving condKernel
are collated in the file Integral.lean
.
The conditional kernel is unique (almost everywhere w.r.t. fst κ
): this is proved in the file Unique.lean
.
Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Rémy Degenne <remydegenne@gmail.com>
@@ -583,6 +583,25 @@ lemma compProd_add_right (μ : kernel α β) (κ η : kernel (α × β) γ)
rw [lintegral_add_left]
exact measurable_kernel_prod_mk_left' hs a
+lemma comapRight_compProd_id_prod {δ : Type*} {mδ : MeasurableSpace δ}
+ (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ) [IsSFiniteKernel η]
+ {f : δ → γ} (hf : MeasurableEmbedding f) :
+ comapRight (κ ⊗ₖ η) (MeasurableEmbedding.id.prod_mk hf) = κ ⊗ₖ (comapRight η hf) := by
+ ext a t ht
+ rw [comapRight_apply' _ _ _ ht, compProd_apply, compProd_apply _ _ _ ht]
+ swap; · exact (MeasurableEmbedding.id.prod_mk hf).measurableSet_image.mpr ht
+ refine lintegral_congr (fun b ↦ ?_)
+ simp only [id_eq, Set.mem_image, Prod.mk.injEq, Prod.exists]
+ rw [comapRight_apply']
+ swap; · exact measurable_prod_mk_left ht
+ congr with x
+ simp only [Set.mem_setOf_eq, Set.mem_image]
+ constructor
+ · rintro ⟨b', c, h, rfl, rfl⟩
+ exact ⟨c, h, rfl⟩
+ · rintro ⟨c, h, rfl⟩
+ exact ⟨b, c, h, rfl, rfl⟩
+
end CompositionProduct
section MapComap
@@ -542,7 +542,7 @@ theorem compProd_apply_univ_le (κ : kernel α β) (η : kernel (α × β) γ) [
calc
∫⁻ b, η (a, b) Set.univ ∂κ a ≤ ∫⁻ _, Cη ∂κ a :=
lintegral_mono fun b => measure_le_bound η (a, b) Set.univ
- _ = Cη * κ a Set.univ := (MeasureTheory.lintegral_const Cη)
+ _ = Cη * κ a Set.univ := MeasureTheory.lintegral_const Cη
_ = κ a Set.univ * Cη := mul_comm _ _
#align probability_theory.kernel.comp_prod_apply_univ_le ProbabilityTheory.kernel.compProd_apply_univ_le
Let γ
be a countably generated measurable space and κ η : kernel α γ
be finite kernels. We build a function rnDeriv κ η : α → γ → ℝ≥0∞
jointly measurable on α × γ
and a kernel singularPart κ η : kernel α γ
such that κ = withDensity η (rnDeriv κ η) + singularPart κ η
and for all a : α
, singularPart κ η a ⟂ₘ η a
.
@@ -921,6 +921,11 @@ lemma fst_map_prod (κ : kernel α β) {f : β → γ} {g : β → δ}
· rfl
· exact measurable_fst hs
+lemma fst_map_id_prod (κ : kernel α β) {γ : Type*} {mγ : MeasurableSpace γ}
+ {f : β → γ} (hf : Measurable f) :
+ fst (map κ (fun a ↦ (a, f a)) (measurable_id.prod_mk hf)) = κ := by
+ rw [fst_map_prod _ measurable_id' hf, kernel.map_id']
+
@[simp]
lemma fst_compProd (κ : kernel α β) (η : kernel (α × β) γ) [IsSFiniteKernel κ] [IsMarkovKernel η] :
fst (κ ⊗ₖ η) = κ := by
@@ -989,6 +994,11 @@ lemma snd_map_prod (κ : kernel α β) {f : β → γ} {g : β → δ}
· rfl
· exact measurable_snd hs
+lemma snd_map_prod_id (κ : kernel α β) {γ : Type*} {mγ : MeasurableSpace γ}
+ {f : β → γ} (hf : Measurable f) :
+ snd (map κ (fun a ↦ (f a, a)) (hf.prod_mk measurable_id)) = κ := by
+ rw [snd_map_prod _ hf measurable_id', kernel.map_id']
+
lemma snd_prodMkLeft (δ : Type*) [MeasurableSpace δ] (κ : kernel α (β × γ)) :
snd (prodMkLeft δ κ) = prodMkLeft δ (snd κ) := rfl
Let κ : kernel α (γ × β)
and ν : kernel α γ
be two finite kernels with kernel.fst κ ≤ ν
, where γ
has a countably generated σ-algebra (true in particular for standard Borel spaces).
We build a function f : α → γ → Set β → ℝ
jointly measurable in the first two arguments such that for all a : α
and all measurable sets s : Set β
and A : Set γ
, ∫ x in A, f a x s ∂(ν a) = (κ a (A ×ˢ s)).toReal
.
Co-authored-by: Rémy Degenne <remydegenne@gmail.com>
@@ -906,6 +906,13 @@ instance IsSFiniteKernel.fst (κ : kernel α (β × γ)) [IsSFiniteKernel κ] :
by rw [kernel.fst]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.fst ProbabilityTheory.kernel.IsSFiniteKernel.fst
+instance (priority := 100) isFiniteKernel_of_isFiniteKernel_fst {κ : kernel α (β × γ)}
+ [h : IsFiniteKernel (fst κ)] :
+ IsFiniteKernel κ := by
+ refine ⟨h.bound, h.bound_lt_top, fun a ↦ le_trans ?_ (measure_le_bound (fst κ) a Set.univ)⟩
+ rw [fst_apply' _ _ MeasurableSet.univ]
+ simp
+
lemma fst_map_prod (κ : kernel α β) {f : β → γ} {g : β → δ}
(hf : Measurable f) (hg : Measurable g) :
fst (map κ (fun x ↦ (f x, g x)) (hf.prod_mk hg)) = map κ f hf := by
@@ -967,6 +974,13 @@ instance IsSFiniteKernel.snd (κ : kernel α (β × γ)) [IsSFiniteKernel κ] :
by rw [kernel.snd]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.snd ProbabilityTheory.kernel.IsSFiniteKernel.snd
+instance (priority := 100) isFiniteKernel_of_isFiniteKernel_snd {κ : kernel α (β × γ)}
+ [h : IsFiniteKernel (snd κ)] :
+ IsFiniteKernel κ := by
+ refine ⟨h.bound, h.bound_lt_top, fun a ↦ le_trans ?_ (measure_le_bound (snd κ) a Set.univ)⟩
+ rw [snd_apply' _ _ MeasurableSet.univ]
+ simp
+
lemma snd_map_prod (κ : kernel α β) {f : β → γ} {g : β → δ}
(hf : Measurable f) (hg : Measurable g) :
snd (map κ (fun x ↦ (f x, g x)) (hf.prod_mk hg)) = map κ g hg := by
λ
by fun
(#11301)
Per the style guidelines, λ
is disallowed in mathlib.
This is close to exhaustive; I left some tactic code alone when it seemed to me that tactic could be upstreamed soon.
Notes
=>
to ↦
.Mathlib/Order/SupClosed
.λ x,
, which I also replaced.@@ -193,7 +193,7 @@ open scoped Classical
If either of the kernels is not s-finite, `compProd` is given the junk value 0. -/
noncomputable def compProd (κ : kernel α β) (η : kernel (α × β) γ) : kernel α (β × γ) :=
if h : IsSFiniteKernel κ ∧ IsSFiniteKernel η then
-{ val := λ a ↦
+{ val := fun a ↦
Measure.ofMeasurable (fun s _ => compProdFun κ η a s) (compProdFun_empty κ η a)
(@compProdFun_iUnion _ _ _ _ _ _ κ η h.2 a)
property := by
ae_compProd_iff
(#11276)
Let κ : kernel α β
and η : kernel (α × β) γ
be two s-finite kernels and p
a predicate on β × γ
.
If the set { x | p x}
is measurable, then (∀ᵐ bc ∂(κ ⊗ₖ η) a, p bc) ↔ ∀ᵐ b ∂κ a, ∀ᵐ c ∂η (a, b), p (b, c)
.
@@ -319,6 +319,18 @@ theorem ae_ae_of_ae_compProd {p : β × γ → Prop} (h : ∀ᵐ bc ∂(κ ⊗
ae_null_of_compProd_null h
#align probability_theory.kernel.ae_ae_of_ae_comp_prod ProbabilityTheory.kernel.ae_ae_of_ae_compProd
+lemma ae_compProd_of_ae_ae {p : β × γ → Prop} (hp : MeasurableSet {x | p x})
+ (h : ∀ᵐ b ∂κ a, ∀ᵐ c ∂η (a, b), p (b, c)) :
+ ∀ᵐ bc ∂(κ ⊗ₖ η) a, p bc := by
+ simp_rw [ae_iff] at h ⊢
+ rw [compProd_null]
+ · exact h
+ · exact hp.compl
+
+lemma ae_compProd_iff {p : β × γ → Prop} (hp : MeasurableSet {x | p x}) :
+ (∀ᵐ bc ∂(κ ⊗ₖ η) a, p bc) ↔ ∀ᵐ b ∂κ a, ∀ᵐ c ∂η (a, b), p (b, c) :=
+ ⟨fun h ↦ ae_ae_of_ae_compProd h, fun h ↦ ae_compProd_of_ae_ae hp h⟩
+
end Ae
section Restrict
compProd_add_left/right
(#11272)
Interaction of the composition-product of kernels with addition.
@@ -558,6 +558,19 @@ instance IsSFiniteKernel.compProd (κ : kernel α β) (η : kernel (α × β) γ
exact kernel.isSFiniteKernel_sum fun n => kernel.isSFiniteKernel_sum inferInstance
#align probability_theory.kernel.is_s_finite_kernel.comp_prod ProbabilityTheory.kernel.IsSFiniteKernel.compProd
+lemma compProd_add_left (μ κ : kernel α β) (η : kernel (α × β) γ)
+ [IsSFiniteKernel μ] [IsSFiniteKernel κ] [IsSFiniteKernel η] :
+ (μ + κ) ⊗ₖ η = μ ⊗ₖ η + κ ⊗ₖ η := by ext _ _ hs; simp [compProd_apply _ _ _ hs]
+
+lemma compProd_add_right (μ : kernel α β) (κ η : kernel (α × β) γ)
+ [IsSFiniteKernel μ] [IsSFiniteKernel κ] [IsSFiniteKernel η] :
+ μ ⊗ₖ (κ + η) = μ ⊗ₖ κ + μ ⊗ₖ η := by
+ ext a s hs
+ simp only [compProd_apply _ _ _ hs, coeFn_add, Pi.add_apply, Measure.add_toOuterMeasure,
+ OuterMeasure.coe_add]
+ rw [lintegral_add_left]
+ exact measurable_kernel_prod_mk_left' hs a
+
end CompositionProduct
section MapComap
@@ -737,6 +750,14 @@ lemma prodMkLeft_zero : kernel.prodMkLeft α (0 : kernel β γ) = 0 := by
lemma prodMkRight_zero : kernel.prodMkRight α (0 : kernel β γ) = 0 := by
ext x s _; simp
+@[simp]
+lemma prodMkLeft_add (κ η : kernel α β) :
+ prodMkLeft γ (κ + η) = prodMkLeft γ κ + prodMkLeft γ η := by ext; simp
+
+@[simp]
+lemma prodMkRight_add (κ η : kernel α β) :
+ prodMkRight γ (κ + η) = prodMkRight γ κ + prodMkRight γ η := by ext; simp
+
theorem lintegral_prodMkLeft (κ : kernel α β) (ca : γ × α) (g : β → ℝ≥0∞) :
∫⁻ b, g b ∂prodMkLeft γ κ ca = ∫⁻ b, g b ∂κ ca.snd := rfl
#align probability_theory.kernel.lintegral_prod_mk_left ProbabilityTheory.kernel.lintegral_prodMkLeft
open Classical
(#11199)
We remove all but one open Classical
s, instead preferring to use open scoped Classical
. The only real side-effect this led to is moving a couple declarations to use Exists.choose
instead of Classical.choose
.
The first few commits are explicitly labelled regex replaces for ease of review.
@@ -185,7 +185,7 @@ theorem measurable_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : ke
exact h_meas.lintegral_kernel_prod_right
#align probability_theory.kernel.measurable_comp_prod_fun ProbabilityTheory.kernel.measurable_compProdFun
-open Classical
+open scoped Classical
/-- Composition-Product of kernels. For s-finite kernels, it satisfies
`∫⁻ bc, f bc ∂(compProd κ η a) = ∫⁻ b, ∫⁻ c, f (b, c) ∂(η (a, b)) ∂(κ a)`
This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0
branch as we update to intermediate nightlies.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>
@@ -436,8 +436,8 @@ theorem lintegral_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel
let g := Function.curry f
change ∫⁻ bc, f bc ∂(κ ⊗ₖ η) a = ∫⁻ b, ∫⁻ c, g b c ∂η (a, b) ∂κ a
rw [← lintegral_compProd']
- · simp_rw [Function.curry_apply]
- · simp_rw [Function.uncurry_curry]; exact hf
+ · simp_rw [g, Function.curry_apply]
+ · simp_rw [g, Function.uncurry_curry]; exact hf
#align probability_theory.kernel.lintegral_comp_prod ProbabilityTheory.kernel.lintegral_compProd
/-- Lebesgue integral against the composition-product of two kernels. -/
@@ -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
@@ -565,7 +565,7 @@ section MapComap
/-! ### map, comap -/
-variable {γ : Type*} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α}
+variable {γ δ : Type*} {mγ : MeasurableSpace γ} {mδ : MeasurableSpace δ} {f : β → γ} {g : γ → α}
/-- The pushforward of a kernel along a measurable function.
We include measurability in the assumptions instead of using junk values
@@ -676,6 +676,12 @@ instance IsSFiniteKernel.comap (κ : kernel α β) [IsSFiniteKernel κ] (hg : Me
⟨⟨fun n => kernel.comap (seq κ n) g hg, inferInstance, (sum_comap_seq κ hg).symm⟩⟩
#align probability_theory.kernel.is_s_finite_kernel.comap ProbabilityTheory.kernel.IsSFiniteKernel.comap
+lemma comap_map_comm (κ : kernel β γ) {f : α → β} {g : γ → δ}
+ (hf : Measurable f) (hg : Measurable g) :
+ comap (map κ g hg) f hf = map (comap κ f hf) g hg := by
+ ext x s _
+ rw [comap_apply, map_apply, map_apply, comap_apply]
+
end MapComap
open scoped ProbabilityTheory
@@ -689,6 +695,10 @@ def prodMkLeft (γ : Type*) [MeasurableSpace γ] (κ : kernel α β) : kernel (
comap κ Prod.snd measurable_snd
#align probability_theory.kernel.prod_mk_left ProbabilityTheory.kernel.prodMkLeft
+/-- Define a `kernel (α × γ) β` from a `kernel α β` by taking the comap of the projection. -/
+def prodMkRight (γ : Type*) [MeasurableSpace γ] (κ : kernel α β) : kernel (α × γ) β :=
+ comap κ Prod.fst measurable_fst
+
variable {γ : Type*} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α}
@[simp]
@@ -696,32 +706,61 @@ theorem prodMkLeft_apply (κ : kernel α β) (ca : γ × α) : prodMkLeft γ κ
rfl
#align probability_theory.kernel.prod_mk_left_apply ProbabilityTheory.kernel.prodMkLeft_apply
+@[simp]
+theorem prodMkRight_apply (κ : kernel α β) (ca : α × γ) : prodMkRight γ κ ca = κ ca.fst := rfl
+
theorem prodMkLeft_apply' (κ : kernel α β) (ca : γ × α) (s : Set β) :
prodMkLeft γ κ ca s = κ ca.snd s :=
rfl
#align probability_theory.kernel.prod_mk_left_apply' ProbabilityTheory.kernel.prodMkLeft_apply'
+theorem prodMkRight_apply' (κ : kernel α β) (ca : α × γ) (s : Set β) :
+ prodMkRight γ κ ca s = κ ca.fst s := rfl
+
@[simp]
lemma prodMkLeft_zero : kernel.prodMkLeft α (0 : kernel β γ) = 0 := by
- ext x s _; simp [kernel.prodMkLeft_apply']
+ ext x s _; simp
+
+@[simp]
+lemma prodMkRight_zero : kernel.prodMkRight α (0 : kernel β γ) = 0 := by
+ ext x s _; simp
theorem lintegral_prodMkLeft (κ : kernel α β) (ca : γ × α) (g : β → ℝ≥0∞) :
- ∫⁻ b, g b ∂prodMkLeft γ κ ca = ∫⁻ b, g b ∂κ ca.snd :=
- rfl
+ ∫⁻ b, g b ∂prodMkLeft γ κ ca = ∫⁻ b, g b ∂κ ca.snd := rfl
#align probability_theory.kernel.lintegral_prod_mk_left ProbabilityTheory.kernel.lintegral_prodMkLeft
+theorem lintegral_prodMkRight (κ : kernel α β) (ca : α × γ) (g : β → ℝ≥0∞) :
+ ∫⁻ b, g b ∂prodMkRight γ κ ca = ∫⁻ b, g b ∂κ ca.fst := rfl
+
instance IsMarkovKernel.prodMkLeft (κ : kernel α β) [IsMarkovKernel κ] :
IsMarkovKernel (prodMkLeft γ κ) := by rw [kernel.prodMkLeft]; infer_instance
#align probability_theory.kernel.is_markov_kernel.prod_mk_left ProbabilityTheory.kernel.IsMarkovKernel.prodMkLeft
+instance IsMarkovKernel.prodMkRight (κ : kernel α β) [IsMarkovKernel κ] :
+ IsMarkovKernel (prodMkRight γ κ) := by rw [kernel.prodMkRight]; infer_instance
+
instance IsFiniteKernel.prodMkLeft (κ : kernel α β) [IsFiniteKernel κ] :
IsFiniteKernel (prodMkLeft γ κ) := by rw [kernel.prodMkLeft]; infer_instance
#align probability_theory.kernel.is_finite_kernel.prod_mk_left ProbabilityTheory.kernel.IsFiniteKernel.prodMkLeft
+instance IsFiniteKernel.prodMkRight (κ : kernel α β) [IsFiniteKernel κ] :
+ IsFiniteKernel (prodMkRight γ κ) := by rw [kernel.prodMkRight]; infer_instance
+
instance IsSFiniteKernel.prodMkLeft (κ : kernel α β) [IsSFiniteKernel κ] :
IsSFiniteKernel (prodMkLeft γ κ) := by rw [kernel.prodMkLeft]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.prod_mk_left ProbabilityTheory.kernel.IsSFiniteKernel.prodMkLeft
+instance IsSFiniteKernel.prodMkRight (κ : kernel α β) [IsSFiniteKernel κ] :
+ IsSFiniteKernel (prodMkRight γ κ) := by rw [kernel.prodMkRight]; infer_instance
+
+lemma map_prodMkLeft (γ : Type*) [MeasurableSpace γ] (κ : kernel α β)
+ {f : β → δ} (hf : Measurable f) :
+ map (prodMkLeft γ κ) f hf = prodMkLeft γ (map κ f hf) := rfl
+
+lemma map_prodMkRight (κ : kernel α β) (γ : Type*) [MeasurableSpace γ]
+ {f : β → δ} (hf : Measurable f) :
+ map (prodMkRight γ κ) f hf = prodMkRight γ (map κ f hf) := rfl
+
/-- Define a `kernel (β × α) γ` from a `kernel (α × β) γ` by taking the comap of `Prod.swap`. -/
def swapLeft (κ : kernel (α × β) γ) : kernel (β × α) γ :=
comap κ Prod.swap measurable_swap
@@ -752,6 +791,12 @@ instance IsSFiniteKernel.swapLeft (κ : kernel (α × β) γ) [IsSFiniteKernel
IsSFiniteKernel (swapLeft κ) := by rw [kernel.swapLeft]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.swap_left ProbabilityTheory.kernel.IsSFiniteKernel.swapLeft
+@[simp] lemma swapLeft_prodMkLeft (κ : kernel α β) (γ : Type*) [MeasurableSpace γ] :
+ swapLeft (prodMkLeft γ κ) = prodMkRight γ κ := rfl
+
+@[simp] lemma swapLeft_prodMkRight (κ : kernel α β) (γ : Type*) [MeasurableSpace γ] :
+ swapLeft (prodMkRight γ κ) = prodMkLeft γ κ := rfl
+
/-- Define a `kernel α (γ × β)` from a `kernel α (β × γ)` by taking the map of `Prod.swap`. -/
noncomputable def swapRight (κ : kernel α (β × γ)) : kernel α (γ × β) :=
map κ Prod.swap measurable_swap
@@ -838,6 +883,12 @@ lemma fst_compProd (κ : kernel α β) (η : kernel (α × β) γ) [IsSFiniteKer
simp_rw [this]
rw [lintegral_indicator_const hs, one_mul]
+lemma fst_prodMkLeft (δ : Type*) [MeasurableSpace δ] (κ : kernel α (β × γ)) :
+ fst (prodMkLeft δ κ) = prodMkLeft δ (fst κ) := rfl
+
+lemma fst_prodMkRight (κ : kernel α (β × γ)) (δ : Type*) [MeasurableSpace δ] :
+ fst (prodMkRight δ κ) = prodMkRight δ (fst κ) := rfl
+
/-- Define a `kernel α γ` from a `kernel α (β × γ)` by taking the map of the second projection. -/
noncomputable def snd (κ : kernel α (β × γ)) : kernel α γ :=
map κ Prod.snd measurable_snd
@@ -879,6 +930,12 @@ lemma snd_map_prod (κ : kernel α β) {f : β → γ} {g : β → δ}
· rfl
· exact measurable_snd hs
+lemma snd_prodMkLeft (δ : Type*) [MeasurableSpace δ] (κ : kernel α (β × γ)) :
+ snd (prodMkLeft δ κ) = prodMkLeft δ (snd κ) := rfl
+
+lemma snd_prodMkRight (κ : kernel α (β × γ)) (δ : Type*) [MeasurableSpace δ] :
+ snd (prodMkRight δ κ) = prodMkRight δ (snd κ) := rfl
+
@[simp]
lemma fst_swapRight (κ : kernel α (β × γ)) : fst (swapRight κ) = snd κ := by
ext a s hs
@@ -982,11 +1039,23 @@ noncomputable def prod (κ : kernel α β) (η : kernel α γ) : kernel α (β
scoped[ProbabilityTheory] infixl:100 " ×ₖ " => ProbabilityTheory.kernel.prod
-theorem prod_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsSFiniteKernel η] (a : α)
- {s : Set (β × γ)} (hs : MeasurableSet s) :
+theorem prod_apply' (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsSFiniteKernel η]
+ (a : α) {s : Set (β × γ)} (hs : MeasurableSet s) :
(κ ×ₖ η) a s = ∫⁻ b : β, (η a) {c : γ | (b, c) ∈ s} ∂κ a := by
simp_rw [prod, compProd_apply _ _ _ hs, swapLeft_apply _ _, prodMkLeft_apply, Prod.swap_prod_mk]
-#align probability_theory.kernel.prod_apply ProbabilityTheory.kernel.prod_apply
+#align probability_theory.kernel.prod_apply ProbabilityTheory.kernel.prod_apply'
+
+lemma prod_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsSFiniteKernel η]
+ (a : α) :
+ (κ ×ₖ η) a = (κ a).prod (η a) := by
+ ext s hs
+ rw [prod_apply' _ _ _ hs, Measure.prod_apply hs]
+ rfl
+
+lemma prod_const (μ : Measure α) [SFinite μ] (ν : Measure β) [SFinite ν] :
+ const α μ ×ₖ const α ν = const α (μ.prod ν) := by
+ ext x
+ rw [const_apply, prod_apply, const_apply, const_apply]
theorem lintegral_prod (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsSFiniteKernel η]
(a : α) {g : β × γ → ℝ≥0∞} (hg : Measurable g) :
@@ -1006,6 +1075,14 @@ instance IsSFiniteKernel.prod (κ : kernel α β) (η : kernel α γ) :
IsSFiniteKernel (κ ×ₖ η) := by rw [kernel.prod]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.prod ProbabilityTheory.kernel.IsSFiniteKernel.prod
+@[simp] lemma fst_prod (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsMarkovKernel η] :
+ fst (κ ×ₖ η) = κ := by
+ rw [prod]; simp
+
+@[simp] lemma snd_prod (κ : kernel α β) [IsMarkovKernel κ] (η : kernel α γ) [IsSFiniteKernel η] :
+ snd (κ ×ₖ η) = η := by
+ ext x; simp [snd_apply, prod_apply]
+
end Prod
end kernel
@@ -618,6 +618,12 @@ instance IsSFiniteKernel.map (κ : kernel α β) [IsSFiniteKernel κ] (hf : Meas
⟨⟨fun n => kernel.map (seq κ n) f hf, inferInstance, (sum_map_seq κ hf).symm⟩⟩
#align probability_theory.kernel.is_s_finite_kernel.map ProbabilityTheory.kernel.IsSFiniteKernel.map
+@[simp]
+lemma map_const (μ : Measure α) {f : α → β} (hf : Measurable f) :
+ map (const γ μ) f hf = const γ (μ.map f) := by
+ ext x s hs
+ rw [map_apply' _ _ _ hs, const_apply, const_apply, Measure.map_apply hf hs]
+
/-- Pullback of a kernel, such that for each set s `comap κ g hg c s = κ (g c) s`.
We include measurability in the assumptions instead of using junk values
to make sure that typeclass inference can infer that the `comap` of a Markov kernel
@@ -676,6 +682,8 @@ open scoped ProbabilityTheory
section FstSnd
+variable {δ : Type*} {mδ : MeasurableSpace δ}
+
/-- Define a `kernel (γ × α) β` from a `kernel α β` by taking the comap of the projection. -/
def prodMkLeft (γ : Type*) [MeasurableSpace γ] (κ : kernel α β) : kernel (γ × α) β :=
comap κ Prod.snd measurable_snd
@@ -683,6 +691,7 @@ def prodMkLeft (γ : Type*) [MeasurableSpace γ] (κ : kernel α β) : kernel (
variable {γ : Type*} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α}
+@[simp]
theorem prodMkLeft_apply (κ : kernel α β) (ca : γ × α) : prodMkLeft γ κ ca = κ ca.snd :=
rfl
#align probability_theory.kernel.prod_mk_left_apply ProbabilityTheory.kernel.prodMkLeft_apply
@@ -692,6 +701,10 @@ theorem prodMkLeft_apply' (κ : kernel α β) (ca : γ × α) (s : Set β) :
rfl
#align probability_theory.kernel.prod_mk_left_apply' ProbabilityTheory.kernel.prodMkLeft_apply'
+@[simp]
+lemma prodMkLeft_zero : kernel.prodMkLeft α (0 : kernel β γ) = 0 := by
+ ext x s _; simp [kernel.prodMkLeft_apply']
+
theorem lintegral_prodMkLeft (κ : kernel α β) (ca : γ × α) (g : β → ℝ≥0∞) :
∫⁻ b, g b ∂prodMkLeft γ κ ca = ∫⁻ b, g b ∂κ ca.snd :=
rfl
@@ -714,18 +727,17 @@ def swapLeft (κ : kernel (α × β) γ) : kernel (β × α) γ :=
comap κ Prod.swap measurable_swap
#align probability_theory.kernel.swap_left ProbabilityTheory.kernel.swapLeft
-theorem swapLeft_apply (κ : kernel (α × β) γ) (a : β × α) : swapLeft κ a = κ a.swap :=
- rfl
+@[simp]
+theorem swapLeft_apply (κ : kernel (α × β) γ) (a : β × α) : swapLeft κ a = κ a.swap := rfl
#align probability_theory.kernel.swap_left_apply ProbabilityTheory.kernel.swapLeft_apply
theorem swapLeft_apply' (κ : kernel (α × β) γ) (a : β × α) (s : Set γ) :
- swapLeft κ a s = κ a.swap s :=
- rfl
+ swapLeft κ a s = κ a.swap s := rfl
#align probability_theory.kernel.swap_left_apply' ProbabilityTheory.kernel.swapLeft_apply'
theorem lintegral_swapLeft (κ : kernel (α × β) γ) (a : β × α) (g : γ → ℝ≥0∞) :
∫⁻ c, g c ∂swapLeft κ a = ∫⁻ c, g c ∂κ a.swap := by
- rw [swapLeft, lintegral_comap _ measurable_swap a]
+ rw [swapLeft_apply]
#align probability_theory.kernel.lintegral_swap_left ProbabilityTheory.kernel.lintegral_swapLeft
instance IsMarkovKernel.swapLeft (κ : kernel (α × β) γ) [IsMarkovKernel κ] :
@@ -784,6 +796,9 @@ theorem fst_apply' (κ : kernel α (β × γ)) (a : α) {s : Set β} (hs : Measu
fst κ a s = κ a {p | p.1 ∈ s} := by rw [fst_apply, Measure.map_apply measurable_fst hs]; rfl
#align probability_theory.kernel.fst_apply' ProbabilityTheory.kernel.fst_apply'
+@[simp]
+lemma fst_zero : fst (0 : kernel α (β × γ)) = 0 := by simp [fst]
+
theorem lintegral_fst (κ : kernel α (β × γ)) (a : α) {g : β → ℝ≥0∞} (hg : Measurable g) :
∫⁻ c, g c ∂fst κ a = ∫⁻ bc : β × γ, g bc.fst ∂κ a := by
rw [fst, lintegral_map _ measurable_fst a hg]
@@ -801,6 +816,28 @@ instance IsSFiniteKernel.fst (κ : kernel α (β × γ)) [IsSFiniteKernel κ] :
by rw [kernel.fst]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.fst ProbabilityTheory.kernel.IsSFiniteKernel.fst
+lemma fst_map_prod (κ : kernel α β) {f : β → γ} {g : β → δ}
+ (hf : Measurable f) (hg : Measurable g) :
+ fst (map κ (fun x ↦ (f x, g x)) (hf.prod_mk hg)) = map κ f hf := by
+ ext x s hs
+ rw [fst_apply' _ _ hs, map_apply', map_apply' _ _ _ hs]
+ · rfl
+ · exact measurable_fst hs
+
+@[simp]
+lemma fst_compProd (κ : kernel α β) (η : kernel (α × β) γ) [IsSFiniteKernel κ] [IsMarkovKernel η] :
+ fst (κ ⊗ₖ η) = κ := by
+ ext x s hs
+ rw [fst_apply' _ _ hs, compProd_apply]
+ swap; · exact measurable_fst hs
+ simp only [Set.mem_setOf_eq]
+ classical
+ have : ∀ b : β, η (x, b) {_c | b ∈ s} = s.indicator (fun _ ↦ 1) b := by
+ intro b
+ by_cases hb : b ∈ s <;> simp [hb]
+ simp_rw [this]
+ rw [lintegral_indicator_const hs, one_mul]
+
/-- Define a `kernel α γ` from a `kernel α (β × γ)` by taking the map of the second projection. -/
noncomputable def snd (κ : kernel α (β × γ)) : kernel α γ :=
map κ Prod.snd measurable_snd
@@ -814,6 +851,9 @@ theorem snd_apply' (κ : kernel α (β × γ)) (a : α) {s : Set γ} (hs : Measu
snd κ a s = κ a {p | p.2 ∈ s} := by rw [snd_apply, Measure.map_apply measurable_snd hs]; rfl
#align probability_theory.kernel.snd_apply' ProbabilityTheory.kernel.snd_apply'
+@[simp]
+lemma snd_zero : snd (0 : kernel α (β × γ)) = 0 := by simp [snd]
+
theorem lintegral_snd (κ : kernel α (β × γ)) (a : α) {g : γ → ℝ≥0∞} (hg : Measurable g) :
∫⁻ c, g c ∂snd κ a = ∫⁻ bc : β × γ, g bc.snd ∂κ a := by
rw [snd, lintegral_map _ measurable_snd a hg]
@@ -831,6 +871,28 @@ instance IsSFiniteKernel.snd (κ : kernel α (β × γ)) [IsSFiniteKernel κ] :
by rw [kernel.snd]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.snd ProbabilityTheory.kernel.IsSFiniteKernel.snd
+lemma snd_map_prod (κ : kernel α β) {f : β → γ} {g : β → δ}
+ (hf : Measurable f) (hg : Measurable g) :
+ snd (map κ (fun x ↦ (f x, g x)) (hf.prod_mk hg)) = map κ g hg := by
+ ext x s hs
+ rw [snd_apply' _ _ hs, map_apply', map_apply' _ _ _ hs]
+ · rfl
+ · exact measurable_snd hs
+
+@[simp]
+lemma fst_swapRight (κ : kernel α (β × γ)) : fst (swapRight κ) = snd κ := by
+ ext a s hs
+ rw [fst_apply' _ _ hs, swapRight_apply', snd_apply' _ _ hs]
+ · rfl
+ · exact measurable_fst hs
+
+@[simp]
+lemma snd_swapRight (κ : kernel α (β × γ)) : snd (swapRight κ) = fst κ := by
+ ext a s hs
+ rw [snd_apply' _ _ hs, swapRight_apply', fst_apply' _ _ hs]
+ · rfl
+ · exact measurable_snd hs
+
end FstSnd
section Comp
This is the supremum of
along with some minor fixes from failures on nightly-testing as Mathlib master
is merged into it.
Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.
I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0
branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.
In particular this includes adjustments for the Lean PRs
We can get rid of all the
local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)
macros across Mathlib (and in any projects that want to write natural number powers of reals).
Changes the default behaviour of simp
to (config := {decide := false})
. This makes simp
(and consequentially norm_num
) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp
or norm_num
to decide
or rfl
, or adding (config := {decide := true})
.
This changed the behaviour of simp
so that simp [f]
will only unfold "fully applied" occurrences of f
. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true })
. We may in future add a syntax for this, e.g. simp [!f]
; please provide feedback! In the meantime, we have made the following changes:
(config := { unfoldPartialApp := true })
in some places, to recover the old behaviour@[eqns]
to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp
and Function.flip
.This change in Lean may require further changes down the line (e.g. adding the !f
syntax, and/or upstreaming the special treatment for Function.comp
and Function.flip
, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!
Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>
@@ -405,8 +405,9 @@ theorem lintegral_compProd' (κ : kernel α β) [IsSFiniteKernel κ] (η : kerne
∫⁻ (a_1 : β), ∫⁻ (c : γ), f (a_1, c) ∂η (a, a_1) ∂κ a)) _ _ (F n)
· intro c s hs
classical -- Porting note: Added `classical` for `Set.piecewise_eq_indicator`
- simp only [SimpleFunc.const_zero, SimpleFunc.coe_piecewise, SimpleFunc.coe_const,
- SimpleFunc.coe_zero, Set.piecewise_eq_indicator, Function.const, lintegral_indicator_const hs]
+ simp (config := { unfoldPartialApp := true }) only [SimpleFunc.const_zero,
+ SimpleFunc.coe_piecewise, SimpleFunc.coe_const, SimpleFunc.coe_zero,
+ Set.piecewise_eq_indicator, Function.const, lintegral_indicator_const hs]
rw [compProd_apply κ η _ hs, ← lintegral_const_mul c _]
swap
· exact (measurable_kernel_prod_mk_left ((measurable_fst.snd.prod_mk measurable_snd) hs)).comp
This incorporates changes from
nightly-testing
are unexciting: we need to fully qualify a few names)They can all be closed when this is merged.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@@ -697,15 +697,15 @@ theorem lintegral_prodMkLeft (κ : kernel α β) (ca : γ × α) (g : β → ℝ
#align probability_theory.kernel.lintegral_prod_mk_left ProbabilityTheory.kernel.lintegral_prodMkLeft
instance IsMarkovKernel.prodMkLeft (κ : kernel α β) [IsMarkovKernel κ] :
- IsMarkovKernel (prodMkLeft γ κ) := by rw [prodMkLeft]; infer_instance
+ IsMarkovKernel (prodMkLeft γ κ) := by rw [kernel.prodMkLeft]; infer_instance
#align probability_theory.kernel.is_markov_kernel.prod_mk_left ProbabilityTheory.kernel.IsMarkovKernel.prodMkLeft
instance IsFiniteKernel.prodMkLeft (κ : kernel α β) [IsFiniteKernel κ] :
- IsFiniteKernel (prodMkLeft γ κ) := by rw [prodMkLeft]; infer_instance
+ IsFiniteKernel (prodMkLeft γ κ) := by rw [kernel.prodMkLeft]; infer_instance
#align probability_theory.kernel.is_finite_kernel.prod_mk_left ProbabilityTheory.kernel.IsFiniteKernel.prodMkLeft
instance IsSFiniteKernel.prodMkLeft (κ : kernel α β) [IsSFiniteKernel κ] :
- IsSFiniteKernel (prodMkLeft γ κ) := by rw [prodMkLeft]; infer_instance
+ IsSFiniteKernel (prodMkLeft γ κ) := by rw [kernel.prodMkLeft]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.prod_mk_left ProbabilityTheory.kernel.IsSFiniteKernel.prodMkLeft
/-- Define a `kernel (β × α) γ` from a `kernel (α × β) γ` by taking the comap of `Prod.swap`. -/
@@ -728,15 +728,15 @@ theorem lintegral_swapLeft (κ : kernel (α × β) γ) (a : β × α) (g : γ
#align probability_theory.kernel.lintegral_swap_left ProbabilityTheory.kernel.lintegral_swapLeft
instance IsMarkovKernel.swapLeft (κ : kernel (α × β) γ) [IsMarkovKernel κ] :
- IsMarkovKernel (swapLeft κ) := by rw [swapLeft]; infer_instance
+ IsMarkovKernel (swapLeft κ) := by rw [kernel.swapLeft]; infer_instance
#align probability_theory.kernel.is_markov_kernel.swap_left ProbabilityTheory.kernel.IsMarkovKernel.swapLeft
instance IsFiniteKernel.swapLeft (κ : kernel (α × β) γ) [IsFiniteKernel κ] :
- IsFiniteKernel (swapLeft κ) := by rw [swapLeft]; infer_instance
+ IsFiniteKernel (swapLeft κ) := by rw [kernel.swapLeft]; infer_instance
#align probability_theory.kernel.is_finite_kernel.swap_left ProbabilityTheory.kernel.IsFiniteKernel.swapLeft
instance IsSFiniteKernel.swapLeft (κ : kernel (α × β) γ) [IsSFiniteKernel κ] :
- IsSFiniteKernel (swapLeft κ) := by rw [swapLeft]; infer_instance
+ IsSFiniteKernel (swapLeft κ) := by rw [kernel.swapLeft]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.swap_left ProbabilityTheory.kernel.IsSFiniteKernel.swapLeft
/-- Define a `kernel α (γ × β)` from a `kernel α (β × γ)` by taking the map of `Prod.swap`. -/
@@ -759,15 +759,15 @@ theorem lintegral_swapRight (κ : kernel α (β × γ)) (a : α) {g : γ × β
#align probability_theory.kernel.lintegral_swap_right ProbabilityTheory.kernel.lintegral_swapRight
instance IsMarkovKernel.swapRight (κ : kernel α (β × γ)) [IsMarkovKernel κ] :
- IsMarkovKernel (swapRight κ) := by rw [swapRight]; infer_instance
+ IsMarkovKernel (swapRight κ) := by rw [kernel.swapRight]; infer_instance
#align probability_theory.kernel.is_markov_kernel.swap_right ProbabilityTheory.kernel.IsMarkovKernel.swapRight
instance IsFiniteKernel.swapRight (κ : kernel α (β × γ)) [IsFiniteKernel κ] :
- IsFiniteKernel (swapRight κ) := by rw [swapRight]; infer_instance
+ IsFiniteKernel (swapRight κ) := by rw [kernel.swapRight]; infer_instance
#align probability_theory.kernel.is_finite_kernel.swap_right ProbabilityTheory.kernel.IsFiniteKernel.swapRight
instance IsSFiniteKernel.swapRight (κ : kernel α (β × γ)) [IsSFiniteKernel κ] :
- IsSFiniteKernel (swapRight κ) := by rw [swapRight]; infer_instance
+ IsSFiniteKernel (swapRight κ) := by rw [kernel.swapRight]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.swap_right ProbabilityTheory.kernel.IsSFiniteKernel.swapRight
/-- Define a `kernel α β` from a `kernel α (β × γ)` by taking the map of the first projection. -/
@@ -789,15 +789,15 @@ theorem lintegral_fst (κ : kernel α (β × γ)) (a : α) {g : β → ℝ≥0
#align probability_theory.kernel.lintegral_fst ProbabilityTheory.kernel.lintegral_fst
instance IsMarkovKernel.fst (κ : kernel α (β × γ)) [IsMarkovKernel κ] : IsMarkovKernel (fst κ) := by
- rw [fst]; infer_instance
+ rw [kernel.fst]; infer_instance
#align probability_theory.kernel.is_markov_kernel.fst ProbabilityTheory.kernel.IsMarkovKernel.fst
instance IsFiniteKernel.fst (κ : kernel α (β × γ)) [IsFiniteKernel κ] : IsFiniteKernel (fst κ) := by
- rw [fst]; infer_instance
+ rw [kernel.fst]; infer_instance
#align probability_theory.kernel.is_finite_kernel.fst ProbabilityTheory.kernel.IsFiniteKernel.fst
instance IsSFiniteKernel.fst (κ : kernel α (β × γ)) [IsSFiniteKernel κ] : IsSFiniteKernel (fst κ) :=
- by rw [fst]; infer_instance
+ by rw [kernel.fst]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.fst ProbabilityTheory.kernel.IsSFiniteKernel.fst
/-- Define a `kernel α γ` from a `kernel α (β × γ)` by taking the map of the second projection. -/
@@ -819,15 +819,15 @@ theorem lintegral_snd (κ : kernel α (β × γ)) (a : α) {g : γ → ℝ≥0
#align probability_theory.kernel.lintegral_snd ProbabilityTheory.kernel.lintegral_snd
instance IsMarkovKernel.snd (κ : kernel α (β × γ)) [IsMarkovKernel κ] : IsMarkovKernel (snd κ) := by
- rw [snd]; infer_instance
+ rw [kernel.snd]; infer_instance
#align probability_theory.kernel.is_markov_kernel.snd ProbabilityTheory.kernel.IsMarkovKernel.snd
instance IsFiniteKernel.snd (κ : kernel α (β × γ)) [IsFiniteKernel κ] : IsFiniteKernel (snd κ) := by
- rw [snd]; infer_instance
+ rw [kernel.snd]; infer_instance
#align probability_theory.kernel.is_finite_kernel.snd ProbabilityTheory.kernel.IsFiniteKernel.snd
instance IsSFiniteKernel.snd (κ : kernel α (β × γ)) [IsSFiniteKernel κ] : IsSFiniteKernel (snd κ) :=
- by rw [snd]; infer_instance
+ by rw [kernel.snd]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.snd ProbabilityTheory.kernel.IsSFiniteKernel.snd
end FstSnd
@@ -932,15 +932,15 @@ theorem lintegral_prod (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α
#align probability_theory.kernel.lintegral_prod ProbabilityTheory.kernel.lintegral_prod
instance IsMarkovKernel.prod (κ : kernel α β) [IsMarkovKernel κ] (η : kernel α γ)
- [IsMarkovKernel η] : IsMarkovKernel (κ ×ₖ η) := by rw [prod]; infer_instance
+ [IsMarkovKernel η] : IsMarkovKernel (κ ×ₖ η) := by rw [kernel.prod]; infer_instance
#align probability_theory.kernel.is_markov_kernel.prod ProbabilityTheory.kernel.IsMarkovKernel.prod
instance IsFiniteKernel.prod (κ : kernel α β) [IsFiniteKernel κ] (η : kernel α γ)
- [IsFiniteKernel η] : IsFiniteKernel (κ ×ₖ η) := by rw [prod]; infer_instance
+ [IsFiniteKernel η] : IsFiniteKernel (κ ×ₖ η) := by rw [kernel.prod]; infer_instance
#align probability_theory.kernel.is_finite_kernel.prod ProbabilityTheory.kernel.IsFiniteKernel.prod
instance IsSFiniteKernel.prod (κ : kernel α β) (η : kernel α γ) :
- IsSFiniteKernel (κ ×ₖ η) := by rw [prod]; infer_instance
+ IsSFiniteKernel (κ ×ₖ η) := by rw [kernel.prod]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.prod ProbabilityTheory.kernel.IsSFiniteKernel.prod
end Prod
@@ -257,6 +257,24 @@ theorem le_compProd_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel
_ = (κ ⊗ₖ η) a s := measure_toMeasurable s
#align probability_theory.kernel.le_comp_prod_apply ProbabilityTheory.kernel.le_compProd_apply
+@[simp]
+lemma compProd_zero_left (κ : kernel (α × β) γ) :
+ (0 : kernel α β) ⊗ₖ κ = 0 := by
+ by_cases h : IsSFiniteKernel κ
+ · ext a s hs
+ rw [kernel.compProd_apply _ _ _ hs]
+ simp
+ · rw [kernel.compProd_of_not_isSFiniteKernel_right _ _ h]
+
+@[simp]
+lemma compProd_zero_right (κ : kernel α β) (γ : Type*) [MeasurableSpace γ] :
+ κ ⊗ₖ (0 : kernel (α × β) γ) = 0 := by
+ by_cases h : IsSFiniteKernel κ
+ · ext a s hs
+ rw [kernel.compProd_apply _ _ _ hs]
+ simp
+ · rw [kernel.compProd_of_not_isSFiniteKernel_left _ _ h]
+
section Ae
/-! ### `ae` filter of the composition-product -/
@@ -565,6 +583,10 @@ theorem map_apply' (κ : kernel α β) (hf : Measurable f) (a : α) {s : Set γ}
map κ f hf a s = κ a (f ⁻¹' s) := by rw [map_apply, Measure.map_apply hf hs]
#align probability_theory.kernel.map_apply' ProbabilityTheory.kernel.map_apply'
+@[simp]
+lemma map_zero (hf : Measurable f) : kernel.map (0 : kernel α β) f hf = 0 := by
+ ext; rw [kernel.map_apply]; simp
+
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]
@@ -613,6 +635,10 @@ theorem comap_apply' (κ : kernel α β) (hg : Measurable g) (c : γ) (s : Set
rfl
#align probability_theory.kernel.comap_apply' ProbabilityTheory.kernel.comap_apply'
+@[simp]
+lemma comap_zero (hg : Measurable g) : kernel.comap (0 : kernel α β) g hg = 0 := by
+ ext; rw [kernel.comap_apply]; simp
+
theorem lintegral_comap (κ : kernel α β) (hg : Measurable g) (c : γ) (g' : β → ℝ≥0∞) :
∫⁻ b, g' b ∂comap κ g hg c = ∫⁻ b, g' b ∂κ (g c) :=
rfl
@@ -469,7 +469,7 @@ theorem compProd_eq_sum_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η :
#align probability_theory.kernel.comp_prod_eq_sum_comp_prod ProbabilityTheory.kernel.compProd_eq_sum_compProd
theorem compProd_eq_sum_compProd_left (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ) :
- κ ⊗ₖ η = kernel.sum fun n => seq κ n ⊗ₖ η := by
+ κ ⊗ₖ η = kernel.sum fun n => seq κ n ⊗ₖ η := by
by_cases h : IsSFiniteKernel η
swap
· simp_rw [compProd_of_not_isSFiniteKernel_right _ _ h]
@@ -163,8 +163,7 @@ theorem measurable_compProdFun_of_finite (κ : kernel α β) [IsFiniteKernel κ]
(Function.uncurry fun a b => η (a, b) {c : γ | (b, c) ∈ s}) = fun p =>
η p {c : γ | (p.2, c) ∈ s} := by
ext1 p
- have hp_eq_mk : p = (p.fst, p.snd) := Prod.mk.eta.symm
- rw [hp_eq_mk, Function.uncurry_apply_pair]
+ rw [Function.uncurry_apply_pair]
rw [this]
exact measurable_kernel_prod_mk_left (measurable_fst.snd.prod_mk measurable_snd hs)
exact h_meas.lintegral_kernel_prod_right
@@ -180,8 +179,7 @@ theorem measurable_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : ke
(Function.uncurry fun a b => seq η n (a, b) {c : γ | (b, c) ∈ s}) = fun p =>
seq η n p {c : γ | (p.2, c) ∈ s} := by
ext1 p
- have hp_eq_mk : p = (p.fst, p.snd) := Prod.mk.eta.symm
- rw [hp_eq_mk, Function.uncurry_apply_pair]
+ rw [Function.uncurry_apply_pair]
rw [this]
exact measurable_kernel_prod_mk_left (measurable_fst.snd.prod_mk measurable_snd hs)
exact h_meas.lintegral_kernel_prod_right
@@ -356,7 +354,7 @@ theorem lintegral_compProd' (κ : kernel α β) [IsSFiniteKernel κ] (η : kerne
have h : ∀ a, ⨆ n, F n a = Function.uncurry f a :=
SimpleFunc.iSup_eapprox_apply (Function.uncurry f) hf
simp only [Prod.forall, Function.uncurry_apply_pair] at h
- simp_rw [← h, Prod.mk.eta]
+ simp_rw [← h]
have h_mono : Monotone F := fun i j hij b =>
SimpleFunc.monotone_eapprox (Function.uncurry f) hij _
rw [lintegral_iSup (fun n => (F n).measurable) h_mono]
MulZeroClass.
in mul_zero
/zero_mul
(#6682)
Search&replace MulZeroClass.mul_zero
-> mul_zero
, MulZeroClass.zero_mul
-> zero_mul
.
These were introduced by Mathport, as the full name of mul_zero
is actually MulZeroClass.mul_zero
(it's exported with the short name).
@@ -93,7 +93,7 @@ noncomputable def compProdFun (κ : kernel α β) (η : kernel (α × β) γ) (a
theorem compProdFun_empty (κ : kernel α β) (η : kernel (α × β) γ) (a : α) :
compProdFun κ η a ∅ = 0 := by
simp only [compProdFun, Set.mem_empty_iff_false, Set.setOf_false, measure_empty,
- MeasureTheory.lintegral_const, MulZeroClass.zero_mul]
+ MeasureTheory.lintegral_const, zero_mul]
#align probability_theory.kernel.comp_prod_fun_empty ProbabilityTheory.kernel.compProdFun_empty
theorem compProdFun_iUnion (κ : kernel α β) (η : kernel (α × β) γ) [IsSFiniteKernel η] (a : α)
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -67,7 +67,7 @@ namespace ProbabilityTheory
namespace kernel
-variable {α β ι : Type _} {mα : MeasurableSpace α} {mβ : MeasurableSpace β}
+variable {α β ι : Type*} {mα : MeasurableSpace α} {mβ : MeasurableSpace β}
section CompositionProduct
@@ -79,7 +79,7 @@ We define a kernel composition-product
-/
-variable {γ : Type _} {mγ : MeasurableSpace γ} {s : Set (β × γ)}
+variable {γ : Type*} {mγ : MeasurableSpace γ} {s : Set (β × γ)}
/-- Auxiliary function for the definition of the composition-product of two kernels.
For all `a : α`, `compProdFun κ η a` is a countably additive function with value zero on the empty
@@ -548,7 +548,7 @@ section MapComap
/-! ### map, comap -/
-variable {γ : Type _} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α}
+variable {γ : Type*} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α}
/-- The pushforward of a kernel along a measurable function.
We include measurability in the assumptions instead of using junk values
@@ -652,11 +652,11 @@ open scoped ProbabilityTheory
section FstSnd
/-- Define a `kernel (γ × α) β` from a `kernel α β` by taking the comap of the projection. -/
-def prodMkLeft (γ : Type _) [MeasurableSpace γ] (κ : kernel α β) : kernel (γ × α) β :=
+def prodMkLeft (γ : Type*) [MeasurableSpace γ] (κ : kernel α β) : kernel (γ × α) β :=
comap κ Prod.snd measurable_snd
#align probability_theory.kernel.prod_mk_left ProbabilityTheory.kernel.prodMkLeft
-variable {γ : Type _} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α}
+variable {γ : Type*} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α}
theorem prodMkLeft_apply (κ : kernel α β) (ca : γ × α) : prodMkLeft γ κ ca = κ ca.snd :=
rfl
@@ -813,7 +813,7 @@ section Comp
/-! ### Composition of two kernels -/
-variable {γ : Type _} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α}
+variable {γ : Type*} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α}
/-- Composition of two kernels. -/
noncomputable def comp (η : kernel β γ) (κ : kernel α β) : kernel α γ where
@@ -859,7 +859,7 @@ instance IsSFiniteKernel.comp (η : kernel β γ) [IsSFiniteKernel η] (κ : ker
#align probability_theory.kernel.is_s_finite_kernel.comp ProbabilityTheory.kernel.IsSFiniteKernel.comp
/-- Composition of kernels is associative. -/
-theorem comp_assoc {δ : Type _} {mδ : MeasurableSpace δ} (ξ : kernel γ δ) [IsSFiniteKernel ξ]
+theorem comp_assoc {δ : Type*} {mδ : MeasurableSpace δ} (ξ : kernel γ δ) [IsSFiniteKernel ξ]
(η : kernel β γ) (κ : kernel α β) : ξ ∘ₖ η ∘ₖ κ = ξ ∘ₖ (η ∘ₖ κ) := by
refine' ext_fun fun a f hf => _
simp_rw [lintegral_comp _ _ _ hf, lintegral_comp _ _ _ hf.lintegral_kernel]
@@ -886,7 +886,7 @@ section Prod
/-! ### Product of two kernels -/
-variable {γ : Type _} {mγ : MeasurableSpace γ}
+variable {γ : Type*} {mγ : MeasurableSpace γ}
/-- Product of two kernels. This is meaningful only when the kernels are s-finite. -/
noncomputable def prod (κ : kernel α β) (η : kernel α γ) : kernel α (β × γ) :=
compProd
and prod
make sense only for s-finite kernels and were defined only for those. I define them for all kernels, with default value 0 when one of the kernels is not s-finite. The new definitions allow rewriting a kernel inside a compProd, which was not possible before (it would raise a "motive is not type correct" error due to the s-finite argument).
Co-authored-by: Rémy Degenne <remydegenne@gmail.com>
@@ -187,15 +187,20 @@ theorem measurable_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : ke
exact h_meas.lintegral_kernel_prod_right
#align probability_theory.kernel.measurable_comp_prod_fun ProbabilityTheory.kernel.measurable_compProdFun
-/-- Composition-Product of kernels. It verifies
+open Classical
+
+/-- Composition-Product of kernels. For s-finite kernels, it satisfies
`∫⁻ bc, f bc ∂(compProd κ η a) = ∫⁻ b, ∫⁻ c, f (b, c) ∂(η (a, b)) ∂(κ a)`
-(see `lintegral_compProd`). -/
-noncomputable def compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
- [IsSFiniteKernel η] : kernel α (β × γ) where
- val a :=
+(see `ProbabilityTheory.kernel.lintegral_compProd`).
+If either of the kernels is not s-finite, `compProd` is given the junk value 0. -/
+noncomputable def compProd (κ : kernel α β) (η : kernel (α × β) γ) : kernel α (β × γ) :=
+if h : IsSFiniteKernel κ ∧ IsSFiniteKernel η then
+{ val := λ a ↦
Measure.ofMeasurable (fun s _ => compProdFun κ η a s) (compProdFun_empty κ η a)
- (compProdFun_iUnion κ η a)
+ (@compProdFun_iUnion _ _ _ _ _ _ κ η h.2 a)
property := by
+ have : IsSFiniteKernel κ := h.1
+ have : IsSFiniteKernel η := h.2
refine' Measure.measurable_of_measurable_coe _ fun s hs => _
have :
(fun a =>
@@ -204,14 +209,18 @@ noncomputable def compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel
fun a => compProdFun κ η a s :=
by ext1 a; rwa [Measure.ofMeasurable_apply]
rw [this]
- exact measurable_compProdFun κ η hs
+ exact measurable_compProdFun κ η hs }
+else 0
#align probability_theory.kernel.comp_prod ProbabilityTheory.kernel.compProd
scoped[ProbabilityTheory] infixl:100 " ⊗ₖ " => ProbabilityTheory.kernel.compProd
theorem compProd_apply_eq_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
- [IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) : (κ ⊗ₖ η) a s = compProdFun κ η a s := by
- rw [compProd]
+ [IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
+ (κ ⊗ₖ η) a s = compProdFun κ η a s := by
+ rw [compProd, dif_pos]
+ swap
+ · constructor <;> infer_instance
change
Measure.ofMeasurable (fun s _ => compProdFun κ η a s) (compProdFun_empty κ η a)
(compProdFun_iUnion κ η a) s =
@@ -220,6 +229,18 @@ theorem compProd_apply_eq_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (
rfl
#align probability_theory.kernel.comp_prod_apply_eq_comp_prod_fun ProbabilityTheory.kernel.compProd_apply_eq_compProdFun
+theorem compProd_of_not_isSFiniteKernel_left (κ : kernel α β) (η : kernel (α × β) γ)
+ (h : ¬ IsSFiniteKernel κ) :
+ κ ⊗ₖ η = 0 := by
+ rw [compProd, dif_neg]
+ simp [h]
+
+theorem compProd_of_not_isSFiniteKernel_right (κ : kernel α β) (η : kernel (α × β) γ)
+ (h : ¬ IsSFiniteKernel η) :
+ κ ⊗ₖ η = 0 := by
+ rw [compProd, dif_neg]
+ simp [h]
+
theorem compProd_apply (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
(κ ⊗ₖ η) a s = ∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a :=
@@ -449,16 +470,24 @@ theorem compProd_eq_sum_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η :
ext a s hs; simp_rw [kernel.sum_apply' _ a hs]; rw [compProd_eq_tsum_compProd κ η a hs]
#align probability_theory.kernel.comp_prod_eq_sum_comp_prod ProbabilityTheory.kernel.compProd_eq_sum_compProd
-theorem compProd_eq_sum_compProd_left (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
- [IsSFiniteKernel η] : κ ⊗ₖ η = kernel.sum fun n => seq κ n ⊗ₖ η := by
+theorem compProd_eq_sum_compProd_left (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ) :
+ κ ⊗ₖ η = kernel.sum fun n => seq κ n ⊗ₖ η := by
+ by_cases h : IsSFiniteKernel η
+ swap
+ · simp_rw [compProd_of_not_isSFiniteKernel_right _ _ h]
+ simp
rw [compProd_eq_sum_compProd]
congr with n a s hs
simp_rw [kernel.sum_apply' _ _ hs, compProd_apply_eq_compProdFun _ _ _ hs,
compProdFun_tsum_right _ η a hs]
#align probability_theory.kernel.comp_prod_eq_sum_comp_prod_left ProbabilityTheory.kernel.compProd_eq_sum_compProd_left
-theorem compProd_eq_sum_compProd_right (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
+theorem compProd_eq_sum_compProd_right (κ : kernel α β) (η : kernel (α × β) γ)
[IsSFiniteKernel η] : κ ⊗ₖ η = kernel.sum fun n => κ ⊗ₖ seq η n := by
+ by_cases hκ : IsSFiniteKernel κ
+ swap
+ · simp_rw [compProd_of_not_isSFiniteKernel_left _ _ hκ]
+ simp
rw [compProd_eq_sum_compProd]
simp_rw [compProd_eq_sum_compProd_left κ _]
rw [kernel.sum_comm]
@@ -472,8 +501,12 @@ instance IsMarkovKernel.compProd (κ : kernel α β) [IsMarkovKernel κ] (η : k
simp only [Set.mem_univ, Set.setOf_true, measure_univ, lintegral_one]⟩⟩
#align probability_theory.kernel.is_markov_kernel.comp_prod ProbabilityTheory.kernel.IsMarkovKernel.compProd
-theorem compProd_apply_univ_le (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
- [IsFiniteKernel η] (a : α) : (κ ⊗ₖ η) a Set.univ ≤ κ a Set.univ * IsFiniteKernel.bound η := by
+theorem compProd_apply_univ_le (κ : kernel α β) (η : kernel (α × β) γ) [IsFiniteKernel η] (a : α) :
+ (κ ⊗ₖ η) a Set.univ ≤ κ a Set.univ * IsFiniteKernel.bound η := by
+ by_cases hκ : IsSFiniteKernel κ
+ swap
+ · rw [compProd_of_not_isSFiniteKernel_left _ _ hκ]
+ simp
rw [compProd_apply κ η a MeasurableSet.univ]
simp only [Set.mem_univ, Set.setOf_true]
let Cη := IsFiniteKernel.bound η
@@ -494,8 +527,16 @@ instance IsFiniteKernel.compProd (κ : kernel α β) [IsFiniteKernel κ] (η : k
mul_le_mul (measure_le_bound κ a Set.univ) le_rfl (zero_le _) (zero_le _)⟩⟩
#align probability_theory.kernel.is_finite_kernel.comp_prod ProbabilityTheory.kernel.IsFiniteKernel.compProd
-instance IsSFiniteKernel.compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
- [IsSFiniteKernel η] : IsSFiniteKernel (κ ⊗ₖ η) := by
+instance IsSFiniteKernel.compProd (κ : kernel α β) (η : kernel (α × β) γ) :
+ IsSFiniteKernel (κ ⊗ₖ η) := by
+ by_cases h : IsSFiniteKernel κ
+ swap
+ · rw [compProd_of_not_isSFiniteKernel_left _ _ h]
+ infer_instance
+ by_cases h : IsSFiniteKernel η
+ swap
+ · rw [compProd_of_not_isSFiniteKernel_right _ _ h]
+ infer_instance
rw [compProd_eq_sum_compProd]
exact kernel.isSFiniteKernel_sum fun n => kernel.isSFiniteKernel_sum inferInstance
#align probability_theory.kernel.is_s_finite_kernel.comp_prod ProbabilityTheory.kernel.IsSFiniteKernel.compProd
@@ -774,7 +815,7 @@ section Comp
variable {γ : Type _} {mγ : MeasurableSpace γ} {f : β → γ} {g : γ → α}
-/-- Composition of two s-finite kernels. -/
+/-- Composition of two kernels. -/
noncomputable def comp (η : kernel β γ) (κ : kernel α β) : kernel α γ where
val a := (κ a).bind η
property := (Measure.measurable_bind' (kernel.measurable _)).comp (kernel.measurable _)
@@ -847,9 +888,8 @@ section Prod
variable {γ : Type _} {mγ : MeasurableSpace γ}
-/-- Product of two s-finite kernels. -/
-noncomputable def prod (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ) [IsSFiniteKernel η] :
- kernel α (β × γ) :=
+/-- Product of two kernels. This is meaningful only when the kernels are s-finite. -/
+noncomputable def prod (κ : kernel α β) (η : kernel α γ) : kernel α (β × γ) :=
κ ⊗ₖ swapLeft (prodMkLeft β η)
#align probability_theory.kernel.prod ProbabilityTheory.kernel.prod
@@ -875,8 +915,8 @@ instance IsFiniteKernel.prod (κ : kernel α β) [IsFiniteKernel κ] (η : kerne
[IsFiniteKernel η] : IsFiniteKernel (κ ×ₖ η) := by rw [prod]; infer_instance
#align probability_theory.kernel.is_finite_kernel.prod ProbabilityTheory.kernel.IsFiniteKernel.prod
-instance IsSFiniteKernel.prod (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel α γ)
- [IsSFiniteKernel η] : IsSFiniteKernel (κ ×ₖ η) := by rw [prod]; infer_instance
+instance IsSFiniteKernel.prod (κ : kernel α β) (η : kernel α γ) :
+ IsSFiniteKernel (κ ×ₖ η) := by rw [prod]; infer_instance
#align probability_theory.kernel.is_s_finite_kernel.prod ProbabilityTheory.kernel.IsSFiniteKernel.prod
end Prod
@@ -2,14 +2,11 @@
Copyright (c) 2023 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-
-! This file was ported from Lean 3 source module probability.kernel.composition
-! leanprover-community/mathlib commit 3b92d54a05ee592aa2c6181a4e76b1bb7cc45d0b
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Probability.Kernel.MeasurableIntegral
+#align_import probability.kernel.composition from "leanprover-community/mathlib"@"3b92d54a05ee592aa2c6181a4e76b1bb7cc45d0b"
+
/-!
# Product and composition of kernels
@@ -17,7 +17,7 @@ We define
* the composition-product `κ ⊗ₖ η` of two s-finite kernels `κ : kernel α β` and
`η : kernel (α × β) γ`, a kernel from `α` to `β × γ`.
* the map and comap of a kernel along a measurable function.
-* the composition `η ∘ₖ κ` of kernels `κ : kernel α β` and `η : kernel β γ`, kernel from `α` to
+* the composition `η ∘ₖ κ` of kernels `κ : kernel α β` and `η : kernel β γ`, kernel from `α` to
`γ`.
* the product `κ ×ₖ η` of s-finite kernels `κ : kernel α β` and `η : kernel α γ`,
a kernel from `α` to `β × γ`.
@@ -335,7 +335,7 @@ theorem lintegral_compProd' (κ : kernel α β) [IsSFiniteKernel κ] (η : kerne
[IsSFiniteKernel η] (a : α) {f : β → γ → ℝ≥0∞} (hf : Measurable (Function.uncurry f)) :
∫⁻ bc, f bc.1 bc.2 ∂(κ ⊗ₖ η) a = ∫⁻ b, ∫⁻ c, f b c ∂η (a, b) ∂κ a := by
let F : ℕ → SimpleFunc (β × γ) ℝ≥0∞ := SimpleFunc.eapprox (Function.uncurry f)
- have h : ∀ a, (⨆ n, F n a) = Function.uncurry f a :=
+ have h : ∀ a, ⨆ n, F n a = Function.uncurry f a :=
SimpleFunc.iSup_eapprox_apply (Function.uncurry f) hf
simp only [Prod.forall, Function.uncurry_apply_pair] at h
simp_rw [← h, Prod.mk.eta]
@@ -293,10 +293,7 @@ variable {κ : kernel α β} [IsSFiniteKernel κ] {η : kernel (α × β) γ} [I
theorem compProd_restrict {s : Set β} {t : Set γ} (hs : MeasurableSet s) (ht : MeasurableSet t) :
kernel.restrict κ hs ⊗ₖ kernel.restrict η ht = kernel.restrict (κ ⊗ₖ η) (hs.prod ht) := by
- -- Porting note: was
- -- ext (a u hu) : 2
- ext (a u) : 2
- intro hu
+ ext a u hu
rw [compProd_apply _ _ _ hu, restrict_apply' _ _ _ hu,
compProd_apply _ _ _ (hu.inter (hs.prod ht))]
simp only [kernel.restrict_apply, Measure.restrict_apply' ht, Set.mem_inter_iff,
@@ -452,16 +449,13 @@ theorem compProd_eq_tsum_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η :
theorem compProd_eq_sum_compProd (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] : κ ⊗ₖ η = kernel.sum fun n => kernel.sum fun m => seq κ n ⊗ₖ seq η m := by
- ext a s; intro hs; simp_rw [kernel.sum_apply' _ a hs]; rw [compProd_eq_tsum_compProd κ η a hs]
+ ext a s hs; simp_rw [kernel.sum_apply' _ a hs]; rw [compProd_eq_tsum_compProd κ η a hs]
#align probability_theory.kernel.comp_prod_eq_sum_comp_prod ProbabilityTheory.kernel.compProd_eq_sum_compProd
theorem compProd_eq_sum_compProd_left (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
[IsSFiniteKernel η] : κ ⊗ₖ η = kernel.sum fun n => seq κ n ⊗ₖ η := by
rw [compProd_eq_sum_compProd]
- -- Porting note: was
- -- congr with (n a s hs)
- congr with (n a s)
- intro hs
+ congr with n a s hs
simp_rw [kernel.sum_apply' _ _ hs, compProd_apply_eq_compProdFun _ _ _ hs,
compProdFun_tsum_right _ η a hs]
#align probability_theory.kernel.comp_prod_eq_sum_comp_prod_left ProbabilityTheory.kernel.compProd_eq_sum_compProd_left
@@ -542,10 +536,7 @@ nonrec theorem lintegral_map (κ : kernel α β) (hf : Measurable f) (a : α) {g
theorem sum_map_seq (κ : kernel α β) [IsSFiniteKernel κ] (hf : Measurable f) :
(kernel.sum fun n => map (seq κ n) f hf) = map κ f hf := by
- -- Porting note: was
- -- ext (a s hs) : 2
- ext (a s) : 2
- intro hs
+ ext a s hs
rw [kernel.sum_apply, map_apply' κ hf a hs, Measure.sum_apply _ hs, ← measure_sum_seq κ,
Measure.sum_apply _ (hf hs)]
simp_rw [map_apply' _ hf _ hs]
@@ -593,10 +584,7 @@ theorem lintegral_comap (κ : kernel α β) (hg : Measurable g) (c : γ) (g' :
theorem sum_comap_seq (κ : kernel α β) [IsSFiniteKernel κ] (hg : Measurable g) :
(kernel.sum fun n => comap (seq κ n) g hg) = comap κ g hg := by
- -- Porting note: was
- -- ext (a s hs) : 2
- ext (a s) : 2
- intro hs
+ ext a s hs
rw [kernel.sum_apply, comap_apply' κ hg a s, Measure.sum_apply _ hs, ← measure_sum_seq κ,
Measure.sum_apply _ hs]
simp_rw [comap_apply' _ hg _ s]
@@ -808,7 +796,7 @@ theorem comp_apply' (η : kernel β γ) (κ : kernel α β) (a : α) {s : Set γ
theorem comp_eq_snd_compProd (η : kernel β γ) [IsSFiniteKernel η] (κ : kernel α β)
[IsSFiniteKernel κ] : η ∘ₖ κ = snd (κ ⊗ₖ prodMkLeft α η) := by
- ext a s; intro hs
+ ext a s hs
rw [comp_apply' _ _ _ hs, snd_apply' _ _ hs, compProd_apply]
swap
· exact measurable_snd hs
@@ -841,14 +829,14 @@ theorem comp_assoc {δ : Type _} {mδ : MeasurableSpace δ} (ξ : kernel γ δ)
theorem deterministic_comp_eq_map (hf : Measurable f) (κ : kernel α β) :
deterministic f hf ∘ₖ κ = map κ f hf := by
- ext a s; intro hs
+ ext a s hs
simp_rw [map_apply' _ _ _ hs, comp_apply' _ _ _ hs, deterministic_apply' hf _ hs,
lintegral_indicator_const_comp hf hs, one_mul]
#align probability_theory.kernel.deterministic_comp_eq_map ProbabilityTheory.kernel.deterministic_comp_eq_map
theorem comp_deterministic_eq_comap (κ : kernel α β) (hg : Measurable g) :
κ ∘ₖ deterministic g hg = comap κ g hg := by
- ext a s; intro hs
+ ext a s hs
simp_rw [comap_apply' _ _ _ s, comp_apply' _ _ _ hs, deterministic_apply hg a,
lintegral_dirac' _ (kernel.measurable_coe κ hs)]
#align probability_theory.kernel.comp_deterministic_eq_comap ProbabilityTheory.kernel.comp_deterministic_eq_comap
The unported dependencies are
algebra.order.module
init.core
linear_algebra.free_module.finite.rank
algebra.order.monoid.cancel.defs
algebra.abs
algebra.group_power.lemmas
init.data.list.basic
linear_algebra.free_module.rank
algebra.order.monoid.cancel.basic
init.data.list.default
topology.subset_properties
init.logic
The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file