Download lean/OAI/Probability/LogConcave/Analysis/ProductPotentialMeasurable.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 3.81 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/LogConcave/Analysis/ProductPotentialMeasurable.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/Probability/LogConcave/Analysis/ProductPotentialMeasurable.lean
-
curl -L -o ProductPotentialMeasurable.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/LogConcave/Analysis/ProductPotentialMeasurable.lean
3.81 kB
| import Mathlib | |
| import OAI.Probability.LogConcave.Sampling.CoordinateProjection | |
| namespace OAI | |
| section | |
| section | |
| noncomputable section | |
| namespace LogConcaveSampling | |
| open MeasureTheory Set ProbabilityTheory | |
| open scoped ENNReal NNReal | |
| lemma productPotential_measurable {d e : ℕ} {H : Point d → ℝ} {G : Point e → ℝ} | |
| (hH : Measurable H) (hG : Measurable G) : Measurable (productPotential H G) := | |
| (hH.comp ((productPointEquiv d e).continuous.measurable.fst)).add | |
| (hG.comp ((productPointEquiv d e).continuous.measurable.snd)) | |
| lemma productPotential_unnormalized {d e : ℕ} {H : Point d → ℝ} {G : Point e → ℝ} | |
| (hH : Measurable H) (hG : Measurable G) : | |
| (volume.withDensity (gibbsDensity (productPotential H G))).map (productPointEquiv d e)= | |
| (volume.withDensity (gibbsDensity H)).prod (volume.withDensity (gibbsDensity G)) := by | |
| let E := (productPointEquiv d e).toHomeomorph.toMeasurableEquiv | |
| have hd : Measurable (gibbsDensity (productPotential H G)) := | |
| (Real.measurable_exp.comp (productPotential_measurable hH hG).neg).ennreal_ofReal | |
| have hHd : Measurable (gibbsDensity H) := (Real.measurable_exp.comp hH.neg).ennreal_ofReal | |
| have hGd : Measurable (gibbsDensity G) := (Real.measurable_exp.comp hG.neg).ennreal_ofReal | |
| rw [show (productPointEquiv d e : Point (d+e) → Point d × Point e)=E from rfl, | |
| map_withDensity_of_measurePreserving E (productPointEquiv_volume d e) hd, | |
| prod_withDensity hHd hGd] | |
| congr 1 | |
| funext p | |
| rw [productPotential_density] | |
| change gibbsDensity H (E (E.symm p)).1*gibbsDensity G (E (E.symm p)).2=_ | |
| rw [E.apply_symm_apply] | |
| lemma productPotential_partition {d e : ℕ} {H : Point d → ℝ} {G : Point e → ℝ} | |
| (hH : Measurable H) (hG : Measurable G) : | |
| partition (productPotential H G)=partition H*partition G := by | |
| have he := congrArg (fun μ : Measure (Point d × Point e) => μ univ) | |
| (productPotential_unnormalized hH hG) | |
| rw [Measure.map_apply (productPointEquiv d e).continuous.measurable MeasurableSet.univ, | |
| preimage_univ] at he | |
| have hp : ((volume.withDensity (gibbsDensity H)).prod (volume.withDensity (gibbsDensity G))) univ= | |
| (volume.withDensity (gibbsDensity H)) univ*(volume.withDensity (gibbsDensity G)) univ := by | |
| rw [← univ_prod_univ,Measure.prod_prod] | |
| rw [hp] at he | |
| simpa only [withDensity_apply _ MeasurableSet.univ,Measure.restrict_univ,partition] using he | |
| theorem productPotential_gibbs {d e : ℕ} {H : Point d → ℝ} {G : Point e → ℝ} | |
| (hH : Continuous H) (hG : Continuous G) : | |
| (gibbs (productPotential H G)).map (productPointEquiv d e)=(gibbs H).prod (gibbs G) := by | |
| unfold gibbs | |
| rw [Measure.map_smul _ (productPointEquiv d e).continuous.measurable.aemeasurable, | |
| productPotential_unnormalized hH.measurable hG.measurable,productPotential_partition hH.measurable hG.measurable, | |
| ENNReal.mul_inv (Or.inl (partition_pos_of_continuous hH).ne') (Or.inr (partition_pos_of_continuous hG).ne'),Measure.prod_smul_left,Measure.prod_smul_right,smul_smul] | |
| lemma gaussianPotential_gibbs (d : ℕ) : | |
| gibbs (fun y : Point d => ‖y‖^2/2)=stdGaussian (Point d) := by | |
| have he := congrArg (fun μ : Measure (Point d) => μ univ) (EulerDensity.standard_density d) | |
| have hmul : EulerDensity.gaussianCoefficient d*partition (fun y : Point d => ‖y‖^2/2)=1 := by | |
| simpa only [measure_univ,Measure.smul_apply,smul_eq_mul, | |
| withDensity_apply _ MeasurableSet.univ,Measure.restrict_univ,partition,gibbsDensity,neg_div] using he.symm | |
| have hi : (partition (fun y : Point d => ‖y‖^2/2))⁻¹=EulerDensity.gaussianCoefficient d := by | |
| exact (ENNReal.eq_inv_of_mul_eq_one_left hmul).symm | |
| rw [EulerDensity.standard_density,gibbs,hi] | |
| congr 2 | |
| funext y | |
| simp only [gibbsDensity,neg_div] | |
| end LogConcaveSampling | |
| end | |
| end | |
| end | |
| end OAI | |