Offline · exact source
Exact Lean source

YoungPhysicalRoundingLimit

formalization/Cloning/YoungPhysicalRoundingLimit.lean

Source hash: a09ab5baecad3d72a8b1dd6eecaa2628eeac7b6371440d19e68b7c56152348b1

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.YoungPhysicalRoundingAnalysis
2 
3/-! The literal randomized dilation of physical Young labels converges in L¹. -/
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 1200000
11 
12def headGaussian (d : ℕ) (p : Fin (d+1) → ℝ) (hp : ∑ i, p i = 1) : (Fin d → ℝ) → ℝ :=
13  coordinateDensity d (covarianceGaussian d p hp)
14 
15theorem headGaussian_nonneg (d : ℕ) (p : Fin (d+1) → ℝ) (hp : ∑ i, p i = 1)
16    (x : Fin d → ℝ) : 0 ≤ headGaussian d p hp x :=
17  mul_nonneg (Real.sqrt_nonneg _) (covarianceGaussian_nonneg d p hp _)
18 
19theorem integral_headGaussian (d : ℕ) (p : Fin (d+1) → ℝ) (hp : ∑ i, p i = 1)
20    (hp0 : ∀ i, 0 < p i) : (∫ x, headGaussian d p hp x) = 1 := by
21  rw [headGaussian, integral_coordinateDensity, integral_covarianceGaussian d p hp hp0]
22 
23theorem integrable_headGaussian (d : ℕ) (p : Fin (d+1) → ℝ) (hp : ∑ i, p i = 1)
24    (hp0 : ∀ i, 0 < p i) : Integrable (headGaussian d p hp) := by
25  by_contra hi
26  have hh := integral_headGaussian d p hp hp0
27  rw [integral_undef hi] at hh
28  norm_num at hh
29 
30theorem continuous_headGaussian (d : ℕ) (p : Fin (d+1) → ℝ) (hp : ∑ i, p i = 1) :
31    Continuous (headGaussian d p hp) := by
32  have hc := (covarianceEigenbasis d p hp).repr.continuous.comp (coordinatesContinuous d).continuous
33  have hi (i : Fin d) : Continuous (fun x : Fin d → ℝ ↦
34      (covarianceEigenbasis d p hp).repr (coordinates d x) i) :=
35    (PiLp.continuous_apply 2 _ i).comp hc
36  unfold headGaussian coordinateDensity covarianceGaussian GaussianAffinity.productDensity
37  apply Continuous.const_mul
38  apply continuous_finset_prod
39  intro i _
40  unfold GaussianAffinity.density
41  exact (Real.continuous_exp.comp ((hi i).pow 2 |>.const_mul (- (1 / (2 * covarianceEigenvalues d p hp i))))).const_mul _
42 
43theorem integrable_headDensity (d N : ℕ) (hN : 0 < N)
44    (p : Fin (d+1) → ℝ) (hp : ∀ i, 0 ≤ p i) (hs : ∑ i, p i = 1) :
45    Integrable (headDensity d N p hp hs) :=
46  integrable_affineDensity _ (by positivity) _
47    (integrable_interpolate (ENNReal.summable_toReal (tensorYoungHeadPMF d N p hp hs).tsum_coe_ne_top))
48 
49theorem headDensity_nonneg (d N : ℕ)
50    (p : Fin (d+1) → ℝ) (hp : ∀ i, 0 ≤ p i) (hs : ∑ i, p i = 1) (x : Fin d → ℝ) :
51    0 ≤ headDensity d N p hp hs x := by
52  unfold headDensity affineDensity YoungRounding.interpolate
53  positivity
54 
55theorem integral_headDensity (d N : ℕ) (hN : 0 < N)
56    (p : Fin (d+1) → ℝ) (hp : ∀ i, 0 ≤ p i) (hs : ∑ i, p i = 1) :
57    (∫ x, headDensity d N p hp hs x) = 1 := by
58  rw [← coordinateDensity_tensorYoungDensity, integral_coordinateDensity,
59    integral_tensorYoungDensity d N hN]
60 
61/-- Exact recentering of the raw dilation: its fluctuation scale is sqrt(m/n). -/
62theorem preRoundedDensity_eq_dilated_headDensity (d n m : ℕ) (hn : 0 < n) (hm : 0 < m)
63    (p : Fin (d+1) → ℝ) (hp : ∀ i, 0 ≤ p i) (hs : ∑ i, p i = 1) :
64    preRoundedDensity (Real.sqrt (m : ℝ))⁻¹ (headAnchor d m p) ((m : ℝ)/n)
65      (tensorYoungHeadPMF d n p hp hs) =
66    affineDensity (Real.sqrt (m : ℝ)/Real.sqrt (n : ℝ)) 0 (headDensity d n p hp hs) := by
67  have hsn : Real.sqrt (n : ℝ) ≠ 0 := by positivity
68  have hsm : Real.sqrt (m : ℝ) ≠ 0 := by positivity
69  have hnR : (n : ℝ) ≠ 0 := by positivity
70  have hmR : (m : ℝ) ≠ 0 := by positivity
71  have hscale : (Real.sqrt (m : ℝ))⁻¹*((m : ℝ)/n) =
72      (Real.sqrt (m : ℝ)/Real.sqrt (n : ℝ))*(Real.sqrt (n : ℝ))⁻¹ := by
73    field_simp
74    nlinarith [Real.sq_sqrt (Nat.cast_nonneg n), Real.sq_sqrt (Nat.cast_nonneg m)]
75  have hanchor : headAnchor d m p =
76      (Real.sqrt (m : ℝ)/Real.sqrt (n : ℝ)) • headAnchor d n p := by
77    ext i
78    simp only [headAnchor, Pi.smul_apply, smul_eq_mul]
79    field_simp
80  rw [preRoundedDensity, headDensity,
81    affineDensity_comp _ _ (inv_ne_zero hsm) (div_ne_zero hmR hnR),
82    affineDensity_comp _ _ (div_ne_zero hsm hsn) (inv_ne_zero hsn)]
83  simp only [smul_zero, add_zero, zero_add, hscale, hanchor]
84 
85/-- Arbitrary divergent input/output sizes and moving strict spectra yield the actual
86rounded output density, with covariance dilated by the limiting sample ratio. -/
87theorem rounded_tensorYoungDensity_l1_tendsto (d : ℕ) (n m : ℕ → ℕ)
88    (hn : Tendsto n atTop atTop) (hm : Tendsto m atTop atTop)
89    (hn0 : ∀ k, 0 < n k) (hm0 : ∀ k, 0 < m k)
90    (γ : ℝ) (hγ : 0 < γ) (hratio : Tendsto (fun k ↦ (m k : ℝ)/n k) atTop (𝓝 γ))
91    (p : ℕ → Fin (d + 1) → ℝ) (hp : ∀ k, ∑ i, p k i = 1)
92    (hp0 : ∀ k i, 0 < p k i) (p₀ : Fin (d + 1) → ℝ) (hs₀ : ∑ i, p₀ i = 1)
93    (hp₀ : ∀ i, 0 < p₀ i) (hord : StrictAnti p₀)
94    (hlim : ∀ i, Tendsto (fun k ↦ p k i) atTop (𝓝 (p₀ i))) :
95    Tendsto (fun k ↦ ∫ x, |roundedDensity (Real.sqrt (m k : ℝ))⁻¹ (headAnchor d (m k) (p k))
96      ((m k : ℝ)/n k) (tensorYoungHeadPMF d (n k) (p k) (fun i ↦ (hp0 k i).le) (hp k)) x -
97      affineDensity (Real.sqrt γ) 0 (headGaussian d p₀ hs₀) x|) atTop (𝓝 0) := by
98  let s := fun k ↦ Real.sqrt (m k : ℝ)/Real.sqrt (n k : ℝ)
99  have hs : ∀ k, 0 < s k := fun k ↦ by dsimp [s]; positivity [hn0 k, hm0 k]
100  have hsconv : Tendsto s atTop (𝓝 (Real.sqrt γ)) := by
101    simpa only [s, Real.sqrt_div (Nat.cast_nonneg _)] using hratio.sqrt
102  have hbase := headDensity_l1_tendsto d n hn hn0 p hp hp0 p₀ hs₀ hp₀ hord hlim
103  have hpre := affineDensity_l1_tendsto s hs (Real.sqrt γ) (by positivity) hsconv
104    (fun k ↦ headDensity d (n k) (p k) (fun i ↦ (hp0 k i).le) (hp k))
105    (fun k ↦ integrable_headDensity d (n k) (hn0 k) (p k) _ (hp k))
106    (headGaussian d p₀ hs₀) (integrable_headGaussian d p₀ hs₀ hp₀)
107    (headGaussian_nonneg d p₀ hs₀) (continuous_headGaussian d p₀ hs₀) hbase
108  apply roundedDensity_l1_tendsto_of_pre
109    (fun k ↦ (Real.sqrt (m k : ℝ))⁻¹) (fun k ↦ (m k : ℝ)/n k)
110    (fun k ↦ headAnchor d (m k) (p k))
111    (fun k ↦ tensorYoungHeadPMF d (n k) (p k) (fun i ↦ (hp0 k i).le) (hp k))
112    (fun k ↦ by positivity [hm0 k]) (fun k ↦ by positivity [hm0 k, hn0 k])
113    (Cloning.YoungMultinomial.inv_sqrt_nat_tendsto_zero.comp hm)
114    (affineDensity (Real.sqrt γ) 0 (headGaussian d p₀ hs₀))
115    (integrable_affineDensity _ (by positivity) _ (integrable_headGaussian d p₀ hs₀ hp₀))
116    (fun x ↦ mul_nonneg (by positivity) (headGaussian_nonneg d p₀ hs₀ _))
117    (by
118      unfold affineDensity
119      exact ((continuous_headGaussian d p₀ hs₀).comp
120        ((continuous_id.sub continuous_const).const_smul _)).const_mul _)
121  simpa only [preRoundedDensity_eq_dilated_headDensity d _ _ (hn0 _) (hm0 _), s] using hpre
122 
123end Cloning.YoungHyperplane