Offline · exact source
Exact Lean source

CountableScheffe

formalization/Cloning/CountableScheffe.lean

Source hash: b22c4d317c25b247bc90699d8dd61ea32d7fb8a9c05da90ad6c6c5232898cd00

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.ClassicalFidelity
2import Cloning.Thermal
3import Mathlib.Analysis.Normed.Group.Tannery
4import Mathlib.Topology.Algebra.InfiniteSum.Real
5 
6/-!
7# Discrete Scheffé and countable Hellinger convergence
8 
9This proves the pointwise-to-`ℓ¹` upgrade invoked in the Werner occupation
10and coherent-product arguments of `cloning.tex`, using the overlap `min(pₙ,p)`
11and Tannery's theorem. No `ℓ¹` limit or uniform domination of the original
12laws is assumed. The index type may be any type, in particular a countable
13Fock occupation lattice.
14 
15The pinned Mathlib input is `tendsto_tsum_of_dominated_convergence` in
16`Mathlib.Analysis.Normed.Group.Tannery`. The actual Werner binomial-ratio
17pointwise limit and its quantum occupation-space identification remain
18separate obligations.
19-/
20 
21noncomputable section
22open scoped BigOperators Topology
23open Filter
24 
25namespace Cloning.CountableScheffe
26 
27variable {ι : Type*}
28 
29def l1Distance (p q : ι → ℝ) : ℝ := ∑' i, |p i - q i|
30 
31def affinity (p q : ι → ℝ) : ℝ := ∑' i, Real.sqrt (p i) * Real.sqrt (q i)
32 
33theorem affinity_comm (p q : ι → ℝ) : affinity p q = affinity q p := by
34  unfold affinity
35  apply tsum_congr
36  intro i
37  exact mul_comm _ _
38 
39theorem summable_min (p q : ι → ℝ) (hp : ∀ i, 0 ≤ p i) (hq : ∀ i, 0 ≤ q i)
40    (hsq : Summable q) : Summable (fun i ↦ min (p i) (q i)) := by
41  apply hsq.of_norm_bounded
42  intro i
43  rw [Real.norm_eq_abs, abs_of_nonneg (le_min (hp i) (hq i))]
44  exact min_le_right _ _
45 
46theorem abs_sub_eq_add_sub_two_min (x y : ℝ) : |x - y| = x + y - 2 * min x y := by
47  rcases le_total x y with h | h
48  · rw [min_eq_left h, abs_of_nonpos (sub_nonpos.mpr h)]
49    ring
50  · rw [min_eq_right h, abs_of_nonneg (sub_nonneg.mpr h)]
51    ring
52 
53/-- The exact overlap formula for the `ℓ¹` distance of nonnegative summable laws. -/
54theorem l1Distance_eq_overlap (p q : ι → ℝ)
55    (hp : ∀ i, 0 ≤ p i) (hq : ∀ i, 0 ≤ q i)
56    (hsp : Summable p) (hsq : Summable q) :
57    l1Distance p q = (∑' i, p i) + (∑' i, q i) - 2 * ∑' i, min (p i) (q i) := by
58  have hmin := summable_min p q hp hq hsq
59  unfold l1Distance
60  simp_rw [abs_sub_eq_add_sub_two_min]
61  rw [(hsp.add hsq).tsum_sub (hmin.mul_left 2), hsp.tsum_add hsq, tsum_mul_left]
62 
63/-- Discrete Scheffé: pointwise convergence of normalized nonnegative laws
64to a normalized law implies convergence in `ℓ¹`. -/
65theorem discrete_scheffe (p : ℕ → ι → ℝ) (q : ι → ℝ)
66    (hp : ∀ n i, 0 ≤ p n i) (hq : ∀ i, 0 ≤ q i)
67    (hpsum : ∀ n, HasSum (p n) 1) (hqsum : HasSum q 1)
68    (hpoint : ∀ i, Tendsto (fun n ↦ p n i) atTop (𝓝 (q i))) :
69    Tendsto (fun n ↦ l1Distance (p n) q) atTop (𝓝 0) := by
70  have hminpoint i : Tendsto (fun n ↦ min (p n i) (q i)) atTop (𝓝 (q i)) := by
71    simpa using (hpoint i).min (tendsto_const_nhds (x := q i))
72  have hminlimit : Tendsto (fun n ↦ ∑' i, min (p n i) (q i)) atTop (𝓝 1) := by
73    simpa only [hqsum.tsum_eq] using
74      (tendsto_tsum_of_dominated_convergence hqsum.summable hminpoint
75        (Eventually.of_forall fun n i ↦ by
76          rw [Real.norm_eq_abs, abs_of_nonneg (le_min (hp n i) (hq i))]
77          exact min_le_right _ _))
78  have hid n : l1Distance (p n) q = 2 - 2 * ∑' i, min (p n i) (q i) := by
79    rw [l1Distance_eq_overlap _ _ (hp n) hq (hpsum n).summable hqsum.summable,
80      (hpsum n).tsum_eq, hqsum.tsum_eq]
81    ring
82  simp_rw [hid]
83  simpa using (tendsto_const_nhds (x := (2 : ℝ))).sub (hminlimit.const_mul 2)
84 
85/-- Countable Cauchy--Schwarz in the square-root form used by Hellinger affinity. -/
86theorem affinity_le_sqrt_mass (p q : ι → ℝ)
87    (hp : ∀ i, 0 ≤ p i) (hq : ∀ i, 0 ≤ q i)
88    (hsp : Summable p) (hsq : Summable q) :
89    affinity p q ≤ Real.sqrt (∑' i, p i) * Real.sqrt (∑' i, q i) := by
90  apply Real.tsum_le_of_sum_le (fun i ↦ mul_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _))
91  intro s
92  calc
93    (∑ i ∈ s, Real.sqrt (p i) * Real.sqrt (q i)) ≤
94        Real.sqrt (∑ i ∈ s, p i) * Real.sqrt (∑ i ∈ s, q i) :=
95      Real.sum_sqrt_mul_sqrt_le s hp hq
96    _ ≤ Real.sqrt (∑' i, p i) * Real.sqrt (∑' i, q i) := by
97      exact mul_le_mul
98        (Real.sqrt_le_sqrt (hsp.sum_le_tsum s (fun i _ ↦ hp i)))
99        (Real.sqrt_le_sqrt (hsq.sum_le_tsum s (fun i _ ↦ hq i)))
100        (Real.sqrt_nonneg _) (Real.sqrt_nonneg _)
101 
102theorem affinity_summable (p q : ι → ℝ)
103    (hp : ∀ i, 0 ≤ p i) (hq : ∀ i, 0 ≤ q i)
104    (hsp : Summable p) (hsq : Summable q) :
105    Summable (fun i ↦ Real.sqrt (p i) * Real.sqrt (q i)) := by
106  apply (hsp.add hsq).of_norm_bounded
107  intro i
108  rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _))]
109  have hx := Real.sq_sqrt (hp i)
110  have hy := Real.sq_sqrt (hq i)
111  nlinarith [sq_nonneg (Real.sqrt (p i) - Real.sqrt (q i))]
112 
113/-- Dimension-free countable affinity continuity; no finite support is required. -/
114theorem affinity_l1_continuity (p q r : ι → ℝ)
115    (hp : ∀ i, 0 ≤ p i) (hq : ∀ i, 0 ≤ q i) (hr : ∀ i, 0 ≤ r i)
116    (hsp : Summable p) (hsq : Summable q) (hrsum : HasSum r 1) :
117    |affinity p r - affinity q r| ≤ Real.sqrt (l1Distance p q) := by
118  have hpr := affinity_summable p r hp hr hsp hrsum.summable
119  have hqr := affinity_summable q r hq hr hsq hrsum.summable
120  have hdiff : Summable (fun i ↦ |p i - q i|) := (hsp.sub hsq).abs
121  have hbound := affinity_summable (fun i ↦ |p i - q i|) r
122    (fun i ↦ abs_nonneg _) hr hdiff hrsum.summable
123  unfold affinity
124  rw [← hpr.tsum_sub hqr]
125  calc
126    |∑' i, (Real.sqrt (p i) * Real.sqrt (r i) - Real.sqrt (q i) * Real.sqrt (r i))| ≤
127        ∑' i, |Real.sqrt (p i) * Real.sqrt (r i) - Real.sqrt (q i) * Real.sqrt (r i)| := by
128      have hnorm : Summable (fun i ↦
129          ‖Real.sqrt (p i) * Real.sqrt (r i) - Real.sqrt (q i) * Real.sqrt (r i)‖) := by
130        simpa only [Real.norm_eq_abs] using (hpr.sub hqr).abs
131      simpa only [Real.norm_eq_abs] using norm_tsum_le_tsum_norm hnorm
132    _ ≤ ∑' i, Real.sqrt |p i - q i| * Real.sqrt (r i) := by
133      apply (hpr.sub hqr).abs.tsum_le_tsum _ hbound
134      intro i
135      rw [← sub_mul, abs_mul, abs_of_nonneg (Real.sqrt_nonneg _)]
136      exact mul_le_mul_of_nonneg_right
137        (Cloning.ClassicalFidelity.sqrt_difference_bound _ _ (hp i) (hq i))
138        (Real.sqrt_nonneg _)
139    _ ≤ Real.sqrt (∑' i, |p i - q i|) * Real.sqrt (∑' i, r i) :=
140      affinity_le_sqrt_mass _ _ (fun i ↦ abs_nonneg _) hr hdiff hrsum.summable
141    _ = Real.sqrt (l1Distance p q) := by rw [hrsum.tsum_eq, Real.sqrt_one, mul_one]; rfl
142 
143/-- Pointwise normalized laws have convergent Hellinger affinities against
144every fixed normalized target law, even on an infinite occupation lattice. -/
145theorem affinity_tendsto_of_pointwise (p : ℕ → ι → ℝ) (q r : ι → ℝ)
146    (hp : ∀ n i, 0 ≤ p n i) (hq : ∀ i, 0 ≤ q i) (hr : ∀ i, 0 ≤ r i)
147    (hpsum : ∀ n, HasSum (p n) 1) (hqsum : HasSum q 1) (hrsum : HasSum r 1)
148    (hpoint : ∀ i, Tendsto (fun n ↦ p n i) atTop (𝓝 (q i))) :
149    Tendsto (fun n ↦ affinity (p n) r) atTop (𝓝 (affinity q r)) := by
150  rw [tendsto_iff_dist_tendsto_zero]
151  simp only [Real.dist_eq]
152  apply squeeze_zero (fun n ↦ abs_nonneg _)
153    (fun n ↦ affinity_l1_continuity (p n) q r (hp n) hq hr
154      (hpsum n).summable hqsum.summable hrsum)
155  simpa using (Real.continuous_sqrt.tendsto 0).comp
156    (discrete_scheffe p q hp hq hpsum hqsum hpoint)
157 
158/-- Both countable probability laws may vary. Pointwise limits and
159normalization alone imply convergence of their Hellinger affinity. -/
160theorem affinity_tendsto_of_pointwise_two (p q : ℕ → ι → ℝ) (p₀ q₀ : ι → ℝ)
161    (hp : ∀ n i, 0 ≤ p n i) (hq : ∀ n i, 0 ≤ q n i)
162    (hp₀ : ∀ i, 0 ≤ p₀ i) (hq₀ : ∀ i, 0 ≤ q₀ i)
163    (hpsum : ∀ n, HasSum (p n) 1) (hqsum : ∀ n, HasSum (q n) 1)
164    (hp₀sum : HasSum p₀ 1) (hq₀sum : HasSum q₀ 1)
165    (hpointp : ∀ i, Tendsto (fun n ↦ p n i) atTop (𝓝 (p₀ i)))
166    (hpointq : ∀ i, Tendsto (fun n ↦ q n i) atTop (𝓝 (q₀ i))) :
167    Tendsto (fun n ↦ affinity (p n) (q n)) atTop (𝓝 (affinity p₀ q₀)) := by
168  have hpL := discrete_scheffe p p₀ hp hp₀ hpsum hp₀sum hpointp
169  have hqL := discrete_scheffe q q₀ hq hq₀ hqsum hq₀sum hpointq
170  have hbound n : |affinity (p n) (q n) - affinity p₀ q₀| ≤
171      Real.sqrt (l1Distance (p n) p₀) + Real.sqrt (l1Distance (q n) q₀) := by
172    apply (abs_sub_le (affinity (p n) (q n)) (affinity p₀ (q n)) (affinity p₀ q₀)).trans
173    apply add_le_add
174      (affinity_l1_continuity (p n) p₀ (q n) (hp n) hp₀ (hq n)
175        (hpsum n).summable hp₀sum.summable (hqsum n))
176    rw [affinity_comm p₀ (q n), affinity_comm p₀ q₀]
177    exact affinity_l1_continuity (q n) q₀ p₀ (hq n) hq₀ hp₀
178      (hqsum n).summable hq₀sum.summable hp₀sum
179  rw [tendsto_iff_dist_tendsto_zero]
180  simp only [Real.dist_eq]
181  apply squeeze_zero (fun n ↦ abs_nonneg _) hbound
182  simpa using ((Real.continuous_sqrt.tendsto 0).comp hpL).add
183    ((Real.continuous_sqrt.tendsto 0).comp hqL)
184 
185/-- The scalar estimate upgrades `ℓ¹` convergence to square-root amplitude convergence. -/
186theorem sqrt_amplitude_error_le (x y : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) :
187    (Real.sqrt x - Real.sqrt y) ^ 2 ≤ |x - y| := by
188  have h := mul_self_le_mul_self (abs_nonneg (Real.sqrt x - Real.sqrt y))
189    (Cloning.ClassicalFidelity.sqrt_difference_bound x y hx hy)
190  simpa only [← sq, sq_abs, Real.sq_sqrt (abs_nonneg (x - y))] using h
191 
192/-- This is the square-root amplitude limit used in the coherent-product argument. -/
193theorem sqrt_amplitudes_tendsto_of_pointwise (p : ℕ → ι → ℝ) (q : ι → ℝ)
194    (hp : ∀ n i, 0 ≤ p n i) (hq : ∀ i, 0 ≤ q i)
195    (hpsum : ∀ n, HasSum (p n) 1) (hqsum : HasSum q 1)
196    (hpoint : ∀ i, Tendsto (fun n ↦ p n i) atTop (𝓝 (q i))) :
197    Tendsto (fun n ↦ ∑' i, (Real.sqrt (p n i) - Real.sqrt (q i)) ^ 2)
198      atTop (𝓝 0) := by
199  have hs (n : ℕ) : Summable (fun i ↦ (Real.sqrt (p n i) - Real.sqrt (q i)) ^ 2) := by
200    apply ((hpsum n).summable.sub hqsum.summable).abs.of_norm_bounded
201    intro i
202    rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)]
203    exact sqrt_amplitude_error_le _ _ (hp n i) (hq i)
204  apply squeeze_zero (fun n ↦ tsum_nonneg (fun i ↦ sq_nonneg _))
205    (fun n ↦ (hs n).tsum_le_tsum
206      (fun i ↦ sqrt_amplitude_error_le _ _ (hp n i) (hq i))
207      ((hpsum n).summable.sub hqsum.summable).abs)
208  exact discrete_scheffe p q hp hq hpsum hqsum hpoint
209 
210/-- The thermal normalization is proved in `Thermal`; hence a pointwise
211geometric occupation limit already implies the required `ℓ¹` limit. -/
212theorem geometric_limit_l1 (p : ℕ → ℕ → ℝ) {q : ℝ}
213    (hq0 : 0 ≤ q) (hq1 : q < 1) (hp : ∀ n k, 0 ≤ p n k)
214    (hpsum : ∀ n, HasSum (p n) 1)
215    (hpoint : ∀ k, Tendsto (fun n ↦ p n k) atTop (𝓝 (Cloning.Thermal.geometric q k))) :
216    Tendsto (fun n ↦ l1Distance (p n) (Cloning.Thermal.geometric q)) atTop (𝓝 0) :=
217  discrete_scheffe p (Cloning.Thermal.geometric q) hp
218    (Cloning.Thermal.geometric_nonneg hq0 hq1.le)
219    hpsum (Cloning.Thermal.geometric_hasSum hq0 hq1) hpoint
220 
221/-- The product-geometric Fock occupation limit needs no additional tightness
222hypothesis: normalization and coordinatewise convergence suffice. -/
223theorem multimode_geometric_limit_l1 {s : ℕ}
224    (p : ℕ → (Fin s → ℕ) → ℝ) (q : Fin s → ℝ)
225    (hq0 : ∀ i, 0 ≤ q i) (hq1 : ∀ i, q i < 1)
226    (hp : ∀ n k, 0 ≤ p n k) (hpsum : ∀ n, HasSum (p n) 1)
227    (hpoint : ∀ k, Tendsto (fun n ↦ p n k) atTop
228      (𝓝 (∏ i, Cloning.Thermal.geometric (q i) (k i)))) :
229    Tendsto (fun n ↦ l1Distance (p n)
230      (fun k ↦ ∏ i, Cloning.Thermal.geometric (q i) (k i))) atTop (𝓝 0) := by
231  apply discrete_scheffe p _ hp _ hpsum
232    (Cloning.Thermal.multimode_geometric_hasSum hq0 hq1) hpoint
233  intro k
234  exact Finset.prod_nonneg fun i _ ↦ Cloning.Thermal.geometric_nonneg (hq0 i) (hq1 i).le _
235 
236end Cloning.CountableScheffe