Download data/lean/OAI/Probability/FreeIsing/Energy/RowEnergyConvergence.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.99 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/FreeIsing/Energy/RowEnergyConvergence.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/FreeIsing/Energy/RowEnergyConvergence.lean
-
curl -L -o RowEnergyConvergence.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/FreeIsing/Energy/RowEnergyConvergence.lean
6.99 kB
| import OAI.Probability.FreeIsing.Energy.EnergyLimit | |
| import OAI.Probability.FreeIsing.Martingales.PredictableL2Completion | |
| namespace OAI | |
| noncomputable section | |
| open Filter Finset | |
| open scoped Topology | |
| namespace Problem367.RowEnergyConvergence | |
| theorem summable_limit_of_tsum_le | |
| {ΞΉ : Type*} {a : β β ΞΉ β β} {b : ΞΉ β β} {K : β} | |
| (ha : β n i, 0 β€ a n i) (hsum : β n, Summable (a n)) | |
| (hlim : β i, Tendsto (fun n => a n i) atTop (π (b i))) | |
| (hbound : β n, β' i, a n i β€ K) : | |
| Summable b β§ β' i, b i β€ K := by | |
| classical | |
| have hb (i : ΞΉ) : 0 β€ b i := | |
| ge_of_tendsto (hlim i) (Eventually.of_forall fun n => ha n i) | |
| have hpartial (s : Finset ΞΉ) : β i β s, b i β€ K := by | |
| apply le_of_tendsto (tendsto_finsetSum s fun i _ => hlim i) | |
| exact Eventually.of_forall fun n => | |
| ((hsum n).sum_le_tsum s (fun i _ => ha n i)).trans (hbound n) | |
| have hs : Summable b := summable_of_sum_le hb hpartial | |
| exact β¨hs, hs.tsum_le_of_sum_le hpartialβ© | |
| theorem uniform_complement_tails_of_two_stage_bound | |
| {ΞΉ : Type*} {a : β β ΞΉ β β} {sets : β β Finset ΞΉ} | |
| {early : β β β} {late : β β β β β} | |
| (hsum : β n, Summable (a n)) | |
| (hearly : Tendsto early atTop (π 0)) | |
| (hlate : β k, Tendsto (late k) atTop (π 0)) | |
| (hbound : β n k L, | |
| (β' i, a n i) - β i β sets L, a n i β€ early k + late k L) : | |
| β Ξ΅ > 0, β s : Finset ΞΉ, | |
| β n, β' i : {i // i β s}, a n i.1 β€ Ξ΅ := by | |
| intro Ξ΅ hΞ΅ | |
| obtain β¨s, hsβ© := Problem367.uniform_energy_tails_of_two_stage_bound | |
| hearly hlate hbound Ξ΅ hΞ΅ | |
| refine β¨s, fun n => ?_β© | |
| have hsplit := (hsum n).sum_add_tsum_subtype_compl s | |
| linarith [hs n] | |
| theorem norm_sub_sq_le {H : Type*} [SeminormedAddCommGroup H] (x y : H) : | |
| βx - yβ ^ 2 β€ 2 * βxβ ^ 2 + 2 * βyβ ^ 2 := by | |
| have h := norm_sub_le x y | |
| have hx := norm_nonneg x | |
| have hy := norm_nonneg y | |
| have hd := norm_nonneg (x - y) | |
| nlinarith [sq_nonneg (βxβ - βyβ)] | |
| theorem tendsto_tsum_norm_sub_sq_of_uniform_tails | |
| {ΞΉ H : Type*} [NormedAddCommGroup H] | |
| {f : β β ΞΉ β H} {g : ΞΉ β H} {K : β} | |
| (hsum : β n, Summable (fun i => βf n iβ ^ 2)) | |
| (hbound : β n, β' i, βf n iβ ^ 2 β€ K) | |
| (hcoordinate : β i, Tendsto (fun n => f n i) atTop (π (g i))) | |
| (htail : β Ξ΅ > 0, β s : Finset ΞΉ, | |
| β n, β' i : {i // i β s}, βf n i.1β ^ 2 β€ Ξ΅) : | |
| Summable (fun i => βg iβ ^ 2) β§ | |
| (β n, Summable (fun i => βf n i - g iβ ^ 2)) β§ | |
| Tendsto (fun n => β' i, βf n i - g iβ ^ 2) atTop (π 0) := by | |
| classical | |
| have henergy (i : ΞΉ) : Tendsto (fun n => βf n iβ ^ 2) atTop | |
| (π (βg iβ ^ 2)) := (hcoordinate i).norm.pow 2 | |
| have hg := (summable_limit_of_tsum_le (fun n i => sq_nonneg βf n iβ) | |
| hsum henergy hbound).1 | |
| have herror (n : β) : Summable (fun i => βf n i - g iβ ^ 2) := | |
| Summable.of_nonneg_of_le (fun i => sq_nonneg _) (fun i => norm_sub_sq_le _ _) | |
| (((hsum n).mul_left 2).add (hg.mul_left 2)) | |
| refine β¨hg, herror, tendsto_order.2 β¨?_, ?_β©β© | |
| Β· intro a ha | |
| exact Eventually.of_forall fun n => | |
| ha.trans_le (tsum_nonneg fun i => sq_nonneg βf n i - g iβ) | |
| Β· intro Ξ΅ hΞ΅ | |
| obtain β¨s, hsβ© := htail (Ξ΅ / 8) (by positivity) | |
| have hgtail : β' i : {i // i β s}, βg i.1β ^ 2 β€ Ξ΅ / 8 := | |
| (summable_limit_of_tsum_le | |
| (a := fun n (i : {i // i β s}) => βf n i.1β ^ 2) | |
| (b := fun i : {i // i β s} => βg i.1β ^ 2) | |
| (fun n i => sq_nonneg βf n i.1β) | |
| (fun n => (hsum n).subtype (fun i => i β s)) | |
| (fun i => henergy i.1) hs).2 | |
| have hfinite : Tendsto (fun n => β i β s, βf n i - g iβ ^ 2) | |
| atTop (π 0) := by | |
| have h := tendsto_finsetSum s (fun i _ => | |
| (((hcoordinate i).sub_const (g i)).norm).pow 2) | |
| simpa only [sub_self, norm_zero, zero_pow (by decide : 2 β 0), sum_const_zero] | |
| using h | |
| filter_upwards [(tendsto_order.1 hfinite).2 (Ξ΅ / 2) (by positivity)] with n hn | |
| have herrtail : (β' i : {i // i β s}, βf n i.1 - g i.1β ^ 2) β€ | |
| 2 * (β' i : {i // i β s}, βf n i.1β ^ 2) + | |
| 2 * (β' i : {i // i β s}, βg i.1β ^ 2) := by | |
| calc | |
| _ β€ β' i : {i // i β s}, | |
| (2 * βf n i.1β ^ 2 + 2 * βg i.1β ^ 2) := | |
| Summable.tsum_le_tsum (fun i => norm_sub_sq_le _ _) | |
| ((herror n).subtype _) | |
| ((((hsum n).subtype _).mul_left 2).add ((hg.subtype _).mul_left 2)) | |
| _ = _ := by | |
| simpa only [Function.comp_apply, tsum_mul_left] using | |
| ((((hsum n).subtype (fun i => i β s)).mul_left 2).tsum_add | |
| ((hg.subtype (fun i => i β s)).mul_left 2)) | |
| rw [β (herror n).sum_add_tsum_subtype_compl s] | |
| linarith [hs n] | |
| open MeasureTheory | |
| theorem tendsto_tsum_integral_sq_sub_of_uniform_tails | |
| {Ξ© ΞΉ : Type*} [MeasurableSpace Ξ©] (ΞΌ : Measure Ξ©) | |
| {f : β β ΞΉ β Ξ© β β} {g : ΞΉ β Ξ© β β} {K : β} | |
| (hf : β n i, MemLp (f n i) 2 ΞΌ) (hg : β i, MemLp (g i) 2 ΞΌ) | |
| (hsum : β n, Summable (fun i => β« Ο, (f n i Ο) ^ 2 βΞΌ)) | |
| (hbound : β n, β' i, β« Ο, (f n i Ο) ^ 2 βΞΌ β€ K) | |
| (hcoordinate : β i, Tendsto | |
| (fun n => β« Ο, (f n i Ο - g i Ο) ^ 2 βΞΌ) atTop (π 0)) | |
| (htail : β Ξ΅ > 0, β s : Finset ΞΉ, | |
| β n, β' i : {i // i β s}, β« Ο, (f n i.1 Ο) ^ 2 βΞΌ β€ Ξ΅) : | |
| Summable (fun i => β« Ο, (g i Ο) ^ 2 βΞΌ) β§ | |
| (β n, Summable (fun i => β« Ο, (f n i Ο - g i Ο) ^ 2 βΞΌ)) β§ | |
| Tendsto (fun n => β' i, β« Ο, (f n i Ο - g i Ο) ^ 2 βΞΌ) | |
| atTop (π 0) := by | |
| let F : β β ΞΉ β Lp β 2 ΞΌ := fun n i => (hf n i).toLp (f n i) | |
| let G : ΞΉ β Lp β 2 ΞΌ := fun i => (hg i).toLp (g i) | |
| have hF (n : β) (i : ΞΉ) : βF n iβ ^ 2 = β« Ο, (f n i Ο) ^ 2 βΞΌ := | |
| PredictableL2.norm_toLp_sq (hf n i) | |
| have hG (i : ΞΉ) : βG iβ ^ 2 = β« Ο, (g i Ο) ^ 2 βΞΌ := | |
| PredictableL2.norm_toLp_sq (hg i) | |
| have hFG (n : β) (i : ΞΉ) : | |
| βF n i - G iβ ^ 2 = β« Ο, (f n i Ο - g i Ο) ^ 2 βΞΌ := by | |
| change β(hf n i).toLp (f n i) - (hg i).toLp (g i)β ^ 2 = _ | |
| rw [β MemLp.toLp_sub] | |
| exact PredictableL2.norm_toLp_sq ((hf n i).sub (hg i)) | |
| have hconv (i : ΞΉ) : Tendsto (fun n => F n i) atTop (π (G i)) := by | |
| apply tendsto_iff_norm_sub_tendsto_zero.2 | |
| have h : Tendsto (fun n => βF n i - G iβ ^ 2) atTop (π 0) := by | |
| simpa only [hFG] using hcoordinate i | |
| simpa only [Real.sqrt_sq_eq_abs, abs_norm, Real.sqrt_zero] using h.sqrt | |
| have h := tendsto_tsum_norm_sub_sq_of_uniform_tails | |
| (f := F) (g := G) (K := K) | |
| (fun n => by simpa only [hF] using hsum n) | |
| (fun n => by simpa only [hF] using hbound n) hconv | |
| (by simpa only [hF] using htail) | |
| simpa only [hG, hFG] using h | |
| end Problem367.RowEnergyConvergence | |
| end | |
| end OAI | |