Cavalieri's principle (the layer-cake formula)
ProvedFamousTheorems.layer_cake_formulaCavalieri's principle (the layer-cake formula). Let be a.e.-measurable on a measure space , and let be a function that is a.e. nonnegative on and integrable on every interval . Then
With this is the layer-cake formula , and with it gives . These identities turn integrals into integrals of distribution functions. They are standard tools in harmonic analysis (interpolation, maximal functions) and in probability (moments from tail bounds).
Formalization note. Mathlib's MeasureTheory.lintegral_comp_eq_lintegral_meas_le_mul. Both sides are lower Lebesgue integrals in ENNReal: the left integrates ENNReal.ofReal of the interval integral , and the right integrates over with respect to Lebesgue measure. The hypothesis 0 ≤ᵐ[μ] f means -almost everywhere.
import Mathlib
namespace FamousTheorems
open MeasureTheory
theorem layer_cake_formula {α : Type*} [MeasurableSpace α] (μ : Measure α) {f : α → ℝ} {g : ℝ → ℝ} (f_nn : 0 ≤ᵐ[μ] f)
(f_mble : AEMeasurable f μ) (g_intble : ∀ t > 0, IntervalIntegrable g volume 0 t)
(g_nn : ∀ᵐ t ∂(volume.restrict (Set.Ioi 0)), 0 ≤ g t) :
∫⁻ ω, ENNReal.ofReal (∫ t in (0 : ℝ)..f ω, g t) ∂μ =
∫⁻ t in Set.Ioi 0, μ {a | t ≤ f a} * ENNReal.ofReal (g t) := by sorry
end FamousTheorems