Download data/lean/OAI/Probability/IsingPerceptron/TimeIncrement.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 34.8 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/IsingPerceptron/TimeIncrement.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/IsingPerceptron/TimeIncrement.lean
-
curl -L -o TimeIncrement.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/IsingPerceptron/TimeIncrement.lean
34.8 kB
| import Mathlib | |
| import OAI.Probability.IsingPerceptron.OrderedQuantile | |
| namespace OAI | |
| /-! Time Increment. -/ | |
| noncomputable section | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped BigOperators Topology ENNReal NNReal | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped BigOperators Topology ENNReal NNReal | |
| namespace IsingPerceptron | |
| lemma enrichedHamiltonian_count_succ {N : β} {A : Type*} (n : β) (h : β β β) | |
| (u : Fin N β β) (Ο : A β Spin N β β) (m : β) (z : EnrichedFixedData n A) : | |
| enrichedHamiltonian n h u Ο (enrichedCountJoin (m+1,z)) = | |
| fun s => enrichedHamiltonian n h u Ο (enrichedCountJoin (m,z)) s+Ο (z.1.1 m) s.1 := by | |
| funext s | |
| unfold enrichedHamiltonian enrichedCountJoin | |
| dsimp only | |
| rw [patternBase_prefix_succ] | |
| simp only [Pi.add_apply] | |
| ring | |
| lemma enrichedFixed_pressure_increment {N : β} (hN : 0 < N) (n : β) (b : β β β) | |
| {h : β β β} (hh : Monotone h) (h0 : 0 β€ h 0) | |
| (u : Fin N β β) (hu : β j, |u j| β€ 2) (Ξ½ : Measure (Spin N)) [IsProbabilityMeasure Ξ½] | |
| {A : Type*} [MeasurableSpace A] (P : Measure A) [IsProbabilityMeasure P] | |
| {Ο : A β Spin N β β} {K : β} (hK : 0 β€ K) | |
| (hΟ : β y x, |Ο y x| β€ K) (m : β) : | |
| βα΅ z βenrichedFixedLaw P n b, | |
| enrichedCylinderPressure n h u Ξ½ Ο (enrichedCountJoin (m+1,z))- | |
| enrichedCylinderPressure n h u Ξ½ Ο (enrichedCountJoin (m,z)) = | |
| cgf (fun s : Spin N Γ LabeledLeaf n => Ο (z.1.1 m) s.1) | |
| (enrichedGibbsReference n h u Ξ½ Ο (enrichedCountJoin (m,z))) 1/N := by | |
| filter_upwards [enrichedFixed_exp_ae hN n b hh h0 u hu Ξ½ P hK hΟ m, | |
| enrichedFixed_exp_ae hN n b hh h0 u hu Ξ½ P hK hΟ (m+1)] with z he he' | |
| rw [enrichedHamiltonian_count_succ] at he' | |
| have hc := cgf_fold (labeledSpinReference n Ξ½ z.1.2) | |
| (enrichedHamiltonian n h u Ο (enrichedCountJoin (m,z))) | |
| (fun s : Spin N Γ LabeledLeaf n => Ο (z.1.1 m) s.1) 1 he (by simpa using he') | |
| change cgf _ (enrichedGibbsReference n h u Ξ½ Ο (enrichedCountJoin (m,z))) _ = _ at hc | |
| rw [hc] | |
| change (Real.log (referencePartition (labeledSpinReference n Ξ½ z.1.2) | |
| (enrichedHamiltonian n h u Ο (enrichedCountJoin (m+1,z))))-N*h n/2)/N - | |
| (Real.log (referencePartition (labeledSpinReference n Ξ½ z.1.2) | |
| (enrichedHamiltonian n h u Ο (enrichedCountJoin (m,z))))-N*h n/2)/N = _ | |
| rw [enrichedHamiltonian_count_succ] | |
| simp only [one_mul] | |
| ring | |
| lemma enrichedFixed_mean_step_bound {N : β} (hN : 0 < N) (n : β) (b : β β β) | |
| (hb : CascadeExponents n b) {h : β β β} (hh : Monotone h) (h0 : 0 β€ h 0) | |
| (u : Fin N β β) (hu : β j, |u j| β€ 2) (Ξ½ : Measure (Spin N)) [IsProbabilityMeasure Ξ½] | |
| {A : Type*} [MeasurableSpace A] (P : Measure A) [IsProbabilityMeasure P] | |
| {Ο : A β Spin N β β} (hm : Measurable Ο) {K : β} (hK : 0 β€ K) | |
| (hΟ : β y x, |Ο y x| β€ K) (m : β) : | |
| |(β« z, enrichedCylinderPressure n h u Ξ½ Ο (enrichedCountJoin (m+1,z)) βenrichedFixedLaw P n b)- | |
| (β« z, enrichedCylinderPressure n h u Ξ½ Ο (enrichedCountJoin (m,z)) βenrichedFixedLaw P n b)| β€ K/N := by | |
| rw [β integral_sub (enrichedFixed_pressure_integrable hN n b hb hh h0 u hu Ξ½ P hm hK hΟ (m+1)) | |
| (enrichedFixed_pressure_integrable hN n b hb hh h0 u hu Ξ½ P hm hK hΟ m),β Real.norm_eq_abs] | |
| apply (norm_integral_le_of_norm_le_const (C := K/N) ?_).trans (by simp) | |
| filter_upwards [enrichedFixed_pressure_increment hN n b hh h0 u hu Ξ½ P hK hΟ m] with z hz | |
| rw [hz,Real.norm_eq_abs,abs_div,abs_of_nonneg (Nat.cast_nonneg N : (0:β) β€ N)] | |
| apply div_le_div_of_nonneg_right _ (Nat.cast_nonneg _) | |
| exact abs_cgf_one_le _ (measurable_of_countable _) (fun s => hΟ (z.1.1 m) s.1) | |
| lemma enrichedMeanPressure_eq_poissonMean {N : β} (hN : 0 < N) (n : β) (b : β β β) | |
| (hb : CascadeExponents n b) {h : β β β} (hh : Monotone h) (h0 : 0 β€ h 0) | |
| (u : Fin N β β) (hu : β j, |u j| β€ 2) (Ξ½ : Measure (Spin N)) [IsProbabilityMeasure Ξ½] | |
| {A : Type*} [MeasurableSpace A] (P : Measure A) [IsProbabilityMeasure P] | |
| {Ο : A β Spin N β β} (hm : Measurable Ο) {K : β} (hK : 0 β€ K) | |
| (hΟ : β y x, |Ο y x| β€ K) (r : ββ₯0) : | |
| enrichedMeanPressure P r n b h u Ξ½ Ο = | |
| poissonMean (fun m => β« z, enrichedCylinderPressure n h u Ξ½ Ο (enrichedCountJoin (m,z)) | |
| βenrichedFixedLaw P n b) r := by | |
| have hn : (N:β) β 0 := by exact_mod_cast hN.ne' | |
| have hi := (enrichedCylinderPressure_field_cap hN n b hb hh h0 (le_refl (h n)) u hu Ξ½ P hm hK hΟ r | |
| (Ξ± := (r:β)/N) (by rw [div_mul_cancelβ _ hn])).1.integrable (by norm_num) | |
| have hp := enrichedCountJoin_preserving P r n b | |
| rw [poissonMean_eq_integral] | |
| unfold enrichedMeanPressure | |
| rw [β hp.hasLaw.integral_comp hi.aestronglyMeasurable,integral_prod _ ((hp.map_eq.symm βΈ hi).comp_measurable hp.measurable)] | |
| rfl | |
| end IsingPerceptron | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped BigOperators Topology ENNReal NNReal | |
| namespace IsingPerceptron | |
| def enrichedNextPatternCGF {N : β} {A : Type*} (n : β) (h : β β β) | |
| (u : Fin N β β) (Ξ½ : Measure (Spin N)) (Ο : A β Spin N β β) | |
| (m : β) (z : EnrichedFixedData n A) : β := | |
| cgf (fun s : Spin N Γ LabeledLeaf n => Ο (z.1.1 m) s.1) | |
| (enrichedGibbsReference n h u Ξ½ Ο (enrichedCountJoin (m,z))) 1 | |
| lemma enrichedFixed_mean_increment {N : β} (hN : 0 < N) (n : β) (b : β β β) | |
| (hb : CascadeExponents n b) {h : β β β} (hh : Monotone h) (h0 : 0 β€ h 0) | |
| (u : Fin N β β) (hu : β j, |u j| β€ 2) (Ξ½ : Measure (Spin N)) [IsProbabilityMeasure Ξ½] | |
| {A : Type*} [MeasurableSpace A] (P : Measure A) [IsProbabilityMeasure P] | |
| {Ο : A β Spin N β β} (hm : Measurable Ο) {K : β} (hK : 0 β€ K) | |
| (hΟ : β y x, |Ο y x| β€ K) (m : β) : | |
| (β« z, enrichedCylinderPressure n h u Ξ½ Ο (enrichedCountJoin (m+1,z)) βenrichedFixedLaw P n b)- | |
| (β« z, enrichedCylinderPressure n h u Ξ½ Ο (enrichedCountJoin (m,z)) βenrichedFixedLaw P n b) = | |
| (β« z, enrichedNextPatternCGF n h u Ξ½ Ο m z βenrichedFixedLaw P n b)/N := by | |
| rw [β integral_sub (enrichedFixed_pressure_integrable hN n b hb hh h0 u hu Ξ½ P hm hK hΟ (m+1)) | |
| (enrichedFixed_pressure_integrable hN n b hb hh h0 u hu Ξ½ P hm hK hΟ m), | |
| integral_congr_ae (enrichedFixed_pressure_increment hN n b hh h0 u hu Ξ½ P hK hΟ m),integral_div] | |
| rfl | |
| theorem enrichedMeanPressure_time_derivative {N : β} (hN : 0 < N) (n : β) (b : β β β) | |
| (hb : CascadeExponents n b) {h : β β β} (hh : Monotone h) (h0 : 0 β€ h 0) | |
| (u : Fin N β β) (hu : β j, |u j| β€ 2) (Ξ½ : Measure (Spin N)) [IsProbabilityMeasure Ξ½] | |
| {A : Type*} [MeasurableSpace A] (P : Measure A) [IsProbabilityMeasure P] | |
| {Ο : A β Spin N β β} (hm : Measurable Ο) {K : β} (hK : 0 β€ K) | |
| (hΟ : β y x, |Ο y x| β€ K) {t : β} (ht : 0 < t) : | |
| HasDerivAt (fun s => -enrichedMeanPressure P (Real.toNNReal (N*s)) n b h u Ξ½ Ο) | |
| (-(β« m, β« z, enrichedNextPatternCGF n h u Ξ½ Ο m z βenrichedFixedLaw P n b | |
| βpoissonMeasure (Real.toNNReal (N*t)))) t := by | |
| let a : β β β := fun m => β« z, enrichedCylinderPressure n h u Ξ½ Ο (enrichedCountJoin (m,z)) | |
| βenrichedFixedLaw P n b | |
| have hn : (0:β)<N := by exact_mod_cast hN | |
| have hstep := enrichedFixed_mean_step_bound hN n b hb hh h0 u hu Ξ½ P hm hK hΟ | |
| change β m, |a (m+1)-a m| β€ K/N at hstep | |
| have hd := ((poisson_count_derivative (div_nonneg hK hn.le) hstep ((N:β)*t)).comp t | |
| ((hasDerivAt_id t).const_mul (N:β))).neg | |
| simp only [mul_one] at hd | |
| have hdval : poissonMean (fun m => a (m+1)-a m) ((N:β)*t)*(N:β) = | |
| (β« m, β« z, enrichedNextPatternCGF n h u Ξ½ Ο m z βenrichedFixedLaw P n b | |
| βpoissonMeasure (Real.toNNReal (N*t))) := by | |
| rw [β Real.coe_toNNReal ((N:β)*t) (mul_nonneg hn.le ht.le),poissonMean_eq_integral] | |
| have he (m : β) : a (m+1)-a m = | |
| (β« z, enrichedNextPatternCGF n h u Ξ½ Ο m z βenrichedFixedLaw P n b)/N := | |
| enrichedFixed_mean_increment hN n b hb hh h0 u hu Ξ½ P hm hK hΟ m | |
| simp_rw [he] | |
| rw [integral_div,div_mul_cancelβ _ hn.ne'] | |
| simp [max_eq_left (mul_nonneg hn.le ht.le)] | |
| rw [hdval] at hd | |
| apply hd.congr_of_eventuallyEq | |
| filter_upwards [isOpen_Ioi.mem_nhds ht] with s hs | |
| congr 1 | |
| rw [enrichedMeanPressure_eq_poissonMean hN n b hb hh h0 u hu Ξ½ P hm hK hΟ, | |
| Real.coe_toNNReal _ (mul_nonneg hn.le hs.le)] | |
| rfl | |
| end IsingPerceptron | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped BigOperators Topology ENNReal NNReal | |
| namespace IsingPerceptron | |
| lemma random_cylinder_cgf_amplitude_cost {Ξ© X : Type*} | |
| [MeasurableSpace Ξ©] [MeasurableSpace X] [Countable X] [MeasurableSingletonClass X] | |
| {P : Measure Ξ©} [IsProbabilityMeasure P] {Ξ½ : Ξ© β Measure X} | |
| (hΞ½ : Measurable Ξ½) [β Ο, IsProbabilityMeasure (Ξ½ Ο)] | |
| (A : X β β ββ β) (hA : β x, (A x).sum (fun _ c => c^2) β€ 1) | |
| {d : β} (hd : β x, cylinderCross (A x) (A x) = d) (hd0 : 0 β€ d) (hd1 : d β€ 1) | |
| (a : β) {v w : β} (hv : |v| β€ 2) (hw : |w| β€ 2) : | |
| |(β« z : Ξ© Γ (β β β), cgf (fun x => cylinderField (A x) z.2) (Ξ½ z.1) (a*v) | |
| βP.prod gaussianCoordinates)- | |
| (β« z : Ξ© Γ (β β β), cgf (fun x => cylinderField (A x) z.2) (Ξ½ z.1) (a*w) | |
| βP.prod gaussianCoordinates)| β€ (4*a^2)*|v-w| := by | |
| let F := fun t => β« z : Ξ© Γ (β β β), cgf (fun x => cylinderField (A x) z.2) (Ξ½ z.1) (a*t) | |
| βP.prod gaussianCoordinates | |
| let R := fun t => randomReplicaAverage P Ξ½ A (a*t) | |
| (fun Ο : Fin 2 β X => cylinderCross (A (Ο 1)) (A (Ο 0))) | |
| have hR (t : β) : |R t| β€ 1 := randomReplicaAverage_abs_le hΞ½ A (a*t) _ zero_le_one | |
| (fun Ο => by simpa using cylinderCross_bound A hA (Ο 1) (Ο 0)) | |
| have hder (t : β) : HasDerivAt F ((a*t*(d-R t))*a) t := by | |
| simpa only [F,R,mul_one,id_eq,Function.comp_def] using (hasDerivAt_random_cylinder_covariance hΞ½ A hA hd (a*t)).comp t | |
| ((hasDerivAt_id t).const_mul a) | |
| have hbound (t : β) (ht : t β Icc (-2:β) 2) : |(a*t*(d-R t))*a| β€ 4*a^2 := by | |
| have ht' : |t| β€ 2 := abs_le.mpr ht | |
| have hd' : |d-R t| β€ 2 := (abs_sub _ _).trans (by rw [abs_of_nonneg hd0]; linarith [hR t]) | |
| rw [abs_mul,abs_mul,abs_mul] | |
| calc | |
| _ β€ (|a| *2*2)* |a| := mul_le_mul_of_nonneg_right | |
| (mul_le_mul (mul_le_mul_of_nonneg_left ht' (abs_nonneg a)) hd' (abs_nonneg _) (by positivity)) (abs_nonneg a) | |
| _ = _ := by nlinarith [sq_abs a] | |
| have he := (convex_Icc (-2:β) 2).norm_image_sub_le_of_norm_hasDerivWithin_le | |
| (fun t _ => (hder t).hasDerivWithinAt) (fun t ht => hbound t ht) | |
| (abs_le.mp hw) (abs_le.mp hv) | |
| simpa only [Real.norm_eq_abs] using he | |
| lemma enriched_coordinate_lipschitz {N : β} (hN : 0 < N) (n : β) (b : β β β) | |
| (hb : CascadeExponents n b) {h : β β β} (hh : Monotone h) (h0 : 0 β€ h 0) | |
| (u : Fin N β β) (hu : β j, |u j| β€ 2) (j : Fin N) {v w : β} | |
| (hv : |v| β€ 2) (hw : |w| β€ 2) | |
| (Ξ½ : Measure (Spin N)) [IsProbabilityMeasure Ξ½] | |
| {A : Type*} [MeasurableSpace A] (P : Measure A) [IsProbabilityMeasure P] | |
| {Ο : A β Spin N β β} (hm : Measurable Ο) {K : β} (hK : 0 β€ K) | |
| (hΟ : β y x, |Ο y x| β€ K) (r : ββ₯0) : | |
| |enrichedMeanPressure P r n b h (Function.update u j v) Ξ½ Ο- | |
| enrichedMeanPressure P r n b h (Function.update u j w) Ξ½ Ο| β€ | |
| (4*(perturbationAmplitude N j)^2/N)*|v-w| := by | |
| have hdiag (x : Spin N Γ LabeledLeaf n) := monomialCoefficients_variance hN n (monomialIndex j).1 (monomialIndex j).2 x | |
| simp_rw [β cylinderCross_self] at hdiag | |
| have hc := random_cylinder_cgf_amplitude_cost (P := enrichedFrozenLaw P r n b j) | |
| (measurable_enrichedFrozenReference n h u j Ξ½ hm) | |
| (monomialCoefficients n (monomialIndex j).1 (monomialIndex j).2) | |
| (monomialCoefficients_variance_le hN n (monomialIndex j).1 (monomialIndex j).2) | |
| hdiag (monomialPath_nonneg n (monomialIndex j).2 n) (monomialPath_diag_le_one n (monomialIndex j).2) | |
| (perturbationAmplitude N j) hv hw | |
| change |(β« z, enrichedCGF n h u j Ξ½ Ο v z β(enrichedFrozenLaw P r n b j).prod gaussianCoordinates)- | |
| (β« z, enrichedCGF n h u j Ξ½ Ο w z β(enrichedFrozenLaw P r n b j).prod gaussianCoordinates)| β€ _ at hc | |
| rw [(enrichedCGF_integral hN n b hb hh h0 u hu j hv Ξ½ P hm hK hΟ r).2, | |
| (enrichedCGF_integral hN n b hb hh h0 u hu j hw Ξ½ P hm hK hΟ r).2] at hc | |
| have hn : (0:β)<N := by exact_mod_cast hN | |
| rw [β mul_sub,sub_sub_sub_cancel_right,abs_mul,abs_of_pos hn] at hc | |
| rw [div_mul_eq_mul_div] | |
| apply (le_div_iffβ hn).mpr | |
| nlinarith [hc] | |
| lemma cube_coordinate_sum_bound {ΞΉ : Type*} [Fintype ΞΉ] [DecidableEq ΞΉ] | |
| (F : (ΞΉ β β) β β) (C : ΞΉ β β) | |
| (hF : β (u : ΞΉ β β), (β j, |u j| β€ 2) β β (j : ΞΉ) (v w : β), | |
| |v| β€ 2 β |w| β€ 2 β |F (Function.update u j v)-F (Function.update u j w)| β€ C j*|v-w|) | |
| {u v : ΞΉ β β} (hu : β j, |u j| β€ 2) (hv : β j, |v j| β€ 2) : | |
| |F u-F v| β€ β j, C j*|u j-v j| := by | |
| let mix := fun (s : Finset ΞΉ) j => if j β s then u j else v j | |
| have hm (s : Finset ΞΉ) : β j, |mix s j| β€ 2 := by | |
| intro j; dsimp only [mix]; split_ifs; exact hu j; exact hv j | |
| have hs (s : Finset ΞΉ) : |F (mix s)-F v| β€ β j β s, C j*|u j-v j| := by | |
| induction s using Finset.induction_on with | |
| | empty => simp [mix] | |
| | @insert j s hj ih => | |
| have he : mix (insert j s) = Function.update (mix s) j (u j) := by | |
| ext k; by_cases hk : k=j <;> simp [mix,hk] | |
| have he' : Function.update (mix s) j (v j) = mix s := by | |
| apply Function.update_eq_self_iff.mpr | |
| simp [mix,hj] | |
| have hb := hF (mix s) (hm s) j (u j) (v j) (hu j) (hv j) | |
| rw [he'] at hb | |
| rw [he,Finset.sum_insert hj] | |
| exact (abs_sub_le (F (Function.update (mix s) j (u j))) (F (mix s)) (F v)).trans | |
| (add_le_add hb ih) | |
| simpa [mix] using hs Finset.univ | |
| theorem enrichedMeanPressure_perturbation_lipschitz {N : β} (hN : 0 < N) (n : β) (b : β β β) | |
| (hb : CascadeExponents n b) {h : β β β} (hh : Monotone h) (h0 : 0 β€ h 0) | |
| {u v : Fin N β β} (hu : β j, |u j| β€ 2) (hv : β j, |v j| β€ 2) | |
| (Ξ½ : Measure (Spin N)) [IsProbabilityMeasure Ξ½] | |
| {A : Type*} [MeasurableSpace A] (P : Measure A) [IsProbabilityMeasure P] | |
| {Ο : A β Spin N β β} (hm : Measurable Ο) {K : β} (hK : 0 β€ K) | |
| (hΟ : β y x, |Ο y x| β€ K) (r : ββ₯0) : | |
| |enrichedMeanPressure P r n b h u Ξ½ Ο-enrichedMeanPressure P r n b h v Ξ½ Ο| β€ | |
| β j : Fin N, (4*(perturbationAmplitude N j)^2/N)*|u j-v j| := | |
| cube_coordinate_sum_bound (fun w => enrichedMeanPressure P r n b h w Ξ½ Ο) | |
| (fun (j : Fin N) => 4*(perturbationAmplitude N j)^2/N) (fun w hw j _ _ hx hy => | |
| enriched_coordinate_lipschitz hN n b hb hh h0 w hw j hx hy Ξ½ P hm hK hΟ r) hu hv | |
| end IsingPerceptron | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped BigOperators Topology ENNReal NNReal | |
| namespace IsingPerceptron | |
| lemma poissonMean_lipschitz {a : β β β} {K : β} (hK : 0 β€ K) | |
| (ha : β n, |a (n+1)-a n| β€ K) {r s : β} (hr : 0 β€ r) (hs : 0 β€ s) : | |
| |poissonMean a r-poissonMean a s| β€ K*|r-s| := by | |
| have hd := fun t (_ : t β Ici (0:β)) => (poisson_count_derivative hK ha t).hasDerivWithinAt (s := Ici 0) | |
| have hb (t : β) (ht : t β Ici (0:β)) : | |
| βpoissonMean (fun n => a (n+1)-a n) tβ β€ K := by | |
| rw [Real.norm_eq_abs] | |
| exact poissonMean_derivative_bound hK ha (β¨t,htβ© : ββ₯0) | |
| simpa only [Real.norm_eq_abs] using | |
| (convex_Ici (0:β)).norm_image_sub_le_of_norm_hasDerivWithin_le hd hb (show s β Ici 0 from hs) (show r β Ici 0 from hr) | |
| theorem enrichedMeanPressure_time_lipschitz {N : β} (hN : 0 < N) (n : β) (b : β β β) | |
| (hb : CascadeExponents n b) {h : β β β} (hh : Monotone h) (h0 : 0 β€ h 0) | |
| (u : Fin N β β) (hu : β j, |u j| β€ 2) (Ξ½ : Measure (Spin N)) [IsProbabilityMeasure Ξ½] | |
| {A : Type*} [MeasurableSpace A] (P : Measure A) [IsProbabilityMeasure P] | |
| {Ο : A β Spin N β β} (hm : Measurable Ο) {K : β} (hK : 0 β€ K) | |
| (hΟ : β y x, |Ο y x| β€ K) (r s : ββ₯0) : | |
| |enrichedMeanPressure P r n b h u Ξ½ Ο-enrichedMeanPressure P s n b h u Ξ½ Ο| β€ | |
| (K/N)*|(r:β)-s| := by | |
| rw [enrichedMeanPressure_eq_poissonMean hN n b hb hh h0 u hu Ξ½ P hm hK hΟ, | |
| enrichedMeanPressure_eq_poissonMean hN n b hb hh h0 u hu Ξ½ P hm hK hΟ] | |
| exact poissonMean_lipschitz (div_nonneg hK (Nat.cast_nonneg N)) | |
| (enrichedFixed_mean_step_bound hN n b hb hh h0 u hu Ξ½ P hm hK hΟ) r.coe_nonneg s.coe_nonneg | |
| end IsingPerceptron | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped BigOperators Topology ENNReal NNReal | |
| namespace IsingPerceptron | |
| abbrev ContactParameter (n N : β) := ββ₯0 Γ (Fin (n+1) β β) Γ (Fin N β β) | |
| def contactRegion (n N : β) (rmax : ββ₯0) (H : β) : Set (ContactParameter n N) := | |
| Icc (0, (fun _ => 0), (fun _ => 1)) (rmax, (fun _ => H), (fun _ => 2)) β© | |
| {p | (β j, p.2.1 j) β€ H} | |
| lemma contactRegion_nonneg {n N : β} {rmax : ββ₯0} {H : β} {p : ContactParameter n N} | |
| (hp : p β contactRegion n N rmax H) : | |
| 0 β€ p.1 β§ p.1 β€ rmax β§ (β j, 0 β€ p.2.1 j) β§ (β j, p.2.1 j) β€ H β§ | |
| β j, p.2.2 j β Icc (1:β) 2 := by | |
| exact β¨hp.1.1.1,hp.1.2.1,hp.1.1.2.1,hp.2,fun j => β¨hp.1.1.2.2 j,hp.1.2.2.2 jβ©β© | |
| lemma contactRegion_mem {n N : β} {rmax : ββ₯0} {H : β} {p : ContactParameter n N} | |
| (hr : p.1 β€ rmax) (ha : β j, 0 β€ p.2.1 j) (hcap : (β j, p.2.1 j) β€ H) | |
| (hu : β j, p.2.2 j β Icc (1:β) 2) : p β contactRegion n N rmax H := by | |
| refine β¨β¨β¨bot_le,ha,fun j => (hu j).1β©,hr,?_,fun j => (hu j).2β©,hcapβ© | |
| intro j | |
| exact (Finset.single_le_sum (fun k _ => ha k) (Finset.mem_univ j)).trans hcap | |
| lemma isCompact_contactRegion (n N : β) (rmax : ββ₯0) (H : β) : | |
| IsCompact (contactRegion n N rmax H) := | |
| isCompact_Icc.inter_right (isClosed_le (by fun_prop) continuous_const) | |
| lemma contactRegion_nonempty (n N : β) (rmax : ββ₯0) {H : β} (hH : 0 β€ H) : | |
| (contactRegion n N rmax H).Nonempty := by | |
| refine β¨(0,fun _ => 0,fun _ => (3:β)/2),contactRegion_mem bot_le (fun _ => le_rfl) ?_ ?_β© | |
| Β· simpa using hH | |
| Β· intro j; norm_num | |
| lemma enrichedMeanPressure_parameters_continuousOn {N : β} (hN : 0 < N) | |
| (n : β) (b : β β β) (hb : CascadeExponents n b) | |
| (Ξ½ : Measure (Spin N)) [IsProbabilityMeasure Ξ½] | |
| {A : Type*} [MeasurableSpace A] (P : Measure A) [IsProbabilityMeasure P] | |
| {Ο : A β Spin N β β} (hm : Measurable Ο) {K : β} (hK : 0 β€ K) | |
| (hΟ : β y x, |Ο y x| β€ K) {s : Set (ContactParameter n N)} | |
| (hs : β p β s, (β j, 0 β€ p.2.1 j) β§ β j, |p.2.2 j| β€ 2) : | |
| ContinuousOn (fun p => enrichedMeanPressure P p.1 n b (finiteFieldPath p.2.1) p.2.2 Ξ½ Ο) s := by | |
| let F := fun p : ContactParameter n N => | |
| enrichedMeanPressure P p.1 n b (finiteFieldPath p.2.1) p.2.2 Ξ½ Ο | |
| have hbnd (p q : s) : |F p-F q| β€ | |
| (K/N)*|(p.val.1:β)-q.val.1| + (β j, |p.val.2.1 j-q.val.2.1 j|)/2 + | |
| β j : Fin N, (4*(perturbationAmplitude N j)^2/N)*|p.val.2.2 j-q.val.2.2 j| := by | |
| have hp := hs p p.property | |
| have hq := hs q q.property | |
| have hr := enrichedMeanPressure_time_lipschitz hN n b hb (monotone_finiteFieldPath hp.1) | |
| (finiteFieldPath_nonneg hp.1 0) p.val.2.2 hp.2 Ξ½ P hm hK hΟ p.val.1 q.val.1 | |
| have ha := enrichedMeanPressure_field_lipschitz hN n b hb hp.1 hq.1 p.val.2.2 hp.2 Ξ½ P hm hK hΟ q.val.1 | |
| have hu := enrichedMeanPressure_perturbation_lipschitz hN n b hb (monotone_finiteFieldPath hq.1) | |
| (finiteFieldPath_nonneg hq.1 0) hp.2 hq.2 Ξ½ P hm hK hΟ q.val.1 | |
| have ht1 := abs_sub_le (F p) | |
| (enrichedMeanPressure P q.val.1 n b (finiteFieldPath p.val.2.1) p.val.2.2 Ξ½ Ο) | |
| (enrichedMeanPressure P q.val.1 n b (finiteFieldPath q.val.2.1) p.val.2.2 Ξ½ Ο) | |
| have ht2 := abs_sub_le (F p) | |
| (enrichedMeanPressure P q.val.1 n b (finiteFieldPath q.val.2.1) p.val.2.2 Ξ½ Ο) (F q) | |
| dsimp only [F] at * | |
| linarith | |
| rw [continuousOn_iff_continuous_domRestrict] | |
| apply continuous_iff_continuousAt.mpr | |
| intro q | |
| apply tendsto_iff_norm_sub_tendsto_zero.mpr | |
| let E := fun p : s => | |
| (K/N)*|(p.val.1:β)-q.val.1| + (β j, |p.val.2.1 j-q.val.2.1 j|)/2 + | |
| β j : Fin N, (4*(perturbationAmplitude N j)^2/N)*|p.val.2.2 j-q.val.2.2 j| | |
| have hE : Continuous E := by fun_prop | |
| have hEq : E q = 0 := by simp [E] | |
| apply squeeze_zero' (Eventually.of_forall (fun _ => norm_nonneg _)) | |
| (Eventually.of_forall (fun p => by simpa only [Real.norm_eq_abs, F, Set.domRestrict_apply] using hbnd p q)) | |
| simpa only [hEq] using (hE.continuousAt (x := q)).tendsto | |
| def enrichedContactObjective {N : β} {A : Type*} [MeasurableSpace A] | |
| (P : Measure A) (n : β) (b : β β β) (Ξ½ : Measure (Spin N)) (Ο : A β Spin N β β) | |
| (c : Fin (n+1) β β) (S v : β) (p : ContactParameter n N) : β := | |
| -enrichedMeanPressure P p.1 n b (finiteFieldPath p.2.1) p.2.2 Ξ½ Ο - | |
| (β i, c i*finiteFieldPath p.2.1 i)/2 + S + ((p.1:β)/N)*v + | |
| β j : Fin N, perturbationWeight j * (p.2.2 j-3/2)^2 | |
| lemma continuous_enrichedContactPenalty {N n : β} (c : Fin (n+1) β β) (S v : β) : | |
| Continuous (fun p : ContactParameter n N => -(β i, c i*finiteFieldPath p.2.1 i)/2 + | |
| S + ((p.1:β)/N)*v + β j : Fin N, perturbationWeight j*(p.2.2 j-3/2)^2) := by | |
| have hf (i : Fin (n+1)) : Continuous (fun p : ContactParameter n N => finiteFieldPath p.2.1 i) := by | |
| unfold finiteFieldPath | |
| apply continuous_finsetSum | |
| intro j _ | |
| split_ifs <;> fun_prop | |
| exact (((((continuous_finsetSum _ (fun i _ => continuous_const.mul (hf i))).neg).div_const 2).add | |
| continuous_const).add ((by fun_prop : Continuous (fun p : ContactParameter n N => (p.1:β)/N)).mul continuous_const)).add | |
| (continuous_finsetSum _ (fun j _ => by fun_prop)) | |
| theorem enrichedContactObjective_exists_minimum {N : β} (hN : 0 < N) | |
| (n : β) (b : β β β) (hb : CascadeExponents n b) | |
| (Ξ½ : Measure (Spin N)) [IsProbabilityMeasure Ξ½] | |
| {A : Type*} [MeasurableSpace A] (P : Measure A) [IsProbabilityMeasure P] | |
| {Ο : A β Spin N β β} (hm : Measurable Ο) {K : β} (hK : 0 β€ K) | |
| (hΟ : β y x, |Ο y x| β€ K) (rmax : ββ₯0) {H : β} (hH : 0 β€ H) | |
| (c : Fin (n+1) β β) (S v : β) : | |
| β p β contactRegion n N rmax H, | |
| IsMinOn (enrichedContactObjective P n b Ξ½ Ο c S v) (contactRegion n N rmax H) p := by | |
| apply (isCompact_contactRegion n N rmax H).exists_isMinOn (contactRegion_nonempty n N rmax hH) | |
| have hc := enrichedMeanPressure_parameters_continuousOn hN n b hb Ξ½ P hm hK hΟ | |
| (s := contactRegion n N rmax H) (fun p hp => by | |
| have h := contactRegion_nonneg hp | |
| exact β¨h.2.2.1,fun j => abs_le.mpr β¨by linarith [(h.2.2.2.2 j).1],(h.2.2.2.2 j).2β©β©) | |
| have he := hc.neg.add (continuous_enrichedContactPenalty c S v).continuousOn | |
| convert he using 1 | |
| ext p | |
| simp only [enrichedContactObjective,sub_eq_add_neg,Pi.add_apply,Pi.neg_apply] | |
| ring | |
| end IsingPerceptron | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped BigOperators Topology ENNReal NNReal | |
| namespace IsingPerceptron | |
| lemma right_derivative_nonneg_of_min {F : β β β} {D : β} | |
| (hD : HasDerivWithinAt F D (Ici 0) 0) | |
| (hmin : βαΆ a in π[>] (0:β), F 0 β€ F a) : 0 β€ D := by | |
| have ht := (hasDerivWithinAt_iff_tendsto_slope' (show (0:β) β Ioi 0 by simp)).mp | |
| (hD.mono Ioi_subset_Ici_self) | |
| apply ge_of_tendsto ht | |
| filter_upwards [hmin,self_mem_nhdsWithin] with a ha ha' | |
| simpa only [slope_def_field,sub_zero] using div_nonneg (sub_nonneg.mpr ha) ha'.le | |
| def enrichedFieldObjective {N : β} {A : Type*} [MeasurableSpace A] | |
| (P : Measure A) (r : ββ₯0) (n : β) (b : β β β) | |
| (u : Fin N β β) (Ξ½ : Measure (Spin N)) (Ο : A β Spin N β β) | |
| (c : Fin (n+1) β β) (h : β β β) : β := | |
| -enrichedMeanPressure P r n b h u Ξ½ Ο - (β i, c i*h i)/2 | |
| theorem enriched_field_minimum_cone {N : β} (hN : 0 < N) (n : β) (b : β β β) | |
| (hb : CascadeExponents n b) {h l : β β β} | |
| (hh : Monotone h) (h0 : 0 β€ h 0) (hl : Monotone l) (l0 : 0 β€ l 0) | |
| (u : Fin N β β) (hu : β j, |u j| β€ 2) (Ξ½ : Measure (Spin N)) [IsProbabilityMeasure Ξ½] | |
| {A : Type*} [MeasurableSpace A] (P : Measure A) [IsProbabilityMeasure P] | |
| {Ο : A β Spin N β β} (hm : Measurable Ο) {K : β} (hK : 0 β€ K) | |
| (hΟ : β y x, |Ο y x| β€ K) (r : ββ₯0) (c : Fin (n+1) β β) | |
| {H : β} (hcap : h n < H) | |
| (hmin : β g : β β β, Monotone g β 0 β€ g 0 β g n β€ H β | |
| enrichedFieldObjective P r n b u Ξ½ Ο c h β€ enrichedFieldObjective P r n b u Ξ½ Ο c g) : | |
| (β i, c i*l i) β€ enrichedReplicaAverage P r n b h u Ξ½ Ο | |
| (fun Ο : Fin 2 β Spin N Γ LabeledLeaf n => | |
| spinOverlap (Ο 1).1 (Ο 0).1*l (labeledCommonDepth n (Ο 1).2 (Ο 0).2)) := by | |
| let R := enrichedReplicaAverage P r n b h u Ξ½ Ο | |
| (fun Ο : Fin 2 β Spin N Γ LabeledLeaf n => | |
| spinOverlap (Ο 1).1 (Ο 0).1*l (labeledCommonDepth n (Ο 1).2 (Ο 0).2)) | |
| have hd := enrichedMeanPressure_field_derivative hN n b hb hh h0 hl l0 u hu Ξ½ P hm hK hΟ r | |
| have hs : HasDerivAt (fun a : β => β i : Fin (n+1), c i*(h i+a*l i)) | |
| (β i : Fin (n+1), c i*l i) 0 := by | |
| simpa only [one_mul, id_eq] using HasDerivAt.fun_sum | |
| (fun (i : Fin (n+1)) (_ : i β Finset.univ) => | |
| (((hasDerivAt_id (0:β)).mul_const (l i)).const_add (h i)).const_mul (c i)) | |
| have hD : HasDerivWithinAt (fun a => enrichedFieldObjective P r n b u Ξ½ Ο c (fun i => h i+a*l i)) | |
| (R/2-(β i, c i*l i)/2) (Ici 0) 0 := hd.sub (hs.div_const 2).hasDerivWithinAt | |
| have hfeas : βαΆ a in π[>] (0:β), h n+a*l n < H := by | |
| have hc : ContinuousAt (fun a : β => h n+a*l n) 0 := by fun_prop | |
| exact (hc.eventually (gt_mem_nhds (by simpa using hcap))).filter_mono nhdsWithin_le_nhds | |
| have hnon := right_derivative_nonneg_of_min hD (by | |
| filter_upwards [hfeas,self_mem_nhdsWithin] with a ha ha' | |
| have hg : Monotone (fun i => h i+a*l i) := hh.add (hl.const_mul ha'.le) | |
| simpa only [zero_mul,add_zero] using hmin (fun i => h i+a*l i) hg | |
| (add_nonneg h0 (mul_nonneg ha'.le l0)) ha.le) | |
| change (β i, c i*l i) β€ R | |
| linarith | |
| end IsingPerceptron | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped BigOperators Topology ENNReal NNReal | |
| namespace IsingPerceptron | |
| lemma finiteFieldPath_const_mul {n : β} (a : Fin (n+1) β β) (t : β) : | |
| finiteFieldPath (fun i => t*a i) = fun i => t*finiteFieldPath a i := by | |
| ext i | |
| simp only [finiteFieldPath,Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro j _ | |
| split_ifs <;> simp | |
| lemma enriched_contact_perturbation_minimum {N n : β} {A : Type*} [MeasurableSpace A] | |
| (P : Measure A) (b : β β β) (Ξ½ : Measure (Spin N)) (Ο : A β Spin N β β) | |
| (c : Fin (n+1) β β) (S v : β) {rmax : ββ₯0} {H : β} {p : ContactParameter n N} | |
| (hp : pβcontactRegion n N rmax H) | |
| (hmin : IsMinOn (enrichedContactObjective P n b Ξ½ Ο c S v) (contactRegion n N rmax H) p) | |
| (u : Fin N β β) (hu : β j, u jβIcc (1:β) 2) : | |
| enrichedPerturbationObjective P p.1 n b (finiteFieldPath p.2.1) Ξ½ Ο p.2.2 β€ | |
| enrichedPerturbationObjective P p.1 n b (finiteFieldPath p.2.1) Ξ½ Ο u := by | |
| have hp' := contactRegion_nonneg hp | |
| have hq : (p.1,p.2.1,u) β contactRegion n N rmax H := | |
| contactRegion_mem hp'.2.1 hp'.2.2.1 hp'.2.2.2.1 hu | |
| have H := hmin hq | |
| simp only [Set.mem_ofPred_eq, enrichedContactObjective,enrichedPerturbationObjective] at H β’ | |
| linarith | |
| lemma enriched_contact_time_minimum {N n : β} {A : Type*} [MeasurableSpace A] | |
| (P : Measure A) (b : β β β) (Ξ½ : Measure (Spin N)) (Ο : A β Spin N β β) | |
| (c : Fin (n+1) β β) (S v : β) {rmax : ββ₯0} {H : β} {p : ContactParameter n N} | |
| (hp : pβcontactRegion n N rmax H) | |
| (hmin : IsMinOn (enrichedContactObjective P n b Ξ½ Ο c S v) (contactRegion n N rmax H) p) | |
| (r : ββ₯0) (hr : rβ€rmax) : | |
| -enrichedMeanPressure P p.1 n b (finiteFieldPath p.2.1) p.2.2 Ξ½ Ο+((p.1:β)/N)*v β€ | |
| -enrichedMeanPressure P r n b (finiteFieldPath p.2.1) p.2.2 Ξ½ Ο+((r:β)/N)*v := by | |
| have hp' := contactRegion_nonneg hp | |
| have hq : (r,p.2.1,p.2.2) β contactRegion n N rmax H := | |
| contactRegion_mem hr hp'.2.2.1 hp'.2.2.2.1 hp'.2.2.2.2 | |
| have H := hmin hq | |
| simp only [Set.mem_ofPred_eq, enrichedContactObjective] at H | |
| linarith | |
| theorem enriched_contact_cone {N : β} (hN : 0<N) (n : β) (b : β β β) (hb : CascadeExponents n b) | |
| (Ξ½ : Measure (Spin N)) [IsProbabilityMeasure Ξ½] {A : Type*} [MeasurableSpace A] | |
| (P : Measure A) [IsProbabilityMeasure P] {Ο : A β Spin N β β} (hm : Measurable Ο) | |
| {K : β} (hK : 0β€K) (hΟ : β y x, |Ο y x|β€K) | |
| (c : Fin (n+1) β β) (S v : β) {rmax : ββ₯0} {H : β} {p : ContactParameter n N} | |
| (hp : pβcontactRegion n N rmax H) | |
| (hmin : IsMinOn (enrichedContactObjective P n b Ξ½ Ο c S v) (contactRegion n N rmax H) p) | |
| (hcap : (β i, p.2.1 i)<H) (d : Fin (n+1) β β) (hd : β i, 0β€d i) : | |
| (β i, c i*finiteFieldPath d i) β€ enrichedReplicaAverage P p.1 n b (finiteFieldPath p.2.1) p.2.2 Ξ½ Ο | |
| (fun Ο : Fin 2 β Spin N Γ LabeledLeaf n => | |
| spinOverlap (Ο 1).1 (Ο 0).1*finiteFieldPath d (labeledCommonDepth n (Ο 1).2 (Ο 0).2)) := by | |
| have hp' := contactRegion_nonneg hp | |
| have hu : β j, |p.2.2 j|β€2 := fun j => abs_le.mpr β¨by linarith [(hp'.2.2.2.2 j).1],(hp'.2.2.2.2 j).2β© | |
| let h := finiteFieldPath p.2.1 | |
| let l := finiteFieldPath d | |
| let R := enrichedReplicaAverage P p.1 n b h p.2.2 Ξ½ Ο | |
| (fun Ο : Fin 2 β Spin N Γ LabeledLeaf n => spinOverlap (Ο 1).1 (Ο 0).1*l (labeledCommonDepth n (Ο 1).2 (Ο 0).2)) | |
| have hder := enrichedMeanPressure_field_derivative hN n b hb | |
| (monotone_finiteFieldPath hp'.2.2.1) (finiteFieldPath_nonneg hp'.2.2.1 0) | |
| (monotone_finiteFieldPath hd) (finiteFieldPath_nonneg hd 0) p.2.2 hu Ξ½ P hm hK hΟ p.1 | |
| have hs : HasDerivAt (fun t : β => β i : Fin (n+1), c i*(h i+t*l i)) (β i, c i*l i) 0 := by | |
| simpa only [one_mul,id_eq] using HasDerivAt.fun_sum (fun (i : Fin (n+1)) (_ : iβFinset.univ) => | |
| (((hasDerivAt_id (0:β)).mul_const (l i)).const_add (h i)).const_mul (c i)) | |
| have hD : HasDerivWithinAt (fun t => enrichedFieldObjective P p.1 n b p.2.2 Ξ½ Ο c (fun i => h i+t*l i)) | |
| (R/2-(β i, c i*l i)/2) (Ici 0) 0 := hder.sub (hs.div_const 2).hasDerivWithinAt | |
| have hfeas : βαΆ t in π[>] (0:β), (β i, p.2.1 i)+t*(β i, d i)<H := by | |
| have hc : ContinuousAt (fun t : β => (β i, p.2.1 i)+t*(β i, d i)) 0 := by fun_prop | |
| exact (hc.eventually (gt_mem_nhds (by simpa using hcap))).filter_mono nhdsWithin_le_nhds | |
| have hnon := right_derivative_nonneg_of_min hD (by | |
| filter_upwards [hfeas,self_mem_nhdsWithin] with t ht ht' | |
| have hnew : (p.1,(fun i => p.2.1 i+t*d i),p.2.2)βcontactRegion n N rmax H := | |
| contactRegion_mem hp'.2.1 (fun i => add_nonneg (hp'.2.2.1 i) (mul_nonneg ht'.le (hd i))) | |
| (by simpa only [Finset.sum_add_distrib,Finset.mul_sum] using ht.le) hp'.2.2.2.2 | |
| have H := hmin hnew | |
| simp only [Set.mem_ofPred_eq, enrichedContactObjective,finiteFieldPath_add,finiteFieldPath_const_mul] at H | |
| simp only [enrichedFieldObjective,zero_mul,add_zero] | |
| dsimp only [h,l] | |
| linarith) | |
| change (β i, c i*l i) β€ R | |
| linarith | |
| end IsingPerceptron | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped BigOperators Topology ENNReal NNReal | |
| namespace IsingPerceptron | |
| def depthTail (n j : β) (t : β) : β := if j=0 then 1 else treeTail n (j-1) t | |
| lemma continuous_depthTail (n j : β) : Continuous (depthTail n j) := by | |
| unfold depthTail | |
| split_ifs | |
| Β· exact continuous_const | |
| Β· exact continuous_treeTail n (j-1) | |
| lemma depthTail_mem (n j : β) (t : β) : depthTail n j tβIcc (0:β) 1 := by | |
| unfold depthTail | |
| split_ifs | |
| Β· exact β¨zero_le_one,le_rflβ© | |
| Β· exact treeTail_mem n (j-1) t | |
| lemma depthTail_level (n j d : β) : depthTail n j ((d:β)/(n+1:β)) = if j β€ d then 1 else 0 := by | |
| by_cases hj : j=0 | |
| Β· simp [depthTail,hj] | |
| Β· simp only [depthTail,hj,ite_false,treeTail_level,show j-1<d β j β€ d by omega] | |
| lemma finiteFieldPath_single {n : β} (j : Fin (n+1)) (i : β) : | |
| finiteFieldPath (Pi.single j (1:β)) i=if j.val β€ i then 1 else 0 := by | |
| classical | |
| unfold finiteFieldPath | |
| rw [Finset.sum_eq_single j] | |
| Β· simp | |
| Β· intro k _ hkj | |
| simp [Pi.single_eq_of_ne hkj] | |
| Β· simp | |
| lemma enrichedArrayLaw_depthTail {N : β} (hN : 0 < N) (n : β) (b : β β β) | |
| {h : β β β} (hh : Monotone h) (h0 : 0 β€ h 0) | |
| (u : Fin N β β) (hu : β j, |u j| β€ 2) (Ξ½ : Measure (Spin N)) [IsProbabilityMeasure Ξ½] | |
| {A : Type*} [MeasurableSpace A] (P : Measure A) [IsProbabilityMeasure P] | |
| {Ο : A β Spin N β β} (hm : Measurable Ο) {K : β} (hK : 0 β€ K) | |
| (hΟ : β y x, |Ο y x| β€ K) (r : ββ₯0) (j : Fin (n+1)) : | |
| (β« x, spinArray x 0 1*depthTail n j (treeArray x 0 1) | |
| β(enrichedArrayLaw P r n b h u Ξ½ hm : Measure JointArray)) = | |
| enrichedReplicaAverage P r n b h u Ξ½ Ο (fun Ο : Fin 2 β Spin N Γ LabeledLeaf n => | |
| spinOverlap (Ο 1).1 (Ο 0).1*finiteFieldPath (Pi.single j (1:β)) | |
| (labeledCommonDepth n (Ο 1).2 (Ο 0).2)) := by | |
| rw [enrichedArrayLaw_integral P r n b h u Ξ½ hm | |
| (fun x => spinArray x 0 1*depthTail n j (treeArray x 0 1)) | |
| ((by unfold spinArray; fun_prop : Continuous (fun x : JointArray => spinArray x 0 1)).mul | |
| ((continuous_depthTail n j).comp (by unfold treeArray; fun_prop))).measurable] | |
| let D : (Fin 2 β Spin N Γ LabeledLeaf n) β β := fun Ο => | |
| spinOverlap (Ο 1).1 (Ο 0).1*finiteFieldPath (Pi.single j (1:β)) | |
| (labeledCommonDepth n (Ο 1).2 (Ο 0).2) | |
| have hbD (Ο) : |D Ο| β€ 1 := by | |
| dsimp only [D] | |
| rw [finiteFieldPath_single] | |
| split_ifs | |
| Β· simpa using abs_spinOverlap_le hN (Ο 1).1 (Ο 0).1 | |
| Β· simp | |
| have he := enrichedReplicaLaw_integral hN n b hh h0 u hu Ξ½ P hm hK hΟ r D hbD | |
| (fun i : Fin 2 => i.val) Fin.val_injective | |
| rw [β he] | |
| apply integral_congr_ae | |
| apply ae_of_all | |
| intro Ο | |
| change spinOverlap (Ο 0).1 (Ο 1).1*depthTail n j (treeOverlap n (Ο 0).2 (Ο 1).2)=_ | |
| rw [treeOverlap,depthTail_level] | |
| simp only [D,finiteFieldPath_single,Fin.val_zero,Fin.val_one] | |
| rw [spinOverlap_symm,labeledCommonDepth_symm] | |
| end IsingPerceptron | |
| end | |
| end OAI | |