Download data/lean/OAI/Probability/Perceptron/Variational/EnergyMean.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 9.4 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/Perceptron/Variational/EnergyMean.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/Perceptron/Variational/EnergyMean.lean
-
curl -L -o EnergyMean.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/Perceptron/Variational/EnergyMean.lean
9.4 kB
| import Mathlib | |
| import OAI.Probability.Perceptron.Pressure.KernelEnergyConcentration | |
| import OAI.Probability.Perceptron.Variational.AnnealedIBP | |
| namespace OAI | |
| noncomputable section | |
| namespace SphericalPerceptronFreeEnergy | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped Topology NNReal ENNReal BigOperators BoundedContinuousFunction | |
| lemma gibbsReplicaMean_const_of_integrable {S : Type*} [MeasurableSpace S] | |
| (ΞΌ : Measure S) [IsProbabilityMeasure ΞΌ] {H : S β β} (hH : Measurable H) | |
| (he : Integrable (fun x => Real.exp (H x)) ΞΌ) (r : β) (c : β) : | |
| gibbsReplicaMean ΞΌ H r (fun _ => c) = c := by | |
| let := tilt_law_probability_of_integrable ΞΌ (by simpa only [one_mul] using he : | |
| Integrable (fun x => Real.exp (1*H x)) ΞΌ) | |
| rw [gibbsReplicaMean_integral_of_integrable ΞΌ hH he] | |
| simp | |
| lemma sourceCoupling_exp_integrable_ae (n k : β) (f : β βα΅ β) | |
| (p d : Fin (n+1) β β) (h : Fin (k+1) β β) | |
| (hh0 : β l, 0 β€ h l) (hh : Monotone h) (u : Fin (n+1) β β) | |
| (j : Fin (n+1)) (z : Fin k β β) (t : ββ₯0) : | |
| βα΅ a β(sourceBaseDataLaw n k z t).prod countableGaussianLaw, | |
| Integrable (fun x => Real.exp (sourceCouplingHamiltonian n k f p d h u a x)) (sourceSpinLeafKernel n k a.1) β§ | |
| Integrable (fun x => Real.exp (sourceCouplingHamiltonian n k f p d h u a x)* | |
| sourceCouplingEnergy n k p d h j a x) (sourceSpinLeafKernel n k a.1) := by | |
| have hH := sourceCouplingHamiltonian_measurable n k f p d h u | |
| have hY := sourceCouplingEnergy_measurable n k p d h j | |
| filter_upwards [sourceCoupling_all_exp_ae n k f p d h hh0 hh u j z t] with a ha | |
| constructor | |
| Β· simpa only [zero_mul,add_zero] using ha 0 | |
| Β· simpa only [zero_mul,add_zero,pow_one] using coupling_weighted_power_integrable | |
| (sourceSpinLeafKernel n k a.1) hH.of_uncurry_left hY.of_uncurry_left ha 0 1 | |
| lemma sourceCoupling_energy_mean (n k : β) (f : β βα΅ β) | |
| (p d : Fin (n+1) β β) (h : Fin (k+1) β β) | |
| (hh0 : β l, 0 β€ h l) (hh : Monotone h) (u : Fin (n+1) β β) | |
| (j : Fin (n+1)) (z : Fin k β β) (t : ββ₯0) | |
| (hYi : Integrable (fun a => tiltMean (sourceSpinLeafKernel n k a.1) | |
| (sourceCouplingHamiltonian n k f p d h u a) | |
| (fun x => |sourceCouplingEnergy n k p d h j a x|) 1) | |
| ((sourceBaseDataLaw n k z t).prod countableGaussianLaw)) : | |
| let H := sourceCouplingHamiltonian n k f p d h u | |
| let Y := sourceCouplingEnergy n k p d h j | |
| let C := sourceCouplingCovariance n k p d u j | |
| let P := (sourceBaseDataLaw n k z t).prod countableGaussianLaw | |
| (β« a, tiltMean (sourceSpinLeafKernel n k a.1) (H a) (Y a) 1 βP) = | |
| perturbationAmplitude (n+1) (fun _ => 1) j*perturbationAmplitude (n+1) u j* | |
| ((k:β)/(k+1:β))^(d j)- | |
| β« a, gibbsReplicaMean (sourceSpinLeafKernel n k a.1) (H a) 2 (fun x => C (x 1) (x 0)) βP := by | |
| dsimp only | |
| let P := (sourceBaseDataLaw n k z t).prod countableGaussianLaw | |
| let H := sourceCouplingHamiltonian n k f p d h u | |
| let C := sourceCouplingCovariance n k p d u j | |
| let D := perturbationAmplitude (n+1) (fun _ => 1) j*perturbationAmplitude (n+1) u j*((k:β)/(k+1:β))^(d j) | |
| have he := sourceCoupling_annealed_ibp n k 1 f p d h hh0 hh u j 0 z t | |
| (G := fun _ => 1) measurable_const (by norm_num : (0:β) β€ 1) (fun _ => by norm_num) hYi | |
| dsimp only at he | |
| simp only [mul_one,one_mul,Fin.sum_univ_one,Nat.cast_one,Fin.succ_zero_eq_one] at he | |
| have hAe := sourceCoupling_exp_integrable_ae n k f p d h hh0 hh u j z t | |
| have hleft : (fun a => gibbsReplicaMean (sourceSpinLeafKernel n k a.1) (H a) 1 | |
| (fun x => sourceCouplingEnergy n k p d h j a (x 0))) =α΅[P] | |
| (fun a => tiltMean (sourceSpinLeafKernel n k a.1) (H a) (sourceCouplingEnergy n k p d h j a) 1) := by | |
| filter_upwards [hAe] with a ha | |
| exact gibbsReplicaMean_coordinate_of_integrable _ (sourceCouplingHamiltonian_section n k f p d h u a) | |
| (sourceCouplingEnergy_section n k p d h j a) ha.1 1 0 | |
| have hdiag : β x : NormalizedSpin (n+1)ΓIndexedLeaf k, C x x = D := by | |
| intro x | |
| dsimp [C,sourceCouplingCovariance,D] | |
| rw [sourceJointMonomial_diagonal] | |
| have hright : (fun a => gibbsReplicaMean (sourceSpinLeafKernel n k a.1) (H a) 1 | |
| (fun x => C (x 0) (x 0))) =α΅[P] (fun _ => D) := by | |
| filter_upwards [hAe] with a ha | |
| simp only [hdiag] | |
| exact gibbsReplicaMean_const_of_integrable _ (sourceCouplingHamiltonian_section n k f p d h u a) ha.1 1 D | |
| have hI := kernel_replicaMean_bounded_integrable (sourceFullSpinLeafKernel n k) P | |
| (H := H) (G := fun _ (x : Fin 2 β NormalizedSpin (n+1)ΓIndexedLeaf k) => C (x 1) (x 0)) | |
| (sourceCouplingHamiltonian_measurable n k f p d h u) | |
| ((sourceCouplingCovariance_measurable n k 2 p d u j 1 0).comp measurable_snd) | |
| (abs_nonneg _) (fun _ x => sourceCouplingCovariance_bound n k p d u j _ _) | |
| dsimp only [sourceFullSpinLeafKernel,Kernel.comap_apply] at hI | |
| rw [integral_congr_ae hleft] at he | |
| have hr : (β« a, gibbsReplicaMean (sourceSpinLeafKernel n k a.1) (H a) 1 | |
| (fun x => C (x 0) (x 0))-gibbsReplicaMean (sourceSpinLeafKernel n k a.1) (H a) 2 | |
| (fun x => C (x 1) (x 0)) βP) = | |
| D-β« a, gibbsReplicaMean (sourceSpinLeafKernel n k a.1) (H a) 2 (fun x => C (x 1) (x 0)) βP := by | |
| calc | |
| _ = β« a, D-gibbsReplicaMean (sourceSpinLeafKernel n k a.1) (H a) 2 (fun x => C (x 1) (x 0)) βP := by | |
| apply integral_congr_ae | |
| filter_upwards [hright] with a ha | |
| rw [ha] | |
| _ = _ := by rw [integral_sub (integrable_const _) hI]; simp | |
| exact he.trans hr | |
| lemma source_contact_energy_concentration (n k : β) (f : β βα΅ β) (p d : Fin (n+1) β β) | |
| (h : Fin (k+1) β β) (hh0 : β l, 0 β€ h l) (hh : Monotone h) | |
| (u : Fin (n+1) β β) (j : Fin (n+1)) (z : Fin k β β) (hz : StrictMono z) | |
| (hz0 : β i, 0<z i) (hz1 : β i, z i<1) (t : ββ₯0) | |
| {H T c a s : β} (hH : 0 β€ H) (hhH : h 0 β€ H) (ht : (t:β) β€ T) (hs : 0<s) | |
| (hu : β l, u l β Icc 1 2) | |
| (hup : β l, (u+Pi.single j s : Fin (n+1) β β) l β Icc 1 2) (hum : β l, (u+Pi.single j (-s) : Fin (n+1) β β) l β Icc 1 2) | |
| (hmin : IsLocalMin (fun r => c*(r-a)^2- | |
| β« b, sourceKernelPressure n k f p d (u+Pi.single j r) h b | |
| β(sourceBaseDataLaw n k z t).prod countableGaussianLaw) 0) | |
| (hp : c*(0-a)^2-(β« b, sourceKernelPressure n k f p d u h b | |
| β(sourceBaseDataLaw n k z t).prod countableGaussianLaw) β€ c*(s-a)^2- | |
| β« b, sourceKernelPressure n k f p d (u+Pi.single j s) h b | |
| β(sourceBaseDataLaw n k z t).prod countableGaussianLaw) | |
| (hm : c*(0-a)^2-(β« b, sourceKernelPressure n k f p d u h b | |
| β(sourceBaseDataLaw n k z t).prod countableGaussianLaw) β€ c*(-s-a)^2- | |
| β« b, sourceKernelPressure n k f p d (u+Pi.single j (-s)) h b | |
| β(sourceBaseDataLaw n k z t).prod countableGaussianLaw) : | |
| let P := (sourceBaseDataLaw n k z t).prod countableGaussianLaw | |
| let Hβ := sourceCouplingHamiltonian n k f p d h u | |
| let Y := sourceCouplingEnergy n k p d h j | |
| let EY := β« b, tiltMean (sourceSpinLeafKernel n k b.1) (Hβ b) (Y b) 1 βP | |
| Integrable (fun b => tiltMean (sourceSpinLeafKernel n k b.1) (Hβ b) (fun x => |Y b x|) 1) P β§ | |
| Integrable (fun b => tiltMean (sourceSpinLeafKernel n k b.1) (Hβ b) (fun x => |Y b x-EY|) 1) P β§ | |
| (β« b, tiltMean (sourceSpinLeafKernel n k b.1) (Hβ b) (fun x => |Y b x-EY|) 1 βP) β€ | |
| Real.sqrt (2*c)/Real.sqrt (1/(n+1:β))+ | |
| (c*s+4*Real.sqrt (enrichedVarianceConstant k z f H T/(n+1:β))/s)/(1/(n+1:β)) := by | |
| have hc := source_contact_thermal_disorder n k f p d h hh0 hh u j z hz hz0 hz1 t | |
| hH hhH ht hs hu hup hum hmin hp hm | |
| dsimp only at hc β’ | |
| have hmean : Integrable (fun b => (1/(n+1:β))*tiltMean (sourceSpinLeafKernel n k b.1) | |
| (sourceCouplingHamiltonian n k f p d h u b) (sourceCouplingEnergy n k p d h j b) 1) | |
| ((sourceBaseDataLaw n k z t).prod countableGaussianLaw) := by | |
| have hm := hc.2.1 | |
| change Integrable (fun b => (1/(n+1:β))*tiltMean (sourceSpinLeafKernel n k b.1) | |
| (fun x => sourceCouplingHamiltonian n k f p d h u b x+0*sourceCouplingEnergy n k p d h j b x) | |
| (sourceCouplingEnergy n k p d h j b) 1) _ at hm | |
| simpa only [zero_mul,add_zero] using hm | |
| have htherm := hc.1.integrable (by norm_num : (1:ENNReal) β€ 2) | |
| change Integrable (fun b => Real.sqrt (1/(n+1:β))*tiltMean (sourceSpinLeafKernel n k b.1) | |
| (fun x => sourceCouplingHamiltonian n k f p d h u b x+0*sourceCouplingEnergy n k p d h j b x) | |
| (fun x => |sourceCouplingEnergy n k p d h j b x-tiltMean (sourceSpinLeafKernel n k b.1) | |
| (fun x => sourceCouplingHamiltonian n k f p d h u b x+0*sourceCouplingEnergy n k p d h j b x) | |
| (sourceCouplingEnergy n k p d h j b) 1|) 1) _ at htherm | |
| simp only [zero_mul,add_zero] at htherm | |
| have hC := hc.2.2.1 | |
| simp only [sourceCouplingThermal,zero_mul,add_zero] at hC | |
| have hD := hc.2.2.2 | |
| simp only [sourceCouplingMean,zero_mul,add_zero] at hD | |
| have hr := kernel_scaled_energy_concentration (sourceFullSpinLeafKernel n k) | |
| ((sourceBaseDataLaw n k z t).prod countableGaussianLaw) | |
| (sourceCouplingHamiltonian_measurable n k f p d h u) (sourceCouplingEnergy_measurable n k p d h j) | |
| (sourceCoupling_all_exp_ae n k f p d h hh0 hh u j z t) | |
| (show 0<(1/(n+1:β):β) by positivity) hmean htherm hC hD | |
| exact hr | |
| end SphericalPerceptronFreeEnergy | |
| end | |
| end OAI | |