Offline · exact source
Exact Lean source

YoungGeneralMoments

formalization/Cloning/YoungGeneralMoments.lean

Source hash: d92af4bb112d7a099a197eb48be411c4548943ffa664f8f6a52c543fa7f8dd3d

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.YoungGeneralPMF
2import Cloning.YoungCompatibilityPMF
3import Cloning.YoungDimensionRatio
4 
5/-!
6# General-rank crossing-dimension moment limits
7 
8The expectations are under genuine PMFs identified with the explicit tableau
9formula at the flat spectrum.  Their tails are proved in the preceding files,
10and the dimension observable is the literal crossing-root Weyl product.
11No moment or concentration premise is assumed.  Representation-space
12dimension identification and Schur measurement identification remain separate.
13-/
14 
15noncomputable section
16open scoped BigOperators Topology Classical
17open Filter
18 
19namespace Cloning.YoungGeneral
20open YoungDimensionRatio
21 
22def flatSpectrum (r : ℕ) : Fin r → ℝ := fun _ ↦ 1 / r
23 
24theorem flatSpectrum_sum (r : ℕ) (hr : 0 < r) : ∑ i, flatSpectrum r i = 1 := by
25  simp [flatSpectrum, (Nat.cast_ne_zero.mpr (Nat.ne_of_gt hr) : (r : ℝ) ≠ 0)]
26 
27def shapeRows {r N : ℕ} (μ : Shape r N) : Fin r → ℝ := fun i ↦ (μ i).val
28 
29theorem shapeRows_nonneg {r N : ℕ} (μ : Shape r N) (i : Fin r) : 0 ≤ shapeRows μ i :=
30  Nat.cast_nonneg _
31 
32theorem shapeRows_le {r N : ℕ} (μ : Shape r N) (i : Fin r) : shapeRows μ i ≤ N := by
33  dsimp only [shapeRows]
34  exact_mod_cast Nat.le_of_lt_succ (μ i).isLt
35 
36def dimensionErrorEnvelope (r k N : ℕ) : ℝ :=
37  Real.exp ((r * k : ℕ) * ((r : ℝ) * shrinkingRadius N + (r : ℝ) * ((r : ℝ) + k) / N)) - 1
38 
39theorem dimensionErrorEnvelope_nonneg (r k N : ℕ) : 0 ≤ dimensionErrorEnvelope r k N := by
40  unfold dimensionErrorEnvelope
41  apply sub_nonneg.mpr
42  apply Real.one_le_exp_iff.mpr
43  have := shrinkingRadius_nonneg N
44  positivity
45 
46theorem dimensionErrorEnvelope_tendsto_zero (r k : ℕ) :
47    Tendsto (dimensionErrorEnvelope r k) atTop (𝓝 0) :=
48  error_envelope_tendsto_zero r k (fun N ↦ (N : ℝ)) shrinkingRadius
49    tendsto_natCast_atTop_atTop shrinkingRadius_tendsto_zero
50 
51def normalizedDimension (r k N : ℕ) (μ : Shape r N) : ℝ :=
52  dimensionRatio r k (shapeRows μ) / (leadingConstant r k * (N : ℝ) ^ (r * k))
53 
54def dimensionUniformBound (r k : ℕ) : ℝ := ((r : ℝ) * (1 + r + k)) ^ (r * k) + 1
55 
56theorem normalizedDimension_global_error (r k N : ℕ) (hr : 0 < r) (hN : 1 ≤ N)
57    (μ : Shape r N) : |normalizedDimension r k N μ - 1| ≤ dimensionUniformBound r k := by
58  have hn : (0 : ℝ) < N := by exact_mod_cast (show 0 < N by omega)
59  have hn1 : (1 : ℝ) ≤ N := by exact_mod_cast hN
60  have hden : leadingConstant r k * (N : ℝ) ^ (r * k) ≠ 0 :=
61    (mul_pos (leadingConstant_pos r k hr) (pow_pos hn _)).ne'
62  unfold normalizedDimension
63  rw [dimensionRatio_factorization r k (shapeRows μ) N hr hn, mul_div_cancel_left₀ _ hden]
64  have hpos (a : Fin r × Fin k) : 0 ≤ (r : ℝ) * (shapeRows μ a.1 + crossingGap a) / N := by
65    have := shapeRows_nonneg μ a.1
66    have := (crossingGap_pos a).le
67    positivity
68  have hb (a : Fin r × Fin k) :
69      (r : ℝ) * (shapeRows μ a.1 + crossingGap a) / N ≤ (r : ℝ) * (1 + r + k) := by
70    have hrow := shapeRows_le μ a.1
71    have hgap := crossingGap_le a
72    have hc : 0 ≤ (r : ℝ) + k := by positivity
73    have hcN := mul_le_mul_of_nonneg_left hn1 hc
74    apply (div_le_iff₀ hn).mpr
75    have hinside : shapeRows μ a.1 + crossingGap a ≤ (1 + r + k) * (N : ℝ) := by
76      nlinarith
77    nlinarith [mul_le_mul_of_nonneg_left hinside (Nat.cast_nonneg r)]
78  have hprod := Finset.prod_le_prod (fun a (_ : a ∈ (Finset.univ : Finset (Fin r × Fin k))) ↦ hpos a)
79    (fun a _ ↦ hb a)
80  simp only [Finset.prod_const, Finset.card_univ, Fintype.card_prod, Fintype.card_fin] at hprod
81  have hprod0 : 0 ≤ ∏ a : Fin r × Fin k, (r : ℝ) * (shapeRows μ a.1 + crossingGap a) / N :=
82    Finset.prod_nonneg (fun a _ ↦ hpos a)
83  have hab := abs_sub (∏ a : Fin r × Fin k, (r : ℝ) * (shapeRows μ a.1 + crossingGap a) / N) (1 : ℝ)
84  rw [abs_of_nonneg hprod0, abs_one] at hab
85  unfold dimensionUniformBound
86  linarith
87 
88theorem normalizedDimension_typical_error (r k N : ℕ) (hr : 0 < r) (hN : 1 ≤ N)
89    (μ : Shape r N)
90    (ht : ¬∃ i, (N : ℝ) * shrinkingRadius N ≤ |shapeRows μ i - N * flatSpectrum r i|) :
91    |normalizedDimension r k N μ - 1| ≤ dimensionErrorEnvelope r k N := by
92  have hn : (0 : ℝ) < N := by exact_mod_cast (show 0 < N by omega)
93  apply dimensionRatio_relative_error r k (shapeRows μ) N (shrinkingRadius N) hr hn
94  intro i
95  have hi := lt_of_not_ge (fun h ↦ ht ⟨i, h⟩)
96  have heq : shapeRows μ i / N - 1 / (r : ℝ) =
97      (shapeRows μ i - N * flatSpectrum r i) / N := by
98        unfold flatSpectrum
99        field_simp
100  rw [heq, abs_div, abs_of_pos hn]
101  apply (div_le_iff₀ hn).mpr
102  nlinarith
103 
104/-- Finite expectation splitting with the actual coordinate tail. -/
105theorem mean_error_le {r N : ℕ} (P : PMF (Shape r N)) (p : Fin r → ℝ)
106    (ε δ B : ℝ) (hδ : 0 ≤ δ) (F : Shape r N → ℝ)
107    (hglobal : ∀ μ, |F μ - 1| ≤ B)
108    (hgood : ∀ μ, (¬∃ i, (N : ℝ) * ε ≤ |((μ i).val : ℝ) - N * p i|) → |F μ - 1| ≤ δ) :
109    (∑ μ, (P μ).toReal * |F μ - 1|) ≤ δ + B * tailProbability P p ε := by
110  have hpoint (μ : Shape r N) : (P μ).toReal * |F μ - 1| ≤ (P μ).toReal * δ +
111      B * (if ∃ i, (N : ℝ) * ε ≤ |((μ i).val : ℝ) - N * p i| then (P μ).toReal else 0) := by
112    split_ifs with ht
113    · have hb := mul_le_mul_of_nonneg_left (hglobal μ) (show 0 ≤ (P μ).toReal from ENNReal.toReal_nonneg)
114      have hz := mul_nonneg (show 0 ≤ (P μ).toReal from ENNReal.toReal_nonneg) hδ
115      nlinarith
116    · simp only [mul_zero, add_zero]
117      exact mul_le_mul_of_nonneg_left (hgood μ ht) ENNReal.toReal_nonneg
118  have hs : ∑ μ, (P μ).toReal = 1 := by
119    simpa only [tsum_fintype, YoungCompatibility.probability] using YoungCompatibility.tsum_probability P
120  have hsum := Finset.sum_le_sum (fun μ (_ : μ ∈ (Finset.univ : Finset (Shape r N))) ↦ hpoint μ)
121  simpa only [Finset.sum_add_distrib, ← Finset.sum_mul, ← Finset.mul_sum, hs, one_mul,
122    tailProbability] using hsum
123 
124/-- General-rank forward dimension moment: convergence in mean absolute
125relative error, under the exact flat Young formula. -/
126theorem mean_normalizedDimension_error_tendsto_zero (r k : ℕ) (hr : 0 < r)
127    (P : ∀ N, PMF (Shape r N))
128    (hformula : ∀ N μ, (P N μ).toReal = youngWeight N (flatSpectrum r) (fun i ↦ (μ i).val)) :
129    Tendsto (fun N ↦ ∑ μ, (P N μ).toReal * |normalizedDimension r k N μ - 1|) atTop (𝓝 0) := by
130  have htail := tailProbability_tendsto_zero P (fun _ ↦ flatSpectrum r)
131    (fun _ _ ↦ by dsimp [flatSpectrum]; positivity) (fun _ ↦ flatSpectrum_sum r hr)
132    (fun _ ↦ antitone_const) hformula
133  have hbound := (dimensionErrorEnvelope_tendsto_zero r k).add (htail.const_mul (dimensionUniformBound r k))
134  simp only [mul_zero, add_zero] at hbound
135  apply squeeze_zero' (Eventually.of_forall (fun N ↦
136    Finset.sum_nonneg (fun μ _ ↦ mul_nonneg ENNReal.toReal_nonneg (abs_nonneg _)))) ?_ hbound
137  filter_upwards [Filter.eventually_ge_atTop 1] with N hN
138  exact mean_error_le (P N) (flatSpectrum r) (shrinkingRadius N)
139    (dimensionErrorEnvelope r k N) (dimensionUniformBound r k)
140    (dimensionErrorEnvelope_nonneg r k N) (normalizedDimension r k N)
141    (normalizedDimension_global_error r k N hr hN) (normalizedDimension_typical_error r k N hr hN)
142 
143def inverseNormalizedDimension (r k N : ℕ) (μ : Shape r N) : ℝ :=
144  (leadingConstant r k * (N : ℝ) ^ (r * k)) / dimensionRatio r k (shapeRows μ)
145 
146theorem dimensionRatio_shape_ge_one (r k N : ℕ) (μ : Shape r N) :
147    1 ≤ dimensionRatio r k (shapeRows μ) := by
148  apply Finset.one_le_prod
149  intro a _
150  apply (one_le_div (crossingGap_pos a)).mpr
151  exact le_add_of_nonneg_left (shapeRows_nonneg μ a.1)
152 
153theorem inverseNormalizedDimension_global_error (r k N : ℕ) (hr : 0 < r)
154    (μ : Shape r N) :
155    |inverseNormalizedDimension r k N μ - 1| ≤ leadingConstant r k * (N : ℝ) ^ (r * k) + 1 := by
156  let D := leadingConstant r k * (N : ℝ) ^ (r * k)
157  have hD : 0 ≤ D := mul_nonneg (leadingConstant_pos r k hr).le (pow_nonneg (Nat.cast_nonneg _) _)
158  have hR := dimensionRatio_shape_ge_one r k N μ
159  have hR0 : 0 < dimensionRatio r k (shapeRows μ) := lt_of_lt_of_le zero_lt_one hR
160  have hdiv : D / dimensionRatio r k (shapeRows μ) ≤ D := div_le_self hD hR
161  have hab := abs_sub (D / dimensionRatio r k (shapeRows μ)) (1 : ℝ)
162  rw [abs_of_nonneg (div_nonneg hD hR0.le), abs_one] at hab
163  change |D / dimensionRatio r k (shapeRows μ) - 1| ≤ D + 1
164  linarith
165 
166private theorem inverse_error_of_error {R D δ : ℝ} (hR : 0 < R) (hD : 0 < D)
167    (hδ : δ ≤ 1 / 2) (herr : |R / D - 1| ≤ δ) : |D / R - 1| ≤ 2 * δ := by
168  have hl : (1 / 2 : ℝ) ≤ R / D := by have := (abs_le.mp herr).1; linarith
169  have hl' : D ≤ 2 * R := by have := (le_div_iff₀ hD).mp hl; linarith
170  have hinv : D / R ≤ 2 := (div_le_iff₀ hR).mpr hl'
171  have heq : D / R - 1 = -(D / R) * (R / D - 1) := by field_simp; ring
172  rw [heq, abs_mul, abs_neg, abs_of_pos (div_pos hD hR)]
173  exact (mul_le_mul_of_nonneg_left herr (div_pos hD hR).le).trans
174    (mul_le_mul_of_nonneg_right hinv (le_trans (abs_nonneg _) herr))
175 
176theorem inverseNormalizedDimension_typical_error (r k N : ℕ) (hr : 0 < r) (hN : 1 ≤ N)
177    (hsmall : dimensionErrorEnvelope r k N ≤ 1 / 2) (μ : Shape r N)
178    (ht : ¬∃ i, (N : ℝ) * shrinkingRadius N ≤ |shapeRows μ i - N * flatSpectrum r i|) :
179    |inverseNormalizedDimension r k N μ - 1| ≤ 2 * dimensionErrorEnvelope r k N := by
180  have hn : (0 : ℝ) < N := by exact_mod_cast (show 0 < N by omega)
181  exact inverse_error_of_error (dimensionRatio_pos r k (shapeRows μ) (shapeRows_nonneg μ))
182    (mul_pos (leadingConstant_pos r k hr) (pow_pos hn _)) hsmall
183    (normalizedDimension_typical_error r k N hr hN μ ht)
184 
185/-- General-rank reciprocal dimension moment.  Polynomial growth on extreme
186shapes is controlled by the proved stretched-exponential Young tail. -/
187theorem mean_inverseNormalizedDimension_error_tendsto_zero (r k : ℕ) (hr : 0 < r)
188    (P : ∀ N, PMF (Shape r N))
189    (hformula : ∀ N μ, (P N μ).toReal = youngWeight N (flatSpectrum r) (fun i ↦ (μ i).val)) :
190    Tendsto (fun N ↦ ∑ μ, (P N μ).toReal * |inverseNormalizedDimension r k N μ - 1|)
191      atTop (𝓝 0) := by
192  let c := leadingConstant r k
193  let a := r * k
194  have hc : 0 ≤ c := (leadingConstant_pos r k hr).le
195  have htail := (polynomial_concentrationEnvelope_tendsto_zero r a).const_mul (c + 1)
196  have hbound := ((dimensionErrorEnvelope_tendsto_zero r k).const_mul 2).add htail
197  simp only [mul_zero, add_zero] at hbound
198  apply squeeze_zero' (Eventually.of_forall (fun N ↦
199    Finset.sum_nonneg (fun μ _ ↦ mul_nonneg ENNReal.toReal_nonneg (abs_nonneg _)))) ?_ hbound
200  have hsmall : ∀ᶠ N in atTop, dimensionErrorEnvelope r k N ≤ 1 / 2 :=
201    (dimensionErrorEnvelope_tendsto_zero r k).eventually (eventually_le_nhds (by norm_num))
202  filter_upwards [Filter.eventually_ge_atTop 1, hsmall] with N hN heN
203  have hmean := mean_error_le (P N) (flatSpectrum r) (shrinkingRadius N)
204    (2 * dimensionErrorEnvelope r k N) (c * (N : ℝ) ^ a + 1)
205    (mul_nonneg (by norm_num) (dimensionErrorEnvelope_nonneg r k N))
206    (inverseNormalizedDimension r k N)
207    (inverseNormalizedDimension_global_error r k N hr)
208    (inverseNormalizedDimension_typical_error r k N hr hN heN)
209  have htailN : tailProbability (P N) (flatSpectrum r) (shrinkingRadius N) ≤ concentrationEnvelope r N := by
210    rw [tailProbability_eq_atypicalMass _ _ (hformula N)]
211    exact atypicalMass_shrinking_le N hN (flatSpectrum r)
212      (fun _ ↦ by dsimp [flatSpectrum]; positivity) (flatSpectrum_sum r hr) antitone_const
213  have hpw : (N : ℝ) ^ a ≤ ((N : ℝ) + 1) ^ a := pow_le_pow_left₀ (by positivity) (by linarith) _
214  have hpw1 : (1 : ℝ) ≤ ((N : ℝ) + 1) ^ a := one_le_pow₀ (by have := Nat.cast_nonneg (α := ℝ) N; linarith)
215  have hcoeff : c * (N : ℝ) ^ a + 1 ≤ (c + 1) * ((N : ℝ) + 1) ^ a := by
216    nlinarith [mul_le_mul_of_nonneg_left hpw hc]
217  have ht0 : 0 ≤ tailProbability (P N) (flatSpectrum r) (shrinkingRadius N) := by
218    unfold tailProbability
219    exact Finset.sum_nonneg (fun μ _ ↦ by split_ifs <;> positivity)
220  have htailbound : (c * (N : ℝ) ^ a + 1) * tailProbability (P N) (flatSpectrum r) (shrinkingRadius N) ≤
221      (c + 1) * (((N : ℝ) + 1) ^ a * concentrationEnvelope r N) := by
222    have hh := mul_le_mul hcoeff htailN ht0 (by positivity : 0 ≤ (c + 1) * ((N : ℝ) + 1) ^ a)
223    convert hh using 1 <;> ring
224  exact hmean.trans (by linarith)
225 
226theorem mean_tendsto_one_of_mean_absolute_error {r : ℕ} (P : ∀ N, PMF (Shape r N))
227    (F : ∀ N, Shape r N → ℝ)
228    (h : Tendsto (fun N ↦ ∑ μ, (P N μ).toReal * |F N μ - 1|) atTop (𝓝 0)) :
229    Tendsto (fun N ↦ ∑ μ, (P N μ).toReal * F N μ) atTop (𝓝 1) := by
230  have herr : Tendsto (fun N ↦ (∑ μ, (P N μ).toReal * F N μ) - 1) atTop (𝓝 0) := by
231    apply squeeze_zero_norm (fun N ↦ ?_) h
232    have hs : ∑ μ, (P N μ).toReal = 1 := by
233      simpa only [tsum_fintype, YoungCompatibility.probability] using
234        YoungCompatibility.tsum_probability (P N)
235    have heq : (∑ μ, (P N μ).toReal * F N μ) - 1 =
236        ∑ μ, (P N μ).toReal * (F N μ - 1) := by
237      simp only [mul_sub, mul_one, Finset.sum_sub_distrib, hs]
238    rw [heq, Real.norm_eq_abs]
239    simpa only [abs_mul, abs_of_nonneg ENNReal.toReal_nonneg] using
240      Finset.abs_sum_le_sum_abs (fun μ : Shape r N ↦ (P N μ).toReal * (F N μ - 1)) Finset.univ
241  simpa only [sub_add_cancel, zero_add] using herr.add_const 1
242 
243/-- Forward and inverse leading-order moments in every rank. -/
244theorem dimension_moments_tendsto_one (r k : ℕ) (hr : 0 < r)
245    (P : ∀ N, PMF (Shape r N))
246    (hformula : ∀ N μ, (P N μ).toReal = youngWeight N (flatSpectrum r) (fun i ↦ (μ i).val)) :
247    Tendsto (fun N ↦ ∑ μ, (P N μ).toReal * normalizedDimension r k N μ) atTop (𝓝 1) ∧
248    Tendsto (fun N ↦ ∑ μ, (P N μ).toReal * inverseNormalizedDimension r k N μ) atTop (𝓝 1) :=
249  ⟨mean_tendsto_one_of_mean_absolute_error P _ (mean_normalizedDimension_error_tendsto_zero r k hr P hformula),
250    mean_tendsto_one_of_mean_absolute_error P _ (mean_inverseNormalizedDimension_error_tendsto_zero r k hr P hformula)⟩
251 
252end Cloning.YoungGeneral