Download data/lean/OAI/Probability/FreeIsing/Stochastic/CompensatorVariation.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7.56 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/FreeIsing/Stochastic/CompensatorVariation.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/FreeIsing/Stochastic/CompensatorVariation.lean
-
curl -L -o CompensatorVariation.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/FreeIsing/Stochastic/CompensatorVariation.lean
7.56 kB
| import Mathlib | |
| namespace OAI | |
| noncomputable section | |
| open MeasureTheory Set Filter | |
| open scoped Topology BigOperators ENNReal | |
| namespace Problem367.CompensatorVariation | |
| def squaredIncrements (a : β β β) (N : β) : β := | |
| β i β Finset.range N, (a (i + 1) - a i) ^ 2 | |
| theorem squaredIncrements_nonneg (a : β β β) (N : β) : | |
| 0 β€ squaredIncrements a N := Finset.sum_nonneg (fun _ _ => sq_nonneg _) | |
| theorem squaredIncrements_le {a : β β β} {N : β} {Ξ΄ : β} | |
| (hpos : β i < N, 0 β€ a (i + 1) - a i) | |
| (hsmall : β i < N, a (i + 1) - a i β€ Ξ΄) : | |
| squaredIncrements a N β€ Ξ΄ * (a N - a 0) := by | |
| calc | |
| squaredIncrements a N β€ β i β Finset.range N, Ξ΄ * (a (i + 1) - a i) := by | |
| apply Finset.sum_le_sum | |
| intro i hi | |
| rw [pow_two] | |
| exact mul_le_mul_of_nonneg_right (hsmall i (Finset.mem_range.mp hi)) | |
| (hpos i (Finset.mem_range.mp hi)) | |
| _ = Ξ΄ * (a N - a 0) := by rw [β Finset.mul_sum, Finset.sum_range_sub] | |
| theorem squaredIncrements_le_total_sq {a : β β β} {N : β} | |
| (hpos : β i < N, 0 β€ a (i + 1) - a i) : | |
| squaredIncrements a N β€ (a N - a 0) ^ 2 := by | |
| have h := Finset.sum_sq_le_sq_sum_of_nonneg | |
| (s := Finset.range N) (fun i hi => hpos i (Finset.mem_range.mp hi)) | |
| simpa only [squaredIncrements, Finset.sum_range_sub] using h | |
| theorem total_nonneg {a : β β β} {N : β} | |
| (hpos : β i < N, 0 β€ a (i + 1) - a i) : 0 β€ a N - a 0 := by | |
| rw [β Finset.sum_range_sub a N] | |
| exact Finset.sum_nonneg (fun i hi => hpos i (Finset.mem_range.mp hi)) | |
| theorem increment_le_total {a : β β β} {N : β} | |
| (hpos : β i < N, 0 β€ a (i + 1) - a i) {i : β} (hi : i < N) : | |
| a (i + 1) - a i β€ a N - a 0 := by | |
| rw [β Finset.sum_range_sub a N] | |
| exact Finset.single_le_sum (fun j hj => hpos j (Finset.mem_range.mp hj)) | |
| (Finset.mem_range.mpr hi) | |
| theorem tendsto_squaredIncrements {I : Type*} [PseudoMetricSpace I] | |
| {K : Set I} (hK : IsCompact K) {A : I β β} (hA : ContinuousOn A K) | |
| (t : β β β β I) (N : β β β) (mesh : β β β) | |
| (hmem : β n i, i β€ N n β t n i β K) | |
| (hdist : β n i, i < N n β dist (t n i) (t n (i + 1)) β€ mesh n) | |
| (hmesh : Tendsto mesh atTop (π 0)) | |
| (hpos : β n i, i < N n β 0 β€ A (t n (i + 1)) - A (t n i)) | |
| {C : β} (hC : 0 β€ C) (hbound : β n, A (t n (N n)) - A (t n 0) β€ C) : | |
| Tendsto (fun n => squaredIncrements (fun i => A (t n i)) (N n)) atTop (π 0) := by | |
| apply Metric.tendsto_atTop.mpr | |
| intro Ξ΅ hΞ΅ | |
| let Ξ· := Ξ΅ / (C + 1) | |
| have hΞ· : 0 < Ξ· := div_pos hΞ΅ (by linarith) | |
| obtain β¨Ξ΄, hΞ΄, hmodβ© := Metric.uniformContinuousOn_iff.mp | |
| (hK.uniformContinuousOn_of_continuous hA) Ξ· hΞ· | |
| obtain β¨nβ, hnββ© := (hmesh.eventually (gt_mem_nhds hΞ΄)).exists_forall_of_atTop | |
| refine β¨nβ, ?_β© | |
| intro n hn | |
| have hsmall (i : β) (hi : i < N n) : A (t n (i + 1)) - A (t n i) β€ Ξ· := by | |
| have hh := hmod (t n (i + 1)) (hmem n (i + 1) (Nat.succ_le_of_lt hi)) | |
| (t n i) (hmem n i hi.le) (by | |
| rw [dist_comm] | |
| exact (hdist n i hi).trans_lt (hnβ n hn)) | |
| exact (le_abs_self _).trans (by simpa only [Real.dist_eq] using hh.le) | |
| rw [Real.dist_eq, sub_zero, abs_of_nonneg (squaredIncrements_nonneg _ _)] | |
| calc | |
| squaredIncrements (fun i => A (t n i)) (N n) β€ | |
| Ξ· * (A (t n (N n)) - A (t n 0)) := squaredIncrements_le (hpos n) hsmall | |
| _ β€ Ξ· * C := mul_le_mul_of_nonneg_left (hbound n) hΞ·.le | |
| _ < Ξ΅ := by | |
| change Ξ΅ / (C + 1) * C < Ξ΅ | |
| rw [div_mul_eq_mul_div] | |
| apply (div_lt_iffβ (by linarith : 0 < C + 1)).2 | |
| nlinarith | |
| variable {Ξ© : Type*} [MeasurableSpace Ξ©] {ΞΌ : Measure Ξ©} | |
| theorem memLp_increment_of_total_bound [IsFiniteMeasure ΞΌ] | |
| {a : β β Ξ© β β} (hmeas : β i, AEStronglyMeasurable (a i) ΞΌ) {N : β} | |
| (hpos : βα΅ Ο βΞΌ, β i < N, 0 β€ a (i + 1) Ο - a i Ο) | |
| {C : β} (hbound : βα΅ Ο βΞΌ, a N Ο - a 0 Ο β€ C) | |
| {i : β} (hi : i < N) (p : ββ₯0β) : | |
| MemLp (fun Ο => a (i + 1) Ο - a i Ο) p ΞΌ := by | |
| apply MemLp.of_bound ((hmeas _).sub (hmeas _)) C | |
| filter_upwards [hpos, hbound] with Ο hp hb | |
| rw [Real.norm_eq_abs, Pi.sub_apply, abs_of_nonneg (hp i hi)] | |
| exact (increment_le_total (a := fun j => a j Ο) hp hi).trans hb | |
| theorem tendsto_integral_squaredIncrements [IsFiniteMeasure ΞΌ] | |
| {I : Type*} [PseudoMetricSpace I] {K : Set I} (hK : IsCompact K) | |
| {A : I β Ξ© β β} (hmeas : β t, AEStronglyMeasurable (A t) ΞΌ) | |
| (hc : βα΅ Ο βΞΌ, ContinuousOn (fun t => A t Ο) K) | |
| (t : β β β β I) (N : β β β) (mesh : β β β) | |
| (hmem : β n i, i β€ N n β t n i β K) | |
| (hdist : β n i, i < N n β dist (t n i) (t n (i + 1)) β€ mesh n) | |
| (hmesh : Tendsto mesh atTop (π 0)) | |
| (hpos : βα΅ Ο βΞΌ, β n i, i < N n β 0 β€ A (t n (i + 1)) Ο - A (t n i) Ο) | |
| {C : β} (hC : 0 β€ C) | |
| (hbound : βα΅ Ο βΞΌ, β n, A (t n (N n)) Ο - A (t n 0) Ο β€ C) : | |
| Tendsto (fun n => β« Ο, squaredIncrements (fun i => A (t n i) Ο) (N n) βΞΌ) | |
| atTop (π 0) := by | |
| have hm (n : β) : AEStronglyMeasurable | |
| (fun Ο => squaredIncrements (fun i => A (t n i) Ο) (N n)) ΞΌ := by | |
| convert (Finset.aestronglyMeasurable_sum (Finset.range (N n)) | |
| (fun i _ => ((hmeas (t n (i + 1))).sub (hmeas (t n i))).pow 2)) using 1 | |
| ext Ο | |
| simp only [squaredIncrements, Finset.sum_apply, Pi.pow_apply, Pi.sub_apply] | |
| have hh := tendsto_integral_of_dominated_convergence | |
| (ΞΌ := ΞΌ) (F := fun n Ο => squaredIncrements (fun i => A (t n i) Ο) (N n)) | |
| (f := fun _ => (0 : β)) (fun _ => C ^ 2) hm (integrable_const _) ?_ ?_ | |
| Β· simpa only [integral_zero] using hh | |
| Β· intro n | |
| filter_upwards [hpos, hbound] with Ο hp hb | |
| rw [Real.norm_eq_abs, abs_of_nonneg (squaredIncrements_nonneg _ _)] | |
| exact (squaredIncrements_le_total_sq (hp n)).trans | |
| ((sq_le_sqβ (total_nonneg (a := fun i => A (t n i) Ο) (hp n)) hC).2 (hb n)) | |
| Β· filter_upwards [hc, hpos, hbound] with Ο hΟ hp hb | |
| exact tendsto_squaredIncrements hK hΟ t N mesh hmem hdist hmesh hp hC hb | |
| theorem tendsto_sum_integral_sq_increments [IsFiniteMeasure ΞΌ] | |
| {I : Type*} [PseudoMetricSpace I] {K : Set I} (hK : IsCompact K) | |
| {A : I β Ξ© β β} (hmeas : β t, AEStronglyMeasurable (A t) ΞΌ) | |
| (hc : βα΅ Ο βΞΌ, ContinuousOn (fun t => A t Ο) K) | |
| (t : β β β β I) (N : β β β) (mesh : β β β) | |
| (hmem : β n i, i β€ N n β t n i β K) | |
| (hdist : β n i, i < N n β dist (t n i) (t n (i + 1)) β€ mesh n) | |
| (hmesh : Tendsto mesh atTop (π 0)) | |
| (hpos : βα΅ Ο βΞΌ, β n i, i < N n β 0 β€ A (t n (i + 1)) Ο - A (t n i) Ο) | |
| {C : β} (hC : 0 β€ C) | |
| (hbound : βα΅ Ο βΞΌ, β n, A (t n (N n)) Ο - A (t n 0) Ο β€ C) : | |
| Tendsto (fun n => β i β Finset.range (N n), | |
| β« Ο, (A (t n (i + 1)) Ο - A (t n i) Ο) ^ 2 βΞΌ) atTop (π 0) := by | |
| have heq (n : β) : (β i β Finset.range (N n), | |
| β« Ο, (A (t n (i + 1)) Ο - A (t n i) Ο) ^ 2 βΞΌ) = | |
| β« Ο, squaredIncrements (fun i => A (t n i) Ο) (N n) βΞΌ := by | |
| symm | |
| apply integral_finsetSum | |
| intro i hi | |
| apply (memLp_increment_of_total_bound (fun j => hmeas (t n j)) | |
| (hpos.mono (fun Ο hΟ => hΟ n)) | |
| (hbound.mono (fun Ο hΟ => hΟ n)) (Finset.mem_range.mp hi) 2).integrable_sq | |
| simp_rw [heq] | |
| exact tendsto_integral_squaredIncrements hK hmeas hc t N mesh hmem hdist hmesh hpos hC hbound | |
| end Problem367.CompensatorVariation | |
| end | |
| end OAI | |