/-Copyright (c) 2026 Carles MarΓn. All rights reserved.Released under Apache 2.0 license as described in the file LICENSE.Authors: Carles MarΓn, Claude (AI assistant)-/module public import Formalizations.MeasureTheory.PappusGuldinpublic import Mathlib.MeasureTheory.Integral.IntegrableOnpublic import Mathlib.MeasureTheory.Integral.Bochner.Basicpublic import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basicpublic import Mathlib.Analysis.SpecialFunctions.Sqrtpublic import Mathlib.Analysis.SpecialFunctions.ImproperIntegralspublic import Mathlib.Analysis.SpecialFunctions.NonIntegrablepublic import Mathlib.Analysis.SpecialFunctions.Pow.Realpublic import Mathlib.Tactic.Ringpublic import Mathlib.Tactic.FieldSimppublic import Mathlib.Tactic.NormNum /-!# Torricelli's trumpet Revolving `y = 1/x`, `x β₯ 1`, about the `x`-axis gives a solid of volume `Ο`; adding the cylinder ofradius 1 and height 1 gives the volume `2Ο` of the cylinder of radius `β2` and height 1 (Theorem ofthe Day's form). The plane region under the hyperbola has infinite area and the surface integrand`(1/x)β(1 + xβ»β΄) β₯ 1/x` is not integrable: a finite volume with an infinite cross-section and skin.The volumes come from our PappusβGuldin `volume_revolution`. ## Main results * `Torricelli.volume_trumpet`: the trumpet has volume Ο* `Torricelli.volume_trumpet_union_cylinder`: trumpet + unit cylinder = cylinder of radius β2 and height 1 (volume 2Ο)* `Torricelli.volume_section_eq_top`: the plane section has infinite area* `Torricelli.not_integrableOn_surface`: the surface-area integrand is not integrable on [1, β) ## References * R. Whitty, Theorem of the Day, Β«Torricelli's TrumpetΒ» (Analysis/Torricelli).* E. Torricelli, Opera geometrica (1644); P. Mancosu, Philosophy of Mathematics and Mathematical Practice in the Seventeenth Century, OUP 1999, ch. 5.-/ @[expose] public section open MeasureTheory Set namespace Torricelli /-- `β«_{r β€ a} rβΊ = aΒ²/2` for `a β₯ 0`. -/private lemma lintegral_Iic (a : β) (ha : 0 β€ a) : β«β» r in Iic a, ENNReal.ofReal r = ENNReal.ofReal (a ^ 2 / 2) := by have h1 : β«β» r in Iic a, ENNReal.ofReal r = β«β» r in Icc 0 a, ENNReal.ofReal r := by rw [β lintegral_indicator measurableSet_Iic, β lintegral_indicator measurableSet_Icc] refine lintegral_congr fun r => ?_ by_cases h0 : 0 β€ r Β· by_cases hr : r β€ a Β· simp [indicator, hr, h0] Β· simp [indicator, hr] Β· have : r β€ 0 := (not_le.mp h0).le simp [indicator, ENNReal.ofReal_eq_zero.mpr this, h0] rw [h1, β ofReal_integral_eq_lintegral_ofReal] Β· congr 1 rw [integral_Icc_eq_integral_Ioc, β intervalIntegral.integral_of_le ha] simp Β· exact (continuous_id.integrableOn_Icc) Β· exact ae_restrict_of_forall_mem measurableSet_Icc fun r hr => hr.1 /-- Tonelli for regions `{p | p.2 β S β§ p.1 β€ g p.2}`. -/private lemma region_lintegral (S : Set β) (hS : MeasurableSet S) (g : β β β) (hg : Measurable g) : β«β» p in {p : β Γ β | p.2 β S β§ p.1 β€ g p.2}, ENNReal.ofReal p.1 = β«β» z in S, β«β» r in Iic (g z), ENNReal.ofReal r := by have hR : MeasurableSet {p : β Γ β | p.2 β S β§ p.1 β€ g p.2} := (measurable_snd hS).inter (measurableSet_le measurable_fst (hg.comp measurable_snd)) have hind : Measurable fun p : β Γ β => {p : β Γ β | p.2 β S β§ p.1 β€ g p.2}.indicator (fun p : β Γ β => ENNReal.ofReal p.1) p := (by fun_prop : Measurable fun p : β Γ β => ENNReal.ofReal p.1).indicator hR rw [β lintegral_indicator hR, Measure.volume_eq_prod, lintegral_prod_symm _ hind.aemeasurable, β lintegral_indicator hS] refine lintegral_congr fun z => ?_ have e : (fun r : β => {p : β Γ β | p.2 β S β§ p.1 β€ g p.2}.indicator (fun p : β Γ β => ENNReal.ofReal p.1) (r, z)) = (S.indicator fun _ : β => ((Iic (g z)).indicator (fun r : β => ENNReal.ofReal r))) z := by funext r by_cases hz : z β S <;> by_cases hr : r β€ g z <;> simp [indicator, hz, hr] by_cases hz : z β S Β· simp only [indicator, hz, ite_true] rw [β lintegral_indicator measurableSet_Iic] refine lintegral_congr fun r => ?_ by_cases hr : r β€ g z <;> simp [indicator, hz, hr] Β· simp [indicator, hz] /-- Volume of a solid with `0 β€ z β€ 1`-type slices of constant radius bound `c`. -/private lemma volume_cyl (c : β) (hc : 0 β€ c) : volume {q : (β Γ β) Γ β | 0 β€ q.2 β§ q.2 β€ 1 β§ Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2) β€ c} = ENNReal.ofReal (2 * Real.pi) * ENNReal.ofReal (c ^ 2 / 2) := by have hset : {q : (β Γ β) Γ β | 0 β€ q.2 β§ q.2 β€ 1 β§ Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2) β€ c} = {q : (β Γ β) Γ β | (Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2), q.2) β {p : β Γ β | p.2 β Icc (0 : β) 1 β§ p.1 β€ (fun _ => c) p.2}} := by ext q; simp [and_assoc] rw [hset, PappusGuldin.volume_revolution, region_lintegral (Icc 0 1) measurableSet_Icc _ measurable_const] Β· congr 1 simp only [lintegral_Iic c hc] rw [setLIntegral_const, Real.volume_Icc] simp Β· exact (measurable_snd measurableSet_Icc).inter (measurableSet_le measurable_fst measurable_const) /-- The trumpet has volume `Ο`. -/theorem volume_trumpet : volume {q : (β Γ β) Γ β | 1 β€ q.2 β§ Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2) β€ 1 / q.2} = ENNReal.ofReal Real.pi := by have hset : {q : (β Γ β) Γ β | 1 β€ q.2 β§ Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2) β€ 1 / q.2} = {q : (β Γ β) Γ β | (Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2), q.2) β {p : β Γ β | p.2 β Ici (1 : β) β§ p.1 β€ (fun z : β => 1 / z) p.2}} := by ext q; simp [and_comm] have hg : Measurable fun z : β => 1 / z := by fun_prop rw [hset, PappusGuldin.volume_revolution, region_lintegral (Ici 1) measurableSet_Ici _ hg] swap Β· exact (measurable_snd measurableSet_Ici).inter (measurableSet_le measurable_fst (hg.comp measurable_snd)) have h1 : β«β» z in Ici (1 : β), β«β» r in Iic (1 / z), ENNReal.ofReal r = β«β» z in Ioi (1 : β), ENNReal.ofReal (z ^ (-2 : β) / 2) := by calc β«β» z in Ici (1 : β), β«β» r in Iic (1 / z), ENNReal.ofReal r = β«β» z in Ioi (1 : β), β«β» r in Iic (1 / z), ENNReal.ofReal r := (setLIntegral_congr Ioi_ae_eq_Ici).symm _ = _ := by refine setLIntegral_congr_fun measurableSet_Ioi fun z hz => ?_ have hz0 : (0 : β) < z := by have := hz.out; linarith rw [lintegral_Iic (1 / z) (by positivity)] congr 1 rw [Real.rpow_neg hz0.le, Real.rpow_two] field_simp have hint : IntegrableOn (fun z : β => z ^ (-2 : β) / 2) (Ioi 1) := (integrableOn_Ioi_rpow_of_lt (by norm_num) one_pos).div_const 2 have h2 : β«β» z in Ioi (1 : β), ENNReal.ofReal (z ^ (-2 : β) / 2) = ENNReal.ofReal (1 / 2) := by rw [β ofReal_integral_eq_lintegral_ofReal hint (ae_restrict_of_forall_mem measurableSet_Ioi fun z hz => by have hz0 : (0 : β) < z := by have := hz.out; linarith show 0 β€ z ^ (-2 : β) / 2 positivity)] congr 1 rw [integral_div, integral_Ioi_rpow_of_lt (by norm_num) one_pos] norm_num rw [h1, h2, β ENNReal.ofReal_mul (by positivity)] congr 1 ring private lemma volume_null_slice : volume {q : (β Γ β) Γ β | q.2 = 1} = 0 := by have : {q : (β Γ β) Γ β | q.2 = 1} = (univ : Set (β Γ β)) ΓΛ’ {1} := by ext q; simp rw [this, Measure.volume_eq_prod, Measure.prod_prod, Real.volume_singleton, mul_zero] /-- Trumpet plus unit cylinder has the volume `2Ο` of the cylinder of radius `β2`, height 1. -/theorem volume_trumpet_union_cylinder : volume ({q : (β Γ β) Γ β | 1 β€ q.2 β§ Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2) β€ 1 / q.2} βͺ {q : (β Γ β) Γ β | 0 β€ q.2 β§ q.2 β€ 1 β§ Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2) β€ 1}) = volume {q : (β Γ β) Γ β | 0 β€ q.2 β§ q.2 β€ 1 β§ Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2) β€ Real.sqrt 2} β§ volume {q : (β Γ β) Γ β | 0 β€ q.2 β§ q.2 β€ 1 β§ Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2) β€ Real.sqrt 2} = ENNReal.ofReal (2 * Real.pi) := by have hf : Measurable fun q : (β Γ β) Γ β => Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2) := by fun_prop have hC : MeasurableSet {q : (β Γ β) Γ β | 0 β€ q.2 β§ q.2 β€ 1 β§ Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2) β€ 1} := (measurableSet_le measurable_const measurable_snd).inter ((measurableSet_le measurable_snd measurable_const).inter (measurableSet_le hf measurable_const)) have hC2 : volume {q : (β Γ β) Γ β | 0 β€ q.2 β§ q.2 β€ 1 β§ Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2) β€ Real.sqrt 2} = ENNReal.ofReal (2 * Real.pi) := by rw [volume_cyl _ (Real.sqrt_nonneg 2), Real.sq_sqrt (by norm_num), β ENNReal.ofReal_mul (by positivity)] congr 1 ring have hC1 := volume_cyl 1 zero_le_one have hcyl : volume {q : (β Γ β) Γ β | 0 β€ q.2 β§ q.2 β€ 1 β§ Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2) β€ 1} = ENNReal.ofReal Real.pi := by rw [hC1, β ENNReal.ofReal_mul (by positivity)] congr 1 ring refine β¨?_, hC2β© rw [hC2] have hnull : volume ({q : (β Γ β) Γ β | 1 β€ q.2 β§ Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2) β€ 1 / q.2} β© {q : (β Γ β) Γ β | 0 β€ q.2 β§ q.2 β€ 1 β§ Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2) β€ 1}) = 0 := by refine measure_mono_null ?_ volume_null_slice intro q hq exact le_antisymm hq.2.2.1 hq.1.1 have := measure_union_add_inter (ΞΌ := volume) {q : (β Γ β) Γ β | 1 β€ q.2 β§ Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2) β€ 1 / q.2} hC rw [hnull, add_zero, volume_trumpet, hcyl, β ENNReal.ofReal_add Real.pi_pos.le Real.pi_pos.le] at this rw [this] congr 1 ring /-- The plane section of the trumpet has infinite area. -/theorem volume_section_eq_top : volume {p : β Γ β | 1 β€ p.1 β§ |p.2| β€ 1 / p.1} = β€ := by have hmeas : MeasurableSet {p : β Γ β | 1 β€ p.1 β§ |p.2| β€ 1 / p.1} := (measurableSet_le measurable_const measurable_fst).inter (measurableSet_le (by fun_prop : Measurable fun p : β Γ β => |p.2|) (by fun_prop : Measurable fun p : β Γ β => 1 / p.1)) have hslice : β x : β, volume (Prod.mk x β»ΒΉ' {p : β Γ β | 1 β€ p.1 β§ |p.2| β€ 1 / p.1}) = (Ici (1 : β)).indicator (fun x : β => ENNReal.ofReal (2 / x)) x := by intro x by_cases hx : 1 β€ x Β· have hx0 : 0 < x := by linarith have : Prod.mk x β»ΒΉ' {p : β Γ β | 1 β€ p.1 β§ |p.2| β€ 1 / p.1} = Icc (-(1 / x)) (1 / x) := by ext y; simp [abs_le, hx] rw [this, Real.volume_Icc, indicator_of_mem (mem_Ici.mpr hx)] congr 1 field_simp ring Β· have : Prod.mk x β»ΒΉ' {p : β Γ β | 1 β€ p.1 β§ |p.2| β€ 1 / p.1} = β := by ext y; simp [hx] rw [this, indicator_of_notMem (by simpa using hx)] simp rw [Measure.volume_eq_prod, Measure.prod_apply hmeas] simp_rw [hslice] rw [lintegral_indicator measurableSet_Ici] by_contra hne have hlt : β«β» x in Ici (1 : β), ENNReal.ofReal (2 / x) < β€ := lt_top_iff_ne_top.mpr hne have hI : IntegrableOn (fun x : β => 2 / x) (Ici 1) := by refine β¨(by fun_prop : Measurable fun x : β => 2 / x).aestronglyMeasurable, ?_β© rw [hasFiniteIntegral_iff_ofReal] Β· exact hlt Β· exact ae_restrict_of_forall_mem measurableSet_Ici fun x hx => by have : (0 : β) < x := by have := hx.out; linarith show 0 β€ 2 / x positivity refine not_integrableOn_Ici_inv (a := 1) ?_ have h2 : IntegrableOn (fun x : β => 2 / x / 2) (Ici 1) := hI.div_const 2 refine IntegrableOn.congr_fun h2 (fun x _ => ?_) measurableSet_Ici show 2 / x / 2 = xβ»ΒΉ ring /-- The surface-area integrand is not integrable on `[1, β)`. -/theorem not_integrableOn_surface : Β¬ IntegrableOn (fun x : β => (1 / x) * Real.sqrt (1 + xβ»ΒΉ ^ 4)) (Ici 1) := by intro h refine not_integrableOn_Ici_inv (a := 1) ?_ refine Integrable.mono' h (by fun_prop : Measurable fun x : β => xβ»ΒΉ).aestronglyMeasurable ?_ refine ae_restrict_of_forall_mem measurableSet_Ici fun x hx => ?_ have hx0 : (0 : β) < x := by have := hx.out; linarith have hs : 1 β€ Real.sqrt (1 + xβ»ΒΉ ^ 4) := by have h4 : 0 β€ xβ»ΒΉ ^ 4 := by positivity calc (1 : β) = Real.sqrt 1 := Real.sqrt_one.symm _ β€ _ := Real.sqrt_le_sqrt (by linarith) rw [Real.norm_of_nonneg (by positivity), one_div] calc xβ»ΒΉ = xβ»ΒΉ * 1 := (mul_one _).symm _ β€ xβ»ΒΉ * Real.sqrt (1 + xβ»ΒΉ ^ 4) := by gcongr /-- **Torricelli's trumpet.** -/theorem trumpet : let Ο : (β Γ β) Γ β β β := fun q => Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2) let T : Set ((β Γ β) Γ β) := {q | 1 β€ q.2 β§ Ο q β€ 1 / q.2} let Cyl : Set ((β Γ β) Γ β) := {q | 0 β€ q.2 β§ q.2 β€ 1 β§ Ο q β€ 1} let Cyl2 : Set ((β Γ β) Γ β) := {q | 0 β€ q.2 β§ q.2 β€ 1 β§ Ο q β€ Real.sqrt 2} volume (T βͺ Cyl) = volume Cyl2 β§ volume Cyl2 = ENNReal.ofReal (2 * Real.pi) β§ volume T = ENNReal.ofReal Real.pi β§ volume {p : β Γ β | 1 β€ p.1 β§ |p.2| β€ 1 / p.1} = β€ β§ Β¬ IntegrableOn (fun x : β => (1 / x) * Real.sqrt (1 + xβ»ΒΉ ^ 4)) (Set.Ici 1) := by intro Ο T Cyl Cyl2 exact β¨volume_trumpet_union_cylinder.1, volume_trumpet_union_cylinder.2, volume_trumpet, volume_section_eq_top, not_integrableOn_surfaceβ© end Torricelli open MeasureTheory