Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/yang/blob/main/proofs/WilsonHeatBathDynamics.lean # yang This project has not described itself yet. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `yang / proofs / WilsonHeatBathDynamics.lean` 234 lines · 14049 bytes Raw Blame History 1 -- SPDX-License-Identifier: Apache-2.0 2 import PeriodicWilsonDS 3 4 namespace YangMills.PeriodicWilson 5 open FundamentalSU2 MeasureTheory ProbabilityTheory Real Filter Set 6 open scoped BigOperators ENNReal Topology 7 noncomputable section 8 private abbrev G := gaugeGroup.image 9 private abbrev Config (l : ℕ+) := Configuration gaugeGroup l 10 11 /-- A weighted coordinate Lipschitz bound in the physical link metric. -/ 12 def LinkVariation {l : ℕ+} (v : Edge l → ℝ) (F : Config l → ℝ) : Prop := 13 ∀ U V, |F U-F V| ≤ ∑ a, v a * linkGeodesic (U a) (V a) 14 15 private theorem geodesic_self (u : G) : linkGeodesic u u = 0 := by 16 rw [linkGeodesic_eq_angle,InnerProductGeometry.angle_self] 17 exact norm_ne_zero_iff.mp (by rw [coordinates_norm]; norm_num) 18 19 private theorem link_distance_to {l : ℕ+} (U : Config l) (a : Edge l) : 20 Continuous (fun V : Config l => linkGeodesic (V a) (U a)) := by 21 unfold linkGeodesic polarAngle 22 exact continuous_arccos.comp (continuous_scalar_link.comp ((continuous_apply a).mul continuous_const)) 23 24 theorem LinkVariation.continuous {l : ℕ+} {v : Edge l → ℝ} {F : Config l → ℝ} 25 (hf : LinkVariation v F) : Continuous F := by 26 apply continuous_iff_continuousAt.mpr 27 intro U 28 apply tendsto_iff_dist_tendsto_zero.mpr 29 have hc : Continuous (fun V : Config l => ∑ a, v a * linkGeodesic (V a) (U a)) := 30 continuous_finsetSum _ fun a _ => continuous_const.mul (link_distance_to U a) 31 apply squeeze_zero (fun _ => dist_nonneg) (fun V => by simpa only [Real.dist_eq] using hf V U) 32 simpa only [geodesic_self,mul_zero,Finset.sum_const_zero] using hc.tendsto U 33 34 /-- Conditional expectation after resampling exactly link e. -/ 35 def heatBathUpdate {l : ℕ+} (β : ℝ) (e : Edge l) (F : Config l → ℝ) (U : Config l) := 36 ∫ u, F (Function.update U e u) ∂heatBath β U e 37 38 /-- Coordinate weights after updating link e. Its old value is resampled. -/ 39 def updateWeight {l : ℕ+} (β : ℝ) (v : Edge l → ℝ) (e a : Edge l) := 40 (if a=e then 0 else v a) + v e * straightInfluence β e a 41 42 /-- Bound the effect of one actual Gibbs update on a configuration observable. -/ 43 theorem heatBathUpdate_variation {l : ℕ+} (hl : 1 < l.val) {β : ℝ} (hβ : 0 ≤ β) 44 {v : Edge l → ℝ} (hv : ∀ a, 0 ≤ v a) {F : Config l → ℝ} (hf : LinkVariation v F) (e : Edge l) : 45 LinkVariation (updateWeight β v e) (heatBathUpdate β e F) := by 46 intro U V 47 let d := fun a => linkGeodesic (U a) (V a) 48 let outside := ∑ a, (if a=e then 0 else v a) * d a 49 let response := ∑ a, straightInfluence β e a * d a 50 have hr : 0 ≤ response := Finset.sum_nonneg fun a _ => mul_nonneg 51 (mul_nonneg (mul_nonneg (sqrt_nonneg _) hβ) (Nat.cast_nonneg _)) (arccos_nonneg _) 52 have cF (W : Config l) : Continuous (fun u => F (Function.update W e u)) := 53 hf.continuous.comp (continuous_const.update (f := fun _ : G => W) e continuous_id) 54 haveI := heatBath_probability hl β U e 55 have bound := integral_difference_of_link_bound _ _ (cF U) (cF V) (A := outside) (hv e) hr 56 (fun u w => (hf (Function.update U e u) (Function.update V e w)).trans_eq (by 57 change _ = (∑ a, (if a=e then 0 else v a)*d a) + v e * linkGeodesic u w 58 have singled : (∑ a : Edge l, if a=e then v a * linkGeodesic u w else 0) = v e * linkGeodesic u w := by simp 59 rw [← singled] 60 rw [← Finset.sum_add_distrib] 61 apply Finset.sum_congr rfl 62 intro a _ 63 by_cases h : a=e <;> simp [h,Function.update,d])) 64 (heatBath_straight_influence hl hβ U V e) 65 apply bound.trans_eq 66 simp only [updateWeight,add_mul,Finset.sum_add_distrib,mul_assoc,←Finset.mul_sum,outside,response,d] 67 68 /-- Number of links eligible for a uniformly chosen update. -/ 69 def edgeCount (l : ℕ+) : ℝ := Fintype.card (Edge l) 70 theorem edgeCount_pos (l : ℕ+) : 0 < edgeCount l := by 71 unfold edgeCount; exact_mod_cast Fintype.card_pos 72 73 /-- One random-scan Markov step chooses a link uniformly and takes its heat-bath 74 conditional expectation. Iterates count individual updates. -/ 75 def randomScan {l : ℕ+} (β : ℝ) (F : Config l → ℝ) (U : Config l) := 76 (∑ e, heatBathUpdate β e F U) / edgeCount l 77 78 def scanWeight {l : ℕ+} (β : ℝ) (v : Edge l → ℝ) (a : Edge l) := 79 (∑ e, updateWeight β v e a) / edgeCount l 80 81 theorem scanWeight_nonneg {l : ℕ+} {β : ℝ} (hβ : 0 ≤ β) {v : Edge l → ℝ} (hv : ∀ a, 0 ≤ v a) (a : Edge l) : 82 0 ≤ scanWeight β v a := div_nonneg (Finset.sum_nonneg fun e _ => add_nonneg 83 (by split <;> simp [hv]) (mul_nonneg (hv e) (mul_nonneg (mul_nonneg (sqrt_nonneg _) hβ) (Nat.cast_nonneg _)))) (edgeCount_pos _).le 84 85 theorem randomScan_variation {l : ℕ+} (hl : 1 < l.val) {β : ℝ} (hβ : 0 ≤ β) 86 {v : Edge l → ℝ} (hv : ∀ a, 0 ≤ v a) {F : Config l → ℝ} (hf : LinkVariation v F) : 87 LinkVariation (scanWeight β v) (randomScan β F) := by 88 intro U V 89 let d := fun a => linkGeodesic (U a) (V a) 90 rw [randomScan,randomScan,← sub_div,← Finset.sum_sub_distrib,abs_div,abs_of_pos (edgeCount_pos _)] 91 calc _ ≤ (∑ e, |heatBathUpdate β e F U - heatBathUpdate β e F V|) / edgeCount l := 92 div_le_div_of_nonneg_right (Finset.abs_sum_le_sum_abs ..) (edgeCount_pos _).le 93 _ ≤ (∑ e : Edge l, ∑ a : Edge l, updateWeight β v e a * d a) / edgeCount l := 94 div_le_div_of_nonneg_right (Finset.sum_le_sum fun e _ => heatBathUpdate_variation hl hβ hv hf e U V) (edgeCount_pos _).le 95 _ = _ := by rw [Finset.sum_comm,Finset.sum_div]; simp only [scanWeight,Finset.sum_mul,div_mul_eq_mul_div,d] 96 97 def randomScanRate (l : ℕ+) (β : ℝ) := (edgeCount l - 1 + straightRow β) / edgeCount l 98 99 private theorem scanWeight_sum {l : ℕ+} (hl : 1 < l.val) (β : ℝ) (v : Edge l → ℝ) : 100 ∑ a, scanWeight β v a = randomScanRate l β * ∑ a, v a := by 101 have out (e : Edge l) : (∑ a, if a=e then 0 else v a) = (∑ a, v a)-v e := by 102 have singled : (∑ a : Edge l, if a=e then v a else 0) = v e := by simp 103 rw [eq_sub_iff_add_eq,← singled] 104 rw [←Finset.sum_add_distrib] 105 apply Finset.sum_congr rfl 106 intro a _; split <;> simp_all 107 simp only [scanWeight,←Finset.sum_div] 108 rw [Finset.sum_comm] 109 simp only [updateWeight,Finset.sum_add_distrib,out,←Finset.mul_sum,straightInfluence_row hl, 110 Finset.sum_sub_distrib,Finset.sum_const,Finset.card_univ,nsmul_eq_mul,←Finset.sum_mul,randomScanRate,edgeCount] 111 ring 112 113 theorem randomScanRate_subunit {l : ℕ+} {β : ℝ} (hβ : 0 ≤ β) (hw : β < sqrt 3/18) : 114 0 ≤ randomScanRate l β ∧ randomScanRate l β < 1 := by 115 have hn := edgeCount_pos l 116 have h1 : 1 ≤ edgeCount l := by unfold edgeCount; exact_mod_cast (Fintype.card_pos (α := Edge l)) 117 have hrow : 0 ≤ straightRow β := div_nonneg (mul_nonneg (by norm_num) hβ) (sqrt_nonneg _) 118 unfold randomScanRate 119 exact ⟨div_nonneg (by linarith) hn.le,(div_lt_one hn).2 (by linarith only [straightRow_subunit.2 hw])⟩ 120 121 private theorem iterate_variation {l : ℕ+} (hl : 1 < l.val) {β : ℝ} (hβ : 0 ≤ β) 122 {v : Edge l → ℝ} (hv : ∀ a, 0 ≤ v a) {F : Config l → ℝ} (hf : LinkVariation v F) (k : ℕ) : 123 ∃ w : Edge l → ℝ, (∀ a, 0 ≤ w a) ∧ LinkVariation w ((randomScan β)^[k] F) ∧ 124 ∑ a, w a = (randomScanRate l β)^k * ∑ a, v a := by 125 induction k with 126 | zero => exact ⟨v,hv,hf,by simp⟩ 127 | succ k ih => 128 obtain ⟨w,hw,hF,hs⟩ := ih 129 refine ⟨scanWeight β w,scanWeight_nonneg hβ hw,?_,?_⟩ 130 · rw [Function.iterate_succ_apply']; exact randomScan_variation hl hβ hw hF 131 · rw [scanWeight_sum hl,hs]; ring 132 133 /-- Uniform oscillation decay of the actual iterated heat-bath operator. -/ 134 theorem randomScan_oscillation {l : ℕ+} (hl : 1 < l.val) {β : ℝ} (hβ : 0 ≤ β) 135 {v : Edge l → ℝ} (hv : ∀ a, 0 ≤ v a) {F : Config l → ℝ} (hf : LinkVariation v F) 136 (k : ℕ) (U V : Config l) : 137 |((randomScan β)^[k] F) U-((randomScan β)^[k] F) V| ≤ 138 π * (randomScanRate l β)^k * ∑ a, v a := by 139 obtain ⟨w,hw,hF,hs⟩ := iterate_variation hl hβ hv hf k 140 apply (hF U V).trans 141 calc _ ≤ ∑ a, w a * π := Finset.sum_le_sum fun a _ => mul_le_mul_of_nonneg_left (arccos_le_pi _) (hw a) 142 _ = _ := by rw [← Finset.sum_mul,hs]; ring 143 144 /-- Resampling one link preserves the full periodic Wilson expectation. The 145 disintegration uses its actual conditional kernel on the other links. -/ 146 theorem heatBathUpdate_stationary {l : ℕ+} (β : ℝ) (e : Edge l) {F : Config l → ℝ} (cf : Continuous F) : 147 (∫ U, heatBathUpdate β e F U ∂wilsonLaw gaugeGroup l β su2Haar) = 148 ∫ U, F U ∂wilsonLaw gaugeGroup l β su2Haar := by 149 let μ := wilsonLaw gaugeGroup l β su2Haar 150 let ρ := splitLaw β e 151 let K := heatBathKernel β e 152 haveI : IsProbabilityMeasure μ := wilson_probability l β 153 let test := fun z : Background e × G => F ((splitLink e).symm z) 154 have htest : StronglyMeasurable test := (cf.measurable.comp (splitLink e).symm.measurable).stronglyMeasurable 155 let m := fun b : Background e => ∫ u, test (b,u) ∂K b 156 have hm : StronglyMeasurable m := htest.integral_kernel_prod_right' (κ := K) 157 have pull (f : Config l → ℝ) : 158 (∫ z, f ((splitLink e).symm z) ∂ρ) = ∫ U, f U ∂μ := by 159 rw [show ρ = μ.map (splitLink e) from rfl,integral_map_equiv] 160 simp only [MeasurableEquiv.symm_apply_apply] 161 have hi : Integrable test ρ := by 162 rw [show ρ = μ.map (splitLink e) from rfl,integrable_map_equiv] 163 simpa only [test,Function.comp_def,MeasurableEquiv.symm_apply_apply] using cf.integrable_of_hasCompactSupport (μ := μ) (HasCompactSupport.of_compactSpace _) 164 have dis : ρ = ρ.fst.compProd K := wilsonLaw_disintegrates β e 165 have resample (z : Background e × G) : heatBathUpdate β e F ((splitLink e).symm z) = m z.1 := by 166 rcases z with ⟨b,u⟩ 167 simp only [heatBathUpdate,fill_update,m,test,K,heatBathKernel_apply β e b u] 168 calc _ = ∫ z, heatBathUpdate β e F ((splitLink e).symm z) ∂ρ := (pull _).symm 169 _ = ∫ z, m z.1 ∂ρ := integral_congr_ae (.of_forall resample) 170 _ = ∫ b, m b ∂ρ.fst := (integral_map measurable_fst.aemeasurable hm.aestronglyMeasurable).symm 171 _ = ∫ z, test z ∂ρ := by 172 have h := Measure.integral_compProd (by rwa [←dis] : Integrable test (ρ.fst.compProd K)) 173 exact h.symm.trans (congrArg (fun ν => ∫ z, test z ∂ν) dis.symm) 174 _ = _ := pull F 175 176 private theorem randomScan_stationary {l : ℕ+} (hl : 1 < l.val) {β : ℝ} (hβ : 0 ≤ β) 177 {v : Edge l → ℝ} (hv : ∀ a, 0 ≤ v a) {F : Config l → ℝ} (hf : LinkVariation v F) : 178 (∫ U, randomScan β F U ∂wilsonLaw gaugeGroup l β su2Haar) = ∫ U, F U ∂wilsonLaw gaugeGroup l β su2Haar := by 179 let μ := wilsonLaw gaugeGroup l β su2Haar 180 haveI : IsProbabilityMeasure μ := wilson_probability l β 181 have hi (e : Edge l) : Integrable (heatBathUpdate β e F) μ := 182 (heatBathUpdate_variation hl hβ hv hf e).continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) 183 change (∫ U, (∑ e, heatBathUpdate β e F U) / edgeCount l ∂μ) = _ 184 rw [integral_div,integral_finsetSum _ (fun e _ => hi e)] 185 have h (e : Edge l) : (∫ U, heatBathUpdate β e F U ∂μ) = ∫ U, F U ∂μ := heatBathUpdate_stationary β e hf.continuous 186 simp only [h,Finset.sum_const,Finset.card_univ,nsmul_eq_mul] 187 field_simp [show (Fintype.card (Edge l) : ℝ) ≠ 0 from (edgeCount_pos l).ne',edgeCount]; rfl 188 189 /-- Uniform convergence estimate to the actual periodic Wilson mean after k 190 uniformly chosen link updates. The decay parameter counts sampler steps. -/ 191 theorem randomScan_wilson_mean_bound {l : ℕ+} (hl : 1 < l.val) {β : ℝ} (hβ : 0 ≤ β) 192 {v : Edge l → ℝ} (hv : ∀ a, 0 ≤ v a) {F : Config l → ℝ} (hf : LinkVariation v F) 193 (k : ℕ) (U : Config l) : 194 |((randomScan β)^[k] F) U - ∫ W, F W ∂wilsonLaw gaugeGroup l β su2Haar| ≤ 195 π * (randomScanRate l β)^k * ∑ a, v a := by 196 let μ := wilsonLaw gaugeGroup l β su2Haar 197 haveI : IsProbabilityMeasure μ := wilson_probability l β 198 have stat (n : ℕ) : (∫ W, ((randomScan β)^[n] F) W ∂μ) = ∫ W, F W ∂μ := by 199 induction n with 200 | zero => rfl 201 | succ n ih => 202 obtain ⟨w,hw,hF,_⟩ := iterate_variation hl hβ hv hf n 203 rw [Function.iterate_succ_apply',randomScan_stationary hl hβ hw hF]; exact ih 204 obtain ⟨w,hw,hF,_⟩ := iterate_variation hl hβ hv hf k 205 let T := (randomScan β)^[k] F 206 have hi : Integrable T μ := hF.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) 207 have hid : T U - ∫ W, F W ∂μ = ∫ W, T U-T W ∂μ := by 208 rw [integral_sub (integrable_const _) hi,integral_const,probReal_univ,one_smul,← stat k] 209 rw [hid] 210 let B := π * (randomScanRate l β)^k * ∑ a, v a 211 calc _ ≤ ∫ W, |T U-T W| ∂μ := abs_integral_le_integral_abs 212 _ ≤ ∫ _W, B ∂μ := integral_mono ((integrable_const _).sub hi).abs (integrable_const _) 213 (fun W => randomScan_oscillation hl hβ hv hf k U W) 214 _ = _ := by simp [B] 215 216 theorem randomScan_tendsto_wilson_mean {l : ℕ+} (hl : 1 < l.val) {β : ℝ} (hβ : 0 ≤ β) 217 (hwindow : β < sqrt 3/18) {v : Edge l → ℝ} (hv : ∀ a, 0 ≤ v a) 218 {F : Config l → ℝ} (hf : LinkVariation v F) (U : Config l) : 219 Tendsto (fun k : ℕ => ((randomScan β)^[k] F) U) atTop 220 (𝓝 (∫ W, F W ∂wilsonLaw gaugeGroup l β su2Haar)) := by 221 apply tendsto_iff_dist_tendsto_zero.mpr 222 have hq := randomScanRate_subunit (l := l) hβ hwindow 223 have ht := tendsto_pow_atTop_nhds_zero_of_lt_one hq.1 hq.2 224 apply squeeze_zero (fun _ => dist_nonneg) (fun k => by simpa only [Real.dist_eq] using randomScan_wilson_mean_bound hl hβ hv hf k U) 225 simpa only [mul_zero,zero_mul] using (ht.const_mul π).mul_const (∑ a, v a) 226 227 #print axioms heatBathUpdate_stationary 228 #print axioms randomScan_wilson_mean_bound 229 #print axioms randomScan_tendsto_wilson_mean 230 #print axioms heatBathUpdate_variation 231 #print axioms randomScanRate_subunit 232 #print axioms randomScan_oscillation 233 end 234 end YangMills.PeriodicWilson