Download data/lean/OAI/Analysis/HardSphere/Bridges/PrefixMap.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 9.05 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/HardSphere/Bridges/PrefixMap.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/HardSphere/Bridges/PrefixMap.lean
-
curl -L -o PrefixMap.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/HardSphere/Bridges/PrefixMap.lean
9.05 kB
| import Mathlib | |
| import OAI.Analysis.HardSphere.Bridges.PartialIndex | |
| namespace OAI | |
| noncomputable section | |
| open MeasureTheory Filter Set | |
| open scoped ENNReal Topology BigOperators | |
| open scoped BigOperators ComplexConjugate | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped ENNReal NNReal Topology BigOperators | |
| namespace HardSphere.Wiener | |
| def prefixMap (u : Time) : C(Time,β) βL[β] C(Time,β) := | |
| ContinuousMap.compCLM β β (prefixTime u) | |
| def suffixMap (u : Time) : C(Time,β) βL[β] C(Time,β) := | |
| ContinuousMap.compCLM β β (suffixTime u) - | |
| (ContinuousLinearMap.const β Time).comp (ContinuousMap.evalCLM β u) | |
| @[simp] lemma prefixMap_apply (u : Time) (f : C(Time,β)) (t : Time) : | |
| prefixMap u f t = f (prefixTime u t) := rfl | |
| @[simp] lemma suffixMap_apply (u : Time) (f : C(Time,β)) (t : Time) : | |
| suffixMap u f t = f (suffixTime u t) - f u := rfl | |
| lemma prefixTime_le (u t : Time) : (prefixTime u t:β) β€ u := by | |
| change (u:β)*(t:β) β€ u | |
| nlinarith [u.property.1,t.property.2] | |
| lemma le_suffixTime (u t : Time) : (u:β) β€ suffixTime u t := by | |
| change (u:β) β€ (u:β)+(1-(u:β))*(t:β) | |
| nlinarith [u.property.2,t.property.1] | |
| lemma split_gaussian (u : Time) : | |
| IsGaussianProcess (Sum.elim (fun t Ο β¦ prefixMap u (path Ο) t) | |
| (fun t Ο β¦ suffixMap u (path Ο) t)) law := by | |
| classical | |
| constructor | |
| intro I | |
| let loc : Option I β Time := fun i β¦ i.elim u | |
| (fun j β¦ j.val.elim (prefixTime u) (suffixTime u)) | |
| let ev (i : Option I) : (Option I β β) βL[β] β := ContinuousLinearMap.proj i | |
| let L : (Option I β β) βL[β] (I β β) := | |
| ContinuousLinearMap.pi (fun i β¦ match i.val with | |
| | .inl _ => ev (some i) | |
| | .inr _ => ev (some i) - ev none) | |
| convert! (finite_path_gaussian loc).map_fun L using 1 | |
| funext Ο i | |
| cases hi : i.val <;> simp [L,loc,hi,ev] | |
| lemma independent_split (u : Time) : | |
| IndepFun (fun Ο β¦ prefixMap u (path Ο)) (fun Ο β¦ suffixMap u (path Ο)) law := by | |
| have hc (s t : Time) : | |
| cov[fun Ο β¦ prefixMap u (path Ο) s, fun Ο β¦ suffixMap u (path Ο) t; law] = 0 := by | |
| simp only [prefixMap_apply,suffixMap_apply] | |
| rw [covariance_fun_sub_right | |
| (path_eval_law _).hasGaussianLaw.memLp_two | |
| (path_eval_law _).hasGaussianLaw.memLp_two | |
| (path_eval_law _).hasGaussianLaw.memLp_two, | |
| path_covariance,path_covariance, | |
| min_eq_left ((prefixTime_le u s).trans (le_suffixTime u t)), | |
| min_eq_left (prefixTime_le u s),sub_self] | |
| have hi := (split_gaussian u).indepFun_of_covariance_eq_zero | |
| (fun t β¦ ((continuous_eval_const t).measurable.comp | |
| ((prefixMap u).continuous.measurable.comp measurable_path)).aemeasurable) | |
| (fun t β¦ ((continuous_eval_const t).measurable.comp | |
| ((suffixMap u).continuous.measurable.comp measurable_path)).aemeasurable) hc | |
| have hid := hi.comp | |
| (Measurable.of_eval fun index β¦ measurable_pi_apply (TopologicalSpace.denseSeq Time index)) | |
| (Measurable.of_eval fun index β¦ measurable_pi_apply (TopologicalSpace.denseSeq Time index)) | |
| have hh := hid.comp denseEval_embedding.measurable_invFun denseEval_embedding.measurable_invFun | |
| convert hh using 1 <;> funext Ο <;> | |
| exact (denseEval_embedding.leftInverse_invFun _).symm | |
| lemma scaled_path_projection_law {ΞΉ : Type*} [Fintype ΞΉ] | |
| (r : β) (hr : 0 β€ r) (c : ΞΉ β β) (t : ΞΉ β Time) : | |
| HasLaw (fun Ο β¦ β i, c i * (Real.sqrt r β’ path Ο) (t i)) | |
| (gaussianReal 0 (Real.toNNReal (r * β i, β j, | |
| c i*c j*min (t i:β) (t j:β)))) law := by | |
| have hh := path_projection_law (fun i β¦ c i * Real.sqrt r) t | |
| convert hh using 1 | |
| Β· funext Ο | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| simp only [ContinuousMap.smul_apply,smul_eq_mul] | |
| ring | |
| Β· congr 1 | |
| congr 1 | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro j _ | |
| calc | |
| r * (c i*c j*min (t i:β) (t j:β)) = | |
| Real.sqrt r ^ 2 * (c i*c j*min (t i:β) (t j:β)) := by rw [Real.sq_sqrt hr] | |
| _ = _ := by ring | |
| lemma prefix_law (u : Time) : | |
| law.map (fun Ο β¦ prefixMap u (path Ο)) = | |
| law.map (fun Ο β¦ Real.sqrt (u:β) β’ path Ο) := by | |
| apply continuous_path_law_ext (X := fun Ο β¦ prefixMap u (path Ο)) | |
| (Y := fun Ο β¦ Real.sqrt (u:β) β’ path Ο) | |
| ((prefixMap u).continuous.measurable.comp measurable_path) | |
| ((show Measurable (fun f : C(Time,β) β¦ Real.sqrt (u:β) β’ f) from | |
| (by fun_prop)).comp measurable_path) | |
| intro ΞΉ _ c t | |
| have h := path_projection_law c (fun i β¦ prefixTime u (t i)) | |
| have hvar : (β i, β j, c i*c j*min (prefixTime u (t i):β) (prefixTime u (t j):β)) = | |
| (u:β)*β i, β j, c i*c j*min (t i:β) (t j:β) := by | |
| simp only [prefixTime,ContinuousMap.coe_mk] | |
| simp_rw [β mul_min_of_nonneg _ _ u.property.1] | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro j _ | |
| ring | |
| rw [hvar] at h | |
| exact h.map_eq.trans (scaled_path_projection_law _ u.property.1 c t).map_eq.symm | |
| lemma suffix_projection_algebra {ΞΉ : Type*} [Fintype ΞΉ] | |
| (u : Time) (c : ΞΉ β β) (t : ΞΉ β Time) : | |
| let a : Option ΞΉ β β := fun i β¦ i.elim (-β i, c i) c | |
| let v : Option ΞΉ β Time := fun i β¦ i.elim u (fun j β¦ suffixTime u (t j)) | |
| (β i, β j, a i*a j*min (v i:β) (v j:β)) = | |
| (1-(u:β))*β i, β j, c i*c j*min (t i:β) (t j:β) := by | |
| let A : β := β i, c i | |
| have hh : (β i, β j, c i*c j*(u:β)) = A*A*(u:β) := by | |
| dsimp only [A] | |
| rw [Finset.sum_mul_sum, Finset.sum_mul] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| rw [Finset.sum_mul] | |
| have h1 : (β i, (-A)*c i*(u:β)) = -A*A*(u:β) := by | |
| rw [β Finset.sum_mul, β Finset.mul_sum] | |
| have h2 : (β i, c i*(-A)*(u:β)) = -A*A*(u:β) := by | |
| rw [β Finset.sum_mul, β Finset.sum_mul] | |
| dsimp only [A] | |
| ring | |
| have h3 : (β i, β j, c i*c j*((1-(u:β))*min (t i:β) (t j:β))) = | |
| (1-(u:β))*β i, β j, c i*c j*min (t i:β) (t j:β) := by | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro j _ | |
| ring | |
| dsimp only | |
| simp only [Fintype.sum_option,Option.elim_none,Option.elim_some, | |
| min_self,min_eq_left (le_suffixTime u (t _)),min_eq_right (le_suffixTime u (t _))] | |
| have ht i j : min (suffixTime u (t i):β) (suffixTime u (t j):β) = | |
| (u:β)+(1-(u:β))*min (t i:β) (t j:β) := by | |
| change min ((u:β)+(1-(u:β))*(t i:β)) ((u:β)+(1-(u:β))*(t j:β)) = _ | |
| rw [min_add_add_left,β mul_min_of_nonneg _ _ (sub_nonneg.mpr u.property.2)] | |
| simp_rw [ht,mul_add,Finset.sum_add_distrib] | |
| change (-A)*(-A)*(u:β)+(β i,(-A)*c i*(u:β))+ | |
| ((β i,c i*(-A)*(u:β))+((β i,β j,c i*c j*(u:β))+_)) = _ | |
| rw [hh,h1,h2,h3] | |
| ring | |
| lemma suffix_law (u : Time) : | |
| law.map (fun Ο β¦ suffixMap u (path Ο)) = | |
| law.map (fun Ο β¦ Real.sqrt (1-(u:β)) β’ path Ο) := by | |
| apply continuous_path_law_ext (X := fun Ο β¦ suffixMap u (path Ο)) | |
| (Y := fun Ο β¦ Real.sqrt (1-(u:β)) β’ path Ο) | |
| ((suffixMap u).continuous.measurable.comp measurable_path) | |
| ((show Measurable (fun f : C(Time,β) β¦ Real.sqrt (1-(u:β)) β’ f) from | |
| (by fun_prop)).comp measurable_path) | |
| intro ΞΉ _ c t | |
| have hh := path_projection_law (fun i : Option ΞΉ β¦ i.elim (-β i,c i) c) | |
| (fun i β¦ i.elim u (fun j β¦ suffixTime u (t j))) | |
| rw [suffix_projection_algebra] at hh | |
| have heq : (fun Ο β¦ β i, c i*suffixMap u (path Ο) (t i)) = | |
| (fun Ο β¦ β i : Option ΞΉ, i.elim (-β i,c i) c * | |
| path Ο (i.elim u (fun j β¦ suffixTime u (t j)))) := by | |
| funext Ο | |
| simp only [Fintype.sum_option,Option.elim_none,Option.elim_some,suffixMap_apply, | |
| mul_sub,Finset.sum_sub_distrib,neg_mul,Finset.sum_mul] | |
| ring | |
| rw [heq, hh.map_eq, | |
| (scaled_path_projection_law _ (sub_nonneg.mpr u.property.2) c t).map_eq] | |
| lemma split_path_law (u : Time) : | |
| law.map (fun Ο β¦ (prefixMap u (path Ο),suffixMap u (path Ο))) = | |
| (wiener.map (fun f β¦ Real.sqrt (u:β) β’ f)).prod | |
| (wiener.map (fun f β¦ Real.sqrt (1-(u:β)) β’ f)) := by | |
| calc | |
| _ = (law.map (fun Ο β¦ prefixMap u (path Ο))).prod | |
| (law.map (fun Ο β¦ suffixMap u (path Ο))) := by | |
| simpa only [Function.comp_def] using (independent_split u).map_prod_eq_prod_map_map | |
| ((prefixMap u).continuous.measurable.comp measurable_path).aemeasurable | |
| ((suffixMap u).continuous.measurable.comp measurable_path).aemeasurable | |
| _ = _ := by | |
| rw [prefix_law,suffix_law] | |
| unfold wiener | |
| rw [Measure.map_map (show Measurable (fun f : C(Time,β) β¦ Real.sqrt (u:β) β’ f) from by fun_prop) measurable_path, | |
| Measure.map_map (show Measurable (fun f : C(Time,β) β¦ Real.sqrt (1-(u:β)) β’ f) from by fun_prop) measurable_path] | |
| rfl | |
| end HardSphere.Wiener | |
| end | |
| end OAI | |