Download data/lean/OAI/Probability/DilutedSpin/CavityInsertionFunctional.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7.08 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/DilutedSpin/CavityInsertionFunctional.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/DilutedSpin/CavityInsertionFunctional.lean
-
curl -L -o CavityInsertionFunctional.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/DilutedSpin/CavityInsertionFunctional.lean
7.08 kB
| import OAI.Probability.DilutedSpin.CavityAllocatedMean | |
| import OAI.Probability.DilutedSpin.CavitySiteMean | |
| import OAI.Probability.DilutedSpin.CavityTrialIdentity | |
| import OAI.Probability.DilutedSpin.CountBridgeTools | |
| import OAI.Probability.DilutedSpin.FullRootIncrement | |
| namespace OAI | |
| section | |
| namespace DilutedSpinGlass | |
| open _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory | |
| open scoped NNReal BigOperators | |
| variable {X Y : Type} [MeasurableSpace X] [MeasurableSpace Y] {N p k : β} [NeZero N] | |
| omit [MeasurableSpace X] in | |
| lemma cavityArray_insertionFunctional (Ο : Measure ((Fin N β Spin) β β)) [IsProbabilityMeasure Ο] | |
| (ΞΎ : Measure Y) [IsProbabilityMeasure ΞΎ] (theta : X β InteractionSample p) (field : Y β β) | |
| (hhm : Measurable field) {F : ((Fin N β Spin) β β) β β} (hF : LipschitzWith 1 F) | |
| {H C : β} (hH : 0β€H) (hC : 0β€C) (hh : β y,|field y|β€H) | |
| (z : Fin k β X) (hz : β a,β(theta (z a)).1ββ€C) : | |
| (FiniteLaw.uniform : FiniteLaw (Fin k β Fin (p-1) β Fin N)).expect (fun j => | |
| β« y,energyInsertionFunctional Ο F | |
| (fun Ο => cavitySiteEnergy (fun a => theta (z a)) (field y) (fun a => Ο (j a.1 a.2))) βΞΎ)= | |
| β« E,cavityArrayValue ΞΎ theta field F E z-F E βΟ := by | |
| let V := fun (j : Fin k β Fin (p-1) β Fin N) (y : Y) (Ο : Fin N β Spin) => | |
| cavitySiteEnergy (fun a => theta (z a)) (field y) (fun a => Ο (j a.1 a.2)) | |
| have hVm j : Measurable (V j) := by | |
| apply Measurable.of_eval | |
| intro Ο | |
| change Measurable (fun y => cavitySiteEnergy (fun a => theta (z a)) (field y) | |
| (fun a => Ο (j a.1 a.2))) | |
| unfold cavitySiteEnergy | |
| apply Measurable.log | |
| apply Measurable.div_const | |
| apply Finset.measurable_sum | |
| intro Ξ΅ _ | |
| apply Measurable.exp | |
| exact (hhm.mul_const _).add measurable_const | |
| have hVb j y : βV j yββ€H+C*k := by | |
| apply (pi_norm_le_iff_of_nonneg (by positivity)).mpr | |
| intro Ο | |
| have hb := cavitySiteEnergy_bound (fun a => theta (z a)) (field y) (fun a => Ο (j a.1 a.2)) | |
| have hs : (β a : Fin k,β(theta (z a)).1β)β€C*k := by | |
| simpa [mul_comm] using Finset.sum_le_sum (fun a (_ : aβ(Finset.univ : Finset (Fin k))) => hz a) | |
| simpa only [Real.norm_eq_abs] using hb.trans (add_le_add (hh y) hs) | |
| have hi j : Integrable (fun w : YΓ((Fin N β Spin) β β) => F (w.2+V j w.1)-F w.2) (ΞΎ.prod Ο) := by | |
| apply Integrable.of_bound ((hF.continuous.measurable.comp (measurable_snd.add ((hVm j).comp measurable_fst))).sub | |
| (hF.continuous.measurable.comp measurable_snd)).aestronglyMeasurable (H+C*k) | |
| exact ae_of_all _ (fun w => by | |
| simpa only [Real.norm_eq_abs,add_sub_cancel_left,NNReal.coe_one,one_mul,Pi.sub_apply,Pi.add_apply,Function.comp_apply] using | |
| (hF.norm_sub_le (w.2+V j w.1) w.2).trans (by simpa using hVb j w.1)) | |
| have hj j : (β« y,energyInsertionFunctional Ο F (V j y) βΞΎ)= | |
| β« E,β« y,F (E+V j y)-F E βΞΎ βΟ := integral_integral_swap (hi j) | |
| have hsub E j : (β« y,F (E+V j y)-F E βΞΎ)=(β« y,F (E+V j y) βΞΎ)-F E := by | |
| have he : Integrable (fun y => F (E+V j y)-F E) ΞΎ := by | |
| apply Integrable.of_bound ((hF.continuous.measurable.comp (measurable_const.add (hVm j))).sub measurable_const).aestronglyMeasurable (H+C*k) | |
| exact ae_of_all _ (fun y => by simpa using (hF.norm_sub_le (E+V j y) E).trans (by simpa using hVb j y)) | |
| have he' : Integrable (fun y => F (E+V j y)) ΞΎ := by | |
| exact (he.add (integrable_const (F E))).congr (ae_of_all _ (fun y => by simp)) | |
| rw [integral_sub he' (integrable_const _)]; simp | |
| change (FiniteLaw.uniform : FiniteLaw (Fin k β Fin (p-1) β Fin N)).expect | |
| (fun j => β« y,energyInsertionFunctional Ο F (V j y) βΞΎ)=_ | |
| simp_rw [hj] | |
| rw [β FiniteLaw.integral_expect _ Ο _ (fun j => (hi j).integral_prod_right)] | |
| apply integral_congr_ae | |
| filter_upwards [] with E | |
| simp only [hsub,FiniteLaw.expect_sub,FiniteLaw.expect_const,cavityArrayValue] | |
| rfl | |
| end DilutedSpinGlass | |
| end | |
| section | |
| namespace DilutedSpinGlass.PrescribedTree | |
| open _root_.MeasureTheory _root_.OAI.MeasureTheory KernelTower | |
| open scoped BigOperators | |
| variable {Ξ R : Type} [Fintype Ξ] [Fintype R] [MeasurableSpace R] [MeasurableSingletonClass R] | |
| lemma activeCountMean_site (q : β) (M : Model (q+1)) (hM : Admissible M) | |
| (a : Ξ) (r : β) (Q : FiniteLaw R) (U : R β KernelTower Ξ r) | |
| (x : R β FinitePath Ξ r β β) (m : Fin (r+1) β β) | |
| (hm : β d,0 < m d) (hend : m (Fin.last r)=1) (k : β) (h : β) : | |
| activeCountMean M Q (terminalTower false (FiniteLaw.uniform : FiniteLaw Spin) r) | |
| (fun b => pad a r (U b)) (terminalState r) | |
| (fun b y => x b (pathPrefix r y)) m (Fin.last q) | |
| (fun y => h*spin (terminalState r y)) k= | |
| β« z : Fin k β InteractionSample (q+1), | |
| trialLog r (finiteTrialLaw r Q U x) (fun d => m d.castSucc) (siteLog z h) | |
| βMeasure.pi (fun _ : Fin k => M.disorder.toMeasure) := by | |
| let F := fun z : RootPath (InteractionSample (q+1)) k Γ RootPath (Fin (q+1) β R) k => | |
| backwardLog (r+1) | |
| (cavityTower (terminalTower false (FiniteLaw.uniform : FiniteLaw Spin) r) | |
| (fun b => pad a r (U b)) k z.2) m | |
| (activeEnergy (terminalState r) (fun b y => x b (pathPrefix r y)) (Fin.last q) k z.2 z.1 | |
| (fun y => h*spin (terminalState r y))) | |
| have hFm : Measurable F := by | |
| apply measurable_from_prod_countable_left | |
| intro b | |
| dsimp only [F] | |
| exact measurable_backwardLog (r+1) _ m (measurable_activeEnergy (terminalState r) | |
| (fun b y => x b (pathPrefix r y)) (Fin.last q) k b id measurable_id | |
| (fun y => h*spin (terminalState r y))) | |
| have hB (z : RootPath (InteractionSample (q+1)) k Γ RootPath (Fin (q+1) β R) k) : | |
| |F z|β€|h|+β i,β(rootArray k z.1 i).1β := by | |
| apply backwardLog_bound _ _ _ hm | |
| intro y | |
| apply activeEnergy_bound _ _ _ _ _ _ _ _ y | |
| intro y | |
| simp only [abs_mul,abs_spin,mul_one] | |
| exact le_refl _ | |
| have hi : Integrable F ((rootLaw k (fun _ => M.disorder.toMeasure)).prod | |
| (rootLaw k (fun _ => ((FiniteLaw.pi (fun _ : Fin (q+1) => Q)).asProbability id).toMeasure))) := by | |
| exact ((integrable_const |h|).add ((integrable_rootArray_sum M.disorder.toMeasure | |
| (fun a => βa.1β) hM.interaction_integrable k).comp_fst _)).mono' | |
| hFm.aestronglyMeasurable (ae_of_all _ hB) | |
| unfold activeCountMean activeDatumRoot | |
| change (β« z,F (rootMap Prod.fst k z,rootMap Prod.snd k z) βrootLaw k (fun _ => _))=_ | |
| rw [integral_rootSplit _ _ k F hFm hi] | |
| have he (z : RootPath (InteractionSample (q+1)) k) : | |
| (β« b,F (z,b) βrootLaw k (fun _ => ((FiniteLaw.pi (fun _ : Fin (q+1) => Q)).asProbability id).toMeasure))= | |
| trialLog r (finiteTrialLaw r Q U x) (fun d => m d.castSucc) (siteLog (rootArray k z) h) := | |
| activeRoot_site_mean a r Q U x m hend q k z h | |
| simp only [he] | |
| exact integral_rootArray_eq_pi M.disorder.toMeasure k | |
| (fun z : Fin k β InteractionSample (q+1) => | |
| trialLog r (finiteTrialLaw r Q U x) (fun d => m d.castSucc) (siteLog z h)) | |
| end DilutedSpinGlass.PrescribedTree | |
| end | |
| end OAI | |