Buckets:
| import Mathlib | |
| import OAI.Probability.Perceptron.Interpolation.GibbsReplicaMean | |
| import OAI.Probability.Perceptron.Variational.IntegrableGibbs | |
| namespace OAI | |
| noncomputable section | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped Topology NNReal ENNReal BigOperators | |
| namespace SphericalPerceptronFreeEnergy | |
| variable {S : Type*} [MeasurableSpace S] (μ : Measure S) [IsProbabilityMeasure μ] | |
| lemma tilt_mean_twice_of_integrable {v w F : S → ℝ} (hw : Measurable w) | |
| {s : ℝ} (hi : Integrable (fun x => Real.exp (s*w x)) μ) (t : ℝ) : | |
| tiltMean (tiltLaw μ w s) v F t = tiltMean μ (fun x => s*w x+t*v x) F 1 := by | |
| let := tilt_law_probability_of_integrable μ hi | |
| have hp := (tilt_partition_pos_of_integrable μ hi).ne' | |
| unfold tiltMean tiltIntegral tiltPartition | |
| rw [tilt_law_integral_of_integrable μ hw hi,tilt_law_integral_of_integrable μ hw hi] | |
| simp only [tiltMean,tiltIntegral,one_mul,Real.exp_add] | |
| have he (x : S) : Real.exp (s*w x) * (Real.exp (t*v x)*F x) = | |
| Real.exp (s*w x) * Real.exp (t*v x) * F x := by ring | |
| simp_rw [he] | |
| change ((∫ x, Real.exp (s*w x) * Real.exp (t*v x) * F x ∂μ) / tiltPartition μ w s) / | |
| ((∫ x, Real.exp (s*w x) * Real.exp (t*v x) ∂μ) / tiltPartition μ w s) = _ | |
| rw [div_div_div_cancel_right₀ hp] | |
| lemma tiltMean_bound_general {H F : S → ℝ} (hH : Measurable H) (hF : Measurable F) | |
| {t C : ℝ} (hC : 0 ≤ C) (hFC : ∀ x, |F x| ≤ C) : | |
| |tiltMean μ H F t| ≤ C := by | |
| by_cases hi : Integrable (fun x => Real.exp (t*H x)) μ | |
| · exact tiltMean_bound_of_integrable μ hH hF hi hFC | |
| · simp only [tiltMean,tiltPartition,integral_undef hi,div_zero,abs_zero] | |
| exact hC | |
| lemma replica_exp_integrable {H : S → ℝ} {t : ℝ} | |
| (hi : Integrable (fun x => Real.exp (t*H x)) μ) (n : ℕ) : | |
| Integrable (fun x : Fin n → S => Real.exp (t*replicaPotential H n x)) | |
| (Measure.pi fun _ : Fin n => μ) := by | |
| simp only [replicaPotential,Finset.mul_sum,Real.exp_sum] | |
| exact Integrable.fintype_prod (fun _ => hi) | |
| omit [IsProbabilityMeasure μ] in | |
| lemma tilt_law_apply_of_integrable {H : S → ℝ} {t : ℝ} | |
| (hi : Integrable (fun x => Real.exp (t*H x)) μ) | |
| {s : Set S} (hs : MeasurableSet s) : | |
| tiltLaw μ H t s = (ENNReal.ofReal (tiltPartition μ H t))⁻¹ * | |
| ENNReal.ofReal (∫ x in s, Real.exp (t * H x) ∂μ) := by | |
| rw [tiltLaw,Measure.smul_apply,smul_eq_mul,withDensity_apply _ hs, | |
| ← ofReal_integral_eq_lintegral_ofReal hi.integrableOn (ae_of_all _ fun x => (Real.exp_pos _).le)] | |
| lemma tilt_law_pi_of_integrable {H : S → ℝ} (hH : Measurable H) {t : ℝ} | |
| (hi : Integrable (fun x => Real.exp (t*H x)) μ) (n : ℕ) : | |
| tiltLaw (Measure.pi fun _ : Fin n => μ) (replicaPotential H n) t = | |
| Measure.pi (fun _ : Fin n => tiltLaw μ H t) := by | |
| let := tilt_law_probability_of_integrable μ hi | |
| symm | |
| apply Measure.pi_eq | |
| intro s hs | |
| rw [tilt_law_apply_of_integrable _ (replica_exp_integrable μ hi n) (MeasurableSet.univ_pi hs), | |
| replica_partition μ hH n,ENNReal.ofReal_pow (tilt_partition_pos_of_integrable μ hi).le, | |
| Measure.restrict_pi_pi] | |
| have he (x : Fin n → S) : Real.exp (t * replicaPotential H n x) = | |
| ∏ i, Real.exp (t * H (x i)) := by | |
| simp only [replicaPotential,Finset.mul_sum,Real.exp_sum] | |
| simp_rw [he] | |
| rw [integral_fintype_prod_eq_prod (f := fun (_ : Fin n) x => Real.exp (t * H x)), | |
| ENNReal.ofReal_prod_of_nonneg (fun i _ => integral_nonneg (fun _ => (Real.exp_pos _).le))] | |
| simp_rw [tilt_law_apply_of_integrable μ hi (hs _)] | |
| rw [Finset.prod_mul_distrib,Finset.prod_const,Finset.card_univ,Fintype.card_fin,ENNReal.inv_pow] | |
| lemma gibbsReplicaMean_integral_of_integrable {H : S → ℝ} (hH : Measurable H) | |
| (hi : Integrable (fun x => Real.exp (H x)) μ) (n : ℕ) (G : (Fin n → S) → ℝ) : | |
| gibbsReplicaMean μ H n G = ∫ x, G x ∂Measure.pi (fun _ : Fin n => tiltLaw μ H 1) := by | |
| rw [← tilt_law_pi_of_integrable μ hH (by simpa only [one_mul] using hi), | |
| tilt_law_integral_of_integrable _ (replicaPotential_measurable hH n) | |
| (replica_exp_integrable μ (by simpa only [one_mul] using hi) n)] | |
| rfl | |
| lemma gibbsReplicaMean_bound_of_integrable {H : S → ℝ} {n : ℕ} {G : (Fin n → S) → ℝ} | |
| (hH : Measurable H) (hG : Measurable G) {D : ℝ} | |
| (hi : Integrable (fun x => Real.exp (H x)) μ) (hGD : ∀ x, |G x| ≤ D) : | |
| |gibbsReplicaMean μ H n G| ≤ D := | |
| tiltMean_bound_of_integrable _ (replicaPotential_measurable hH n) hG | |
| (replica_exp_integrable μ (by simpa only [one_mul] using hi) n) hGD | |
| lemma gibbsReplicaMean_coordinate_of_integrable {H F : S → ℝ} | |
| (hH : Measurable H) (hF : Measurable F) | |
| (hi : Integrable (fun x => Real.exp (H x)) μ) (n : ℕ) (j : Fin n) : | |
| gibbsReplicaMean μ H n (fun x => F (x j)) = tiltMean μ H F 1 := by | |
| have heI : Integrable (fun x => Real.exp (1*H x)) μ := by simpa only [one_mul] using hi | |
| let := tilt_law_probability_of_integrable μ heI | |
| rw [gibbsReplicaMean_integral_of_integrable μ hH hi, | |
| ← tilt_law_integral_of_integrable μ hH heI] | |
| have he := measurePreserving_eval (fun _ : Fin n => tiltLaw μ H 1) j | |
| conv_rhs => rw [← he.map_eq,integral_map he.measurable.aemeasurable hF.aestronglyMeasurable] | |
| lemma gibbsReplicaMean_sum_of_integrable {ι : Type*} (s : Finset ι) | |
| {H : S → ℝ} {n : ℕ} {G : ι → (Fin n → S) → ℝ} | |
| (hH : Measurable H) (hi : Integrable (fun x => Real.exp (H x)) μ) | |
| (hG : ∀ i ∈ s, Measurable (G i)) {D : ι → ℝ} | |
| (hGD : ∀ i ∈ s, ∀ x, |G i x| ≤ D i) : | |
| gibbsReplicaMean μ H n (fun x => ∑ i ∈ s, G i x) = | |
| ∑ i ∈ s, gibbsReplicaMean μ H n (G i) := by | |
| let := tilt_law_probability_of_integrable μ (by simpa only [one_mul] using hi : | |
| Integrable (fun x => Real.exp (1*H x)) μ) | |
| simp_rw [gibbsReplicaMean_integral_of_integrable μ hH hi] | |
| exact integral_finsetSum s fun i hi => Integrable.of_bound (hG i hi).aestronglyMeasurable | |
| (D i) (ae_of_all _ fun x => by simpa only [Real.norm_eq_abs] using hGD i hi x) | |
| lemma gibbsReplicaMean_potential_of_integrable {H F : S → ℝ} | |
| (hH : Measurable H) (hF : Measurable F) | |
| (hi : Integrable (fun x => Real.exp (H x)) μ) {D : ℝ} (hFD : ∀ x, |F x| ≤ D) (n : ℕ) : | |
| gibbsReplicaMean μ H n (replicaPotential F n) = n*tiltMean μ H F 1 := by | |
| change gibbsReplicaMean μ H n (fun x => ∑ i, F (x i)) = _ | |
| rw [gibbsReplicaMean_sum_of_integrable μ Finset.univ (G := fun i (x : Fin n → S) => F (x i)) hH hi | |
| (fun i _ => hF.comp (measurable_pi_apply i)) (fun i _ x => hFD (x i))] | |
| simp_rw [gibbsReplicaMean_coordinate_of_integrable μ hH hF hi] | |
| simp | |
| lemma gibbsReplicaMean_product_of_integrable {H F : S → ℝ} {n : ℕ} | |
| {G : (Fin n → S) → ℝ} (hH : Measurable H) (hF : Measurable F) (hG : Measurable G) | |
| (hi : Integrable (fun x => Real.exp (H x)) μ) {D B : ℝ} | |
| (hFD : ∀ x, |F x| ≤ D) (hGB : ∀ x, |G x| ≤ B) : | |
| gibbsReplicaMean μ H (n+1) (fun x => F (x 0)*G (fun j => x j.succ)) = | |
| tiltMean μ H F 1*gibbsReplicaMean μ H n G := by | |
| have heI : Integrable (fun x => Real.exp (1*H x)) μ := by simpa only [one_mul] using hi | |
| let := tilt_law_probability_of_integrable μ heI | |
| simp_rw [gibbsReplicaMean_integral_of_integrable μ hH hi] | |
| rw [← tilt_law_integral_of_integrable μ hH heI] | |
| let ν := tiltLaw μ H 1 | |
| have he := (measurePreserving_piFinSuccAbove (fun _ : Fin (n+1) => ν) 0).symm | |
| rw [← he.integral_comp' (fun x => F (x 0)*G (fun j => x j.succ))] | |
| change (∫ p : S×(Fin n → S), F ((Fin.insertNth 0 p.1 p.2 : Fin (n+1) → S) 0)* | |
| G (fun j => (Fin.insertNth 0 p.1 p.2 : Fin (n+1) → S) j.succ) | |
| ∂ν.prod (Measure.pi fun _ => ν)) = _ | |
| simp only [Fin.insertNth_zero',Fin.cons_zero,Fin.cons_succ] | |
| have hFi : Integrable F ν := Integrable.of_bound hF.aestronglyMeasurable D | |
| (ae_of_all _ fun x => by simpa only [Real.norm_eq_abs] using hFD x) | |
| have hGi : Integrable G (Measure.pi fun _ : Fin n => ν) := Integrable.of_bound | |
| hG.aestronglyMeasurable B (ae_of_all _ fun x => by simpa only [Real.norm_eq_abs] using hGB x) | |
| rw [integral_prod _ (hFi.mul_prod hGi)] | |
| simp_rw [integral_const_mul] | |
| rw [integral_mul_const] | |
| end SphericalPerceptronFreeEnergy | |
| end | |
| end OAI | |
Xet Storage Details
- Size:
- 8.22 kB
- Xet hash:
- e15f2f5bd9fe6dd77443cd4cce2f5b22cf45f3715c06881dd40feeef5b95f43f
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.