Skip to content

Commit 376952a

Browse files
committed
feat: Add polar change of coordinates for complex variable (#8034)
1 parent e8a32f1 commit 376952a

File tree

4 files changed

+52
-6
lines changed

4 files changed

+52
-6
lines changed

Mathlib/Analysis/Complex/Basic.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ def equivRealProdClm : ℂ ≃L[ℝ] ℝ × ℝ :=
234234
abs_le_sqrt_two_mul_max (equivRealProd.symm p)
235235
#align complex.equiv_real_prod_clm Complex.equivRealProdClm
236236

237+
theorem equivRealProdClm_symm_apply (p : ℝ × ℝ) :
238+
Complex.equivRealProdClm.symm p = p.1 + p.2 * Complex.I := Complex.equivRealProd_symm_apply p
239+
237240
instance : ProperSpace ℂ :=
238241
(id lipschitz_equivRealProd : LipschitzWith 1 equivRealProdClm.toHomeomorph).properSpace
239242

Mathlib/Analysis/SpecialFunctions/PolarCoord.lean

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Sébastien Gouëzel
55
-/
6-
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv
76
import Mathlib.MeasureTheory.Function.Jacobian
7+
import Mathlib.MeasureTheory.Measure.Lebesgue.Complex
88

99
#align_import analysis.special_functions.polar_coord from "leanprover-community/mathlib"@"8f9fea08977f7e450770933ee6abb20733b47c92"
1010

@@ -19,11 +19,10 @@ It satisfies the following change of variables formula (see `integral_comp_polar
1919
2020
-/
2121

22-
23-
noncomputable section
24-
2522
local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
2623

24+
noncomputable section Real
25+
2726
open Real Set MeasureTheory
2827

2928
open scoped Real Topology
@@ -152,3 +151,44 @@ theorem integral_comp_polarCoord_symm {E : Type*} [NormedAddCommGroup E] [Normed
152151
rw [B_det, abs_of_pos]
153152
exact hx.1
154153
#align integral_comp_polar_coord_symm integral_comp_polarCoord_symm
154+
155+
end Real
156+
157+
noncomputable section Complex
158+
159+
namespace Complex
160+
161+
open scoped Real
162+
163+
/-- The polar coordinates local homeomorphism in `ℂ`, mapping `r (cos θ + I * sin θ)` to `(r, θ)`.
164+
It is a homeomorphism between `ℂ - ℝ≤0` and `(0, +∞) × (-π, π)`. -/
165+
protected noncomputable def polarCoord : LocalHomeomorph ℂ (ℝ × ℝ) :=
166+
equivRealProdClm.toHomeomorph.toLocalHomeomorph.trans polarCoord
167+
168+
protected theorem polarCoord_apply (a : ℂ) :
169+
Complex.polarCoord a = (Complex.abs a, Complex.arg a) := by
170+
simp_rw [Complex.abs_def, Complex.normSq_apply, ← pow_two]
171+
rfl
172+
173+
protected theorem polarCoord_source :
174+
Complex.polarCoord.source = {a | 0 < a.re} ∪ {a | a.im ≠ 0} := by simp [Complex.polarCoord]
175+
176+
protected theorem polarCoord_target :
177+
Complex.polarCoord.target = Set.Ioi (0 : ℝ) ×ˢ Set.Ioo (-π) π := by simp [Complex.polarCoord]
178+
179+
@[simp]
180+
protected theorem polarCoord_symm_apply (p : ℝ × ℝ) :
181+
Complex.polarCoord.symm p = p.1 * (Real.cos p.2 + Real.sin p.2 * Complex.I) := by
182+
simp [Complex.polarCoord, equivRealProdClm_symm_apply, mul_add, mul_assoc]
183+
184+
theorem polardCoord_symm_abs (p : ℝ × ℝ) :
185+
Complex.abs (Complex.polarCoord.symm p) = |p.1| := by simp
186+
187+
protected theorem integral_comp_polarCoord_symm {E : Type*} [NormedAddCommGroup E]
188+
[NormedSpace ℝ E] (f : ℂ → E) :
189+
(∫ p in polarCoord.target, p.1 • f (Complex.polarCoord.symm p)) = ∫ p, f p := by
190+
rw [← (Complex.volume_preserving_equiv_real_prod.symm).integral_comp
191+
measurableEquivRealProd.symm.measurableEmbedding, ← integral_comp_polarCoord_symm]
192+
rfl
193+
194+
end Complex

Mathlib/Data/Complex/Module.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ def equivRealProdAddHom : ℂ ≃+ ℝ × ℝ :=
289289
{ equivRealProd with map_add' := by simp }
290290
#align complex.equiv_real_prod_add_hom Complex.equivRealProdAddHom
291291

292+
theorem equivRealProdAddHom_symm_apply (p : ℝ × ℝ) :
293+
Complex.equivRealProdAddHom.symm p = p.1 + p.2 * Complex.I := Complex.equivRealProd_symm_apply p
294+
292295
/-- The natural `LinearEquiv` from `ℂ` to `ℝ × ℝ`. -/
293296
@[simps! (config := { simpRhs := true }) apply symm_apply_re symm_apply_im]
294297
def equivRealProdLm : ℂ ≃ₗ[ℝ] ℝ × ℝ :=
@@ -297,6 +300,8 @@ def equivRealProdLm : ℂ ≃ₗ[ℝ] ℝ × ℝ :=
297300
map_smul' := fun r c => by simp [equivRealProdAddHom, (Prod.smul_def), smul_eq_mul] }
298301
#align complex.equiv_real_prod_lm Complex.equivRealProdLm
299302

303+
theorem equivRealProdLm_symm_apply (p : ℝ × ℝ) :
304+
Complex.equivRealProdLm.symm p = p.1 + p.2 * Complex.I := Complex.equivRealProd_symm_apply p
300305
section lift
301306

302307
variable {A : Type*} [Ring A] [Algebra ℝ A]

Mathlib/MeasureTheory/Measure/Lebesgue/Complex.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Yury Kudryashov
55
-/
6-
import Mathlib.Analysis.SpecialFunctions.Integrals
76
import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace
8-
import Mathlib.MeasureTheory.Measure.Lebesgue.Integral
97

108
#align_import measure_theory.measure.lebesgue.complex from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
119

0 commit comments

Comments
 (0)