interplane.Get Omega
Read in your language

yang

This project has not described itself yet.

Brought by drakestapleton

branch main Branches Tags History

yang / proofs / WilsonRadialTransport.lean

453 lines · 27338 bytes Raw Blame History
1-- SPDX-License-Identifier: Apache-2.0
2import WilsonAngle
3import Mathlib.Analysis.Calculus.ImplicitFunction.Bivariate
4import Mathlib.Analysis.Calculus.ParametricIntervalIntegral
5import Mathlib.MeasureTheory.Constructions.UnitInterval
6
7namespace YangMills.PeriodicWilson
8open MeasureTheory Set Real Filter OneLinkTransport FundamentalSU2
9open scoped Topology unitInterval ENNReal Matrix.Norms.Frobenius
10noncomputable section
11
12/-- Normalized cumulative integral, used as the angular CDF on [0,π]. -/
13def angleCumulative (r t : ℝ) := (∫ x in 0..t, weight r x) / angleNormalizer r
14
15private theorem continuous_weight_pair : Continuous (Function.uncurry weight) := by
16 unfold weight Function.uncurry; fun_prop
17
18private theorem continuous_Z : Continuous angleNormalizer :=
19 intervalIntegral.continuous_parametric_intervalIntegral_of_continuous' continuous_weight_pair _ _
20
21private theorem continuous_cum : Continuous (Function.uncurry angleCumulative) :=
22 (intervalIntegral.continuous_parametric_primitive_of_continuous continuous_weight_pair).div
23 (continuous_Z.comp continuous_fst) (fun p => (angleNormalizer_pos p.1).ne')
24
25private theorem weight_pos {t : ℝ} (ht : t ∈ Ioo 0 π) (r : ℝ) : 0 < weight r t :=
26 mul_pos (pow_pos (sin_pos_of_pos_of_lt_pi ht.1 ht.2) _) (exp_pos _)
27
28private theorem cum_angle_deriv (r t : ℝ) :
29 HasDerivAt (angleCumulative r) (weight r t / angleNormalizer r) t := by
30 have h : Continuous (weight r) := by unfold weight; fun_prop
31 exact (intervalIntegral.integral_hasDerivAt_right (h.intervalIntegrable _ _)
32 h.aestronglyMeasurable.stronglyMeasurableAtFilter h.continuousAt).div_const _
33
34theorem weightMass_hasDerivAt (r t : ℝ) :
35 HasDerivAt (fun s => ∫ x in 0..t, weight s x) (∫ x in 0..t, weight r x*cos x) r := by
36 let dw := fun s x => weight s x * cos x
37 have hd : Continuous (Function.uncurry dw) := continuous_weight_pair.mul (continuous_cos.comp continuous_snd)
38 have hc (s : ℝ) : Continuous (weight s) := by unfold weight; fun_prop
39 obtain ⟨C,hC⟩ := (isCompact_Icc (a := r-1) (b := r+1)).prod (isCompact_uIcc (a := 0) (b := t))
40 |>.exists_bound_of_continuousOn hd.continuousOn
41 apply (intervalIntegral.hasDerivAt_integral_of_dominated_loc_of_deriv_le (F' := dw)
42 (Icc_mem_nhds (by linarith : r-1<r) (by linarith : r<r+1))
43 (.of_forall fun s => (hc s).aestronglyMeasurable)
44 ((hc r).intervalIntegrable _ _) ((hc r).mul continuous_cos).aestronglyMeasurable
45 (.of_forall fun x hx s hs => hC (s,x) ⟨hs,uIoc_subset_uIcc hx⟩)
46 ((continuous_const (y := C)).intervalIntegrable _ _) ?_).2
47 exact .of_forall fun x _ s _ => by
48 have h := (((hasDerivAt_id s).mul_const (cos x)).exp).const_mul (sin x ^ 2)
49 convert h using 1 <;> first | rfl | (simp [dw,weight]; ring)
50
51private theorem cum_field_deriv (r t : ℝ) :
52 HasDerivAt (fun s => angleCumulative s t) (polarFlux r t / angleNormalizer r) r := by
53 have h := (weightMass_hasDerivAt r t).div (weightMass_hasDerivAt r π) (angleNormalizer_pos r).ne'
54 apply h.congr_deriv
55 have hw : Continuous (weight r) := by unfold weight; fun_prop
56 have h₁ : Continuous (fun x => weight r x*cos x) := hw.mul continuous_cos
57 have h₂ : Continuous (fun x => weight r x*meanCos r) := hw.mul continuous_const
58 have hz : (∫ x in 0..π, weight r x) ≠ 0 := (angleNormalizer_pos r).ne'
59 unfold polarFlux
60 simp_rw [mul_sub]
61 rw [intervalIntegral.integral_sub (h₁.intervalIntegrable _ _) (h₂.intervalIntegrable _ _),intervalIntegral.integral_mul_const]
62 unfold meanCos angleNormalizer
63 field_simp [hz]
64
65private theorem cum_strict (r : ℝ) : StrictMonoOn (angleCumulative r) (Icc 0 π) := by
66 apply strictMonoOn_of_deriv_pos (convex_Icc ..)
67 ((continuous_cum.comp (continuous_const.prodMk continuous_id)).continuousOn)
68 intro t ht
69 rw [interior_Icc] at ht
70 change 0 < deriv (angleCumulative r) t
71 rw [(cum_angle_deriv r t).deriv]
72 exact div_pos (weight_pos ht _) (angleNormalizer_pos _)
73
74@[simp] private theorem cum_zero (r : ℝ) : angleCumulative r 0 = 0 := by simp [angleCumulative]
75@[simp] private theorem cum_pi (r : ℝ) : angleCumulative r π = 1 := by
76 change angleNormalizer r / angleNormalizer r = 1
77 exact div_self (angleNormalizer_pos r).ne'
78
79private theorem exists_quantile (r : ℝ) (p : unitInterval) :
80 ∃ t ∈ Icc 0 π, angleCumulative r t = p := by
81 apply intermediate_value_Icc pi_pos.le
82 (show ContinuousOn (angleCumulative r) (Icc 0 π) from
83 (continuous_cum.comp (continuous_const.prodMk continuous_id)).continuousOn)
84 simp
85
86/-- The unique angle with cumulative probability p. Both endpoint quantiles
87are included, although they have probability zero under a uniform rank. -/
88def angleQuantile (r : ℝ) (p : unitInterval) := (exists_quantile r p).choose
89
90theorem quantile_mem (r : ℝ) (p : unitInterval) : angleQuantile r p ∈ Icc 0 π :=
91 (exists_quantile r p).choose_spec.1
92
93theorem cumulative_quantile (r : ℝ) (p : unitInterval) : angleCumulative r (angleQuantile r p) = p :=
94 (exists_quantile r p).choose_spec.2
95
96private theorem quantile_iff (r : ℝ) (p : unitInterval) {t : ℝ} (ht : t ∈ Icc 0 π) :
97 angleQuantile r p ≤ t ↔ p.val ≤ angleCumulative r t := by
98 rw [← cumulative_quantile r p]
99 exact ((cum_strict r).le_iff_le (quantile_mem ..) ht).symm
100
101private theorem quantile_cont : Continuous (Function.uncurry angleQuantile) := by
102 apply continuous_iff_continuousAt.mpr
103 rintro ⟨r,p⟩
104 apply tendsto_order.mpr
105 constructor
106 · intro a ha
107 by_cases ha0 : a < 0
108 · exact .of_forall fun z => ha0.trans_le (quantile_mem z.1 z.2).1
109 have ht : a ∈ Icc 0 π := ⟨le_of_not_gt ha0, ha.le.trans (quantile_mem r p).2⟩
110 have h : angleCumulative r a < p := by
111 rw [← cumulative_quantile r p]; exact cum_strict r ht (quantile_mem ..) ha
112 have hc : Continuous (fun z : ℝ × unitInterval => angleCumulative z.1 a) :=
113 continuous_cum.comp (continuous_fst.prodMk continuous_const)
114 filter_upwards [(isOpen_lt hc (continuous_subtype_val.comp continuous_snd)).mem_nhds h] with z hz
115 exact lt_of_not_ge fun hh => (not_lt_of_ge ((quantile_iff z.1 z.2 ht).mp hh)) hz
116 · intro a ha
117 by_cases hπ : π < a
118 · exact .of_forall fun z => (quantile_mem z.1 z.2).2.trans_lt hπ
119 have ht : a ∈ Icc 0 π := ⟨(quantile_mem r p).1.trans ha.le,le_of_not_gt hπ⟩
120 have h : (p:ℝ) < angleCumulative r a := by
121 rw [← cumulative_quantile r p]; exact cum_strict r (quantile_mem ..) ht ha
122 have hc : Continuous (fun z : ℝ × unitInterval => angleCumulative z.1 a) :=
123 continuous_cum.comp (continuous_fst.prodMk continuous_const)
124 filter_upwards [(isOpen_lt (continuous_subtype_val.comp continuous_snd) hc).mem_nhds h] with z hz
125 apply ((cum_strict z.1).lt_iff_lt (quantile_mem ..) ht).mp
126 rwa [cumulative_quantile]
127
128private theorem quantile_interior {p : unitInterval} (hp : p ≠ 0 ∧ p ≠ 1) (r : ℝ) :
129 angleQuantile r p ∈ Ioo 0 π := by
130 have h := cumulative_quantile r p
131 obtain ⟨h0,hπ⟩ := quantile_mem r p
132 constructor
133 · refine lt_of_le_of_ne h0 fun he => hp.1 (Subtype.ext ?_)
134 simpa [← he] using h.symm
135 · refine lt_of_le_of_ne hπ fun he => hp.2 (Subtype.ext ?_)
136 simpa [he] using h.symm
137
138private theorem continuous_flux : Continuous (Function.uncurry polarFlux) := by
139 have hm : Continuous meanCos :=
140 (intervalIntegral.continuous_parametric_intervalIntegral_of_continuous'
141 (f := fun r t => weight r t * cos t) (continuous_weight_pair.mul (continuous_cos.comp continuous_snd)) 0 π).div
142 continuous_Z (fun r => (angleNormalizer_pos r).ne')
143 exact intervalIntegral.continuous_parametric_primitive_of_continuous
144 (f := fun r x => weight r x * (cos x-meanCos r))
145 (continuous_weight_pair.mul ((continuous_cos.comp continuous_snd).sub (hm.comp continuous_fst)))
146
147/-- The polar velocity is the derivative of the moving angle at fixed uniform rank.
148The minus sign comes from keeping the cumulative mass fixed. -/
149def radialVelocity (r t : ℝ) := -(polarFlux r t / weight r t)
150
151theorem quantile_field_deriv (r : ℝ) {p : unitInterval} (hp : p ≠ 0 ∧ p ≠ 1) :
152 HasDerivAt (fun s => angleQuantile s p) (radialVelocity r (angleQuantile r p)) r := by
153 let t := angleQuantile r p
154 let A := fun s x => polarFlux s x / angleNormalizer s
155 let B := fun s x => weight s x / angleNormalizer s
156 let lin := fun x : ℝ => (1 : ℝ →L[ℝ] ℝ).smulRight x
157 have hl : Continuous lin := (ContinuousLinearMap.smulRightL ℝ ℝ ℝ 1).continuous
158 have hA : Continuous (Function.uncurry A) := continuous_flux.div (continuous_Z.comp continuous_fst)
159 (fun z => (angleNormalizer_pos _).ne')
160 have hB : Continuous (Function.uncurry B) := continuous_weight_pair.div (continuous_Z.comp continuous_fst)
161 (fun z => (angleNormalizer_pos _).ne')
162 have da : ∀ᶠ z : ℝ × ℝ in 𝓝 (r,t), HasFDerivAt (fun s => angleCumulative s z.2)
163 (lin (A z.1 z.2)) z.1 := .of_forall fun z => (cum_field_deriv ..).hasFDerivAt
164 have db : ∀ᶠ z : ℝ × ℝ in 𝓝 (r,t), HasFDerivAt (angleCumulative z.1)
165 (lin (B z.1 z.2)) z.2 := .of_forall fun z => (cum_angle_deriv ..).hasFDerivAt
166 have hb : 0 < B r t := div_pos (weight_pos (quantile_interior hp r) _) (angleNormalizer_pos _)
167 have inv : (lin (B r t)).IsInvertible := ⟨ContinuousLinearEquiv.unitsEquivAut ℝ (.mk0 _ hb.ne'), rfl⟩
168 have ca : ContinuousAt (fun z : ℝ × ℝ => lin (A z.1 z.2)) (r,t) := (hl.comp hA).continuousAt
169 have cb : ContinuousAt (fun z : ℝ × ℝ => lin (B z.1 z.2)) (r,t) := (hl.comp hB).continuousAt
170 let ψ := implicitFunctionOfBivariate (u := (r,t)) (f := angleCumulative)
171 (f₁ := fun s x => lin (A s x)) (f₂ := fun s x => lin (B s x)) da db ca cb inv
172 have hq : Continuous (fun s => angleQuantile s p) :=
173 quantile_cont.comp (continuous_id.prodMk continuous_const)
174 have hh := (continuous_id.prodMk hq).continuousAt (x := r) |>.tendsto.eventually
175 (eventually_apply_eq_iff_implicitFunctionOfBivariate (u := (r,t)) (f := angleCumulative)
176 (f₁ := fun s x => lin (A s x)) (f₂ := fun s x => lin (B s x)) da db ca cb inv)
177 have he : (fun s => angleQuantile s p) =ᶠ[𝓝 r] ψ := by
178 filter_upwards [hh] with s hs
179 exact (hs.mp ((cumulative_quantile s p).trans (cumulative_quantile r p).symm)).symm
180 have hd := (hasStrictFDerivAt_implicitFunctionOfBivariate (u := (r,t)) (f := angleCumulative)
181 (f₁ := fun s x => lin (A s x)) (f₂ := fun s x => lin (B s x)) da db ca cb inv).hasFDerivAt.hasDerivAt
182 apply (hd.congr_of_eventuallyEq he).congr_deriv
183 change -((lin (B r t)).inverse (1 * A r t)) = -(polarFlux r t / weight r t)
184 congr 1
185 apply inv.inverse_apply_eq.mpr
186 change 1 * (polarFlux r t / angleNormalizer r) =
187 (polarFlux r t / weight r t) * (weight r t / angleNormalizer r)
188 have hw : weight r t ≠ 0 := (weight_pos (quantile_interior hp r) r).ne'
189 field_simp [hw,(angleNormalizer_pos r).ne']
190
191private theorem angle_measure_Iic (r t : ℝ) :
192 angleLaw r (Iic t) = ∫⁻ x in Iic t ∩ Ioc 0 π, ENNReal.ofReal (weight r x / angleNormalizer r) := by
193 rw [angleLaw, withDensity_apply _ measurableSet_Iic, Measure.restrict_restrict measurableSet_Iic]
194
195private theorem angle_measure_inside (r : ℝ) {t : ℝ} (ht : t ∈ Icc 0 π) :
196 angleLaw r (Iic t) = ENNReal.ofReal (angleCumulative r t) := by
197 rw [angle_measure_Iic, show Iic t ∩ Ioc 0 π = Ioc 0 t by ext x; simp only [mem_inter_iff,mem_Iic,mem_Ioc]; grind]
198 have hc : Continuous (fun x => weight r x / angleNormalizer r) := by unfold weight; fun_prop
199 rw [← ofReal_integral_eq_lintegral_ofReal
200 ((intervalIntegrable_iff_integrableOn_Ioc_of_le ht.1).mp (hc.intervalIntegrable (μ := volume) 0 t))
201 (.of_forall fun x => div_nonneg (mul_nonneg (sq_nonneg _) (exp_pos _).le) (angleNormalizer_pos r).le)]
202 rw [← intervalIntegral.integral_of_le ht.1, intervalIntegral.integral_div, angleCumulative]
203
204theorem continuous_Q (r : ℝ) : Continuous (angleQuantile r) :=
205 quantile_cont.comp (continuous_const.prodMk continuous_id)
206
207/-- Sampling a uniform rank and taking its quantile reproduces the exact Wilson angular law. -/
208theorem quantile_pushforward (r : ℝ) : (volume : Measure unitInterval).map (angleQuantile r) = angleLaw r := by
209 apply Measure.ext_of_Iic
210 intro t
211 rw [Measure.map_apply (continuous_Q r).measurable measurableSet_Iic]
212 by_cases hl : 0 ≤ t
213 · by_cases hh : t ≤ π
214 · have ht : t ∈ Icc 0 π := ⟨hl,hh⟩
215 let z : unitInterval := ⟨angleCumulative r t,
216 by simpa using (cum_strict r).monotoneOn (show 0 ∈ Icc 0 π from ⟨le_rfl,pi_pos.le⟩) ht hl,
217 by simpa using (cum_strict r).monotoneOn ht (show π ∈ Icc 0 π from ⟨pi_pos.le,le_rfl⟩) hh⟩
218 rw [show angleQuantile r ⁻¹' Iic t = Iic z from Set.ext fun p => quantile_iff r p ht,
219 unitInterval.volume_Iic, angle_measure_inside r ht]
220 · have he : angleQuantile r ⁻¹' Iic t = univ := eq_univ_of_forall fun p => (quantile_mem r p).2.trans (le_of_not_ge hh)
221 have h := measure_mono (μ := angleLaw r) (Iic_subset_Iic.mpr (le_of_not_ge hh))
222 rw [angle_measure_inside r (show π ∈ Icc 0 π from ⟨pi_pos.le,le_rfl⟩), cum_pi, ENNReal.ofReal_one] at h
223 rw [he, measure_univ]
224 exact le_antisymm h (prob_le_one)
225 · have he : angleQuantile r ⁻¹' Iic t = ∅ := eq_empty_iff_forall_notMem.mpr
226 fun p h => hl ((quantile_mem r p).1.trans h)
227 rw [he,measure_empty,angle_measure_Iic, show Iic t ∩ Ioc 0 π = ∅ from eq_empty_iff_forall_notMem.mpr (fun x hx => hl (hx.2.1.le.trans hx.1)), setLIntegral_empty]
228
229/-- Shared uniform rank coupling of two polar-angle laws. -/
230def radialCoupling (r s : ℝ) : Measure (ℝ × ℝ) :=
231 (volume : Measure unitInterval).map (fun p => (angleQuantile r p, angleQuantile s p))
232
233theorem radialCoupling_marginals (r s : ℝ) :
234 (radialCoupling r s).fst = angleLaw r ∧ (radialCoupling r s).snd = angleLaw s := by
235 constructor
236 · rw [radialCoupling, Measure.fst_map_prodMk (continuous_Q s).measurable,quantile_pushforward]
237 · rw [radialCoupling, Measure.snd_map_prodMk (continuous_Q r).measurable,quantile_pushforward]
238
239private def rankSpeed (r : ℝ) (p : unitInterval) := radialVelocity r (angleQuantile r p)
240
241private theorem speed_measurable : Measurable (Function.uncurry rankSpeed) := by
242 have h : Continuous (fun z : ℝ × unitInterval => (z.1, angleQuantile z.1 z.2)) :=
243 continuous_fst.prodMk quantile_cont
244 exact ((continuous_flux.comp h).measurable.div (continuous_weight_pair.comp h).measurable).neg
245
246private theorem speed_in_rank {r : ℝ} (hr : 0 ≤ r) : Continuous (rankSpeed r) :=
247 (polarSpeed_continuousOn hr).neg.comp_continuous (continuous_Q r) (quantile_mem r)
248
249private theorem speed_in_field {p : unitInterval} (hp : p ≠ 0 ∧ p ≠ 1) :
250 Continuous (fun r => rankSpeed r p) := by
251 have h : Continuous (fun r => (r, angleQuantile r p)) :=
252 continuous_id.prodMk (quantile_cont.comp (continuous_id.prodMk continuous_const))
253 exact ((continuous_flux.comp h).div (continuous_weight_pair.comp h)
254 (fun r => (weight_pos (quantile_interior hp r) r).ne')).neg
255
256/-- The mean squared velocity of the quantile path equals the analytic parallel energy. -/
257theorem quantile_mean_square_speed (r : ℝ) :
258 (∫ p : unitInterval, (radialVelocity r (angleQuantile r p))^2) = parallelEnergy r := by
259 have h : Measurable (fun t => (radialVelocity r t)^2) :=
260 (((continuous_flux.comp (continuous_const (y := r) |>.prodMk continuous_id)).measurable.div
261 (continuous_weight_pair.comp (continuous_const (y := r) |>.prodMk continuous_id)).measurable).neg.pow_const 2)
262 rw [← integral_map (continuous_Q r).measurable.aemeasurable h.aestronglyMeasurable, quantile_pushforward,
263 integral_angleLaw]
264 unfold parallelEnergy
265 congr 1
266 apply intervalIntegral.integral_congr
267 intro t _
268 change weight r t * (-(polarFlux r t / weight r t))^2 = polarFlux r t^2 / weight r t
269 by_cases hw : weight r t = 0
270 · simp [hw]
271 · field_simp
272
273/-- Integral Cauchy–Schwarz on an interval, in the form used for path energies. -/
274theorem interval_square_increment {a b D : ℝ} (hab : a < b) {f : ℝ → ℝ}
275 (hc : Continuous f) (hD : (∫ r in a..b, f r) = D) :
276 D^2 ≤ (b-a) * ∫ r in a..b, f r^2 := by
277 let L := b-a
278 have hL : 0 < L := sub_pos.mpr hab
279 have hz := intervalIntegral.integral_nonneg_of_forall (μ := volume) hab.le
280 (fun r => sq_nonneg (L*f r-D))
281 have he (r : ℝ) : (L*f r-D)^2 =
282 L^2*(f r)^2 - (2*L*D)*(f r) + D^2 := by ring
283 simp_rw [he] at hz
284 have c₁ : Continuous (fun r => L^2 * (f r)^2) := continuous_const.mul (hc.pow 2)
285 have c₂ : Continuous (fun r => (2*L*D)*(f r)) := continuous_const.mul hc
286 have c₃ : Continuous (fun r => L^2 * f r^2 - (2*L*D)*f r) := c₁.sub c₂
287 rw [intervalIntegral.integral_add (c₃.intervalIntegrable _ _) (intervalIntegrable_const (c := D^2)),
288 intervalIntegral.integral_sub (c₁.intervalIntegrable _ _) (c₂.intervalIntegrable _ _),
289 intervalIntegral.integral_const_mul,intervalIntegral.integral_const_mul,hD,intervalIntegral.integral_const] at hz
290 change 0 ≤ L^2 * (∫ r in a..b, f r ^ 2) - 2*L*D*D + L * D^2 at hz
291 apply (mul_le_mul_iff_right₀ hL).mp
292 change L*D^2 ≤ L*(L * ∫ r in a..b, f r^2)
293 linarith only [hz]
294
295private theorem square_increment {a b : ℝ} (hab : a < b) {p : unitInterval} (hp : p ≠ 0 ∧ p ≠ 1) :
296 (angleQuantile b p - angleQuantile a p)^2 ≤ (b-a) * ∫ r in a..b, (rankSpeed r p)^2 := by
297 let D := angleQuantile b p - angleQuantile a p
298 have hc := speed_in_field hp
299 have hD : (∫ r in a..b, rankSpeed r p) = D := intervalIntegral.integral_eq_sub_of_hasDerivAt
300 (fun r _ => quantile_field_deriv r hp) (hc.intervalIntegrable _ _)
301 exact interval_square_increment hab hc hD
302
303private theorem path_square_integrable {a : ℝ} (ha : 0 ≤ a) (b : ℝ) :
304 Integrable (fun z : ℝ × unitInterval => (rankSpeed z.1 z.2)^2)
305 ((volume.restrict (Ioc a b)).prod volume) := by
306 have hm : Measurable (fun z : ℝ × unitInterval => rankSpeed z.1 z.2 ^ 2) := speed_measurable.pow_const 2
307 rw [integrable_prod_iff hm.aestronglyMeasurable]
308 constructor
309 · filter_upwards [ae_restrict_mem (μ := (volume : Measure ℝ)) (measurableSet_Ioc (a := a) (b := b))] with r hr
310 exact ((speed_in_rank (ha.trans hr.1.le)).pow 2).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _)
311 · have hmeas := hm.norm.stronglyMeasurable.integral_prod_right' (ν := (volume : Measure unitInterval))
312 apply Integrable.of_bound hmeas.aestronglyMeasurable (1/12)
313 filter_upwards [ae_restrict_mem (μ := (volume : Measure ℝ)) (measurableSet_Ioc (a := a) (b := b))] with r hr
314 have hn (p : unitInterval) : |rankSpeed r p ^ 2| = rankSpeed r p ^ 2 := abs_of_nonneg (sq_nonneg _)
315 have hmean : 0 ≤ ∫ p : unitInterval, rankSpeed r p ^ 2 := integral_nonneg fun p => sq_nonneg _
316 simp only [Real.norm_eq_abs, hn, abs_of_nonneg hmean]
317 exact (quantile_mean_square_speed r).trans_le (parallel_energy_cap (ha.trans hr.1.le))
318
319private theorem ordered_cost_bound {a b : ℝ} (ha : 0 ≤ a) (hab : a < b) :
320 (∫ p : unitInterval, (angleQuantile b p - angleQuantile a p)^2) ≤ (b-a)^2 / 12 := by
321 have hprod := path_square_integrable ha b
322 have hi : Integrable (fun p : unitInterval => ∫ r in a..b, rankSpeed r p^2) volume := by
323 simp_rw [intervalIntegral.integral_of_le hab.le]
324 exact hprod.integral_prod_right
325 have hc : Continuous (fun p => (angleQuantile b p-angleQuantile a p)^2) :=
326 ((continuous_Q b).sub (continuous_Q a)).pow 2
327 have hh := integral_mono_ae (hc.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _))
328 (hi.const_mul (b-a)) (by
329 filter_upwards [(volume : Measure unitInterval).ae_ne 0, (volume : Measure unitInterval).ae_ne 1] with p h₀ h₁
330 exact square_increment hab ⟨h₀,h₁⟩)
331 rw [integral_const_mul, ← intervalIntegral_integral_swap (f := fun r p => rankSpeed r p^2)
332 (by simpa only [uIoc_of_le hab.le, Function.uncurry_def] using hprod)] at hh
333 have hs : IntervalIntegrable (fun r => ∫ p : unitInterval, rankSpeed r p^2) volume a b :=
334 (intervalIntegrable_iff_integrableOn_Ioc_of_le hab.le).2 hprod.integral_prod_left
335 have hh' := intervalIntegral.integral_mono_on (μ := volume) hab.le hs intervalIntegrable_const
336 (fun r hr => (quantile_mean_square_speed r).trans_le (parallel_energy_cap (ha.trans hr.1)))
337 rw [intervalIntegral.integral_const] at hh'
338 exact hh.trans ((mul_le_mul_of_nonneg_left hh' (sub_nonneg.mpr hab.le)).trans_eq (by simp [smul_eq_mul]; ring))
339
340/-- A concrete two-marginal coupling with the squared Euclidean angle transport cost
341bounded by the strength increment squared divided by twelve. -/
342theorem radialCoupling_cost {r s : ℝ} (hr : 0 ≤ r) (hs : 0 ≤ s) :
343 (∫ z, (z.2-z.1)^2 ∂radialCoupling r s) ≤ (s-r)^2/12 := by
344 have hm := (continuous_Q r).prodMk (continuous_Q s)
345 rw [radialCoupling, integral_map hm.measurable.aemeasurable
346 (show AEStronglyMeasurable (fun z : ℝ × ℝ => (z.2-z.1)^2) _ from
347 ((continuous_snd.sub continuous_fst).pow 2).aestronglyMeasurable)]
348 rcases lt_trichotomy r s with h|h|h
349 · exact ordered_cost_bound hr h
350 · subst s; simp
351 · have he (p : unitInterval) : (angleQuantile s p-angleQuantile r p)^2 =
352 (angleQuantile r p-angleQuantile s p)^2 := by ring
353 simp_rw [he]
354 exact (ordered_cost_bound hs h).trans_eq (by ring)
355
356/-- Squared Wasserstein transport cost on the real angle coordinate (in radians).
357The infimum runs over all joint measures with the specified marginals. -/
358def angleWassersteinSq (μ ν : Measure ℝ) : ℝ≥0∞ :=
359 ⨅ γ : {P : Measure (ℝ × ℝ) // P.fst = μ ∧ P.snd = ν},
360 ∫⁻ z, ENNReal.ofReal ((z.2-z.1)^2) ∂γ.val
361
362theorem radial_wasserstein_sq_le {r s : ℝ} (hr : 0 ≤ r) (hs : 0 ≤ s) :
363 angleWassersteinSq (angleLaw r) (angleLaw s) ≤ ENNReal.ofReal ((s-r)^2/12) := by
364 let γ : {P : Measure (ℝ × ℝ) // P.fst = angleLaw r ∧ P.snd = angleLaw s} :=
365 ⟨radialCoupling r s, radialCoupling_marginals r s⟩
366 apply (iInf_le _ γ).trans
367 have cost : Continuous (fun z : ℝ × ℝ => (z.2-z.1)^2) := (continuous_snd.sub continuous_fst).pow 2
368 have joint := (continuous_Q r).prodMk (continuous_Q s)
369 have hi : Integrable (fun z : ℝ × ℝ => (z.2-z.1)^2) (radialCoupling r s) :=
370 (integrable_map_measure cost.aestronglyMeasurable joint.aemeasurable).2
371 ((cost.comp joint).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _))
372 change (∫⁻ z, ENNReal.ofReal ((z.2-z.1)^2) ∂radialCoupling r s) ≤ _
373 rw [← ofReal_integral_eq_lintegral_ofReal hi (.of_forall fun z => sq_nonneg (z.2-z.1))]
374 exact ENNReal.ofReal_le_ofReal (radialCoupling_cost hr hs)
375
376/-- Transport of the projected heat baths, each angle measured about its own staple pole. -/
377theorem heatBath_radial_wasserstein {l : ℕ+} (hl : 1 < l.val) {β : ℝ} (hβ : 0 ≤ β)
378 (U V : Configuration gaugeGroup l) (e : Edge l) :
379 ∃ k j : gaugeGroup.image,
380 heatBath β U e = su2Haar.tilted (fun u => fieldStrength β U e * (suMat (u*k) 0 0).re) ∧
381 heatBath β V e = su2Haar.tilted (fun v => fieldStrength β V e * (suMat (v*j) 0 0).re) ∧
382 angleWassersteinSq ((heatBath β U e).map fun u => polarAngle (u*k))
383 ((heatBath β V e).map fun v => polarAngle (v*j)) ≤
384 ENNReal.ofReal ((fieldStrength β V e - fieldStrength β U e)^2/12) := by
385 obtain ⟨k,hk⟩ := heatBath_eq_tilt hl β U e
386 obtain ⟨j,hj⟩ := heatBath_eq_tilt hl β V e
387 refine ⟨k,j,hk,hj,?_⟩
388 rw [hk,hj,tilted_polarAngle,tilted_polarAngle]
389 exact radial_wasserstein_sq_le (fieldStrength_mem hβ U e).1 (fieldStrength_mem hβ V e).1
390
391/-- Degree-18 bound on the squared change in actual Wilson staple strength. -/
392theorem fieldStrength_degree18_sq {l : ℕ+} (hl : 1 < l.val) {β δ : ℝ}
393 (hβ : 0 ≤ β) (U V : Configuration gaugeGroup l) (e : Edge l)
394 (hneighbors : ∀ i ∈ incidences e,
395 linkChord (U (neighbor e i.1 i.2).1) (V (neighbor e i.1 i.2).1) / sqrt 2 ≤ δ) :
396 (fieldStrength β V e - fieldStrength β U e)^2 / 12 ≤ 27 * β^2 * δ^2 := by
397 have hroot : 0 < sqrt 2 := by positivity
398 have hnorm : |‖stapleMatrix V e‖ - ‖stapleMatrix U e‖| ≤ 18 * (δ * sqrt 2) := calc
399 _ ≤ ‖stapleMatrix U e - stapleMatrix V e‖ := by
400 rw [abs_sub_comm]; exact abs_norm_sub_norm_le _ _
401 _ ≤ _ := staple_perturbation hl U V e
402 _ ≤ ∑ _i ∈ incidences e, δ * sqrt 2 := Finset.sum_le_sum fun i hi =>
403 (div_le_iff₀ hroot).mp (hneighbors i hi)
404 _ = _ := by simp [incidence_count hl]
405 let d := fieldStrength β V e - fieldStrength β U e
406 have hd : |d| ≤ 18 * β * δ := calc
407 |d| = β * (|‖stapleMatrix V e‖ - ‖stapleMatrix U e‖| / sqrt 2) := by
408 change |β * (‖stapleMatrix V e‖ / sqrt 2) - β * (‖stapleMatrix U e‖ / sqrt 2)| = _
409 rw [← mul_sub, ← sub_div, abs_mul, abs_of_nonneg hβ, abs_div, abs_of_pos hroot]
410 _ ≤ β * (18*δ) := mul_le_mul_of_nonneg_left ((div_le_iff₀ hroot).2 (by linarith only [hnorm])) hβ
411 _ = _ := by ring
412 have hs := sq_le_sq' (neg_le_of_abs_le hd) (le_of_abs_le hd)
413 change d^2 / 12 ≤ 27 * β^2 * δ^2
414 nlinarith only [hs]
415
416/-- Degree-18 response of the heat-bath polar angle when all incident normalized
417SU(2) chords are at most δ. Incidences retain their periodic multiplicities. -/
418theorem heatBath_radial_degree18 {l : ℕ+} (hl : 1 < l.val) {β δ : ℝ}
419 (hβ : 0 ≤ β) (U V : Configuration gaugeGroup l) (e : Edge l)
420 (hneighbors : ∀ i ∈ incidences e,
421 linkChord (U (neighbor e i.1 i.2).1) (V (neighbor e i.1 i.2).1) / sqrt 2 ≤ δ) :
422 angleWassersteinSq (angleLaw (fieldStrength β U e)) (angleLaw (fieldStrength β V e)) ≤
423 ENNReal.ofReal (27 * β^2 * δ^2) := by
424 have hcost := radial_wasserstein_sq_le (fieldStrength_mem hβ U e).1 (fieldStrength_mem hβ V e).1
425 exact hcost.trans (ENNReal.ofReal_le_ofReal (fieldStrength_degree18_sq hl hβ U V e hneighbors))
426
427/-- Strict response relative to a positive input chord bound throughout the
428degree-18 window. Both output observables are measured about their staple poles. -/
429theorem heatBath_radial_subunit {l : ℕ+} (hl : 1 < l.val) {β δ : ℝ}
430 (hβ : 0 ≤ β) (hwindow : β < sqrt 3 / 9) (hδ : 0 < δ)
431 (U V : Configuration gaugeGroup l) (e : Edge l)
432 (hneighbors : ∀ i ∈ incidences e,
433 linkChord (U (neighbor e i.1 i.2).1) (V (neighbor e i.1 i.2).1) / sqrt 2 ≤ δ) :
434 angleWassersteinSq (angleLaw (fieldStrength β U e)) (angleLaw (fieldStrength β V e)) <
435 ENNReal.ofReal (δ^2) := by
436 apply (heatBath_radial_degree18 hl hβ U V e hneighbors).trans_lt
437 apply (ENNReal.ofReal_lt_ofReal_iff (sq_pos_of_pos hδ)).2
438 have hs := sq_lt_sq' (by linarith [sqrt_pos.mpr (show (0:ℝ)<3 by norm_num)] : -(sqrt 3/9)<β) hwindow
439 have hcoeff : 27*β^2 < 1 := by nlinarith only [hs, sq_sqrt (show (0:ℝ) ≤ 3 by norm_num)]
440 simpa using mul_lt_mul_of_pos_right hcoeff (sq_pos_of_pos hδ)
441
442#print axioms quantile_field_deriv
443#print axioms quantile_pushforward
444#print axioms radialCoupling_marginals
445#print axioms quantile_mean_square_speed
446#print axioms radialCoupling_cost
447#print axioms radial_wasserstein_sq_le
448#print axioms heatBath_radial_wasserstein
449#print axioms heatBath_radial_degree18
450#print axioms heatBath_radial_subunit
451
452end
453end YangMills.PeriodicWilson