Skip to content

Commit

Permalink
feat: Compute volume of balls of higher dimension for Lp norms (#8030)
Browse files Browse the repository at this point in the history
We give a formula `measure_unitBall_eq_integral_div_gamma` for computing the volume of the unit ball
in a normed finite dimensional `ℝ`-vector space `E` with an Haar measure: 
```lean
theorem measure_unitBall_eq_integral_div_gamma {E : Type*} {p : ℝ}
    [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E]
    [BorelSpace E] (μ : Measure E) [IsAddHaarMeasure μ] (hp : 0 < p) :
    μ (Metric.ball 0 1) =
      ENNReal.ofReal ((∫ (x : E), Real.exp (- ‖x‖ ^ p) ∂μ) / Real.Gamma (finrank ℝ E / p + 1))
```
We also provide a theorem `measure_lt_one_eq_integral_div_gamma` to compute the volume of the ball `{x : E | g x < 1}` for a function `g : E → ℝ` defining a norm. 
```lean
theorem measure_lt_one_eq_integral_div_gamma {E : Type*}
    [AddCommGroup E] [Module ℝ E] [FiniteDimensional ℝ E] [mE : MeasurableSpace E]
    [tE : TopologicalSpace E] [TopologicalAddGroup E] [BorelSpace E] [T2Space E]
    [ContinuousSMul ℝ E] (μ : Measure E) [IsAddHaarMeasure μ]
    {g : E → ℝ} (hg0 : g 0 = 0) (hgn : ∀ x, g (- x) = g x) (hgt : ∀ x y, g (x + y) ≤ g x + g y)
    (hgs : ∀ {x}, g x = 0 → x = 0) (hns :  ∀ r x, g (r • x) ≤ |r| * (g x)) {p : ℝ} (hp : 0 < p) :
    μ {x : E | g x < 1} =
      ENNReal.ofReal ((∫ (x : E), Real.exp (- (g x) ^ p) ∂μ) / Real.Gamma (finrank ℝ E / p + 1))
```
This provides a way to compute the volume of the unit ball for the norms `L_p` for `1 ≤ p` in any dimension over the reals `MeasureTheory.volume_sum_rpow_lt_one` and the complex `Complex.volume_sum_rpow_lt_one`.
```lean
variable (ι : Type*) [Fintype ι] {p : ℝ} (hp : 1 ≤ p)

theorem volume_sum_rpow_lt_one :
    volume {x : ι → ℝ | ∑ i, |x i| ^ p < 1} =
      ENNReal.ofReal ((2 * Real.Gamma (1 / p + 1)) ^ card ι / Real.Gamma (card ι / p + 1))

theorem Complex.volume_sum_rpow_lt_one {p : ℝ} (hp : 1 ≤ p) :
    volume {x : ι → ℂ | ∑ i, ‖x i‖ ^ p < 1} =
      ENNReal.ofReal ((π * Real.Gamma (2 / p + 1)) ^ card ι / Real.Gamma (2 * card ι / p + 1)) 
```
From these, we deduce the volume of balls in several situations. 

-- 

Other significant changes include: 
-  Adding `MeasurePreserving.integral_comp'`: when the theorem `MeasurePreserving.integral_comp` is used with `f` a measurable equiv, it is necessary to specify that it is a measurable embedding although it is trivial in this case. This version bypasses this hypothesis
-  Proof of volume computations of the unit ball in `ℂ` and in `EuclideanSpace ℝ (Fin 2)` which are now done with the methods of the file `VolumeOfBalls` have been moved to this file.



Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>
  • Loading branch information
xroblot and urkud committed Dec 7, 2023
1 parent 9c4be1c commit f24e05a
Show file tree
Hide file tree
Showing 10 changed files with 594 additions and 62 deletions.
3 changes: 3 additions & 0 deletions Mathlib.lean
Expand Up @@ -2584,6 +2584,7 @@ import Mathlib.MeasureTheory.Integral.CircleTransform
import Mathlib.MeasureTheory.Integral.DivergenceTheorem
import Mathlib.MeasureTheory.Integral.ExpDecay
import Mathlib.MeasureTheory.Integral.FundThmCalculus
import Mathlib.MeasureTheory.Integral.Gamma
import Mathlib.MeasureTheory.Integral.Indicator
import Mathlib.MeasureTheory.Integral.IntegrableOn
import Mathlib.MeasureTheory.Integral.IntegralEqImproper
Expand All @@ -2596,6 +2597,7 @@ import Mathlib.MeasureTheory.Integral.Marginal
import Mathlib.MeasureTheory.Integral.MeanInequalities
import Mathlib.MeasureTheory.Integral.PeakFunction
import Mathlib.MeasureTheory.Integral.Periodic
import Mathlib.MeasureTheory.Integral.Pi
import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani
import Mathlib.MeasureTheory.Integral.SetIntegral
import Mathlib.MeasureTheory.Integral.SetToL1
Expand Down Expand Up @@ -2629,6 +2631,7 @@ import Mathlib.MeasureTheory.Measure.Lebesgue.Basic
import Mathlib.MeasureTheory.Measure.Lebesgue.Complex
import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
import Mathlib.MeasureTheory.Measure.Lebesgue.Integral
import Mathlib.MeasureTheory.Measure.Lebesgue.VolumeOfBalls
import Mathlib.MeasureTheory.Measure.MeasureSpace
import Mathlib.MeasureTheory.Measure.MeasureSpaceDef
import Mathlib.MeasureTheory.Measure.MutuallySingular
Expand Down
4 changes: 4 additions & 0 deletions Mathlib/Analysis/SpecialFunctions/Pow/Real.lean
Expand Up @@ -616,6 +616,10 @@ theorem rpow_lt_one_iff (hx : 0 ≤ x) :
· simp [rpow_lt_one_iff_of_pos hx, hx.ne.symm]
#align real.rpow_lt_one_iff Real.rpow_lt_one_iff

theorem rpow_lt_one_iff' {x y : ℝ} (hx : 0 ≤ x) (hy : 0 < y) :
x ^ y < 1 ↔ x < 1 := by
rw [← Real.rpow_lt_rpow_iff hx zero_le_one hy, Real.one_rpow]

theorem one_lt_rpow_iff_of_pos (hx : 0 < x) : 1 < x ^ y ↔ 1 < x ∧ 0 < y ∨ x < 1 ∧ y < 0 := by
rw [rpow_def_of_pos hx, one_lt_exp_iff, mul_pos_iff, log_pos_iff hx, log_neg_iff hx]
#align real.one_lt_rpow_iff_of_pos Real.one_lt_rpow_iff_of_pos
Expand Down
5 changes: 5 additions & 0 deletions Mathlib/MeasureTheory/Constructions/Pi.lean
Expand Up @@ -420,6 +420,11 @@ theorem pi_of_empty {α : Type*} [IsEmpty α] {β : α → Type*} {m : ∀ a, Me
exact isEmptyElim (α := α)
#align measure_theory.measure.pi_of_empty MeasureTheory.Measure.pi_of_empty

@[simp]
theorem pi_empty_univ {α : Type*} {β : α → Type*} [IsEmpty α] {m : ∀ α, MeasurableSpace (β α)}
(μ : ∀ a : α, Measure (β a)) : Measure.pi μ (Set.univ) = 1 := by
rw [pi_of_empty, measure_univ]

theorem pi_eval_preimage_null {i : ι} {s : Set (α i)} (hs : μ i s = 0) :
Measure.pi μ (eval i ⁻¹' s) = 0 := by
-- WLOG, `s` is measurable
Expand Down
4 changes: 4 additions & 0 deletions Mathlib/MeasureTheory/Integral/Bochner.lean
Expand Up @@ -1646,6 +1646,10 @@ theorem MeasurePreserving.integral_comp {β} {_ : MeasurableSpace β} {f : α
h₁.map_eq ▸ (h₂.integral_map g).symm
#align measure_theory.measure_preserving.integral_comp MeasureTheory.MeasurePreserving.integral_comp

theorem MeasurePreserving.integral_comp' {β} [MeasurableSpace β] {ν} {f : α ≃ᵐ β}
(h : MeasurePreserving f μ ν) (g : β → G) :
∫ x, g (f x) ∂μ = ∫ y, g y ∂ν := MeasurePreserving.integral_comp h f.measurableEmbedding _

theorem integral_subtype_comap {α} [MeasurableSpace α] {μ : Measure α} {s : Set α}
(hs : MeasurableSet s) (f : α → G) :
∫ x : s, f (x : α) ∂(Measure.comap Subtype.val μ) = ∫ x in s, f x ∂μ := by
Expand Down
138 changes: 138 additions & 0 deletions Mathlib/MeasureTheory/Integral/Gamma.lean
@@ -0,0 +1,138 @@
/-
Copyright (c) 2023 Xavier Roblot. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Xavier Roblot
-/
import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup

/-!
# Integrals involving the Gamma function
In this file, we collect several integrals over `ℝ` or `ℂ` that evaluate in terms of the
`Real.Gamma` function.
-/

open Real Set MeasureTheory MeasureTheory.Measure

section real

theorem integral_rpow_mul_exp_neg_rpow {p q : ℝ} (hp : 0 < p) (hq : - 1 < q) :
∫ x in Ioi (0:ℝ), x ^ q * exp (- x ^ p) = (1 / p) * Gamma ((q + 1) / p) := by
calc
_ = ∫ (x : ℝ) in Ioi 0, (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * exp (-x)) := by
rw [← integral_comp_rpow_Ioi _ (one_div_ne_zero (ne_of_gt hp)),
abs_eq_self.mpr (le_of_lt (one_div_pos.mpr hp))]
refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
rw [← rpow_mul (le_of_lt hx) _ p, one_div_mul_cancel (ne_of_gt hp), rpow_one]
_ = ∫ (x : ℝ) in Ioi 0, 1 / p * exp (-x) * x ^ (1 / p - 1 + q / p) := by
simp_rw [smul_eq_mul, mul_assoc]
refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
rw [← rpow_mul (le_of_lt hx), div_mul_eq_mul_div, one_mul, rpow_add hx]
ring_nf
_ = (1 / p) * Gamma ((q + 1) / p) := by
rw [Gamma_eq_integral (div_pos (neg_lt_iff_pos_add.mp hq) hp)]
simp_rw [show 1 / p - 1 + q / p = (q + 1) / p - 1 by field_simp; ring, ← integral_mul_left,
← mul_assoc]

theorem integral_rpow_mul_exp_neg_mul_rpow {p q b : ℝ} (hp : 0 < p) (hq : - 1 < q) (hb : 0 < b) :
∫ x in Ioi (0:ℝ), x ^ q * exp (- b * x ^ p) =
b ^ (-(q + 1) / p) * (1 / p) * Gamma ((q + 1) / p) := by
calc
_ = ∫ x in Ioi (0:ℝ), b ^ (-p⁻¹ * q) * ((b ^ p⁻¹ * x) ^ q * rexp (-(b ^ p⁻¹ * x) ^ p)) := by
refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
rw [mul_rpow _ (le_of_lt hx), mul_rpow _ (le_of_lt hx), ← rpow_mul, ← rpow_mul,
inv_mul_cancel, rpow_one, mul_assoc, ← mul_assoc, ← rpow_add, neg_mul p⁻¹, add_left_neg,
rpow_zero, one_mul, neg_mul]
all_goals positivity
_ = (b ^ p⁻¹)⁻¹ * ∫ x in Ioi (0:ℝ), b ^ (-p⁻¹ * q) * (x ^ q * rexp (-x ^ p)) := by
rw [integral_comp_mul_left_Ioi (fun x => b ^ (-p⁻¹ * q) * (x ^ q * exp (- x ^ p))) 0,
mul_zero, abs_eq_self.mpr ?_, smul_eq_mul]
all_goals positivity
_ = b ^ (-(q + 1) / p) * (1 / p) * Gamma ((q + 1) / p) := by
rw [integral_mul_left, integral_rpow_mul_exp_neg_rpow _ hq, mul_assoc, ← mul_assoc,
← rpow_neg_one, ← rpow_mul, ← rpow_add]
congr; ring
all_goals positivity

theorem integral_exp_neg_rpow {p : ℝ} (hp : 0 < p) :
∫ x in Ioi (0:ℝ), exp (- x ^ p) = Gamma (1 / p + 1) := by
convert (integral_rpow_mul_exp_neg_rpow hp neg_one_lt_zero) using 1
· simp_rw [rpow_zero, one_mul]
· rw [zero_add, Gamma_add_one (one_div_ne_zero (ne_of_gt hp))]

theorem integral_exp_neg_mul_rpow {p b : ℝ} (hp : 0 < p) (hb : 0 < b) :
∫ x in Ioi (0:ℝ), exp (- b * x ^ p) = b ^ (- 1 / p) * Gamma (1 / p + 1) := by
convert (integral_rpow_mul_exp_neg_mul_rpow hp neg_one_lt_zero hb) using 1
· simp_rw [rpow_zero, one_mul]
· rw [zero_add, Gamma_add_one (one_div_ne_zero (ne_of_gt hp)), mul_assoc]

end real

section complex

theorem Complex.integral_rpow_mul_exp_neg_rpow {p q : ℝ} (hp : 1 ≤ p) (hq : - 2 < q) :
∫ x : ℂ, ‖x‖ ^ q * rexp (- ‖x‖ ^ p) = (2 * π / p) * Real.Gamma ((q + 2) / p) := by
calc
_ = ∫ x in Ioi (0:ℝ) ×ˢ Ioo (-π) π, x.1 * (|x.1| ^ q * rexp (-|x.1| ^ p)) := by
rw [← Complex.integral_comp_polarCoord_symm, polarCoord_target]
simp_rw [Complex.norm_eq_abs, Complex.polardCoord_symm_abs, smul_eq_mul]
_ = (∫ x in Ioi (0:ℝ), x * |x| ^ q * rexp (-|x| ^ p)) * ∫ _ in Ioo (-π) π, 1 := by
rw [← set_integral_prod_mul, volume_eq_prod]
simp_rw [mul_one]
congr! 2; ring
_ = 2 * π * ∫ x in Ioi (0:ℝ), x * |x| ^ q * rexp (-|x| ^ p) := by
simp_rw [integral_const, Measure.restrict_apply MeasurableSet.univ, Set.univ_inter,
volume_Ioo, sub_neg_eq_add, ← two_mul, ENNReal.toReal_ofReal (by positivity : 02 * π),
smul_eq_mul, mul_one, mul_comm]
_ = 2 * π * ∫ x in Ioi (0:ℝ), x ^ (q + 1) * rexp (-x ^ p) := by
congr 1
refine set_integral_congr measurableSet_Ioi (fun x hx => ?_)
rw [abs_eq_self.mpr (le_of_lt (by exact hx)), rpow_add hx, rpow_one]
ring
_ = (2 * Real.pi / p) * Real.Gamma ((q + 2) / p) := by
rw [_root_.integral_rpow_mul_exp_neg_rpow (by linarith) (by linarith), add_assoc,
one_add_one_eq_two]
ring

theorem Complex.integral_rpow_mul_exp_neg_mul_rpow {p q b : ℝ} (hp : 1 ≤ p) (hq : - 2 < q)
(hb : 0 < b) :
∫ x : ℂ, ‖x‖ ^ q * rexp (- b * ‖x‖ ^ p) = (2 * π / p) *
b ^ (-(q + 2) / p) * Real.Gamma ((q + 2) / p) := by
calc
_ = ∫ x in Ioi (0:ℝ) ×ˢ Ioo (-π) π, x.1 * (|x.1| ^ q * rexp (- b * |x.1| ^ p)) := by
rw [← Complex.integral_comp_polarCoord_symm, polarCoord_target]
simp_rw [Complex.norm_eq_abs, Complex.polardCoord_symm_abs, smul_eq_mul]
_ = (∫ x in Ioi (0:ℝ), x * |x| ^ q * rexp (- b * |x| ^ p)) * ∫ _ in Ioo (-π) π, 1 := by
rw [← set_integral_prod_mul, volume_eq_prod]
simp_rw [mul_one]
congr! 2; ring
_ = 2 * π * ∫ x in Ioi (0:ℝ), x * |x| ^ q * rexp (- b * |x| ^ p) := by
simp_rw [integral_const, Measure.restrict_apply MeasurableSet.univ, Set.univ_inter,
volume_Ioo, sub_neg_eq_add, ← two_mul, ENNReal.toReal_ofReal (by positivity : 02 * π),
smul_eq_mul, mul_one, mul_comm]
_ = 2 * π * ∫ x in Ioi (0:ℝ), x ^ (q + 1) * rexp (-b * x ^ p) := by
congr 1
refine set_integral_congr measurableSet_Ioi (fun x hx => ?_)
rw [abs_eq_self.mpr (le_of_lt (by exact hx)), rpow_add hx, rpow_one]
ring
_ = (2 * π / p) * b ^ (-(q + 2) / p) * Real.Gamma ((q + 2) / p) := by
rw [_root_.integral_rpow_mul_exp_neg_mul_rpow (by linarith) (by linarith) hb, add_assoc,
one_add_one_eq_two]
ring

theorem Complex.integral_exp_neg_rpow {p : ℝ} (hp : 1 ≤ p) :
∫ x : ℂ, rexp (- ‖x‖ ^ p) = π * Real.Gamma (2 / p + 1) := by
convert (integral_rpow_mul_exp_neg_rpow hp (by linarith : (-2:ℝ) < 0)) using 1
· simp_rw [norm_eq_abs, rpow_zero, one_mul]
· rw [zero_add, Real.Gamma_add_one (div_ne_zero two_ne_zero (by linarith))]
ring

theorem Complex.integral_exp_neg_mul_rpow {p b : ℝ} (hp : 1 ≤ p) (hb : 0 < b) :
∫ x : ℂ, rexp (- b * ‖x‖ ^ p) = π * b ^ (-2 / p) * Real.Gamma (2 / p + 1) := by
convert (integral_rpow_mul_exp_neg_mul_rpow hp (by linarith : (-2:ℝ) < 0)) hb using 1
· simp_rw [norm_eq_abs, rpow_zero, one_mul]
· rw [zero_add, Real.Gamma_add_one (div_ne_zero two_ne_zero (by linarith))]
ring

end complex
49 changes: 49 additions & 0 deletions Mathlib/MeasureTheory/Integral/Pi.lean
@@ -0,0 +1,49 @@
/-
Copyright (c) 2023 Xavier Roblot. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Xavier Roblot
-/
import Mathlib.MeasureTheory.Constructions.Pi
import Mathlib.MeasureTheory.Constructions.Prod.Integral

/-!
# Integration with respect to a finite product of measures
-/

open BigOperators Fintype MeasureTheory MeasureTheory.Measure

theorem MeasureTheory.integral_finset_prod_eq_prod' {E : Type*} {n : ℕ} (f : (Fin n) → E → ℝ)
[MeasureSpace E] [SigmaFinite (volume : Measure E)] :
∫ x : (Fin n) → E, ∏ i, f i (x i) = ∏ i, ∫ x, f i x := by
induction n with
| zero =>
simp only [Nat.zero_eq, volume_pi, Finset.univ_eq_empty, Finset.prod_empty, integral_const,
pi_empty_univ, ENNReal.one_toReal, smul_eq_mul, mul_one, pow_zero]
| succ n n_ih =>
calc
_ = ∫ x : E × (Fin n → E), f 0 x.1 * ∏ i : Fin n, f (Fin.succ i) (x.2 i) := by
rw [volume_pi, ← ((measurePreserving_piFinSuccAboveEquiv
(fun _ => (volume : Measure E)) 0).symm).integral_comp']
simp_rw [MeasurableEquiv.piFinSuccAboveEquiv_symm_apply, Fin.insertNth_zero',
Fin.prod_univ_succ, Fin.cons_zero, Fin.cons_succ]
rfl
_ = (∫ x, f 0 x) * ∏ i : Fin n, ∫ (x : E), f (Fin.succ i) x := by
rw [← n_ih, ← integral_prod_mul, volume_eq_prod]
_ = ∏ i, ∫ x, f i x := by rw [Fin.prod_univ_succ]

theorem MeasureTheory.integral_finset_prod_eq_prod {E : Type*} (ι : Type*) [Fintype ι]
(f : ι → E → ℝ) [MeasureSpace E] [SigmaFinite (volume : Measure E)] :
∫ x : ι → E, ∏ i, f i (x i) = ∏ i, ∫ x, f i x := by
let e := (equivFin ι)
let p := measurePreserving_piCongrLeft (fun _ => (volume : Measure E)) e
rw [volume_pi, ← (p.symm).integral_comp', Fintype.prod_equiv e _ (fun j => ∫ x, f (e.symm j) x)
(fun _ => by simp_rw [e.symm_apply_apply]), ← integral_finset_prod_eq_prod'
(fun j => f (e.symm j))]
congr!
rw [Fintype.prod_equiv e]
exact fun _ => by simp [Equiv.symm_apply_apply]; rfl

theorem MeasureTheory.integral_finset_prod_eq_pow {E : Type*} (ι : Type*) [Fintype ι] (f : E → ℝ)
[MeasureSpace E] [SigmaFinite (volume : Measure E)] :
∫ x : ι → E, ∏ i, f (x i) = (∫ x, f x) ^ (card ι) := by
rw [integral_finset_prod_eq_prod, Finset.prod_const, Fintype.card]
42 changes: 0 additions & 42 deletions Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean
Expand Up @@ -121,45 +121,3 @@ theorem PiLp.volume_preserving_equiv_symm : MeasurePreserving (WithLp.equiv 2 (
(EuclideanSpace.volume_preserving_measurableEquiv ι).symm

end PiLp

namespace EuclideanSpace

open BigOperators ENNReal

@[simp]
theorem volume_ball (x : EuclideanSpace ℝ (Fin 2)) (r : ℝ) :
volume (Metric.ball x r) = NNReal.pi * (ENNReal.ofReal r) ^ 2 := by
obtain hr | hr := le_total r 0
· rw [Metric.ball_eq_empty.mpr hr, measure_empty, ← zero_eq_ofReal.mpr hr, zero_pow zero_lt_two,
mul_zero]
· suffices volume (Metric.ball (0 : EuclideanSpace ℝ (Fin 2)) 1) = NNReal.pi by
rw [Measure.addHaar_ball _ _ hr, finrank_euclideanSpace_fin, ofReal_pow hr, this, mul_comm]
calc
_ = volume {p : ℝ × ℝ | p.1 ^ 2 + p.2 ^ 2 < 1} := by
have : MeasurePreserving (_ : ℝ × ℝ ≃ᵐ EuclideanSpace ℝ (Fin 2)) :=
MeasurePreserving.trans
(volume_preserving_finTwoArrow ℝ).symm (volume_preserving_measurableEquiv (Fin 2)).symm
rw [← this.measure_preimage_emb (MeasurableEquiv.measurableEmbedding _),
ball_zero_eq _ zero_le_one, preimage_setOf_eq]
simp only [MeasurableEquiv.finTwoArrow_symm_apply, Fin.sum_univ_two, preimage_setOf_eq,
Fin.cons_zero, Fin.cons_one, one_pow, Function.comp_apply, coe_measurableEquiv_symm,
MeasurableEquiv.trans_apply, WithLp.equiv_symm_pi_apply]
_ = volume {p : ℝ × ℝ | (- 1 < p.1 ∧ p.11) ∧ p.1 ^ 2 + p.2 ^ 2 < 1} := by
congr
refine Set.ext fun _ => iff_and_self.mpr fun h => And.imp_right le_of_lt ?_
rw [← abs_lt, ← sq_lt_one_iff_abs_lt_one]
exact lt_of_add_lt_of_nonneg_left h (sq_nonneg _)
_ = volume (regionBetween (fun x => - Real.sqrt (1 - x ^ 2)) (fun x => Real.sqrt (1 - x ^ 2))
(Set.Ioc (-1) 1)) := by
simp_rw [regionBetween, Set.mem_Ioo, Set.mem_Ioc, ← Real.sq_lt, lt_tsub_iff_left]
_ = ENNReal.ofReal ((2 : ℝ) * ∫ (a : ℝ) in Set.Ioc (-1) 1, Real.sqrt (1 - a ^ 2)) := by
rw [volume_eq_prod, volume_regionBetween_eq_integral (Continuous.integrableOn_Ioc
(by continuity)) (Continuous.integrableOn_Ioc (by continuity)) measurableSet_Ioc
(fun _ _ => neg_le_self (Real.sqrt_nonneg _))]
simp_rw [Pi.sub_apply, sub_neg_eq_add, ← two_mul, integral_mul_left]
_ = NNReal.pi := by
rw [← intervalIntegral.integral_of_le (by norm_num : (-1 : ℝ) ≤ 1),
integral_sqrt_one_sub_sq, two_mul, add_halves, ← NNReal.coe_real_pi,
ofReal_coe_nnreal]

end EuclideanSpace
18 changes: 0 additions & 18 deletions Mathlib/MeasureTheory/Measure/Lebesgue/Complex.lean
Expand Up @@ -62,22 +62,4 @@ theorem volume_preserving_equiv_real_prod : MeasurePreserving measurableEquivRea
(volume_preserving_finTwoArrow ℝ).comp volume_preserving_equiv_pi
#align complex.volume_preserving_equiv_real_prod Complex.volume_preserving_equiv_real_prod

@[simp]
theorem volume_ball (a : ℂ) (r : ℝ) :
volume (Metric.ball a r) = NNReal.pi * ENNReal.ofReal r ^ 2 := by
rw [Measure.addHaar_ball_center, ← EuclideanSpace.volume_ball 0,
← (volume_preserving_equiv_pi.symm).measure_preimage measurableSet_ball,
← ((EuclideanSpace.volume_preserving_measurableEquiv (Fin 2)).symm).measure_preimage
measurableSet_ball]
refine congrArg _ (Set.ext fun _ => ?_)
simp_rw [← MeasurableEquiv.coe_toEquiv_symm, Set.mem_preimage, MeasurableEquiv.coe_toEquiv_symm,
measurableEquivPi_symm_apply, mem_ball_zero_iff, norm_eq_abs, abs_def, normSq_add_mul_I,
EuclideanSpace.coe_measurableEquiv_symm, EuclideanSpace.norm_eq, WithLp.equiv_symm_pi_apply,
Fin.sum_univ_two, Real.norm_eq_abs, _root_.sq_abs]

@[simp]
theorem volume_closedBall (a : ℂ) (r : ℝ) :
volume (Metric.closedBall a r) = NNReal.pi * ENNReal.ofReal r ^ 2 := by
rw [MeasureTheory.Measure.addHaar_closedBall_eq_addHaar_ball, Complex.volume_ball]

end Complex

0 comments on commit f24e05a

Please sign in to comment.