Offline · exact source
Exact Lean source

CountMultinomialLimit

formalization/Cloning/CountMultinomialLimit.lean

Source hash: d8a17e39628c8e60701d4e7eccc2ac28c891f96f18a558d0a3e7b110e6ec29ca

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.CountMultinomialLocal
2 
3/-! Global L¹ conditional count CLT, with no strict positivity premise on the finite samples. -/
4noncomputable section
5open scoped BigOperators Topology Classical
6open Filter MeasureTheory
7namespace Cloning.CountMultinomial
8open Cloning.YoungGeneral Cloning.YoungHyperplane
9set_option backward.isDefEq.respectTransparency false
10set_option maxHeartbeats 1400000
11 
12def shiftedGaussian (d : ℕ) (h : rootSpace d) (x : rootSpace d) : ℝ :=
13  covarianceGaussian d (flatSpectrum (d+1)) (flatSpectrum_sum _ (by omega)) (x-h)
14 
15theorem integral_shiftedGaussian (d : ℕ) (h : rootSpace d) :
16    (∫ x, shiftedGaussian d h x)=1 := by
17  unfold shiftedGaussian
18  rw [integral_sub_right_eq_self]
19  exact integral_covarianceGaussian d _ _ (fun _ ↦ by unfold flatSpectrum; positivity)
20 
21theorem integrable_shiftedGaussian (d : ℕ) (h : rootSpace d) :
22    Integrable (shiftedGaussian d h) := by
23  by_contra hi
24  have hh := integral_shiftedGaussian d h
25  rw [integral_undef hi] at hh
26  norm_num at hh
27 
28theorem shiftedGaussian_nonneg (d : ℕ) (h x : rootSpace d) : 0≤shiftedGaussian d h x :=
29  covarianceGaussian_nonneg _ _ _ _
30 
31theorem density_l1_tendsto_of_positive (d : ℕ) (n : ℕ → ℕ)
32    (hn : Tendsto n atTop atTop) (hn0 : ∀ k, 0<n k)
33    (p : ℕ → Fin (d+1) → ℝ) (hp : ∀ k i, 0≤p k i) (hs : ∀ k, ∑ i, p k i=1)
34    (hp0 : ∀ k i, 0<p k i)
35    (hlim : ∀ i, Tendsto (fun k ↦ p k i) atTop (𝓝 (flatSpectrum (d+1) i)))
36    (h : rootSpace d)
37    (hshift : ∀ i, Tendsto (fun k ↦ Real.sqrt (n k : ℝ)*(p k i-flatSpectrum (d+1) i))
38      atTop (𝓝 (h.1 i))) :
39    Tendsto (fun k ↦ ∫ x, |density d (n k) (p k) (hp k) (hs k) x-shiftedGaussian d h x|)
40      atTop (𝓝 0) := by
41  apply density_scheffe volume _ _
42    (fun k ↦ integrable_density d (n k) (hn0 k) (p k) (hp k) (hs k))
43    (integrable_shiftedGaussian d h) (fun k ↦ density_nonneg d (n k) (p k) (hp k) (hs k))
44    (shiftedGaussian_nonneg d h)
45  · intro k
46    rw [integral_density d (n k) (hn0 k), integral_shiftedGaussian]
47  · exact ae_of_all _ (density_moving_tendsto_of_positive d n hn hn0 p hp hs hp0 hlim h hshift)
48 
49/-- The true independent-word count densities converge in L¹ under any local
50moving probabilities; zeros at finitely many sample sizes cause no restriction. -/
51theorem density_l1_tendsto (d : ℕ) (n : ℕ → ℕ) (hn : Tendsto n atTop atTop)
52    (p : ℕ → Fin (d+1) → ℝ) (hp : ∀ k i, 0≤p k i) (hs : ∀ k, ∑ i, p k i=1)
53    (hlim : ∀ i, Tendsto (fun k ↦ p k i) atTop (𝓝 (flatSpectrum (d+1) i)))
54    (h : rootSpace d)
55    (hshift : ∀ i, Tendsto (fun k ↦ Real.sqrt (n k : ℝ)*(p k i-flatSpectrum (d+1) i))
56      atTop (𝓝 (h.1 i))) :
57    Tendsto (fun k ↦ ∫ x, |density d (n k) (p k) (hp k) (hs k) x-shiftedGaussian d h x|)
58      atTop (𝓝 0) := by
59  have hp0 : ∀ᶠ k in atTop, ∀ i, 0<p k i :=
60    eventually_all.mpr fun i ↦ (hlim i).eventually (eventually_gt_nhds (by unfold flatSpectrum; positivity))
61  obtain ⟨K,hK⟩ := eventually_atTop.mp ((hn.eventually (eventually_gt_atTop 0)).and hp0)
62  have hk : Tendsto (fun j : ℕ ↦ j+K) atTop atTop :=
63    tendsto_atTop_mono (fun j ↦ Nat.le_add_right j K) tendsto_id
64  apply (tendsto_add_atTop_iff_nat K).mp
65  exact density_l1_tendsto_of_positive d (fun j ↦ n (j+K)) (hn.comp hk)
66    (fun j ↦ (hK (j+K) (by omega)).1) (fun j ↦ p (j+K)) (fun j ↦ hp (j+K))
67    (fun j ↦ hs (j+K)) (fun j ↦ (hK (j+K) (by omega)).2)
68    (fun i ↦ (hlim i).comp hk) h (fun i ↦ (hshift i).comp hk)
69 
70end Cloning.CountMultinomial