Download lean/OAI/Probability/LogConcave/Dynamics/ProbabilityFlowIntegral.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 3.1 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/LogConcave/Dynamics/ProbabilityFlowIntegral.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/Probability/LogConcave/Dynamics/ProbabilityFlowIntegral.lean
-
curl -L -o ProbabilityFlowIntegral.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/LogConcave/Dynamics/ProbabilityFlowIntegral.lean
3.1 kB
| import Mathlib | |
| import OAI.Probability.LogConcave.Dynamics.TriangularEquiv | |
| import OAI.Probability.LogConcave.Sampling.ProbabilityVelocity | |
| namespace OAI | |
| section | |
| section | |
| noncomputable section | |
| open MeasureTheory Filter | |
| open scoped ENNReal NNReal Topology | |
| section UpperProof | |
| open MeasureTheory ProbabilityTheory Filter | |
| open scoped ENNReal NNReal RealInnerProductSpace Topology | |
| open Function MeasureTheory Set Filter | |
| open scoped Topology NNReal | |
| namespace LogConcaveSampling | |
| open Set Function MeasureTheory Filter ProbabilityTheory | |
| open scoped Topology | |
| theorem probabilityFlow_integral {d : ℕ} {F : Point d → ℝ} {lam : ℝ≥0} | |
| (hF : Primitive F lam) (x : Point d) {r T : ℝ} (hr : 0≤r) | |
| (hl : (lam:ℝ)*r^2≤1/2) (hT0 : 0<T) (hT1 : T<1) | |
| {φ : Point d → ℝ} (hφ : Differentiable ℝ φ) {L : ℝ≥0} (hφL : LipschitzWith L φ) | |
| {B : ℝ} (hφB : ∀ z,‖φ z‖≤B) : | |
| (∫ y,φ y ∂interpolationLaw F x r T) = | |
| ∫ z,φ (probabilityFlow hF x hr hl hT0.le hT1 z) ∂stdGaussian (Point d) := by | |
| let μ := gibbs (primitivePotential F x r) | |
| let ν := stdGaussian (Point d) | |
| let := probability_gibbs_of_partition | |
| (partition_pos_of_continuous (hF.continuous_potential x r)).ne' | |
| (partition_ne_top_of_integrable (hF.integrable_exp_neg_potential x hr (by linarith))) | |
| have hc := clampedProbabilityVelocity_continuous hF x hr hl hT0.le hT1 | |
| have hL := fun t (_ : t∈Icc 0 T) => clampedProbabilityVelocity_lipschitz hF x hr hl hT0.le hT1 t | |
| obtain ⟨g,hg,hgb⟩ := interpolationPath_defect_bound hF x hr hl hT0.le hT1 | |
| have hh := GlobalODE.transport_expectation_of_flux (μ:=μ.prod ν) hT0 hc hL | |
| (clampedProbabilityDerivative_continuous hF x hr hl hT0.le hT1) | |
| (clampedProbabilityVelocity_hasFDerivAt hF x hr hl hT0.le hT1) | |
| (X:=interpolationPath) (X':=interpolationPathDerivative) | |
| interpolationPath_measurable interpolationPath_continuous | |
| (fun t ht p => interpolationPath_hasDerivAt (by | |
| have hh := (probability_time ht.1.le (ht.2.trans hT1)).1; linarith) p) | |
| interpolationPathDerivative_measurable hg (fun t ht => hgb t ⟨ht.1.le,ht.2.le⟩) | |
| (fun t ht S hS ⟨C,hC⟩ => by | |
| simp_rw [clampedProbabilityVelocity_eq F x r T hT0.le ⟨ht.1.le,ht.2.le⟩] | |
| exact interpolationPath_flux hF x hr hl ht.1.le (ht.2.trans hT1) hS hC) | |
| hφ hφL hφB | |
| have hfc := probabilityFlow_continuous hF x hr hl hT0.le hT1 | |
| have he := integral_map (μ:=μ.prod ν) measurable_snd.aemeasurable | |
| (hφ.continuous.comp hfc).aestronglyMeasurable | |
| rw [Measure.map_snd_prod,measure_univ,one_smul] at he | |
| change (∫ y,φ y ∂(μ.prod ν).map (interpolationPath T))=_ | |
| rw [integral_map (interpolationPath_measurable T).aemeasurable hφ.continuous.aestronglyMeasurable] | |
| change (∫ p,φ (interpolationPath T p) ∂μ.prod ν)=_ | |
| rw [hh] | |
| trans ∫ p,φ (probabilityFlow hF x hr hl hT0.le hT1 p.2) ∂μ.prod ν | |
| · apply integral_congr_ae | |
| filter_upwards [] with p | |
| rw [show interpolationPath 0 p=p.2 by simp [interpolationPath]] | |
| rfl | |
| · exact he.symm | |
| end LogConcaveSampling | |
| end UpperProof | |
| end | |
| end | |
| end | |
| end OAI | |