English
Let μ be a sigma-finite measure on α, f: α → ℝ with f ≥ 0 and measurable, and g: ℝ → ℝ nonnegative with appropriate integrability. Then the integral of the composition G ∘ f can be computed as the tail integral against g: ∫⁻ ω of G(f(ω)) dμ = ∫⁻ t>0 μ{a: f(a) ≥ t} g′(t) dt (in a suitable sense). In particular, for G with derivative g, one has a Cavalieri-type equality.
Русский
Пусть μ — сигма- конечная мера на α, f: α → ℝ ≥ 0 измерима, G абсолютно непрерывна на [0,∞) с производной G′ = g. Тогда интеграл G ∘ f по μ равен интегралу по t > 0 веса μ{a: f(a) ≥ t} на функции g.
LaTeX
$$$$ \\int^{\\! -}_{\\omega} \\mathrm{ENNReal.ofReal}\\Big(\\int_{0}^{f(\\omega)} g(t)\\,dt\\Big) \\, d\\mu(\\omega) = \\int^{\\! -}_{t \\in (0,\\infty)} \\mu\\{a : t \\le f(a)\\} \\cdot \\mathrm{ENNReal.ofReal}(g(t)) \\, dt. $$$$
Lean4
/-- An auxiliary version of the layer cake formula (Cavalieri's principle, tail probability
formula), with a measurability assumption that would also essentially follow from the
integrability assumptions, and a sigma-finiteness assumption.
See `MeasureTheory.lintegral_comp_eq_lintegral_meas_le_mul` and
`MeasureTheory.lintegral_comp_eq_lintegral_meas_lt_mul` for the main formulations of the layer
cake formula. -/
theorem lintegral_comp_eq_lintegral_meas_le_mul_of_measurable_of_sigmaFinite (μ : Measure α) [SFinite μ] (f_nn : 0 ≤ f)
(f_mble : Measurable f) (g_intble : ∀ t > 0, IntervalIntegrable g volume 0 t) (g_mble : Measurable g)
(g_nn : ∀ t > 0, 0 ≤ g t) :
∫⁻ ω, ENNReal.ofReal (∫ t in 0..f ω, g t) ∂μ = ∫⁻ t in Ioi 0, μ {a : α | t ≤ f a} * ENNReal.ofReal (g t) :=
by
have g_intble' : ∀ t : ℝ, 0 ≤ t → IntervalIntegrable g volume 0 t :=
by
intro t ht
rcases eq_or_lt_of_le ht with h | h
· simp [← h]
· exact g_intble t h
have integrand_eq : ∀ ω, ENNReal.ofReal (∫ t in 0..f ω, g t) = ∫⁻ t in Ioc 0 (f ω), ENNReal.ofReal (g t) :=
by
intro ω
have g_ae_nn : 0 ≤ᵐ[volume.restrict (Ioc 0 (f ω))] g := by
filter_upwards [self_mem_ae_restrict (measurableSet_Ioc : MeasurableSet (Ioc 0 (f ω)))] with x hx using
g_nn x hx.1
rw [← ofReal_integral_eq_lintegral_ofReal (g_intble' (f ω) (f_nn ω)).1 g_ae_nn]
congr
exact intervalIntegral.integral_of_le (f_nn ω)
rw [lintegral_congr integrand_eq]
simp_rw [← lintegral_indicator measurableSet_Ioc]
rw [← lintegral_indicator measurableSet_Ioi, lintegral_lintegral_swap]
· apply congr_arg
funext s
have aux₁ :
(fun x => (Ioc 0 (f x)).indicator (fun t : ℝ => ENNReal.ofReal (g t)) s) = fun x =>
ENNReal.ofReal (g s) * (Ioi (0 : ℝ)).indicator (fun _ => 1) s *
(Ici s).indicator (fun _ : ℝ => (1 : ℝ≥0∞)) (f x) :=
by
funext a
by_cases h : s ∈ Ioc (0 : ℝ) (f a)
· simp only [h, show s ∈ Ioi (0 : ℝ) from h.1, show f a ∈ Ici s from h.2, indicator_of_mem, mul_one]
· have h_copy := h
simp only [mem_Ioc, not_and, not_le] at h
by_cases h' : 0 < s
· simp only [h_copy, h h', indicator_of_notMem, not_false_iff, mem_Ici, not_le, mul_zero]
· have : s ∉ Ioi (0 : ℝ) := h'
simp only [this, h', indicator_of_notMem, not_false_iff, mul_zero, zero_mul, mem_Ioc, false_and]
simp_rw [aux₁]
rw [lintegral_const_mul']
swap
· apply ENNReal.mul_ne_top ENNReal.ofReal_ne_top
by_cases h : (0 : ℝ) < s <;> · simp [h]
simp_rw [show
(fun a => (Ici s).indicator (fun _ : ℝ => (1 : ℝ≥0∞)) (f a)) = fun a =>
{a : α | s ≤ f a}.indicator (fun _ => 1) a
by funext a; by_cases h : s ≤ f a <;> simp [h]]
rw [lintegral_indicator₀]
swap; · exact f_mble.nullMeasurable measurableSet_Ici
rw [lintegral_one, Measure.restrict_apply MeasurableSet.univ, univ_inter, indicator_mul_left, mul_assoc,
show
(Ioi 0).indicator (fun _x : ℝ => (1 : ℝ≥0∞)) s * μ {a : α | s ≤ f a} =
(Ioi 0).indicator (fun _x : ℝ => 1 * μ {a : α | s ≤ f a}) s
by by_cases h : 0 < s <;> simp [h]]
simp_rw [mul_comm _ (ENNReal.ofReal _), one_mul]
rfl
have aux₂ :
(Function.uncurry fun (x : α) (y : ℝ) => (Ioc 0 (f x)).indicator (fun t : ℝ => ENNReal.ofReal (g t)) y) =
{p : α × ℝ | p.2 ∈ Ioc 0 (f p.1)}.indicator fun p => ENNReal.ofReal (g p.2) :=
by
funext p
cases p with
| mk p_fst p_snd => ?_
rw [Function.uncurry_apply_pair]
by_cases h : p_snd ∈ Ioc 0 (f p_fst)
· have h' : (p_fst, p_snd) ∈ {p : α × ℝ | p.snd ∈ Ioc 0 (f p.fst)} := h
rw [Set.indicator_of_mem h', Set.indicator_of_mem h]
· have h' : (p_fst, p_snd) ∉ {p : α × ℝ | p.snd ∈ Ioc 0 (f p.fst)} := h
rw [Set.indicator_of_notMem h', Set.indicator_of_notMem h]
rw [aux₂]
have mble₀ : MeasurableSet {p : α × ℝ | p.snd ∈ Ioc 0 (f p.fst)} := by
simpa only [mem_univ, Pi.zero_apply, true_and] using
measurableSet_region_between_oc measurable_zero f_mble MeasurableSet.univ
exact (ENNReal.measurable_ofReal.comp (g_mble.comp measurable_snd)).aemeasurable.indicator₀ mble₀.nullMeasurableSet