Download data/lean/OAI/Probability/FreeIsing/Martingales/PredictableMeshApproximation.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 9.8 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/FreeIsing/Martingales/PredictableMeshApproximation.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/FreeIsing/Martingales/PredictableMeshApproximation.lean
-
curl -L -o PredictableMeshApproximation.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/FreeIsing/Martingales/PredictableMeshApproximation.lean
9.8 kB
| import Mathlib | |
| namespace OAI | |
| noncomputable section | |
| open MeasureTheory Filter Set | |
| open scoped NNReal Topology | |
| namespace Problem367.PredictableMesh | |
| def point (n k : β) : ββ₯0 := (k : ββ₯0) / (n + 1 : β) | |
| def left (n : β) (t : ββ₯0) : ββ₯0 := | |
| point n (β(n + 1 : β) * tββ - 1) | |
| @[simp] theorem point_zero (n : β) : point n 0 = 0 := by simp [point] | |
| @[simp] theorem left_zero (n : β) : left n 0 = 0 := by simp [left] | |
| theorem point_strictMono (n : β) : StrictMono (point n) := by | |
| intro i j hij | |
| exact div_lt_div_of_pos_right (by exact_mod_cast hij) (by positivity) | |
| theorem left_eq_of_mem_Ioc {n k : β} {t : ββ₯0} | |
| (ht : t β Ioc (point n k) (point n (k + 1))) : | |
| left n t = point n k := by | |
| have hN : (0 : ββ₯0) < (n + 1 : β) := by positivity | |
| have hc : β(n + 1 : β) * tββ = k + 1 := by | |
| apply (Nat.ceil_eq_iff (Nat.succ_ne_zero k)).2 | |
| constructor | |
| Β· have := (div_lt_iffβ hN).1 ht.1 | |
| simpa only [mul_comm, Nat.succ_sub_one] using this | |
| Β· have := (le_div_iffβ hN).1 ht.2 | |
| simpa only [mul_comm, Nat.succ_sub_one] using this | |
| change point n (β(n + 1 : β) * tββ - 1) = point n k | |
| rw [hc, Nat.add_sub_cancel] | |
| theorem mem_mesh_Ioc {n : β} {t : ββ₯0} (ht : 0 < t) : | |
| t β Ioc (left n t) | |
| (point n (β(n + 1 : β) * tββ - 1 + 1)) := by | |
| have hN : (0 : ββ₯0) < (n + 1 : β) := by positivity | |
| have hc : 1 β€ β(n + 1 : β) * tββ := | |
| Nat.one_le_ceil_iff.mpr (mul_pos hN ht) | |
| have hh := (Nat.ceil_eq_iff (show β(n + 1 : β) * tββ β 0 by omega)).mp rfl | |
| constructor | |
| Β· apply (div_lt_iffβ hN).2 | |
| simpa only [mul_comm] using hh.1 | |
| Β· dsimp [point] | |
| rw [Nat.sub_add_cancel hc] | |
| apply (le_div_iffβ hN).2 | |
| simpa only [mul_comm] using hh.2 | |
| theorem left_le (n : β) (t : ββ₯0) : left n t β€ t := by | |
| by_cases ht : t = 0 | |
| Β· simp [ht] | |
| Β· exact (mem_mesh_Ioc (n := n) (pos_iff_ne_zero.mpr ht)).1.le | |
| theorem le_left_add_width (n : β) (t : ββ₯0) : | |
| t β€ left n t + 1 / (n + 1 : β) := by | |
| by_cases ht : t = 0 | |
| Β· simp [ht] | |
| Β· have h := (mem_mesh_Ioc (n := n) (pos_iff_ne_zero.mpr ht)).2 | |
| simpa only [point, left, Nat.cast_add, Nat.cast_one, add_div] using h | |
| theorem tendsto_left (t : ββ₯0) : Tendsto (fun n => left n t) atTop (π t) := by | |
| apply NNReal.tendsto_coe.mp | |
| apply tendsto_iff_norm_sub_tendsto_zero.mpr | |
| apply squeeze_zero (fun n => norm_nonneg _) | |
| (fun n => show β(left n t : β) - (t : β)β β€ 1 / ((n : β) + 1) from ?_) | |
| tendsto_one_div_add_atTop_nhds_zero_nat | |
| have hl : (left n t : β) β€ (t : β) := left_le n t | |
| have hu := le_left_add_width n t | |
| have hu' : (t : β) β€ (left n t : β) + 1 / ((n : β) + 1) := by | |
| exact_mod_cast hu | |
| rw [Real.norm_eq_abs, abs_of_nonpos (sub_nonpos.mpr hl)] | |
| linarith | |
| theorem measurable_left (n : β) : Measurable (left n) := by | |
| exact (measurable_of_countable (fun k : β => point n (k - 1))).comp | |
| ((measurable_const.mul measurable_id).nat_ceil) | |
| def sample {Ξ© : Type*} (u : ββ₯0 β Ξ© β β) (n : β) (t : ββ₯0) (Ο : Ξ©) : β := | |
| u (left n t) Ο | |
| theorem sample_tendsto {Ξ© : Type*} {u : ββ₯0 β Ξ© β β} | |
| (hu : β Ο, Continuous (fun t => u t Ο)) (t : ββ₯0) (Ο : Ξ©) : | |
| Tendsto (fun n => sample u n t Ο) atTop (π (u t Ο)) := | |
| (hu Ο).continuousAt.tendsto.comp (tendsto_left t) | |
| theorem sample_stronglyAdapted {Ξ© : Type*} [mΞ© : MeasurableSpace Ξ©] | |
| {F : Filtration ββ₯0 mΞ©} {u : ββ₯0 β Ξ© β β} | |
| (hu : StronglyAdapted F u) (n : β) : StronglyAdapted F (sample u n) := | |
| fun t => (hu (left n t)).mono (F.mono (left_le n t)) | |
| theorem sample_isStronglyPredictable {Ξ© : Type*} [mΞ© : MeasurableSpace Ξ©] | |
| {F : Filtration ββ₯0 mΞ©} {u : ββ₯0 β Ξ© β β} | |
| (hu : StronglyAdapted F u) (n : β) : IsStronglyPredictable F (sample u n) := by | |
| apply Measurable.stronglyMeasurable | |
| intro s hs | |
| have heq : (Function.uncurry (sample u n)) β»ΒΉ' s = | |
| ({0} ΓΛ’ (u 0 β»ΒΉ' s)) βͺ | |
| β k : β, (Ioc (point n k) (point n (k + 1))) ΓΛ’ (u (point n k) β»ΒΉ' s) := by | |
| ext β¨t, Οβ© | |
| simp only [mem_preimage, Function.uncurry_apply_pair, mem_union, mem_prod, | |
| mem_singleton_iff, mem_iUnion] | |
| constructor | |
| Β· intro h | |
| by_cases ht : t = 0 | |
| Β· exact Or.inl β¨ht, by simpa [ht, sample] using hβ© | |
| Β· exact Or.inr β¨β(n + 1 : β) * tββ - 1, | |
| mem_mesh_Ioc (pos_iff_ne_zero.mpr ht), hβ© | |
| Β· rintro (β¨ht, hβ© | β¨k, ht, hβ©) | |
| Β· simpa [ht, sample] using h | |
| Β· simpa only [sample, left_eq_of_mem_Ioc ht] using h | |
| rw [heq] | |
| apply MeasurableSet.union | |
| Β· exact measurableSet_predictable_singleton_bot_prod ((hu 0).measurable hs) | |
| Β· exact MeasurableSet.iUnion fun k => | |
| measurableSet_predictable_Ioc_prod _ _ ((hu (point n k)).measurable hs) | |
| theorem isStronglyPredictable_of_continuous {Ξ© : Type*} [mΞ© : MeasurableSpace Ξ©] | |
| {F : Filtration ββ₯0 mΞ©} {u : ββ₯0 β Ξ© β β} | |
| (hu : StronglyAdapted F u) (hc : β Ο, Continuous (fun t => u t Ο)) : | |
| IsStronglyPredictable F u := by | |
| apply stronglyMeasurable_of_tendsto atTop (f := fun n => Function.uncurry (sample u n)) | |
| (fun n => sample_isStronglyPredictable hu n) | |
| exact tendsto_pi_nhds.mpr fun p => sample_tendsto hc p.1 p.2 | |
| theorem stronglyMeasurable_uncurry {Ξ© : Type*} [mΞ© : MeasurableSpace Ξ©] | |
| {F : Filtration ββ₯0 mΞ©} {u : ββ₯0 β Ξ© β β} | |
| (hu : StronglyAdapted F u) (hc : β Ο, Continuous (fun t => u t Ο)) : | |
| StronglyMeasurable (Function.uncurry u) := | |
| stronglyMeasurable_uncurry_of_continuous_of_stronglyMeasurable hc | |
| (fun t => (hu t).mono (F.le t)) | |
| theorem stronglyMeasurable_sample {Ξ© : Type*} [mΞ© : MeasurableSpace Ξ©] | |
| {F : Filtration ββ₯0 mΞ©} {u : ββ₯0 β Ξ© β β} | |
| (hu : StronglyAdapted F u) (hc : β Ο, Continuous (fun t => u t Ο)) (n : β) : | |
| StronglyMeasurable (Function.uncurry (sample u n)) := | |
| (stronglyMeasurable_uncurry hu hc).comp_measurable | |
| (((measurable_left n).comp measurable_fst).prodMk measurable_snd) | |
| theorem memLp_uncurry {Ξ© : Type*} [mΞ© : MeasurableSpace Ξ©] | |
| {F : Filtration ββ₯0 mΞ©} {u : ββ₯0 β Ξ© β β} | |
| (hu : StronglyAdapted F u) (hc : β Ο, Continuous (fun t => u t Ο)) | |
| (Ξ½ : Measure ββ₯0) (P : Measure Ξ©) [IsFiniteMeasure Ξ½] [IsFiniteMeasure P] | |
| (C : β) (hb : β t Ο, |u t Ο| β€ C) : | |
| MemLp (Function.uncurry u) 2 (Ξ½.prod P) := | |
| MemLp.of_bound (stronglyMeasurable_uncurry hu hc).aestronglyMeasurable C | |
| (Filter.Eventually.of_forall fun p => by simpa only [Real.norm_eq_abs, Function.uncurry] using hb p.1 p.2) | |
| theorem memLp_sample {Ξ© : Type*} [mΞ© : MeasurableSpace Ξ©] | |
| {F : Filtration ββ₯0 mΞ©} {u : ββ₯0 β Ξ© β β} | |
| (hu : StronglyAdapted F u) (hc : β Ο, Continuous (fun t => u t Ο)) | |
| (Ξ½ : Measure ββ₯0) (P : Measure Ξ©) [IsFiniteMeasure Ξ½] [IsFiniteMeasure P] | |
| (C : β) (hb : β t Ο, |u t Ο| β€ C) (n : β) : | |
| MemLp (Function.uncurry (sample u n)) 2 (Ξ½.prod P) := | |
| MemLp.of_bound (stronglyMeasurable_sample hu hc n).aestronglyMeasurable C | |
| (Filter.Eventually.of_forall fun p => by | |
| simpa only [Real.norm_eq_abs, Function.uncurry, sample] using hb (left n p.1) p.2) | |
| theorem tendsto_integral_sq_sample_sub | |
| {A Ξ© : Type*} [MeasurableSpace A] [mΞ© : MeasurableSpace Ξ©] | |
| {F : Filtration ββ₯0 mΞ©} {u : ββ₯0 β Ξ© β β} | |
| (hu : StronglyAdapted F u) (hc : β Ο, Continuous (fun t => u t Ο)) | |
| (Ξ½ : Measure A) (P : Measure Ξ©) [IsFiniteMeasure Ξ½] [IsFiniteMeasure P] | |
| (Ο : A β ββ₯0) (hΟ : Measurable Ο) | |
| (C : β) (hC : 0 β€ C) (hb : β t Ο, |u t Ο| β€ C) : | |
| Tendsto (fun n => β« p : A Γ Ξ©, | |
| (sample u n (Ο p.1) p.2 - u (Ο p.1) p.2) ^ 2 βΞ½.prod P) atTop (π 0) := by | |
| have hcoord : Measurable (fun p : A Γ Ξ© => (Ο p.1, p.2)) := | |
| (hΟ.comp measurable_fst).prodMk measurable_snd | |
| have huM := (stronglyMeasurable_uncurry hu hc).comp_measurable hcoord | |
| have hsM (n : β) := (stronglyMeasurable_sample hu hc n).comp_measurable hcoord | |
| have hlim := tendsto_integral_of_dominated_convergence | |
| (ΞΌ := Ξ½.prod P) (F := fun n p => | |
| (sample u n (Ο p.1) p.2 - u (Ο p.1) p.2) ^ 2) | |
| (f := fun _ => (0 : β)) (fun _ => (2 * C) ^ 2) | |
| (fun n => ((hsM n).sub huM).pow 2 |>.aestronglyMeasurable) | |
| (integrable_const _) ?_ ?_ | |
| Β· simpa only [integral_zero] using hlim | |
| Β· intro n | |
| exact Filter.Eventually.of_forall fun p => by | |
| have hn : |sample u n (Ο p.1) p.2 - u (Ο p.1) p.2| β€ 2 * C := by | |
| calc | |
| _ β€ |sample u n (Ο p.1) p.2| + |u (Ο p.1) p.2| := abs_sub _ _ | |
| _ β€ 2 * C := by | |
| dsimp [sample] | |
| linarith [hb (left n (Ο p.1)) p.2, hb (Ο p.1) p.2] | |
| simpa only [Real.norm_eq_abs, abs_sq, sq_abs] using | |
| (sq_le_sqβ (abs_nonneg _) (mul_nonneg (by norm_num) hC)).mpr hn | |
| Β· exact Filter.Eventually.of_forall fun p => by | |
| simpa only [sub_self, zero_pow (by decide : 2 β 0)] using | |
| ((sample_tendsto hc (Ο p.1) p.2).sub | |
| (tendsto_const_nhds (x := u (Ο p.1) p.2))).pow 2 | |
| theorem tendsto_time_integral_sq_sample_sub | |
| {Ξ© : Type*} [mΞ© : MeasurableSpace Ξ©] | |
| {F : Filtration ββ₯0 mΞ©} {u : ββ₯0 β Ξ© β β} | |
| (hu : StronglyAdapted F u) (hc : β Ο, Continuous (fun t => u t Ο)) | |
| (P : Measure Ξ©) [IsFiniteMeasure P] (T C : β) | |
| (hC : 0 β€ C) (hb : β t Ο, |u t Ο| β€ C) : | |
| Tendsto (fun n => β« p : β Γ Ξ©, | |
| (sample u n p.1.toNNReal p.2 - u p.1.toNNReal p.2) ^ 2 | |
| β(volume.restrict (Icc 0 T)).prod P) atTop (π 0) := | |
| tendsto_integral_sq_sample_sub hu hc (volume.restrict (Icc 0 T)) P | |
| Real.toNNReal (by fun_prop) C hC hb | |
| end Problem367.PredictableMesh | |
| end | |
| end OAI | |