Offline · exact source
Exact Lean source

ComplexGaussianMoments

formalization/Cloning/ComplexGaussianMoments.lean

Source hash: 6d482f7d2991a0bf1ba92d9a4bfd8a0f8702c050a8ce51eee49f421abe604ebb

Full source copied without mathematical changes from the snapshot whose input hash matches the passing audit. Select a line number for a stable source pointer.

The declarations belong to the compiled inventory covered by the project’s shared axiom audit. That audit records an aggregate union, without attributing axioms to individual declarations.

Declarations in this module
1import Mathlib.MeasureTheory.Integral.Gamma
2import Mathlib.Analysis.SpecialFunctions.Integrals.Basic
3import Mathlib.Analysis.SpecialFunctions.Complex.Log
4 
5/-! Exact mixed moments of the circular complex Gaussian density, proved by
6polar coordinates and the Gamma integral. -/
7 
8namespace Cloning.ComplexGaussianMoments
9 
10noncomputable section
11set_option backward.isDefEq.respectTransparency false
12open MeasureTheory Set
13open scoped Real
14 
15lemma angular_integral_zero (n m : ℕ) (hnm : n ≠ m) :
16    (∫ θ : ℝ in Ioo (-Real.pi) Real.pi,
17      Complex.exp (((n : ℂ) - m) * Complex.I * θ)) = 0 := by
18  rw [← integral_Ioc_eq_integral_Ioo,
19    ← intervalIntegral.integral_of_le (by linarith [Real.pi_pos])]
20  have hc : ((n : ℂ) - m) * Complex.I ≠ 0 := by
21    apply mul_ne_zero _ Complex.I_ne_zero
22    exact sub_ne_zero.mpr (by exact_mod_cast hnm)
23  rw [integral_exp_mul_complex hc]
24  have he : Complex.exp (((n : ℂ) - m) * Complex.I * (Real.pi : ℝ)) =
25      Complex.exp (((n : ℂ) - m) * Complex.I * (-Real.pi : ℝ)) := by
26    apply Complex.exp_eq_exp_iff_exists_int.mpr
27    refine ⟨(n : ℤ) - m, ?_⟩
28    push_cast
29    ring
30  rw [he, sub_self, zero_div]
31 
32lemma polarCoord_symm_exp (p : ℝ × ℝ) :
33    Complex.polarCoord.symm p = (p.1 : ℂ) * Complex.exp ((p.2 : ℂ) * Complex.I) := by
34  rw [Complex.polarCoord_symm_apply, Complex.exp_mul_I]
35  simp only [Complex.ofReal_cos, Complex.ofReal_sin]
36 
37lemma polar_monomial (p : ℝ × ℝ) (n m : ℕ) :
38    Complex.polarCoord.symm p ^ n * star (Complex.polarCoord.symm p) ^ m =
39      (p.1 : ℂ) ^ (n + m) * Complex.exp (((n : ℂ) - m) * Complex.I * p.2) := by
40  rw [polarCoord_symm_exp]
41  simp only [map_mul, Complex.star_def, Complex.conj_ofReal,
42    ← Complex.exp_conj, map_mul, Complex.conj_I, mul_neg, mul_pow]
43  rw [← Complex.exp_nat_mul, ← Complex.exp_nat_mul]
44  calc
45    _ = (p.1 : ℂ) ^ (n + m) *
46        (Complex.exp ((n : ℂ) * ((p.2 : ℂ) * Complex.I)) *
47         Complex.exp ((m : ℂ) * -((p.2 : ℂ) * Complex.I))) := by rw [pow_add]; ring
48    _ = _ := by rw [← Complex.exp_add]; congr 2; ring
49 
50lemma offDiagonal_integral (a : ℝ) (n m : ℕ) (hnm : n ≠ m) :
51    (∫ z : ℂ, (Real.exp (-a * ‖z‖ ^ 2) : ℂ) * z ^ n * star z ^ m) = 0 := by
52  rw [← Complex.integral_comp_polarCoord_symm, polarCoord_target]
53  have he (p : ℝ × ℝ) :
54      p.1 • ((Real.exp (-a * ‖Complex.polarCoord.symm p‖ ^ 2) : ℂ) *
55        Complex.polarCoord.symm p ^ n * star (Complex.polarCoord.symm p) ^ m) =
56      ((p.1 : ℂ) * Real.exp (-a * |p.1| ^ 2) * (p.1 : ℂ) ^ (n + m)) *
57        Complex.exp (((n : ℂ) - m) * Complex.I * p.2) := by
58    rw [Complex.norm_polarCoord_symm, mul_assoc, polar_monomial]
59    simp only [Complex.real_smul]
60    ring
61  simp_rw [he]
62  rw [Measure.volume_eq_prod]
63  rw [setIntegral_prod_mul
64    (fun r : ℝ => (r : ℂ) * Real.exp (-a * |r| ^ 2) * (r : ℂ) ^ (n + m))
65    (fun θ : ℝ => Complex.exp (((n : ℂ) - m) * Complex.I * θ))]
66  rw [angular_integral_zero n m hnm, mul_zero]
67 
68lemma radial_integral (a : ℝ) (ha : 0 < a) (n : ℕ) :
69    (∫ z : ℂ, ‖z‖ ^ (2 * n) * Real.exp (-a * ‖z‖ ^ 2)) =
70      Real.pi * (n.factorial : ℝ) / a ^ (n + 1) := by
71  have h := Complex.integral_rpow_mul_exp_neg_mul_rpow
72    (p := 2) (q := (2 * n : ℕ)) (b := a) (by norm_num) (by have hn : (0 : ℝ) ≤ ((2 * n : ℕ) : ℝ) := Nat.cast_nonneg _; linarith) ha
73  have he : -(((2 * n : ℕ) : ℝ) + 2) / 2 = -((n + 1 : ℕ) : ℝ) := by push_cast; ring
74  have he' : (((2 * n : ℕ) : ℝ) + 2) / 2 = (n : ℝ) + 1 := by push_cast; ring
75  simp only [Real.rpow_natCast, Real.rpow_two, he, he', Real.Gamma_nat_eq_factorial] at h
76  rw [Real.rpow_neg ha.le, Real.rpow_natCast] at h
77  convert h using 1
78  ring
79 
80lemma diagonal_integral (a : ℝ) (ha : 0 < a) (n : ℕ) :
81    (∫ z : ℂ, (Real.exp (-a * ‖z‖ ^ 2) : ℂ) * z ^ n * star z ^ n) =
82      (Real.pi * (n.factorial : ℝ) / a ^ (n + 1) : ℝ) := by
83  have he (z : ℂ) : (Real.exp (-a * ‖z‖ ^ 2) : ℂ) * z ^ n * star z ^ n =
84      ((‖z‖ ^ (2 * n) * Real.exp (-a * ‖z‖ ^ 2) : ℝ) : ℂ) := by
85    rw [mul_assoc, ← mul_pow, Complex.star_def, Complex.mul_conj, Complex.normSq_eq_norm_sq]
86    push_cast
87    rw [pow_mul]
88    ring
89  simp_rw [he]
90  rw [integral_complex_ofReal, radial_integral a ha n]
91 
92end
93end Cloning.ComplexGaussianMoments