File size: 2,670 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | import Mathlib
import OAI.Probability.LogConcave.Model
import OAI.Probability.LogConcave.Sampling.ContinuousFirstOrderReply
namespace OAI
section
section
noncomputable section
open MeasureTheory Filter
open scoped ENNReal NNReal Topology
section UpperProof
namespace LogConcaveSampling
open scoped RealInnerProductSpace
theorem ContDiff.isSymmetric_gradient_derivative {d : β} {V : Point d β β}
(hV : ContDiff β 2 V) (x : Point d) :
(fderiv β (gradient V) x).IsSymmetric := by
have hg : ContDiff β 1 (gradient V) :=
(InnerProductSpace.toDual β (Point d)).symm.contDiff.comp
(hV.fderiv_right (by norm_num))
have hd := ((InnerProductSpace.toDual β (Point d)).hasFDerivAt).comp x
((hg.differentiable (by norm_num) x).hasFDerivAt)
have he : fderiv β (fderiv β V) x =
(InnerProductSpace.toDual β (Point d)).toContinuousLinearEquiv.toContinuousLinearMap.comp
(fderiv β (gradient V) x) := by
have hid := toDual_comp_gradient (π := β) (f := V)
rw [hid] at hd
exact hd.fderiv
have hs := (hV.contDiffAt (x := x)).isSymmSndFDerivAt (by norm_num [minSmoothness])
intro v w
have h := hs.eq v w
rw [he] at h
change inner β ((fderiv β (gradient V) x) v) w =
inner β v ((fderiv β (gradient V) x) w)
conv_rhs => rw [real_inner_comm]
simpa only [ContinuousLinearMap.comp_apply, LinearIsometryEquiv.coe_toContinuousLinearEquiv,
ContinuousLinearEquiv.coe_coe, InnerProductSpace.toDual_apply_apply] using h
theorem Admissible.gradient_lipschitz {d : β} {V : Point d β β}
(hV : Admissible V) : LipschitzWith 2 (gradient V) := by
apply lipschitzWith_of_nnnorm_fderiv_le (hV.contDiff_gradient.differentiable (by norm_num))
intro x
change βfderiv β (gradient V) xβ β€ (2 : β)
rw [ContinuousLinearMap.norm_eq_iSup_rayleighQuotient
(fderiv β (gradient V) x) (ContDiff.isSymmetric_gradient_derivative hV.smooth x)]
apply ciSup_le
intro v
by_cases hv : v = 0
Β· simp [hv]
have hn : 0 < βvβ ^ 2 := sq_pos_of_pos (norm_pos_iff.mpr hv)
rw [ContinuousLinearMap.rayleighQuotient,
ContinuousLinearMap.reApplyInnerSelf_apply, real_inner_comm]
simp only [RCLike.re_to_real]
rw [abs_of_nonneg (div_nonneg ((sq_nonneg βvβ).trans (hV.hessian_bounds x v).1)
(sq_nonneg βvβ)), div_le_iffβ hn]
exact (hV.hessian_bounds x v).2
theorem Admissible.gradient_norm_le {d : β} {V : Point d β β}
(hV : Admissible V) (x : Point d) : βgradient V xβ β€ 2 * βxβ := by
simpa [dist_eq_norm, hV.gradient_zero] using hV.gradient_lipschitz.dist_le_mul x 0
end LogConcaveSampling
end UpperProof
end
end
end
end OAI
|