Download data/lean/OAI/Probability/LogConcave/Sampling/Directional.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.34 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LogConcave/Sampling/Directional.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/LogConcave/Sampling/Directional.lean
-
curl -L -o Directional.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LogConcave/Sampling/Directional.lean
3.34 kB
| import Mathlib | |
| import OAI.Probability.LogConcave.Model | |
| 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 scoped RealInnerProductSpace | |
| open MeasureTheory | |
| def directional {d : β} (v : Point d) (f : Point d β β) : Point d β β := | |
| fun x => fderiv β f x v | |
| lemma directional_smooth {d : β} {f : Point d β β} (hf : ContDiff β (β€ : ββ) f) (v : Point d) : | |
| ContDiff β (β€ : ββ) (directional v f) := | |
| (hf.fderiv_right (by simp)).clm_apply contDiff_const | |
| lemma directional_mul {d : β} {f g : Point d β β} (hf : Differentiable β f) | |
| (hg : Differentiable β g) (v : Point d) : | |
| directional v (fun x => f x*g x)=fun x => directional v f x*g x+f x*directional v g x := by | |
| funext x | |
| unfold directional | |
| change (fderiv β (f*g) x) v=_ | |
| rw [((hf x).hasFDerivAt.mul (hg x).hasFDerivAt).fderiv] | |
| simp only [add_apply,smul_apply,smul_eq_mul] | |
| ring | |
| lemma directional_add {d : β} {f g : Point d β β} (hf : Differentiable β f) | |
| (hg : Differentiable β g) (v : Point d) : | |
| directional v (fun x => f x+g x)=fun x => directional v f x+directional v g x := by | |
| funext x | |
| exact congrArg (fun A : Point d βL[β] β => A v) ((hf x).hasFDerivAt.add (hg x).hasFDerivAt).fderiv | |
| lemma directional_neg {d : β} {f : Point d β β} (hf : Differentiable β f) (v : Point d) : | |
| directional v (fun x => -f x)=fun x => -directional v f x := by | |
| funext x | |
| exact congrArg (fun A : Point d βL[β] β => A v) ((hf x).hasFDerivAt.neg).fderiv | |
| lemma directional_sum {d : β} {ΞΉ : Type*} (s : Finset ΞΉ) {f : ΞΉ β Point d β β} | |
| (hf : β iβs,Differentiable β (f i)) (v : Point d) : | |
| directional v (fun x => β iβs,f i x)=fun x => β iβs,directional v (f i) x := by | |
| funext x | |
| have hh := HasFDerivAt.fun_sum (u:=s) (fun i hi => (hf i hi x).hasFDerivAt) | |
| simpa only [directional,sum_apply] using | |
| congrArg (fun A : Point d βL[β] β => A v) hh.fderiv | |
| lemma directional_directional {d : β} {f : Point d β β} (hf : ContDiff β (β€ : ββ) f) (u v x : Point d) : | |
| directional u (directional v f) x=(fderiv β (fderiv β f) x u) v := by | |
| have hdf : ContDiff β (β€ : ββ) (fderiv β f) := hf.fderiv_right (by simp) | |
| unfold directional | |
| rw [fderiv_clm_apply (hdf.differentiable (by norm_num) x) (differentiableAt_const _)] | |
| simp | |
| lemma directional_commute {d : β} {f : Point d β β} (hf : ContDiff β (β€ : ββ) f) (u v : Point d) : | |
| directional u (directional v f)=directional v (directional u f) := by | |
| funext x | |
| rw [directional_directional hf,directional_directional hf] | |
| exact ((hf.contDiffAt (x:=x)).isSymmSndFDerivAt (by | |
| simp only [minSmoothness_of_isRCLikeNormedField] | |
| exact WithTop.coe_le_coe.mpr (show (2:ββ)β€β€ from le_top))).eq u v | |
| lemma directional_gradient {d : β} (H : Point d β β) (v x : Point d) : | |
| directional v H x=inner β (gradient H x) v := by | |
| rw [directional,βtoDual_gradient,InnerProductSpace.toDual_apply_apply] | |
| end LogConcaveSampling | |
| end UpperProof | |
| end | |
| end | |
| end | |
| end OAI | |