Download lean/OAI/Probability/PosteriorReplicas/Measures/GaussianConstant.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.36 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/PosteriorReplicas/Measures/GaussianConstant.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/Probability/PosteriorReplicas/Measures/GaussianConstant.lean
-
curl -L -o GaussianConstant.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/PosteriorReplicas/Measures/GaussianConstant.lean
1.36 kB
Lean 4 · 2
declarations statementsfull
lemma gaussian_scaled_constant (q : ℕ) {ε : ℝ} (hε : 0 < ε) :
(ε^q)⁻¹ * (2*Real.pi)^(-(q:ℝ)/2) = (2*Real.pi*ε^2)^(-(q:ℝ)/2) := by proof · 6 lines
have he : (ε^2)^(-(q:ℝ)/2) = (ε^q)⁻¹ := by
rw [← Real.rpow_natCast ε 2, ← Real.rpow_mul hε.le]
norm_num only [Nat.cast_ofNat]
rw [show (2:ℝ) * (-(q:ℝ)/2) = -(q:ℝ) by ring, Real.rpow_neg hε.le,
Real.rpow_natCast]
rw [Real.mul_rpow (by positivity) (sq_nonneg ε), he, mul_comm]lemma scaledRadial_eq {k : ℕ} (n : ℕ) (y x : Vec k) :
scaledRadial n y x = ENNReal.ofReal
((2*Real.pi* ((n+1:ℝ)⁻¹)^2)^(-(k:ℝ)/2) *
Real.exp (-‖x-y‖^2 / (2*((n+1:ℝ)⁻¹)^2))) := by proof · 9 lines
have he := noiseScale_pos n
simp only [scaledRadial, gaussianRadialDensity, finrank_euclideanSpace_fin]
rw [← ENNReal.ofReal_inv_of_pos (pow_pos he _), ← ENNReal.ofReal_mul (by positivity)]
congr 1
rw [← mul_assoc, gaussian_scaled_constant k he]
have hexp : -(‖x-y‖/noiseScale n)^2/2 = -‖x-y‖^2/(2*(noiseScale n)^2) := by
field_simp
rw [hexp]
simp only [noiseScale, one_div]Outline