math / data /lean /OAI /Probability /DilutedSpin /ClippedModelFacts.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
7.04 kB
import OAI.Probability.DilutedSpin.CompoundRate
import OAI.Probability.DilutedSpin.FunctionalStability
import OAI.Probability.DilutedSpin.UpperMoments
namespace OAI
section
namespace DilutedSpinGlass
open _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory Filter
open scoped NNReal
lemma clippedModel_interaction_bounded {p : β„•} (M : Model p) {K : ℝ} (hK : 0 ≀ K) :
βˆ€α΅ z βˆ‚(clippedModel M K).disorder.toMeasure, β€–z.1β€– ≀ K := by
change βˆ€α΅ z βˆ‚Measure.map (clipSample K) M.disorder.toMeasure, β€–z.1β€– ≀ K
apply (ae_map_iff (measurable_clipSample K).aemeasurable (measurableSet_le measurable_fst.norm measurable_const)).mpr
exact ae_of_all _ (fun z => (pi_norm_le_iff_of_nonneg hK).mpr (fun s => by
simpa only [Real.norm_eq_abs,clipSample] using clipReal_bound hK (z.1 s)))
lemma clippedModel_field_bounded {p : β„•} (M : Model p) {K : ℝ} (hK : 0 ≀ K) :
βˆ€α΅ h βˆ‚(clippedModel M K).field.toMeasure, |h| ≀ K := by
change βˆ€α΅ h βˆ‚Measure.map (clipReal K) M.field.toMeasure, |h| ≀ K
apply (ae_map_iff (measurable_clipReal K).aemeasurable (measurableSet_le measurable_id.abs measurable_const)).mpr
exact ae_of_all _ (clipReal_bound hK)
lemma clippedModel_interaction_integrable {p : β„•} (M : Model p) {K : ℝ} (hK : 0 ≀ K) :
Integrable (fun z : InteractionSample p => β€–z.1β€–) (clippedModel M K).disorder.toMeasure := by
exact (integrable_const K).mono' (by fun_prop) ((clippedModel_interaction_bounded M hK).mono (fun z hz => by simpa only [norm_norm] using hz))
lemma clippedModel_field_integrable {p : β„•} (M : Model p) {K : ℝ} (hK : 0 ≀ K) :
Integrable (fun h : ℝ => |h|) (clippedModel M K).field.toMeasure := by
exact (integrable_const K).mono' (by fun_prop) ((clippedModel_field_bounded M hK).mono (fun z hz => by simpa only [Real.norm_eq_abs,abs_abs] using hz))
lemma clippedModel_symmetric {p : β„•} (M : Model p) (K : ℝ)
(hsym : βˆ€ e : Equiv.Perm (Fin p),IdentDistrib (fun z : InteractionSample p => z.1)
(fun z : InteractionSample p => fun s => z.1 (fun i => s (e i))) M.disorder.toMeasure M.disorder.toMeasure)
(e : Equiv.Perm (Fin p)) :
IdentDistrib (fun z : InteractionSample p => z.1)
(fun z : InteractionSample p => fun s => z.1 (fun i => s (e i)))
(clippedModel M K).disorder.toMeasure (clippedModel M K).disorder.toMeasure := by
constructor
Β· exact measurable_fst.aemeasurable
Β· exact (show Measurable (fun z : InteractionSample p => fun (s : Fin p β†’ Spin) => z.1 (fun l => s (e l))) by fun_prop).aemeasurable
Β· change Measure.map _ (Measure.map (clipSample K) M.disorder.toMeasure)=Measure.map _ (Measure.map (clipSample K) M.disorder.toMeasure)
rw [Measure.map_map measurable_fst (measurable_clipSample K),
Measure.map_map (show Measurable (fun z : InteractionSample p => fun (s : Fin p β†’ Spin) => z.1 (fun l => s (e l))) by fun_prop) (measurable_clipSample K)]
exact (interaction_clip_symmetric M K hsym e).map_eq
lemma clip_interaction_difference_integrable {p : β„•} (M : Model p) {K : ℝ} (hK : 0 ≀ K)
(hi : Integrable (fun z : InteractionSample p => β€–z.1β€–) M.disorder.toMeasure) :
Integrable (fun z => β€–(clipSample K z).1-z.1β€–) M.disorder.toMeasure := by
apply (hi.const_mul 2).mono' ((measurable_fst.comp (measurable_clipSample K)).sub measurable_fst).norm.aestronglyMeasurable
exact ae_of_all _ (fun z => by
simp only [norm_norm]
change β€–(clipSample K z).1-z.1β€– ≀ 2*β€–z.1β€–
rw [norm_sub_rev]
exact clipSample_difference_bound hK z)
lemma clip_field_difference_integrable {p : β„•} (M : Model p) {K : ℝ} (hK : 0 ≀ K)
(hi : Integrable (fun h : ℝ => |h|) M.field.toMeasure) :
Integrable (fun h => |clipReal K h-h|) M.field.toMeasure := by
apply (hi.const_mul 2).mono' ((measurable_clipReal K).sub measurable_id).abs.aestronglyMeasurable
exact ae_of_all _ (fun h => by
simp only [Real.norm_eq_abs,abs_abs]
change |clipReal K h-h| ≀ 2*|h|
have h1 := abs_sub (clipReal K h) h
have h2 := clipReal_abs_le hK h
linarith)
end DilutedSpinGlass
end
section
namespace DilutedSpinGlass
open _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory
open scoped BigOperators
noncomputable def replicaInsertionMoment {p n : β„•} (M : Model p) (R : ℝ)
(P : Fin p β†’ FiniteLaw (Fin n β†’ Spin)) : ℝ :=
∫ z : InteractionSample p, (-z.2.2.1)^n*(FiniteLaw.pi P).expect
(fun s => ∏ a : Fin n,∏ l : Fin p,factorCut R (z.2.2.2 l) (s l a)) βˆ‚M.disorder.toMeasure
/-- The literal order-n replica coefficient of the three independent-label
insertions. The old spin-pattern law P and fresh-label spin-pattern law B
are arbitrary; their laws are not assumed to agree. -/
lemma replicaInsertion_combination {p n : β„•} (M : Model p) (hM : Admissible M)
(j : Fin p) (R : ℝ) (P B : FiniteLaw (Fin n β†’ Spin)) :
replicaInsertionMoment M R (fun _ : Fin p => P) -
(p:ℝ)*replicaInsertionMoment M R (fun l : Fin p => if l=j then P else B) +
((p-1:β„•):ℝ)*replicaInsertionMoment M R (fun _ : Fin p => B) =
(∫ z : InteractionSample p,(-z.2.2.1)^n βˆ‚M.disorder.toMeasure)*
((∫ z : InteractionSample p,patternFeature R P (z.2.2.2 j) βˆ‚M.disorder.toMeasure)^p -
(p:ℝ)*(∫ z : InteractionSample p,patternFeature R P (z.2.2.2 j) βˆ‚M.disorder.toMeasure)*
(∫ z : InteractionSample p,patternFeature R B (z.2.2.2 j) βˆ‚M.disorder.toMeasure)^(p-1) +
((p-1:β„•):ℝ)*(∫ z : InteractionSample p,patternFeature R B (z.2.2.2 j) βˆ‚M.disorder.toMeasure)^p) := by
classical
unfold replicaInsertionMoment
rw [upper_pattern_moment M hM j,upper_pattern_moment M hM j,upper_pattern_moment M hM j]
simp only [Finset.prod_const,Finset.card_univ,Fintype.card_fin]
have he : (∏ l : Fin p, ∫ z : InteractionSample p,
patternFeature R (if l=j then P else B) (z.2.2.2 j) βˆ‚M.disorder.toMeasure) =
(∫ z : InteractionSample p,patternFeature R P (z.2.2.2 j) βˆ‚M.disorder.toMeasure)*
(∫ z : InteractionSample p,patternFeature R B (z.2.2.2 j) βˆ‚M.disorder.toMeasure)^(p-1) := by
convert product_one_distinguished j
(∫ z : InteractionSample p,patternFeature R P (z.2.2.2 j) βˆ‚M.disorder.toMeasure)
(∫ z : InteractionSample p,patternFeature R B (z.2.2.2 j) βˆ‚M.disorder.toMeasure) using 1
Β· apply Finset.prod_congr rfl
intro l _
split_ifs <;> rfl
Β· simp
rw [he]
ring
lemma replicaInsertion_coefficient_nonpos {p n : β„•} (M : Model p) (hM : Admissible M)
(hn : 1≀n) (j : Fin p) (R t : ℝ) (ht : 0≀t) (P B : FiniteLaw (Fin n β†’ Spin)) :
-(t^n/(n:ℝ))*(replicaInsertionMoment M R (fun _ : Fin p => P) -
(p:ℝ)*replicaInsertionMoment M R (fun l : Fin p => if l=j then P else B) +
((p-1:β„•):ℝ)*replicaInsertionMoment M R (fun _ : Fin p => B)) ≀ 0 := by
rw [replicaInsertion_combination M hM j, ← mul_assoc]
exact admissible_upper_coefficient_nonpos M hM n hn t _ _ ht
end DilutedSpinGlass
end
end OAI