GaussianSpatialSign.lean
1module23public import SubentropyCertificates.CircularRadii4public import SubentropyCertificates.GaussianSignBound5public import SubentropyCertificates.GaussianSignSpectral6public import SubentropyCertificates.ExponentialSignMoments78/-! The Gaussian representation of K, and the first moment of the logarithmic Gaussian tilt. -/9@[expose] public section10noncomputable section11set_option backward.isDefEq.respectTransparency false12open Matrix MeasureTheory ProbabilityTheory Set13open scoped BigOperators ComplexOrder MatrixOrder Matrix.Norms.L2Operator1415namespace SubentropyCertificates.ConditionalContinuity16open SubentropyCertificates.Representations1718variable {D : Type*} [Fintype D] [DecidableEq D]1920omit [DecidableEq D] in21private theorem radii_test (f : (D → ℝ) → ℝ) (hf : Measurable f) :22 (∫ g, f (fun i ↦ Complex.normSq (g i)) ∂circularGaussian D) =23 ∫ z, f z ∂Measure.pi (fun _ ↦ expMeasure 1) := by24 rw [← circular_radii_map D, integral_map (by fun_prop) hf.aestronglyMeasurable]2526private theorem radial_sign (w : D → ℝ) (hw : ∀ j, 0 ≤ w j) (i : D) :27 (∫ g, w i * Complex.normSq (g i) / diagonalEnergy w g ∂circularGaussian D) =28 ∫ t in Ioi (0 : ℝ), (w i / (1 + t*w i)) * ∏ j, (1 + t*w j)⁻¹ :=29 (radii_test (fun z ↦ w i*z i / (∑ j, w j*z j)) (by fun_prop)).trans30 (exponential_sign_integral w hw i)3132private theorem radial_log (w : D → ℝ) (hw : ∀ j, 0 < w j) (i : D) :33 (∫ g, (1 + Real.log (diagonalEnergy w g)) * Complex.normSq (g i) ∂circularGaussian D) =34 1 + (∫ g, Real.log (diagonalEnergy w g) ∂circularGaussian D) +35 ∫ g, w i * Complex.normSq (g i) / diagonalEnergy w g ∂circularGaussian D := by36 let T (z : D → ℝ) := ∑ j, w j*z j37 have hT : Measurable T := by dsimp [T]; fun_prop38 have h := exponential_log_moment w hw i39 exact ((radii_test (fun z ↦ (1 + Real.log (T z)) * z i) (by fun_prop)).trans h).trans40 (congrArg₂ (· + ·)41 (congrArg (1 + ·) (radii_test (fun z ↦ Real.log (T z)) (by fun_prop)).symm)42 (radii_test (fun z ↦ w i*z i/T z) (by fun_prop)).symm)4344/-- The determinant integral agrees with the Gaussian normalized outer product for every45positive semidefinite matrix. The totalized expression also equals zero at the zero matrix. -/46theorem spatialSign_gaussian_expectation {M : Matrix D D ℂ} (hM : M.PosSemidef) :47 spatialSign M = ∫ g, gaussianSign M g ∂circularGaussian D := by48 rw [spatialSign_spectral hM, gaussianSign_spectral hM (gaussianSign_integrable hM)]49 simp_rw [radial_sign _ hM.eigenvalues_nonneg]5051/-- For a nonzero covariance the denominator is strictly positive almost surely,52even when the matrix is singular. -/53theorem quadraticForm_pos_ae {M : Matrix D D ℂ} (hM : M.PosSemidef) (hn : M ≠ 0) :54 ∀ᵐ g ∂circularGaussian D, 0 < quadraticForm M g := by55 obtain ⟨i, hi⟩ : ∃ i, 0 < hM.isHermitian.eigenvalues i := by56 by_contra! he57 exact hn (hM.isHermitian.eigenvalues_eq_zero_iff.mp58 (funext fun i ↦ le_antisymm (he i) (hM.eigenvalues_nonneg i)))59 have hz : ∀ᵐ t ∂expMeasure 1, t ≠ 0 := by60 rw [expMeasure, gammaMeasure]61 exact (Measure.ae_le_iff_absolutelyContinuous.mpr (withDensity_absolutelyContinuous _ _))62 (volume.ae_ne (0 : ℝ))63 let : IsProbabilityMeasure (expMeasure 1) := isProbabilityMeasure_expMeasure one_pos64 have hprod := (measurePreserving_eval (fun _ : D ↦ expMeasure 1) i).quasiMeasurePreserving.ae hz65 rw [← circular_radii_map D] at hprod66 have hr := ae_of_ae_map (by fun_prop : AEMeasurable (fun (g : V D) j ↦ Complex.normSq (g j))67 (circularGaussian D)) hprod68 apply (quadraticForm_spectral_ae hM.isHermitian (0 < ·)).269 filter_upwards [hr] with g hg70 have hzi : 0 < Complex.normSq (g i) := lt_of_le_of_ne (Complex.normSq_nonneg _) (Ne.symm hg)71 exact lt_of_lt_of_le (mul_pos hi hzi) (Finset.single_le_sum72 (fun j _ ↦ mul_nonneg (hM.eigenvalues_nonneg j) (Complex.normSq_nonneg (g j)))73 (Finset.mem_univ i))7475/-- The Gaussian representation has trace one at every nonzero covariance. -/76theorem spatialSign_trace_one {M : Matrix D D ℂ} (hM : M.PosSemidef) (hn : M ≠ 0) :77 (spatialSign M).trace = 1 := by78 let L : Matrix D D ℂ →L[ℝ] ℂ := (Matrix.traceLinearMap D ℝ ℂ).toContinuousLinearMap79 let : IsProbabilityMeasure (circularGaussian D) := by unfold circularGaussian; infer_instance80 rw [spatialSign_gaussian_expectation hM]81 change L _ = 182 rw [← L.integral_comp_comm (gaussianSign_integrable hM)]83 calc84 _ = ∫ _ : V D, (1 : ℂ) ∂circularGaussian D := by85 apply integral_congr_ae86 filter_upwards [quadraticForm_pos_ae hM hn] with g hg87 let y := Matrix.toEuclideanLin (CFC.sqrt M) g88 have ho : (gaussianOuter y).trace = ((‖y‖ ^ 2 : ℝ) : ℂ) := by89 rw [gaussianOuter, trace_vecMulVec, Complex.ofReal_pow]90 exact (EuclideanSpace.inner_eq_star_dotProduct y y).symm.trans (inner_self_eq_norm_sq_to_K _)91 change ((quadraticForm M g)⁻¹ • gaussianOuter y).trace = _92 rw [trace_smul, ho, ← quadraticForm_sqrt_norm hM g, Complex.real_smul,93 ← Complex.ofReal_mul, inv_mul_cancel₀ hg.ne', Complex.ofReal_one]94 _ = 1 := by simp9596/-- Integration by parts identifies the Gaussian derivative moment at a positive definite M. -/97theorem gaussianSlope_eq_of_integrable {M : Matrix D D ℂ} (hM : M.PosDef)98 (hi : Integrable (fun g ↦ (1 + Real.log (quadraticForm M g)) • gaussianOuter g)99 (circularGaussian D)) :100 gaussianSlope M = (1 + gaussianLogMean M) • 1 + spatialSign M := by101 let h := hM.isHermitian102 let U := Unitary.conjStarAlgAut ℂ _ h.eigenvectorUnitary103 let w := h.eigenvalues104 let b := 1 + ∫ g, Real.log (diagonalEnergy w g) ∂circularGaussian D105 let v (i : D) := ∫ g, w i * Complex.normSq (g i) / diagonalEnergy w g ∂circularGaussian D106 rw [gaussianSlope_spectral h hi, gaussianLogMean_spectral h, spatialSign_gaussian_expectation107 hM.posSemidef, gaussianSign_spectral hM.posSemidef (gaussianSign_integrable hM.posSemidef)]108 change U (diagonal fun i ↦ ((∫ g, (1 + Real.log (diagonalEnergy w g)) *109 Complex.normSq (g i) ∂circularGaussian D : ℝ) : ℂ)) = b • 1 + U (diagonal fun i ↦ (v i : ℂ))110 have he (i : D) : (∫ g, (1 + Real.log (diagonalEnergy w g)) * Complex.normSq (g i)111 ∂circularGaussian D) = b + v i := radial_log w hM.eigenvalues_pos i112 simp_rw [he, Complex.ofReal_add]113 rw [← diagonal_add (fun _ : D ↦ (b : ℂ)) (fun i ↦ (v i : ℂ)), map_add]114 congr 1115 have hid : diagonal (fun _ : D ↦ (b : ℂ)) = (b : ℂ) • (1 : Matrix D D ℂ) := by116 ext i j117 by_cases hij : i = j <;> simp [hij]118 rw [hid, map_smul, map_one]119 rfl120121end SubentropyCertificates.ConditionalContinuity
Axioms used
Choose a statement to see which axioms its proof uses.