Download data/lean/OAI/Probability/SKFluctuations/ClockRootMarginal.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 29.5 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SKFluctuations/ClockRootMarginal.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/SKFluctuations/ClockRootMarginal.lean
-
curl -L -o ClockRootMarginal.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SKFluctuations/ClockRootMarginal.lean
29.5 kB
| import Mathlib | |
| import OAI.Probability.SKFluctuations.ReplicaProfileDifferentiation | |
| namespace OAI | |
| /-! Clock Root Marginal. -/ | |
| noncomputable section | |
| open MeasureTheory ProbabilityTheory Filter | |
| open scoped BigOperators Topology | |
| open MeasureTheory Filter Set | |
| open scoped Topology | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| namespace SKFluctuations.Hierarchy.ClockTree | |
| open MeasureTheory ProbabilityTheory Filter Set GaussianCalculus | |
| open scoped NNReal BigOperators | |
| variable {S : Type*} [Fintype S] [Nonempty S] {n : β} | |
| theorem markedAttach_preserves {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (Fin (n+1) β β) βL[β] β) {as : List PositiveMass} | |
| (T : ClockTree S as) {a : β} (ho : MassOrdered a as) | |
| (p : MarkedPlacement T) (hp : p β T.markedAttach a) | |
| (q : β β Fin (n+1) β ββ₯0) (P : T.Assignment β β) (x : Fin (n+1) β β) : | |
| p.tree.expect w Ο q (fun Ο => P (p.restrict Ο)) x = T.expect w Ο q P x := by | |
| have hm : p.realize q β (T.realize q).markedAttach a := by | |
| rw [β T.markedAttach_realize a q] | |
| exact List.mem_map.mpr β¨p,hp,rflβ© | |
| have h := (T.realize q).markedAttach_preserves hw Ο (clockSteps_ordered ho q) | |
| (p.realize q) hm (fun Ο => P ((T.assignmentEquiv q).symm Ο)) x | |
| rw [p.tree.expect_realize,T.expect_realize] | |
| simpa only [MarkedPlacement.realize,Equiv.symm_apply_apply] using h | |
| theorem rootExpect_integrable {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (Fin (n+1) β β) βL[β] β) {as : List PositiveMass} | |
| (T : ClockTree S as) {a : β} (ho : MassOrdered a as) | |
| (P : T.Assignment β β) (qβ : Fin (n+1) β β) | |
| (q : β β Fin (n+1) β β) (x : Fin (n+1) β β) : | |
| Integrable (fun y => T.expect w Ο (fun j i => Real.toNNReal (q j i)) P (x+y)) | |
| (Measure.pi fun i => gaussianReal 0 (Real.toNNReal (qβ i))) := by | |
| have h := ((T.homTest P).eval_smooth hw Ο ho q 0).integrable_zero_shift | |
| (Ξ½ := Measure.pi fun i => gaussianReal 0 (Real.toNNReal (qβ i))) x | |
| simpa only [ClockTree.eval_homTest] using h | |
| theorem rootExpect_mono {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (Fin (n+1) β β) βL[β] β) {as : List PositiveMass} | |
| (T : ClockTree S as) {a : β} (ho : MassOrdered a as) | |
| {P Q : T.Assignment β β} (hPQ : β Ο, P Ο β€ Q Ο) | |
| (qβ : Fin (n+1) β β) (q : β β Fin (n+1) β β) (x : Fin (n+1) β β) : | |
| T.rootExpect w Ο P qβ q x β€ T.rootExpect w Ο Q qβ q x := by | |
| rw [T.rootExpect_eq_integral,T.rootExpect_eq_integral] | |
| apply integral_mono (T.rootExpect_integrable hw Ο ho P qβ q x) | |
| (T.rootExpect_integrable hw Ο ho Q qβ q x) | |
| intro y | |
| dsimp only | |
| rw [T.expect_realize,T.expect_realize] | |
| exact (T.realize _).expect_mono hw Ο (clockSteps_ordered ho _) (fun Ο => hPQ _) _ | |
| omit [Nonempty S] in | |
| theorem rootExpect_const_mul (w : S β β) | |
| (Ο : S β (Fin (n+1) β β) βL[β] β) {as : List PositiveMass} | |
| (T : ClockTree S as) (c : β) (P : T.Assignment β β) | |
| (qβ : Fin (n+1) β β) (q : β β Fin (n+1) β β) (x : Fin (n+1) β β) : | |
| T.rootExpect w Ο (fun Ο => c*P Ο) qβ q x = c*T.rootExpect w Ο P qβ q x := by | |
| simp only [rootExpect_eq_integral,expect_realize,ReplicaTree.expect_const_mul,integral_const_mul] | |
| theorem rootExpect_nonneg {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (Fin (n+1) β β) βL[β] β) {as : List PositiveMass} | |
| (T : ClockTree S as) {a : β} (ho : MassOrdered a as) | |
| {P : T.Assignment β β} (hP : β Ο, 0 β€ P Ο) | |
| (qβ : Fin (n+1) β β) (q : β β Fin (n+1) β β) (x : Fin (n+1) β β) : | |
| 0 β€ T.rootExpect w Ο P qβ q x := by | |
| rw [rootExpect_eq_integral] | |
| apply integral_nonneg | |
| intro y | |
| dsimp only | |
| rw [expect_realize] | |
| exact (T.realize _).expect_nonneg hw Ο (clockSteps_ordered ho _) (fun Ο => hP _) _ | |
| theorem abs_rootExpect_le {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (Fin (n+1) β β) βL[β] β) {as : List PositiveMass} | |
| (T : ClockTree S as) {a : β} (ho : MassOrdered a as) (P : T.Assignment β β) | |
| (qβ : Fin (n+1) β β) (q : β β Fin (n+1) β β) (x : Fin (n+1) β β) : | |
| |T.rootExpect w Ο P qβ q x| β€ T.rootExpect w Ο (fun Ο => |P Ο|) qβ q x := by | |
| rw [rootExpect_eq_integral,rootExpect_eq_integral] | |
| apply (abs_integral_le_integral_abs).trans | |
| apply integral_mono (T.rootExpect_integrable hw Ο ho P qβ q x).abs | |
| (T.rootExpect_integrable hw Ο ho (fun Ο => |P Ο|) qβ q x) | |
| intro y | |
| dsimp only | |
| rw [expect_realize,expect_realize] | |
| exact (T.realize _).abs_expect_le_expect_abs hw Ο (clockSteps_ordered ho _) _ _ | |
| theorem markedAttach_rootPreserves {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (Fin (n+1) β β) βL[β] β) {as : List PositiveMass} | |
| (T : ClockTree S as) {a : β} (ho : MassOrdered a as) | |
| (p : MarkedPlacement T) (hp : p β T.markedAttach a) | |
| (qβ : Fin (n+1) β β) (q : β β Fin (n+1) β β) | |
| (P : T.Assignment β β) (x : Fin (n+1) β β) : | |
| p.tree.rootExpect w Ο (fun Ο => P (p.restrict Ο)) qβ q x = T.rootExpect w Ο P qβ q x := by | |
| simp only [rootExpect_eq_integral,T.markedAttach_preserves hw Ο ho p hp] | |
| end SKFluctuations.Hierarchy.ClockTree | |
| namespace SKFluctuations.Hierarchy.ClockTree | |
| open MeasureTheory ProbabilityTheory Filter Set GaussianCalculus | |
| open scoped NNReal BigOperators | |
| variable {S : Type*} [Fintype S] [Nonempty S] {n : β} | |
| theorem profilePairTest_root_abs_le {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (Fin (n+1) β β) βL[β] β) {as : List PositiveMass} | |
| (T : ClockTree S as) (ho : MassOrdered 0 as) (P : T.Assignment β β) | |
| (K : β β S β S β β) {M : β} (hK : β j Ο Ο, |K j Ο Ο| β€ M) | |
| (p : MarkedPlacement T) (hp : p β T.markedAttach 0) | |
| (r : MarkedPlacement p.tree) (hr : r β p.tree.markedAttach 0) | |
| (qβ : Fin (n+1) β β) (q : β β Fin (n+1) β β) (x : Fin (n+1) β β) : | |
| r.tree.rootExpect w Ο (fun Ο => |profilePairTest P K p r Ο|) qβ q x β€ | |
| M*T.rootExpect w Ο (fun Ο => |P Ο|) qβ q x := by | |
| calc | |
| _ β€ r.tree.rootExpect w Ο (fun Ο => M*|P (p.restrict (r.restrict Ο))|) qβ q x := by | |
| apply r.tree.rootExpect_mono hw Ο ho | |
| intro Ο | |
| rw [profilePairTest,abs_mul,mul_comm M] | |
| exact mul_le_mul_of_nonneg_left (hK _ _ _) (abs_nonneg _) | |
| _ = _ := by | |
| rw [rootExpect_const_mul,p.tree.markedAttach_rootPreserves hw Ο ho r hr qβ q (fun Ο => |P (p.restrict Ο)|) x, T.markedAttach_rootPreserves hw Ο ho p hp qβ q (fun Ο => |P Ο|) x] | |
| theorem rootProfileJets_relative_abs_le {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (Fin (n+1) β β) βL[β] β) {as : List PositiveMass} | |
| (ho : MassOrdered 0 as) (Ks : List (β β S β S β β)) (T : ClockTree S as) | |
| {r : β} (hT : T.leaves β€ r) (P : T.Assignment β β) {M : β} (hM : 0 β€ M) | |
| (hK : β K β Ks, β j Ο Ο, |K j Ο Ο| β€ M) | |
| (qβ : Fin (n+1) β β) (q : β β Fin (n+1) β β) (x : Fin (n+1) β β) : | |
| |rootProfileJets w Ο qβ q x Ks T P| β€ | |
| jetVariation r Ks.length*T.rootExpect w Ο (fun Ο => |P Ο|) qβ q x*M^Ks.length := by | |
| induction Ks generalizing T r with | |
| | nil => | |
| simpa only [rootProfileJets,jetVariation,List.length_nil,pow_zero,mul_one,one_mul] using | |
| T.abs_rootExpect_le hw Ο ho P qβ q x | |
| | cons K Ks ih => | |
| let E := T.rootExpect w Ο (fun Ο => |P Ο|) qβ q x | |
| let D := jetVariation (r+2) Ks.length*(M*E)*M^Ks.length | |
| have hE : 0 β€ E := T.rootExpect_nonneg hw Ο ho (fun Ο => abs_nonneg _) qβ q x | |
| have hD : 0 β€ D := mul_nonneg | |
| (mul_nonneg (jetVariation_nonneg _ _) (mul_nonneg hM hE)) (pow_nonneg hM _) | |
| have h := T.marked_pair_weight_abs_le ho hT | |
| (fun p s => rootProfileJets w Ο qβ q x Ks s.tree (profilePairTest P K p s)) hD | |
| (fun p hp s hs => by | |
| have hleaf : s.tree.leaves β€ r+2 := by | |
| have hβ := T.markedAttach_leaves 0 p hp | |
| have hβ := p.tree.markedAttach_leaves 0 s hs | |
| omega | |
| apply (ih s.tree hleaf (profilePairTest P K p s) | |
| (fun L hL => hK L (List.mem_cons_of_mem _ hL))).trans | |
| apply mul_le_mul_of_nonneg_right _ (pow_nonneg hM _) | |
| apply mul_le_mul_of_nonneg_left _ (jetVariation_nonneg _ _) | |
| exact T.profilePairTest_root_abs_le hw Ο ho P K (hK K List.mem_cons_self) p hp s hs qβ q x) | |
| apply h.trans_eq | |
| simp only [D,E,List.length_cons,jetVariation,pow_succ] | |
| ring | |
| end SKFluctuations.Hierarchy.ClockTree | |
| namespace SKFluctuations.Hierarchy | |
| open MeasureTheory ProbabilityTheory Filter Set GaussianCalculus | |
| open scoped NNReal BigOperators | |
| variable {S ΞΉ ΞΊ : Type*} [Fintype S] [Fintype ΞΉ] [Fintype ΞΊ] | |
| def ClockTree.disorderProfileJets (w : S β β) (Ο : S β (ΞΉ β β) βL[β] β) | |
| {as : List PositiveMass} (v : ΞΉ β β) (q : β β ΞΉ β β) (x : ΞΉ β β) : | |
| List (β β S β S β β) β (T : ClockTree S as) β (T.Assignment β β) β β | |
| | [], T, P => T.disorderExpect w Ο v q P x | |
| | K::Ks, T, P => | |
| ((T.markedAttach 0).map fun p => p.coeff* | |
| ((p.tree.markedAttach 0).map fun r => r.coeff* | |
| disorderProfileJets w Ο v q x Ks r.tree (ClockTree.profilePairTest P K p r)).sum).sum/2 | |
| theorem ClockTree.disorderProfileJets_reindex (e : ΞΊ β ΞΉ) (w : S β β) | |
| (Ο : S β (ΞΉ β β) βL[β] β) {as : List PositiveMass} | |
| (Ks : List (β β S β S β β)) (T : ClockTree S as) (P : T.Assignment β β) | |
| (v : ΞΉ β β) (q : β β ΞΉ β β) (x : ΞΊ β β) : | |
| ClockTree.disorderProfileJets w (reindexFeature e Ο) (fun i => v (e i)) | |
| (fun j i => q j (e i)) x Ks T P = | |
| ClockTree.disorderProfileJets w Ο v q (coordinateEquiv e x) Ks T P := by | |
| induction Ks generalizing T with | |
| | nil => exact T.disorderExpect_reindex e w Ο v q P x | |
| | cons K Ks ih => simp only [disorderProfileJets,ih] | |
| omit [Fintype S] in | |
| theorem ReplicaTree.coordinateProfile_reindex (e : ΞΊ β ΞΉ) | |
| (Ο : S β (ΞΉ β β) βL[β] β) (K : β β ΞΉ β β) : | |
| coordinateProfile (reindexFeature e Ο) (fun j i => K j (e i)) = coordinateProfile Ο K := by | |
| classical | |
| have he (Ο : S) (i : ΞΊ) : reindexFeature e Ο Ο (Pi.single i 1) = Ο Ο (Pi.single (e i) 1) := by | |
| change Ο Ο (coordinateEquiv e (Pi.single i 1)) = _ | |
| rw [coordinateEquiv_single] | |
| funext j Ο Ο | |
| simp only [coordinateProfile,he] | |
| exact e.sum_comp (fun i => K j i*Ο Ο (Pi.single i 1)*Ο Ο (Pi.single i 1)) | |
| variable [Nonempty S] {n : β} | |
| theorem ClockTree.rootExpect_eq_disorderExpect {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (Fin (n+1) β β) βL[β] β) {as : List PositiveMass} | |
| (T : ClockTree S as) {a : β} (ho : MassOrdered a as) | |
| (P : T.Assignment β β) (v : Fin (n+1) β β) | |
| (q : β β Fin (n+1) β β) (x : Fin (n+1) β β) : | |
| T.rootExpect w Ο P (fun i => q 0 i-v i) (fun j i => q (j+1) i-q j i) x = | |
| T.disorderExpect w Ο v q P x := by | |
| rw [β T.rootEval_testExpr hw Ο ho] | |
| simp only [ClockTree.rootExpect,ClockTree.homTest,ClockTree.testExpr, ClockExpr.rootEval_homSum hw Ο ho,ClockExpr.rootEval_listSum hw Ο ho] | |
| theorem ClockTree.rootProfileJets_eq_disorderProfileJets {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (Fin (n+1) β β) βL[β] β) {as : List PositiveMass} | |
| (ho : MassOrdered 0 as) (Ks : List (β β S β S β β)) (T : ClockTree S as) | |
| (P : T.Assignment β β) (v : Fin (n+1) β β) | |
| (q : β β Fin (n+1) β β) (x : Fin (n+1) β β) : | |
| ClockTree.rootProfileJets w Ο (fun i => q 0 i-v i) (fun j i => q (j+1) i-q j i) x Ks T P = | |
| ClockTree.disorderProfileJets w Ο v q x Ks T P := by | |
| induction Ks generalizing T with | |
| | nil => exact T.rootExpect_eq_disorderExpect hw Ο ho P v q x | |
| | cons K Ks ih => simp only [rootProfileJets,disorderProfileJets,ih] | |
| theorem ClockTree.iteratedDeriv_disorderProfileJets {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (Fin (n+1) β β) βL[β] β) {as : List PositiveMass} | |
| (T : ClockTree S as) (ho : MassOrdered 0 as) (v : Fin (n+1) β β) | |
| (q K : β β Fin (n+1) β β) {l r : β} | |
| (hp : β s β Ioo l r, β i, Monotone (fun j => q j i+s*K j i)) | |
| (hr : β s β Ioo l r, β i, v i β€ q 0 i+s*K 0 i) | |
| (P : T.Assignment β β) (x : Fin (n+1) β β) (k : β) {t : β} (ht : t β Ioo l r) : | |
| iteratedDeriv k (fun s => T.disorderExpect w Ο v (fun j i => q j i+s*K j i) P x) t = | |
| ClockTree.disorderProfileJets w Ο v (fun j i => q j i+t*K j i) x | |
| (List.replicate k (ReplicaTree.coordinateProfile Ο K)) T P := by | |
| have hinc : β j, β s β Ioo l r, β i, | |
| 0 β€ (q (j+1) i-q j i)+s*(K (j+1) i-K j i) := by | |
| intro j s hs i | |
| have h := hp s hs i (Nat.le_succ j) | |
| linarith | |
| have hroot : β s β Ioo l r, β i, 0 β€ q 0 i-v i+s*K 0 i := by | |
| intro s hs i | |
| linarith [hr s hs i] | |
| have hβ (s : β) : (fun i => q 0 i+s*K 0 i-v i) = fun i => q 0 i-v i+s*K 0 i := by | |
| funext i; ring | |
| have hβ (s : β) : (fun j i => (q (j+1) i+s*K (j+1) i)-(q j i+s*K j i)) = | |
| fun j i => q (j+1) i-q j i+s*(K (j+1) i-K j i) := by | |
| funext j i; ring | |
| have he (s : β) : T.disorderExpect w Ο v (fun j i => q j i+s*K j i) P x = | |
| T.rootExpect w Ο P (fun i => q 0 i-v i+s*K 0 i) | |
| (fun j i => q (j+1) i-q j i+s*(K (j+1) i-K j i)) x := by | |
| rw [β T.rootExpect_eq_disorderExpect hw Ο ho,hβ,hβ] | |
| simp only [he] | |
| rw [T.iteratedDeriv_rootProfileJets hw Ο ho P _ _ K hinc hroot x k ht] | |
| rw [β T.rootProfileJets_eq_disorderProfileJets hw Ο ho,hβ,hβ] | |
| end SKFluctuations.Hierarchy | |
| namespace SKFluctuations.Hierarchy | |
| open MeasureTheory ProbabilityTheory Filter Set GaussianCalculus | |
| open scoped NNReal BigOperators | |
| variable {S ΞΉ : Type*} [Fintype S] [Fintype ΞΉ] [Nonempty S] [Nonempty ΞΉ] | |
| theorem ClockTree.iteratedDeriv_finiteProfileJets {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) {as : List PositiveMass} | |
| (T : ClockTree S as) (ho : MassOrdered 0 as) (v : ΞΉ β β) | |
| (q K : β β ΞΉ β β) {l r : β} | |
| (hp : β s β Ioo l r, β i, Monotone (fun j => q j i+s*K j i)) | |
| (hr : β s β Ioo l r, β i, v i β€ q 0 i+s*K 0 i) | |
| (P : T.Assignment β β) (x : ΞΉ β β) (k : β) {t : β} (ht : t β Ioo l r) : | |
| iteratedDeriv k (fun s => T.disorderExpect w Ο v (fun j i => q j i+s*K j i) P x) t = | |
| ClockTree.disorderProfileJets w Ο v (fun j i => q j i+t*K j i) x | |
| (List.replicate k (ReplicaTree.coordinateProfile Ο K)) T P := by | |
| let e := finiteJetEquiv ΞΉ | |
| have hd := T.iteratedDeriv_disorderProfileJets hw (reindexFeature e Ο) ho | |
| (fun i => v (e i)) (fun j i => q j (e i)) (fun j i => K j (e i)) | |
| (fun s hs i => hp s hs (e i)) (fun s hs i => hr s hs (e i)) P | |
| ((coordinateEquiv e).symm x) k ht | |
| have he (s : β) : T.disorderExpect w (reindexFeature e Ο) (fun i => v (e i)) | |
| (fun j i => q j (e i)+s*K j (e i)) P ((coordinateEquiv e).symm x) = | |
| T.disorderExpect w Ο v (fun j i => q j i+s*K j i) P x := by | |
| simpa only [ContinuousLinearEquiv.apply_symm_apply] using | |
| T.disorderExpect_reindex e w Ο v (fun j i => q j i+s*K j i) P ((coordinateEquiv e).symm x) | |
| simp only [he,ReplicaTree.coordinateProfile_reindex] at hd | |
| rw [T.disorderProfileJets_reindex e w Ο _ P v (fun j i => q j i+t*K j i), ContinuousLinearEquiv.apply_symm_apply] at hd | |
| exact hd | |
| theorem ClockTree.disorderProfileJets_abs_le {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) {as : List PositiveMass} | |
| (ho : MassOrdered 0 as) (Ks : List (β β S β S β β)) (T : ClockTree S as) | |
| {r : β} (hT : T.leaves β€ r) (P : T.Assignment β β) {C M : β} | |
| (hC : 0 β€ C) (hM : 0 β€ M) (hP : β Ο, |P Ο| β€ C) | |
| (hK : β K β Ks, β j Ο Ο, |K j Ο Ο| β€ M) | |
| (v : ΞΉ β β) (q : β β ΞΉ β β) (x : ΞΉ β β) : | |
| |ClockTree.disorderProfileJets w Ο v q x Ks T P| β€ | |
| ClockTree.jetVariation r Ks.length*C*M^Ks.length := by | |
| let e := finiteJetEquiv ΞΉ | |
| have hd := ClockTree.rootProfileJets_abs_le hw (reindexFeature e Ο) ho Ks T hT P hC hM hP hK | |
| (fun i => q 0 (e i)-v (e i)) (fun j i => q (j+1) (e i)-q j (e i)) | |
| ((coordinateEquiv e).symm x) | |
| rw [T.rootProfileJets_eq_disorderProfileJets hw (reindexFeature e Ο) ho Ks P (fun i => v (e i)) (fun j i => q j (e i)), T.disorderProfileJets_reindex e w Ο Ks P v q, ContinuousLinearEquiv.apply_symm_apply] at hd | |
| exact hd | |
| theorem ClockTree.disorderProfileJets_relative_abs_le {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) {as : List PositiveMass} | |
| (ho : MassOrdered 0 as) (Ks : List (β β S β S β β)) (T : ClockTree S as) | |
| {r : β} (hT : T.leaves β€ r) (P : T.Assignment β β) {M : β} (hM : 0 β€ M) | |
| (hK : β K β Ks, β j Ο Ο, |K j Ο Ο| β€ M) | |
| (v : ΞΉ β β) (q : β β ΞΉ β β) (x : ΞΉ β β) : | |
| |ClockTree.disorderProfileJets w Ο v q x Ks T P| β€ | |
| ClockTree.jetVariation r Ks.length*T.disorderExpect w Ο v q (fun Ο => |P Ο|) x*M^Ks.length := by | |
| let e := finiteJetEquiv ΞΉ | |
| have hd := ClockTree.rootProfileJets_relative_abs_le hw (reindexFeature e Ο) ho Ks T hT P hM hK | |
| (fun i => q 0 (e i)-v (e i)) (fun j i => q (j+1) (e i)-q j (e i)) | |
| ((coordinateEquiv e).symm x) | |
| rw [T.rootProfileJets_eq_disorderProfileJets hw (reindexFeature e Ο) ho Ks P (fun i => v (e i)) (fun j i => q j (e i)), T.rootExpect_eq_disorderExpect hw (reindexFeature e Ο) ho (fun Ο => |P Ο|) (fun i => v (e i)) (fun j i => q j (e i)), T.disorderProfileJets_reindex e w Ο Ks P v q, T.disorderExpect_reindex e w Ο v q, ContinuousLinearEquiv.apply_symm_apply] at hd | |
| exact hd | |
| end SKFluctuations.Hierarchy | |
| namespace SKFluctuations.Hierarchy | |
| open MeasureTheory ProbabilityTheory Filter Set GaussianCalculus | |
| open scoped Topology NNReal BigOperators | |
| theorem continuous_listSum {Ξ± : Type*} (L : List Ξ±) (f : Ξ± β β β β) | |
| (h : β a β L, Continuous (f a)) : | |
| Continuous (fun t => (L.map fun a => f a t).sum) := by | |
| induction L with | |
| | nil => exact continuous_const | |
| | cons a L ih => | |
| exact (h a List.mem_cons_self).add | |
| (ih (fun b hb => h b (List.mem_cons_of_mem _ hb))) | |
| variable {S ΞΉ : Type*} [Fintype S] [Fintype ΞΉ] [Nonempty S] [Nonempty ΞΉ] | |
| theorem ClockTree.disorderExpect_continuous {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) {as : List PositiveMass} | |
| (T : ClockTree S as) (ho : MassOrdered 0 as) (v : ΞΉ β β) | |
| (q : β β β β ΞΉ β β) (hq : β j, Continuous (fun t => q t j)) | |
| (P : T.Assignment β β) (x : β β ΞΉ β β) (hx : Continuous x) : | |
| Continuous (fun t => T.disorderExpect w Ο v (q t) P (x t)) := by | |
| let e := finiteJetEquiv ΞΉ | |
| have hβ : Continuous (fun t i => q t 0 (e i)-v (e i)) := by | |
| apply continuous_pi; intro i | |
| exact ((continuous_apply (e i)).comp (hq 0)).sub continuous_const | |
| have hβ (j : β) : Continuous (fun t i => q t (j+1) (e i)-q t j (e i)) := by | |
| apply continuous_pi; intro i | |
| exact ((continuous_apply (e i)).comp (hq (j+1))).sub | |
| ((continuous_apply (e i)).comp (hq j)) | |
| have hd := (T.testExpr P).rootEval_continuous hw (reindexFeature e Ο) | |
| (fun t i => q t 0 (e i)-v (e i)) | |
| (fun j t i => q t (j+1) (e i)-q t j (e i)) hβ hβ | |
| (fun t => (coordinateEquiv e).symm (x t)) ((coordinateEquiv e).symm.continuous.comp hx) | |
| have he (t : β) : (T.testExpr P).rootEval w (reindexFeature e Ο) | |
| (fun i => q t 0 (e i)-v (e i)) | |
| (fun j i => q t (j+1) (e i)-q t j (e i)) ((coordinateEquiv e).symm (x t)) = | |
| T.disorderExpect w Ο v (q t) P (x t) := by | |
| rw [T.rootEval_testExpr hw (reindexFeature e Ο) ho (fun i => v (e i)) (fun j i => q t j (e i)),T.disorderExpect_reindex e w Ο v (q t), ContinuousLinearEquiv.apply_symm_apply] | |
| simpa only [he] using hd | |
| theorem ClockTree.disorderProfileJets_continuous {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) {as : List PositiveMass} | |
| (ho : MassOrdered 0 as) (v : ΞΉ β β) (q : β β β β ΞΉ β β) | |
| (hq : β j, Continuous (fun t => q t j)) (x : β β ΞΉ β β) (hx : Continuous x) | |
| (Ks : List (β β S β S β β)) (T : ClockTree S as) (P : T.Assignment β β) : | |
| Continuous (fun t => ClockTree.disorderProfileJets w Ο v (q t) (x t) Ks T P) := by | |
| induction Ks generalizing T with | |
| | nil => exact T.disorderExpect_continuous hw Ο ho v q hq P x hx | |
| | cons K Ks ih => | |
| simp only [disorderProfileJets] | |
| apply Continuous.div_const | |
| apply continuous_listSum | |
| intro p hp | |
| apply Continuous.const_mul | |
| apply continuous_listSum | |
| intro r hr | |
| exact (ih r.tree (ClockTree.profilePairTest P K p r)).const_mul r.coeff | |
| end SKFluctuations.Hierarchy | |
| namespace SKFluctuations.Hierarchy | |
| open MeasureTheory ProbabilityTheory Filter Set GaussianCalculus | |
| open scoped Topology NNReal BigOperators | |
| variable {S ΞΉ : Type*} [Fintype S] [Fintype ΞΉ] [Nonempty S] [Nonempty ΞΉ] | |
| theorem ClockTree.hasDerivAt_finiteProfileJets {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) {as : List PositiveMass} | |
| (ho : MassOrdered 0 as) (v : ΞΉ β β) (q K : β β ΞΉ β β) {l r : β} | |
| (hp : β s β Ioo l r, β i, Monotone (fun j => q j i+s*K j i)) | |
| (hr : β s β Ioo l r, β i, v i β€ q 0 i+s*K 0 i) | |
| (Ks : List (β β S β S β β)) (T : ClockTree S as) (P : T.Assignment β β) | |
| (x : ΞΉ β β) {t : β} (ht : t β Ioo l r) : | |
| HasDerivAt (fun s => ClockTree.disorderProfileJets w Ο v (fun j i => q j i+s*K j i) x Ks T P) | |
| (ClockTree.disorderProfileJets w Ο v (fun j i => q j i+t*K j i) x | |
| (Ks++[ReplicaTree.coordinateProfile Ο K]) T P) t := by | |
| induction Ks generalizing T with | |
| | nil => | |
| have hd := T.hasDerivAt_finiteDisorderExpect hw Ο v q K hp hr P ht x | |
| have he := T.iteratedDeriv_finiteProfileJets hw Ο ho v q K hp hr P x 1 ht | |
| simp only [iteratedDeriv_one] at he | |
| rw [hd.deriv] at he | |
| exact he βΈ hd | |
| | cons L Ks ih => | |
| exact (hasDerivAt_listSum (T.markedAttach 0) _ _ (fun p _ => | |
| (hasDerivAt_listSum (p.tree.markedAttach 0) _ _ (fun r _ => | |
| (ih r.tree (ClockTree.profilePairTest P L p r)).const_mul r.coeff)).const_mul p.coeff)).div_const 2 | |
| end SKFluctuations.Hierarchy | |
| namespace SKFluctuations.Cavity | |
| open MeasureTheory ProbabilityTheory Filter Set Hierarchy GaussianCalculus | |
| open scoped Topology NNReal BigOperators | |
| section | |
| variable (n : β) (q : β β RestCoordinate n β β) (U : β) (b h K : β β β) | |
| {as : List PositiveMass} (T : ClockTree (Spin n Γ Bool) as) (ho : MassOrdered 0 as) | |
| (P : T.Assignment β β) (x : FullCoordinate n β β) | |
| (hq0 : β j i, 0 β€ q j i) (hq : β i, Monotone (fun j => q j i)) | |
| (hb : β j, 0 β€ b j) (hh : β j, 0 β€ h j) (hK : β j, 0 β€ K j) | |
| (hbm : Monotone b) (hhm : Monotone h) (hKm : Monotone K) | |
| include hq0 hq hb hh hK hbm hhm hKm ho | |
| theorem cutLowJet_eq_iteratedDeriv (k : β) {l t : β} | |
| (hl : l β Ioo (0:β) 1) (ht : t β Icc (0:β) 1) : | |
| iteratedDeriv k (fun s => T.disorderExpect (fullWeight n) (fullFeature n) 0 | |
| (cutFullVariance n q U s t b h K) P x) l = cutLowJet n q U b h K T P x k l t := by | |
| induction k generalizing l with | |
| | zero => exact (cutLowJet_zero n q U b h K T ho P x l t).symm | |
| | succ k ih => | |
| rw [iteratedDeriv_succ] | |
| have he : iteratedDeriv k (fun s => T.disorderExpect (fullWeight n) (fullFeature n) 0 | |
| (cutFullVariance n q U s t b h K) P x) =αΆ [π l] | |
| (fun s => cutLowJet n q U b h K T P x k s t) := by | |
| filter_upwards [isOpen_Ioo.mem_nhds hl] with s hs | |
| exact ih hs | |
| rw [he.deriv_eq] | |
| exact (cutLowJet_hasDerivAt_l n q U hl ht b h K hq0 hq hb hh hK hbm hhm hKm T ho P x k).deriv | |
| theorem cutLowJet_eq_profileJets (k : β) {l t : β} | |
| (hl : l β Icc (0:β) 1) (ht : t β Icc (0:β) 1) : | |
| cutLowJet n q U b h K T P x k l t = | |
| ClockTree.disorderProfileJets (fullWeight n) (fullFeature n) 0 | |
| (cutFullVariance n q U l t b h K) x | |
| (List.replicate k (ReplicaTree.coordinateProfile (fullFeature n) (cutLSlope n U t b h K))) T P := by | |
| have hr : β s β Ioo (0:β) 1, β i, (0 : FullCoordinate n β β) i β€ | |
| cutLBase n q U t b h K 0 i+s*cutLSlope n U t b h K 0 i := by | |
| intro s hs i | |
| have hn := cutFullVariance_nonneg n q U (l := s) β¨hs.1.le,hs.2.leβ© ht hq0 hb hh hK 0 i | |
| simpa only [cutFullVariance_l_affine,Pi.zero_apply] using hn | |
| have hi : Set.EqOn (fun l => cutLowJet n q U b h K T P x k l t) | |
| (fun l => ClockTree.disorderProfileJets (fullWeight n) (fullFeature n) 0 | |
| (cutFullVariance n q U l t b h K) x | |
| (List.replicate k (ReplicaTree.coordinateProfile (fullFeature n) (cutLSlope n U t b h K))) T P) | |
| (Ioo (0:β) 1) := by | |
| intro s hs | |
| dsimp only | |
| rw [β cutLowJet_eq_iteratedDeriv n q U b h K T ho P x hq0 hq hb hh hK hbm hhm hKm k hs ht] | |
| simpa only [cutFullVariance_l_affine] using | |
| T.iteratedDeriv_finiteProfileJets (fullWeight_pos n) (fullFeature n) ho 0 | |
| (cutLBase n q U t b h K) (cutLSlope n U t b h K) | |
| (cutL_affine_monotone n q U ht hq hb hh hK hbm hhm hKm) hr P x k hs | |
| have hc := hi.closure (cutLowJet_continuous_l n q U b h K T P x k t) | |
| (ClockTree.disorderProfileJets_continuous (fullWeight_pos n) (fullFeature n) ho 0 | |
| (fun l => cutFullVariance n q U l t b h K) (cutFullVariance_continuous_l n q U b h K t) | |
| (fun _ => x) continuous_const _ T P) | |
| apply hc | |
| simpa only [closure_Ioo (show (0:β) β 1 by norm_num)] using hl | |
| end | |
| end SKFluctuations.Cavity | |
| namespace SKFluctuations.Hierarchy.ClockTree | |
| open MeasureTheory ProbabilityTheory | |
| open scoped NNReal BigOperators | |
| variable {S ΞΉ : Type*} [Fintype S] [Fintype ΞΉ] | |
| theorem expect_fork (w : S β β) (Ο : S β (ΞΉ β β) βL[β] β) | |
| {as : List PositiveMass} (T U : ClockTree S as) (q : β β ΞΉ β ββ₯0) | |
| (P : (T.fork U).Assignment β β) (x : ΞΉ β β) : | |
| (T.fork U).expect w Ο q P x = | |
| T.expect w Ο q (fun Ο => U.expect w Ο q (fun Ο => P (Ο,Ο)) x) x := by | |
| simp only [expect,weight_fork,Fintype.sum_prod_type,Finset.mul_sum,mul_assoc] | |
| variable [Nonempty S] | |
| theorem expect_step {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) {as : List PositiveMass} (b : PositiveMass) | |
| (T : ClockTree S as) (ho : MassOrdered b.val as) (q : β β ΞΉ β ββ₯0) | |
| (P : T.Assignment β β) (x : ΞΉ β β) : | |
| (T.step b).expect w Ο q P x = | |
| shiftedMean (Measure.pi fun i => gaussianReal 0 (q 0 i)) b.val | |
| (gaussianHierarchy w Ο (clockSteps as (fun j => q (j+1)))) | |
| (T.expect w Ο (fun j => q (j+1)) P) x := by | |
| rw [expect_realize] | |
| change ((T.realize (fun j => q (j+1))).step (b.val,q 0)).expect w Ο | |
| (fun Ο => P ((T.assignmentEquiv (fun j => q (j+1))).symm Ο)) x = _ | |
| rw [ReplicaTree.expect_step hw Ο _ b.val (q 0) (clockSteps_ordered ho _)] | |
| congr 1 | |
| funext y | |
| exact (T.expect_realize w Ο _ P y).symm | |
| theorem expect_const {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) {as : List PositiveMass} | |
| (T : ClockTree S as) {a : β} (ho : MassOrdered a as) (q : β β ΞΉ β ββ₯0) | |
| (c : β) (x : ΞΉ β β) : T.expect w Ο q (fun _ => c) x = c := by | |
| rw [expect_realize] | |
| exact (T.realize q).expect_const hw Ο (clockSteps_ordered ho q) c x | |
| def singleMean (w : S β β) (Ο : S β (ΞΉ β β) βL[β] β) | |
| (as : List PositiveMass) (q : β β ΞΉ β ββ₯0) (P : S β β) (x : ΞΉ β β) : β := | |
| (single as).expect w Ο q (fun Ο => P (singleEquiv (S:=S) as Ο)) x | |
| theorem singleMean_step {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) {as : List PositiveMass} (b : PositiveMass) | |
| (ho : MassOrdered b.val as) (q : β β ΞΉ β ββ₯0) (P : S β β) (x : ΞΉ β β) : | |
| singleMean w Ο (b::as) q P x = | |
| shiftedMean (Measure.pi fun i => gaussianReal 0 (q 0 i)) b.val | |
| (gaussianHierarchy w Ο (clockSteps as (fun j => q (j+1)))) | |
| (singleMean w Ο as (fun j => q (j+1)) P) x := by | |
| exact expect_step hw Ο b (single as) ho q _ x | |
| theorem expect_atSlot {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) {as : List PositiveMass} | |
| (T : ClockTree S as) {a : β} (ho : MassOrdered a as) (q : β β ΞΉ β ββ₯0) | |
| (s : T.Slot) (P : S β β) (x : ΞΉ β β) : | |
| T.expect w Ο q (fun Ο => P (T.atSlot Ο s)) x = singleMean w Ο as q P x := by | |
| induction T generalizing a q P x with | |
| | leaf => rfl | |
| | step b T ih => | |
| rw [expect_step hw Ο b T ho.2.2,singleMean_step hw Ο b ho.2.2] | |
| congr 1 | |
| funext y | |
| exact ih ho.2.2 _ s P y | |
| | fork T U ihT ihU => | |
| cases s with | |
| | inl s => | |
| rw [expect_fork] | |
| change T.expect w Ο q (fun Ο => U.expect w Ο q (fun _ => P (T.atSlot Ο s)) x) x = _ | |
| simp only [U.expect_const hw Ο ho q] | |
| exact ihT ho q s P x | |
| | inr s => | |
| rw [expect_fork] | |
| change T.expect w Ο q (fun _ => U.expect w Ο q (fun Ο => P (U.atSlot Ο s)) x) x = _ | |
| rw [T.expect_const hw Ο ho q] | |
| exact ihU ho q s P x | |
| end SKFluctuations.Hierarchy.ClockTree | |
| end | |
| end OAI | |