Offline · exact source
Exact Lean source

YoungPhysicalRoundingGaussian

formalization/Cloning/YoungPhysicalRoundingGaussian.lean

Source hash: 51593a4bc4c808ed3b6f16104535c62f64589521ed12fa675dbb5ff5f5eaa7dc

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 Cloning.YoungPhysicalRoundingLimit
2 
3/-! Exact Gaussian affinity for randomized Young-label dilation. -/
4noncomputable section
5open scoped BigOperators Topology Classical
6open MeasureTheory Filter
7namespace Cloning.YoungHyperplane
8open Cloning.YoungRounding
9set_option backward.isDefEq.respectTransparency false
10set_option maxHeartbeats 1000000
11 
12private theorem sqrt_scale (c x y : ℝ) (hc : 0 ≤ c) :
13    Real.sqrt (c*x)*Real.sqrt (c*y) = c*(Real.sqrt x*Real.sqrt y) := by
14  rw [Real.sqrt_mul hc, Real.sqrt_mul hc]
15  calc
16    _ = (Real.sqrt c)^2*(Real.sqrt x*Real.sqrt y) := by ring
17    _ = _ := by rw [Real.sq_sqrt hc]
18 
19theorem coordinateDensity_affinity (d : ℕ) (f g : rootSpace d → ℝ) :
20    (∫ x, Real.sqrt (coordinateDensity d f x)*Real.sqrt (coordinateDensity d g x)) =
21      ∫ x, Real.sqrt (f x)*Real.sqrt (g x) := by
22  have he : (fun x ↦ Real.sqrt (coordinateDensity d f x)*Real.sqrt (coordinateDensity d g x)) =
23      coordinateDensity d (fun x ↦ Real.sqrt (f x)*Real.sqrt (g x)) := by
24    funext x
25    exact sqrt_scale _ _ _ (Real.sqrt_nonneg _)
26  rw [he, integral_coordinateDensity]
27 
28private theorem gaussian_density_scale (a h x : ℝ) (ha : 0 ≤ a) (hh : 0 < h) :
29    GaussianAffinity.density (a/(h*h)) x = h⁻¹ * GaussianAffinity.density a (h⁻¹*x) := by
30  unfold GaussianAffinity.density
31  rw [Real.sqrt_div ha, Real.sqrt_mul_self hh.le]
32  have he : -(a/(h*h))*x^2 = -a*(h⁻¹*x)^2 := by ring
33  rw [he]
34  ring
35 
36/-- Covariance-dilated Gaussian on the orthonormal physical root coordinates. -/
37def dilatedCovarianceGaussian (d : ℕ) (p : Fin (d+1) → ℝ) (hp : ∑ i, p i = 1)
38    (γ : ℝ) (x : rootSpace d) : ℝ :=
39  GaussianAffinity.productDensity (fun i ↦ (1/(2*covarianceEigenvalues d p hp i))/γ)
40    (fun i ↦ (covarianceEigenbasis d p hp).repr x i)
41 
42/-- The coordinate Gaussian dilation includes exactly the scalar density Jacobian. -/
43theorem affineDensity_headGaussian (d : ℕ) (p : Fin (d+1) → ℝ) (hp : ∑ i, p i = 1)
44    (hp0 : ∀ i, 0 < p i) (γ : ℝ) (hγ : 0 < γ) :
45    affineDensity (Real.sqrt γ) 0 (headGaussian d p hp) =
46      coordinateDensity d (dilatedCovarianceGaussian d p hp γ) := by
47  have hs : 0 < Real.sqrt γ := by positivity
48  have hss : Real.sqrt γ*Real.sqrt γ = γ := Real.mul_self_sqrt hγ.le
49  have hi i : 0 ≤ 1/(2*covarianceEigenvalues d p hp i) := by
50    positivity [covarianceEigenvalues_pos d p hp hp0 i]
51  have hden (i : Fin d) (y : ℝ) :
52      GaussianAffinity.density ((1/(2*covarianceEigenvalues d p hp i))/γ) y =
53        (Real.sqrt γ)⁻¹ * GaussianAffinity.density (1/(2*covarianceEigenvalues d p hp i))
54          ((Real.sqrt γ)⁻¹*y) := by
55    convert gaussian_density_scale (1/(2*covarianceEigenvalues d p hp i)) (Real.sqrt γ) y (hi i) hs using 1 <;> rw [hss]
56  funext x
57  simp only [affineDensity, headGaussian, coordinateDensity, dilatedCovarianceGaussian,
58    covarianceGaussian, GaussianAffinity.productDensity, sub_zero, map_smul,
59    PiLp.smul_apply, smul_eq_mul, Fintype.card_fin]
60  simp_rw [hden]
61  rw [Finset.prod_mul_distrib]
62  simp only [Finset.prod_const, Finset.card_univ, Fintype.card_fin, inv_pow]
63  ring
64 
65/-- The actual covariance and root-space Jacobians cancel in the Gaussian affinity. -/
66theorem headGaussian_dilation_affinity (d : ℕ) (p : Fin (d+1) → ℝ) (hp : ∑ i, p i = 1)
67    (hp0 : ∀ i, 0 < p i) (γ : ℝ) (hγ : 0 < γ) :
68    (∫ x, Real.sqrt (headGaussian d p hp x) *
69      Real.sqrt (affineDensity (Real.sqrt γ) 0 (headGaussian d p hp) x)) =
70      Cloning.classicalValue γ (d+1) := by
71  rw [affineDensity_headGaussian d p hp hp0 γ hγ]
72  change (∫ x, Real.sqrt (coordinateDensity d (covarianceGaussian d p hp) x)*
73    Real.sqrt (coordinateDensity d (dilatedCovarianceGaussian d p hp γ) x)) = _
74  rw [coordinateDensity_affinity]
75  let b := covarianceEigenbasis d p hp
76  let a := fun i ↦ 1/(2*covarianceEigenvalues d p hp i)
77  have ha i : 0 < a i := by
78    dsimp [a]
79    positivity [covarianceEigenvalues_pos d p hp hp0 i]
80  have he := (PiLp.volume_preserving_toLp (Fin d)).symm (MeasurableEquiv.toLp 2 (Fin d → ℝ))
81  have hb := b.repr.measurePreserving
82  have h := (he.comp hb).integral_comp
83    ((MeasurableEquiv.toLp 2 _).symm.measurableEmbedding.comp b.repr.toHomeomorph.measurableEmbedding)
84    (fun x ↦ Real.sqrt (GaussianAffinity.productDensity a x)*
85      Real.sqrt (GaussianAffinity.productDensity (fun i ↦ a i/γ) x))
86  change (∫ x, Real.sqrt (covarianceGaussian d p hp x)*
87    Real.sqrt (dilatedCovarianceGaussian d p hp γ x)) = _ at h ⊢
88  rw [h, GaussianAffinity.integral_product_dilation a ha hγ]
89  simp [Cloning.classicalValue]
90 
91end Cloning.YoungHyperplane