Skip to content

Commit c6620c8

Browse files
committed
feat: integral against the composition of kernels (#22363)
Prove the formula for the integral against the composition of kernels. This is a simplified version of the proof for the composition-product which is in the same file. However we need to do all the proofs again because the results about composition-product require s-finiteness while composition do not. Co-authored-by: EtienneC30 <66847262+EtienneC30@users.noreply.github.com>
1 parent 93207dc commit c6620c8

File tree

5 files changed

+278
-56
lines changed

5 files changed

+278
-56
lines changed

Mathlib/Probability/Kernel/Composition/Basic.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,6 +1401,15 @@ lemma snd_comp (κ : Kernel α β) (η : Kernel β (γ × δ)) : (η ∘ₖ κ).
14011401
· rfl
14021402
· exact measurable_snd hs
14031403

1404+
lemma comp_add_right (μ κ : Kernel α β) (η : Kernel β γ) :
1405+
η ∘ₖ (μ + κ) = η ∘ₖ μ + η ∘ₖ κ := by ext _ _ hs; simp [comp_apply' _ _ _ hs]
1406+
1407+
lemma comp_add_left (μ : Kernel α β) (κ η : Kernel β γ) :
1408+
(κ + η) ∘ₖ μ = κ ∘ₖ μ + η ∘ₖ μ := by
1409+
ext a s hs
1410+
simp_rw [comp_apply' _ _ _ hs, add_apply, Measure.add_apply, comp_apply' _ _ _ hs,
1411+
lintegral_add_left (Kernel.measurable_coe κ hs)]
1412+
14041413
end Comp
14051414

14061415
section Prod

Mathlib/Probability/Kernel/Composition/IntegralCompProd.lean

Lines changed: 197 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,47 @@
11
/-
22
Copyright (c) 2023 Rémy Degenne. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
4-
Authors: Rémy Degenne
4+
Authors: Rémy Degenne, Etienne Marion
55
-/
66
import Mathlib.Probability.Kernel.Composition.Basic
77
import Mathlib.Probability.Kernel.MeasurableIntegral
88

99
/-!
10-
# Bochner integral of a function against the composition-product of two kernels
10+
# Bochner integral of a function against the composition and the composition-products of two kernels
1111
12-
We prove properties of the composition-product of two kernels. If `κ` is an s-finite kernel from
13-
`α` to `β` and `η` is an s-finite kernel from `α × β` to `γ`, we can form their composition-product
14-
`κ ⊗ₖ η : Kernel α (β × γ)`. We proved in `ProbabilityTheory.Kernel.lintegral_compProd` that it
12+
We prove properties of the composition and the composition-product of two kernels.
13+
14+
If `κ` is a kernel from `α` to `β` and `η` is a kernel from `β` to `γ`, we can form their
15+
composition `η ∘ₖ κ : Kernel α γ`. We proved in `ProbabilityTheory.Kernel.lintegral_comp` that it
16+
verifies `∫⁻ c, f c ∂((η ∘ₖ κ) a) = ∫⁻ b, ∫⁻ c, f c ∂(η b) ∂(κ a)`. In this file, we
17+
prove the same equality for the Bochner integral.
18+
19+
If `κ` is an s-finite kernel from `α` to `β` and `η` is an s-finite kernel from `α × β` to `γ`,
20+
we can form their composition-product `κ ⊗ₖ η : Kernel α (β × γ)`.
21+
We proved in `ProbabilityTheory.Kernel.lintegral_compProd` that it
1522
verifies `∫⁻ bc, f bc ∂((κ ⊗ₖ η) a) = ∫⁻ b, ∫⁻ c, f (b, c) ∂(η (a, b)) ∂(κ a)`. In this file, we
1623
prove the same equality for the Bochner integral.
1724
1825
## Main statements
1926
2027
* `ProbabilityTheory.integral_compProd`: the integral against the composition-product is
21-
`∫ z, f z ∂((κ ⊗ₖ η) a) = ∫ x, ∫ y, f (x, y) ∂(η (a, x)) ∂(κ a)`
28+
`∫ z, f z ∂((κ ⊗ₖ η) a) = ∫ x, ∫ y, f (x, y) ∂(η (a, x)) ∂(κ a)`.
29+
30+
* `ProbabilityTheory.integral_comp`: the integral against the composition is
31+
`∫⁻ z, f z ∂((η ∘ₖ κ) a) = ∫⁻ x, ∫⁻ y, f y ∂(η x) ∂(κ a)`.
2232
2333
## Implementation details
2434
25-
This file is to a large extent a copy of part of
26-
`Mathlib/MeasureTheory/Constructions/Prod/Basic.lean`. The product of
27-
two measures is a particular case of composition-product of kernels and it turns out that once the
28-
measurablity of the Lebesgue integral of a kernel is proved, almost all proofs about integrals
29-
against products of measures extend with minimal modifications to the composition-product of two
30-
kernels.
35+
This file is to a large extent a copy of part of `Mathlib/MeasureTheory/Integral/Prod.lean`.
36+
The product of two measures is a particular case of composition-product of kernels and
37+
it turns out that once the measurablity of the Lebesgue integral of a kernel is proved,
38+
almost all proofs about integrals against products of measures extend with minimal modifications
39+
to the composition-product of two kernels.
40+
41+
The composition of kernels can also be expressed easily with the composition-product and therefore
42+
the proofs about the composition are only simplified versions of the ones for the
43+
composition-product. However it is necessary to do all the proofs once again because the
44+
composition-product requires s-finiteness while the composition does not.
3145
-/
3246

3347

@@ -37,11 +51,14 @@ open Set Function Real ENNReal MeasureTheory Filter ProbabilityTheory Probabilit
3751
open scoped Topology ENNReal MeasureTheory
3852

3953
variable {α β γ E : Type*} {mα : MeasurableSpace α} {mβ : MeasurableSpace β}
40-
{mγ : MeasurableSpace γ} [NormedAddCommGroup E] {κ : Kernel α β} [IsSFiniteKernel κ]
41-
{η : Kernel (α × β) γ} [IsSFiniteKernel η] {a : α}
54+
{mγ : MeasurableSpace γ} [NormedAddCommGroup E] {a : α}
4255

4356
namespace ProbabilityTheory
4457

58+
section compProd
59+
60+
variable {κ : Kernel α β} [IsSFiniteKernel κ] {η : Kernel (α × β) γ} [IsSFiniteKernel η]
61+
4562
theorem hasFiniteIntegral_prod_mk_left (a : α) {s : Set (β × γ)} (h2s : (κ ⊗ₖ η) a s ≠ ∞) :
4663
HasFiniteIntegral (fun b => (η (a, b) (Prod.mk b ⁻¹' s)).toReal) (κ a) := by
4764
let t := toMeasurable ((κ ⊗ₖ η) a) s
@@ -118,10 +135,14 @@ theorem integrable_compProd_iff ⦃f : β × γ → E⦄ (hf : AEStronglyMeasura
118135
simp only [Integrable, hasFiniteIntegral_compProd_iff' hf, hf.norm.integral_kernel_compProd,
119136
hf, hf.compProd_mk_left, eventually_and, true_and]
120137

121-
theorem _root_.MeasureTheory.Integrable.compProd_mk_left_ae ⦃f : β × γ → E⦄
138+
theorem _root_.MeasureTheory.Integrable.ae_of_compProd ⦃f : β × γ → E⦄
122139
(hf : Integrable f ((κ ⊗ₖ η) a)) : ∀ᵐ x ∂κ a, Integrable (fun y => f (x, y)) (η (a, x)) :=
123140
((integrable_compProd_iff hf.aestronglyMeasurable).mp hf).1
124141

142+
@[deprecated (since := "2025-02-28")]
143+
alias _root_.MeasureTheory.Integrable.compProd_mk_left_ae :=
144+
_root_.MeasureTheory.Integrable.ae_of_compProd
145+
125146
theorem _root_.MeasureTheory.Integrable.integral_norm_compProd ⦃f : β × γ → E⦄
126147
(hf : Integrable f ((κ ⊗ₖ η) a)) : Integrable (fun x => ∫ y, ‖f (x, y)‖ ∂η (a, x)) (κ a) :=
127148
((integrable_compProd_iff hf.aestronglyMeasurable).mp hf).2
@@ -146,23 +167,23 @@ theorem Kernel.integral_fn_integral_add ⦃f g : β × γ → E⦄ (F : E → E'
146167
∫ x, F (∫ y, f (x, y) + g (x, y) ∂η (a, x)) ∂κ a =
147168
∫ x, F (∫ y, f (x, y) ∂η (a, x) + ∫ y, g (x, y) ∂η (a, x)) ∂κ a := by
148169
refine integral_congr_ae ?_
149-
filter_upwards [hf.compProd_mk_left_ae, hg.compProd_mk_left_ae] with _ h2f h2g
170+
filter_upwards [hf.ae_of_compProd, hg.ae_of_compProd] with _ h2f h2g
150171
simp [integral_add h2f h2g]
151172

152173
theorem Kernel.integral_fn_integral_sub ⦃f g : β × γ → E⦄ (F : E → E')
153174
(hf : Integrable f ((κ ⊗ₖ η) a)) (hg : Integrable g ((κ ⊗ₖ η) a)) :
154175
∫ x, F (∫ y, f (x, y) - g (x, y) ∂η (a, x)) ∂κ a =
155176
∫ x, F (∫ y, f (x, y) ∂η (a, x) - ∫ y, g (x, y) ∂η (a, x)) ∂κ a := by
156177
refine integral_congr_ae ?_
157-
filter_upwards [hf.compProd_mk_left_ae, hg.compProd_mk_left_ae] with _ h2f h2g
178+
filter_upwards [hf.ae_of_compProd, hg.ae_of_compProd] with _ h2f h2g
158179
simp [integral_sub h2f h2g]
159180

160181
theorem Kernel.lintegral_fn_integral_sub ⦃f g : β × γ → E⦄ (F : E → ℝ≥0∞)
161182
(hf : Integrable f ((κ ⊗ₖ η) a)) (hg : Integrable g ((κ ⊗ₖ η) a)) :
162183
∫⁻ x, F (∫ y, f (x, y) - g (x, y) ∂η (a, x)) ∂κ a =
163184
∫⁻ x, F (∫ y, f (x, y) ∂η (a, x) - ∫ y, g (x, y) ∂η (a, x)) ∂κ a := by
164185
refine lintegral_congr_ae ?_
165-
filter_upwards [hf.compProd_mk_left_ae, hg.compProd_mk_left_ae] with _ h2f h2g
186+
filter_upwards [hf.ae_of_compProd, hg.ae_of_compProd] with _ h2f h2g
166187
simp [integral_sub h2f h2g]
167188

168189
theorem Kernel.integral_integral_add ⦃f g : β × γ → E⦄ (hf : Integrable f ((κ ⊗ₖ η) a))
@@ -261,4 +282,162 @@ theorem setIntegral_compProd_univ_left (f : β × γ → E) {t : Set γ} (ht : M
261282
∫ z in univ ×ˢ t, f z ∂(κ ⊗ₖ η) a = ∫ x, ∫ y in t, f (x, y) ∂η (a, x) ∂κ a := by
262283
simp_rw [setIntegral_compProd MeasurableSet.univ ht hf, Measure.restrict_univ]
263284

285+
end compProd
286+
287+
section comp
288+
289+
variable {κ : Kernel α β} {η : Kernel β γ}
290+
291+
theorem _root_.MeasureTheory.AEStronglyMeasurable.integral_kernel_comp [NormedSpace ℝ E]
292+
⦃f : γ → E⦄ (hf : AEStronglyMeasurable f ((η ∘ₖ κ) a)) :
293+
AEStronglyMeasurable (fun x ↦ ∫ y, f y ∂η x) (κ a) :=
294+
fun x ↦ ∫ y, hf.mk f y ∂η x, hf.stronglyMeasurable_mk.integral_kernel, by
295+
filter_upwards [ae_ae_of_ae_comp hf.ae_eq_mk] with _ hx using integral_congr_ae hx⟩
296+
297+
theorem _root_.MeasureTheory.AEStronglyMeasurable.comp {δ : Type*} [TopologicalSpace δ]
298+
{f : γ → δ} (hf : AEStronglyMeasurable f ((η ∘ₖ κ) a)) :
299+
∀ᵐ x ∂κ a, AEStronglyMeasurable f (η x) := by
300+
filter_upwards [ae_ae_of_ae_comp hf.ae_eq_mk] with x hx using
301+
⟨hf.mk f, hf.stronglyMeasurable_mk, hx⟩
302+
303+
/-! ### Integrability with respect to composition -/
304+
305+
theorem hasFiniteIntegral_comp_iff ⦃f : γ → E⦄ (hf : StronglyMeasurable f) :
306+
HasFiniteIntegral f ((η ∘ₖ κ) a) ↔
307+
(∀ᵐ x ∂κ a, HasFiniteIntegral f (η x)) ∧ HasFiniteIntegral (fun x ↦ ∫ y, ‖f y‖ ∂η x) (κ a) := by
308+
simp_rw [hasFiniteIntegral_iff_enorm, lintegral_comp _ _ _ hf.enorm]
309+
simp_rw [integral_eq_lintegral_of_nonneg_ae (ae_of_all _ fun y ↦ norm_nonneg _)
310+
hf.norm.aestronglyMeasurable, enorm_eq_ofReal toReal_nonneg, ofReal_norm_eq_enorm]
311+
have : ∀ {p q r : Prop} (_ : r → p), (r ↔ p ∧ q) ↔ p → (r ↔ q) := fun h ↦ by
312+
rw [← and_congr_right_iff, and_iff_right_of_imp h]
313+
rw [this]
314+
· intro h
315+
rw [lintegral_congr_ae]
316+
filter_upwards [h] with x hx
317+
rw [ofReal_toReal]
318+
rwa [← lt_top_iff_ne_top]
319+
· exact fun h ↦ ae_lt_top hf.enorm.lintegral_kernel h.ne
320+
321+
theorem hasFiniteIntegral_comp_iff' ⦃f : γ → E⦄ (hf : AEStronglyMeasurable f ((η ∘ₖ κ) a)) :
322+
HasFiniteIntegral f ((η ∘ₖ κ) a) ↔
323+
(∀ᵐ x ∂κ a, HasFiniteIntegral f (η x)) ∧ HasFiniteIntegral (fun x ↦ ∫ y, ‖f y‖ ∂η x) (κ a) := by
324+
rw [hasFiniteIntegral_congr hf.ae_eq_mk, hasFiniteIntegral_comp_iff hf.stronglyMeasurable_mk]
325+
refine and_congr (eventually_congr ?_) (hasFiniteIntegral_congr ?_)
326+
· filter_upwards [ae_ae_of_ae_comp hf.ae_eq_mk.symm] with _ hx using
327+
hasFiniteIntegral_congr hx
328+
· filter_upwards [ae_ae_of_ae_comp hf.ae_eq_mk.symm] with _ hx using
329+
integral_congr_ae (EventuallyEq.fun_comp hx _)
330+
331+
theorem integrable_comp_iff ⦃f : γ → E⦄ (hf : AEStronglyMeasurable f ((η ∘ₖ κ) a)) :
332+
Integrable f ((η ∘ₖ κ) a) ↔
333+
(∀ᵐ y ∂κ a, Integrable f (η y)) ∧ Integrable (fun y ↦ ∫ z, ‖f z‖ ∂η y) (κ a) := by
334+
simp only [Integrable, hf, hasFiniteIntegral_comp_iff' hf, true_and, eventually_and, hf.comp,
335+
hf.norm.integral_kernel_comp]
336+
337+
theorem _root_.MeasureTheory.Integrable.ae_of_comp ⦃f : γ → E⦄ (hf : Integrable f ((η ∘ₖ κ) a)) :
338+
∀ᵐ x ∂κ a, Integrable f (η x) := ((integrable_comp_iff hf.1).1 hf).1
339+
340+
theorem _root_.MeasureTheory.Integrable.integral_norm_comp ⦃f : γ → E⦄
341+
(hf : Integrable f ((η ∘ₖ κ) a)) : Integrable (fun x ↦ ∫ y, ‖f y‖ ∂η x) (κ a) :=
342+
((integrable_comp_iff hf.1).1 hf).2
343+
344+
theorem _root_.MeasureTheory.Integrable.integral_comp [NormedSpace ℝ E] ⦃f : γ → E⦄
345+
(hf : Integrable f ((η ∘ₖ κ) a)) : Integrable (fun x ↦ ∫ y, f y ∂η x) (κ a) :=
346+
Integrable.mono hf.integral_norm_comp hf.1.integral_kernel_comp <|
347+
ae_of_all _ fun _ ↦ (norm_integral_le_integral_norm _).trans_eq
348+
(norm_of_nonneg <| integral_nonneg_of_ae <| ae_of_all _ fun _ ↦ norm_nonneg _).symm
349+
350+
/-! ### Bochner integral with respect to the composition -/
351+
352+
variable [NormedSpace ℝ E] {E' : Type*} [NormedAddCommGroup E'] [NormedSpace ℝ E']
353+
354+
namespace Kernel
355+
356+
theorem integral_fn_integral_add_comp ⦃f g : γ → E⦄ (F : E → E')
357+
(hf : Integrable f ((η ∘ₖ κ) a)) (hg : Integrable g ((η ∘ₖ κ) a)) :
358+
∫ x, F (∫ y, f y + g y ∂η x) ∂κ a = ∫ x, F (∫ y, f y ∂η x + ∫ y, g y ∂η x) ∂κ a := by
359+
refine integral_congr_ae ?_
360+
filter_upwards [hf.ae_of_comp, hg.ae_of_comp] with _ h2f h2g
361+
simp [integral_add h2f h2g]
362+
363+
theorem integral_fn_integral_sub_comp ⦃f g : γ → E⦄ (F : E → E')
364+
(hf : Integrable f ((η ∘ₖ κ) a)) (hg : Integrable g ((η ∘ₖ κ) a)) :
365+
∫ x, F (∫ y, f y - g y ∂η x) ∂κ a = ∫ x, F (∫ y, f y ∂η x - ∫ y, g y ∂η x) ∂κ a := by
366+
refine integral_congr_ae ?_
367+
filter_upwards [hf.ae_of_comp, hg.ae_of_comp] with _ h2f h2g
368+
simp [integral_sub h2f h2g]
369+
370+
theorem lintegral_fn_integral_sub_comp ⦃f g : γ → E⦄ (F : E → ℝ≥0∞)
371+
(hf : Integrable f ((η ∘ₖ κ) a)) (hg : Integrable g ((η ∘ₖ κ) a)) :
372+
∫⁻ x, F (∫ y, f y - g y ∂η x) ∂κ a = ∫⁻ x, F (∫ y, f y ∂η x - ∫ y, g y ∂η x) ∂κ a := by
373+
refine lintegral_congr_ae ?_
374+
filter_upwards [hf.ae_of_comp, hg.ae_of_comp] with _ h2f h2g
375+
simp [integral_sub h2f h2g]
376+
377+
theorem integral_integral_add_comp ⦃f g : γ → E⦄ (hf : Integrable f ((η ∘ₖ κ) a))
378+
(hg : Integrable g ((η ∘ₖ κ) a)) :
379+
∫ x, ∫ y, f y + g y ∂η x ∂κ a = ∫ x, ∫ y, f y ∂η x ∂κ a + ∫ x, ∫ y, g y ∂η x ∂κ a :=
380+
(integral_fn_integral_add_comp id hf hg).trans <| integral_add hf.integral_comp hg.integral_comp
381+
382+
theorem integral_integral_add'_comp ⦃f g : γ → E⦄ (hf : Integrable f ((η ∘ₖ κ) a))
383+
(hg : Integrable g ((η ∘ₖ κ) a)) :
384+
∫ x, ∫ y, (f + g) y ∂η x ∂κ a = ∫ x, ∫ y, f y ∂η x ∂κ a + ∫ x, ∫ y, g y ∂η x ∂κ a :=
385+
integral_integral_add_comp hf hg
386+
387+
theorem integral_integral_sub_comp ⦃f g : γ → E⦄ (hf : Integrable f ((η ∘ₖ κ) a))
388+
(hg : Integrable g ((η ∘ₖ κ) a)) :
389+
∫ x, ∫ y, f y - g y ∂η x ∂κ a = ∫ x, ∫ y, f y ∂η x ∂κ a - ∫ x, ∫ y, g y ∂η x ∂κ a :=
390+
(integral_fn_integral_sub_comp id hf hg).trans <| integral_sub hf.integral_comp hg.integral_comp
391+
392+
theorem integral_integral_sub'_comp ⦃f g : γ → E⦄ (hf : Integrable f ((η ∘ₖ κ) a))
393+
(hg : Integrable g ((η ∘ₖ κ) a)) :
394+
∫ x, ∫ y, (f - g) y ∂η x ∂κ a = ∫ x, ∫ y, f y ∂η x ∂κ a - ∫ x, ∫ y, g y ∂η x ∂κ a :=
395+
integral_integral_sub_comp hf hg
396+
397+
theorem continuous_integral_integral_comp :
398+
Continuous fun f : γ →₁[(η ∘ₖ κ) a] E ↦ ∫ x, ∫ y, f y ∂η x ∂κ a := by
399+
refine continuous_iff_continuousAt.2 fun g ↦ ?_
400+
refine tendsto_integral_of_L1 _ (L1.integrable_coeFn g).integral_comp
401+
(Eventually.of_forall fun h ↦ (L1.integrable_coeFn h).integral_comp) ?_
402+
simp_rw [← lintegral_fn_integral_sub_comp (‖·‖ₑ) (L1.integrable_coeFn _) (L1.integrable_coeFn g)]
403+
refine tendsto_of_tendsto_of_tendsto_of_le_of_le
404+
(h := fun i ↦ ∫⁻ x, ∫⁻ y, ‖i y - g y‖ₑ ∂η x ∂κ a)
405+
tendsto_const_nhds ?_ (fun _ ↦ zero_le _) ?_
406+
swap; · exact fun _ ↦ lintegral_mono fun _ ↦ enorm_integral_le_lintegral_enorm _
407+
have (i : γ →₁[(η ∘ₖ κ) a] E) : Measurable fun z ↦ ‖i z - g z‖ₑ :=
408+
((Lp.stronglyMeasurable i).sub (Lp.stronglyMeasurable g)).enorm
409+
simp_rw [← lintegral_comp _ _ _ (this _), ← L1.ofReal_norm_sub_eq_lintegral, ← ofReal_zero]
410+
exact (continuous_ofReal.tendsto 0).comp (tendsto_iff_norm_sub_tendsto_zero.1 tendsto_id)
411+
412+
theorem integral_comp : ∀ {f : γ → E} (_ : Integrable f ((η ∘ₖ κ) a)),
413+
∫ z, f z ∂(η ∘ₖ κ) a = ∫ x, ∫ y, f y ∂η x ∂κ a := by
414+
by_cases hE : CompleteSpace E; swap
415+
· simp [integral, hE]
416+
apply Integrable.induction
417+
· intro c s hs ms
418+
simp_rw [integral_indicator hs, MeasureTheory.setIntegral_const, integral_smul_const]
419+
congr
420+
rw [integral_toReal, Kernel.comp_apply' _ _ _ hs]
421+
· exact (Kernel.measurable_coe _ hs).aemeasurable
422+
· exact ae_lt_top_of_comp_ne_top a ms.ne
423+
· rintro f g - i_f i_g hf hg
424+
simp_rw [integral_add' i_f i_g, integral_integral_add'_comp i_f i_g, hf, hg]
425+
· exact isClosed_eq continuous_integral Kernel.continuous_integral_integral_comp
426+
· rintro f g hfg - hf
427+
convert hf using 1
428+
· exact integral_congr_ae hfg.symm
429+
· apply integral_congr_ae
430+
filter_upwards [ae_ae_of_ae_comp hfg] with x hfgx using integral_congr_ae (ae_eq_symm hfgx)
431+
432+
theorem setIntegral_comp {f : γ → E} {s : Set γ} (hs : MeasurableSet s)
433+
(hf : IntegrableOn f s ((η ∘ₖ κ) a)) :
434+
∫ z in s, f z ∂(η ∘ₖ κ) a = ∫ x, ∫ y in s, f y ∂η x ∂κ a := by
435+
rw [← restrict_apply (η ∘ₖ κ) hs, ← comp_restrict hs, integral_comp]
436+
· simp_rw [restrict_apply]
437+
· rwa [comp_restrict, restrict_apply]
438+
439+
end Kernel
440+
441+
end comp
442+
264443
end ProbabilityTheory

0 commit comments

Comments
 (0)