Offline · exact source
Exact Lean source

YoungFlatLocal

formalization/Cloning/YoungFlatLocal.lean

Source hash: 37150fd556c875fc340731a0afda796b1d09b39ce5921d2a60d6cf7d5c4ce46b

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.YoungFlatCells
2import Cloning.YoungUniformLocalScheffe
3 
4/-! The actual flat Young law has a continuous Vandermonde-squared local limit. -/
5noncomputable section
6open scoped BigOperators Topology Classical
7open Filter MeasureTheory
8namespace Cloning.YoungFlat
9open Cloning.TensorLie Cloning.YoungHyperplane Cloning.YoungGeneral Cloning.YoungMultinomial
10set_option backward.isDefEq.respectTransparency false
11set_option maxHeartbeats 1400000
12 
13def flatDensity (d N : ℕ) : rootSpace d → ℝ :=
14  tensorYoungDensity d N (flatSpectrum (d+1))
15    (fun _ ↦ by unfold flatSpectrum; positivity) (flatSpectrum_sum _ (by omega))
16 
17/-- Positive-part Vandermonde form of the Gaussian density on the ordered chamber. -/
18def limitDensity (d : ℕ) (x : rootSpace d) : ℝ :=
19  covarianceGaussian d (flatSpectrum (d+1)) (flatSpectrum_sum _ (by omega)) x *
20    vandermondeFactor (fun i ↦ x.1 i)
21 
22theorem flatDensity_nonneg (d N : ℕ) (x : rootSpace d) : 0 ≤ flatDensity d N x :=
23  tensorYoungDensity_nonneg _ _ _ _ _ _
24 
25theorem integral_flatDensity (d N : ℕ) (hN : 0 < N) : (∫ x, flatDensity d N x) = 1 :=
26  integral_tensorYoungDensity d N hN _ _ _
27 
28theorem integrable_flatDensity (d N : ℕ) (hN : 0 < N) : Integrable (flatDensity d N) :=
29  integrable_tensorYoungDensity d N hN _ _ _
30 
31theorem limitDensity_nonneg (d : ℕ) (x : rootSpace d) : 0 ≤ limitDensity d x :=
32  mul_nonneg (covarianceGaussian_nonneg _ _ _ _) (vandermondeFactor_nonneg (by omega) _)
33 
34/-- Local convergence also allows moving points and includes chamber walls. -/
35theorem flatDensity_moving_tendsto (d : ℕ) (n : ℕ → ℕ)
36    (hn : Tendsto n atTop atTop) (hn0 : ∀ k, 0 < n k)
37    (x : ℕ → rootSpace d) (x₀ : rootSpace d)
38    (hx : ∀ i, Tendsto (fun k ↦ (x k).1 i) atTop (𝓝 (x₀.1 i))) :
39    Tendsto (fun k ↦ flatDensity d (n k) (x k)) atTop (𝓝 (limitDensity d x₀)) := by
40  let p := flatSpectrum (d+1)
41  have hp : ∑ i, p i = 1 := flatSpectrum_sum _ (by omega)
42  have hp0 i : 0 < p i := by dsimp [p, flatSpectrum]; positivity
43  let μ := fun k ↦ sampleShape d (n k) p (x k)
44  let c := fun k ↦ sampleCenter d (n k) p (sampleLabel d (n k) p (x k))
45  have hv := eventually_flat_sampleShape_valid d n hn x x₀ hx
46  have hc i : Tendsto (fun k ↦ (c k).1 i) atTop (𝓝 (x₀.1 i)) :=
47    sampleCenter_moving_tendsto d n hn (fun _ ↦ p) (fun _ ↦ hp) x x₀ hx i
48  have hb : ∀ᶠ k in atTop, ∀ i, |(c k).1 i| ≤ ‖x₀‖+1 := by
49    apply eventually_all.mpr
50    intro i
51    filter_upwards [(hc i).eventually (Metric.ball_mem_nhds _ (by norm_num : (0:ℝ)<1))] with k hk
52    have hxbound : |x₀.1 i| ≤ ‖x₀‖ := by simpa using PiLp.norm_apply_le x₀.1 i
53    have ha := abs_add_le ((c k).1 i-x₀.1 i) (x₀.1 i)
54    simp only [Metric.mem_ball, Real.dist_eq] at hk
55    rw [sub_add_cancel] at ha
56    linarith
57  have hm : Tendsto (fun k ↦ multinomialMass (n k) p (fun i ↦ (μ k i).val) /
58      gaussianMass (n k) p (fun i ↦ (c k).1 i)) atTop (𝓝 1) := by
59    apply Metric.tendsto_nhds.mpr
60    intro ε hε
61    obtain ⟨N₀, hN₀⟩ := uniform_multinomial_local_limit (ι := Fin (d+1))
62      (1/((d+1 : ℕ) : ℝ)) (‖x₀‖+1) (by positivity) (by positivity) ε hε
63    filter_upwards [hb, hv, hn.eventually (eventually_ge_atTop N₀)] with k hbk hvk hnk
64    rw [Real.dist_eq]
65    exact hN₀ (n k) hnk p (fun i ↦ (c k).1 i) (fun i ↦ (μ k i).val)
66      (fun _ ↦ le_rfl) hp (c k).2 hbk
67      (shape_count_from_cell d (n k) (hn0 k) p hp (x k) (μ k) hvk.1 hvk.2)
68  have hcorr : Tendsto (fun k ↦ positiveCorrection (fun i ↦ (μ k i).val)) atTop
69      (𝓝 (vandermondeFactor (fun i ↦ x₀.1 i))) := by
70    apply (scaledCorrection_tendsto (by omega : 0<d+1)
71      (fun k ↦ (Real.sqrt (n k : ℝ))⁻¹) (inv_sqrt_nat_tendsto_zero.comp hn)
72      (fun k i ↦ (c k).1 i) (fun i ↦ x₀.1 i) hc).congr'
73    filter_upwards [hv] with k hk
74    exact (positiveCorrection_eq_scaled (hn0 k) (fun i ↦ (μ k i).val)
75      (fun i ↦ (c k).1 i)
76      (shape_count_from_cell d (n k) (hn0 k) p hp (x k) (μ k) hk.1 hk.2)).symm
77  have hmass : Tendsto (fun k ↦ (tensorFlatYoungPMF (n k) (d+1) (by omega) (μ k)).toReal /
78      gaussianMass (n k) p (fun i ↦ (c k).1 i)) atTop
79      (𝓝 (vandermondeFactor (fun i ↦ x₀.1 i))) := by
80    have hh := hm.mul hcorr
81    simp only [one_mul] at hh
82    apply hh.congr'
83    filter_upwards [hv] with k hk
84    rw [tensorFlatYoungPMF_eq_multinomial d (n k) (μ k) hk.1]
85    ring
86  have hg := covarianceGaussian_tendsto d (fun _ ↦ p) p (fun _ ↦ hp) hp
87    (fun _ ↦ hp0) hp0 (fun _ ↦ tendsto_const_nhds) c x₀ hc
88  have ht := hmass.mul hg
89  rw [mul_comm] at ht
90  apply ht.congr'
91  filter_upwards [hv] with k hk
92  have hxcell : x k ∈ sampleCell d (n k) p (shapeLattice d (n k) (μ k)) := by
93    rw [hk.2]
94    exact mem_sampleCell_sampleLabel d (n k) p (x k)
95  change _ = tensorYoungDensity d (n k) p _ hp (x k)
96  rw [tensorYoungDensity_eq_on_cell d (n k) (hn0 k) p _ hp (μ k) hk.1 (x k) hxcell,
97    ← scaled_gaussianMass_eq_covarianceGaussian d (n k) (hn0 k) p hp hp0 (c k)]
98  change (tensorFlatYoungPMF (n k) (d+1) (by omega) (μ k)).toReal /
99      gaussianMass (n k) p (fun i ↦ (c k).1 i) *
100      ((Real.sqrt (n k : ℝ)^d / Real.sqrt ((d : ℝ)+1))*gaussianMass (n k) p (fun i ↦ (c k).1 i)) = _
101  have hg0 : gaussianMass (n k) p (fun i ↦ (c k).1 i) ≠ 0 := Real.exp_ne_zero _
102  change _ = (Real.sqrt (n k : ℝ)^d / Real.sqrt ((d : ℝ)+1))*
103    (tensorFlatYoungPMF (n k) (d+1) (by omega) (μ k)).toReal
104  field_simp
105 
106end Cloning.YoungFlat