/-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 Mathlib.Analysis.SpecialFunctions.PolarCoord /-!# The PappusβGuldin theorem for volumes of revolution Revolving a measurable plane region `R` (coordinates `(r, z)`) about the `z`-axis gives a solid ofvolume `2Ο β«_R r`, i.e. the area of `R` times the length `2Ο rΜ` of the path of its centroid; pointswith `r β€ 0` contribute nothing to either side, so no sign condition is needed. Built on Mathlib'spolar coordinates: each horizontal slice is a planar set `{β(uΒ² + vΒ²) β A}`, whose area is`2Ο β«_A r` by `lintegral_comp_polarCoord_symm`, and Tonelli reassembles the slices. ## Main results * `PappusGuldin.volume_revolution`: volume of the solid of revolution of R = 2 pi * integral over R of r ## References * P. Guldin, *Centrobaryca*, Vienna, 1635β1641; Pappus of Alexandria, *Collection*, Book VII.-/ @[expose] public section open MeasureTheory Set namespace PappusGuldin /-- Radial slice: for measurable `A β β`, the plane set `{w | βwβ β A}` has area `2Ο β«_A r`. -/private lemma volume_radial (A : Set β) (hA : MeasurableSet A) : volume {w : β Γ β | Real.sqrt (w.1 ^ 2 + w.2 ^ 2) β A} = ENNReal.ofReal (2 * Real.pi) * β«β» r in A, ENNReal.ofReal r := by have hm : MeasurableSet {w : β Γ β | Real.sqrt (w.1 ^ 2 + w.2 ^ 2) β A} := (by fun_prop : Measurable fun w : β Γ β => Real.sqrt (w.1 ^ 2 + w.2 ^ 2)) hA have h := lintegral_comp_polarCoord_symm ({w : β Γ β | Real.sqrt (w.1 ^ 2 + w.2 ^ 2) β A}.indicator (fun _ => (1 : ENNReal))) rw [lintegral_indicator_const hm, one_mul] at h rw [β h] have h2 : β«β» p in polarCoord.target, ENNReal.ofReal p.1 β’ ({w : β Γ β | Real.sqrt (w.1 ^ 2 + w.2 ^ 2) β A}.indicator (fun _ => (1 : ENNReal)) (polarCoord.symm p)) = β«β» p in polarCoord.target, ENNReal.ofReal p.1 * A.indicator (fun _ => (1 : ENNReal)) p.1 := by refine setLIntegral_congr_fun polarCoord.open_target.measurableSet ?_ intro p hp rw [polarCoord_target] at hp have hp1 : 0 < p.1 := hp.1 have : Real.sqrt ((polarCoord.symm p).1 ^ 2 + (polarCoord.symm p).2 ^ 2) = p.1 := by rw [polarCoord_symm_apply] simp only have : (p.1 * Real.cos p.2) ^ 2 + (p.1 * Real.sin p.2) ^ 2 = p.1 ^ 2 := by nlinarith [Real.sin_sq_add_cos_sq p.2] rw [this, Real.sqrt_sq hp1.le] have e : polarCoord.symm p β {w : β Γ β | Real.sqrt (w.1 ^ 2 + w.2 ^ 2) β A} β p.1 β A := by show Real.sqrt _ β A β _ rw [this] classical simp only [smul_eq_mul, indicator] rw [if_congr e rfl rfl] have hmeas : Measurable fun p : β Γ β => ENNReal.ofReal p.1 * A.indicator (fun _ => (1 : ENNReal)) p.1 := Measurable.mul (by fun_prop) ((measurable_const.indicator hA).comp measurable_fst) rw [h2, polarCoord_target, Measure.volume_eq_prod, β Measure.prod_restrict, lintegral_prod _ hmeas.aemeasurable] simp only [lintegral_const, Measure.restrict_apply_univ, Real.volume_Ioo] have hm1 : Measurable fun x : β => ENNReal.ofReal x * A.indicator (fun _ => (1 : ENNReal)) x := Measurable.mul (by fun_prop) (measurable_const.indicator hA) rw [lintegral_mul_const _ hm1] have e1 : β«β» x in Ioi 0, ENNReal.ofReal x * A.indicator (fun _ => (1 : ENNReal)) x = β«β» r in A, ENNReal.ofReal r := by rw [setLIntegral_eq_of_support_subset, β lintegral_indicator hA] Β· congr 1 funext x by_cases hx : x β A <;> simp [indicator, hx] Β· intro x hx by_contra hx0 have : x β€ 0 := not_lt.mp hx0 exact hx (by simp [ENNReal.ofReal_eq_zero.mpr this]) rw [e1, mul_comm] congr 2 ring /-- **PappusβGuldin (volume).** Revolving a measurable plane region `R` (coordinates `(r, z)`) aboutthe `z`-axis gives a solid of volume `2Ο β«_R r`. -/theorem volume_revolution (R : Set (β Γ β)) (hR : MeasurableSet R) : volume {q : (β Γ β) Γ β | (Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2), q.2) β R} = ENNReal.ofReal (2 * Real.pi) * β«β» p in R, ENNReal.ofReal p.1 := by have hS : MeasurableSet {q : (β Γ β) Γ β | (Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2), q.2) β R} := (by fun_prop : Measurable fun q : (β Γ β) Γ β => (Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2), q.2)) hR have hslice : β z : β, volume ((fun x : β Γ β => (x, z)) β»ΒΉ' {q : (β Γ β) Γ β | (Real.sqrt (q.1.1 ^ 2 + q.1.2 ^ 2), q.2) β R}) = ENNReal.ofReal (2 * Real.pi) * β«β» r in (fun r : β => (r, z)) β»ΒΉ' R, ENNReal.ofReal r := fun z => volume_radial _ (measurable_prodMk_right hR) have hind : Measurable fun p : β Γ β => R.indicator (fun p : β Γ β => ENNReal.ofReal p.1) p := (by fun_prop : Measurable fun p : β Γ β => ENNReal.ofReal p.1).indicator hR rw [Measure.volume_eq_prod, Measure.prod_apply_symm hS] simp_rw [hslice] rw [lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] congr 1 rw [β lintegral_indicator hR, Measure.volume_eq_prod, lintegral_prod_symm _ hind.aemeasurable] refine lintegral_congr fun z => ?_ rw [β lintegral_indicator (measurable_prodMk_right hR)] rfl end PappusGuldin