math / data /lean /OAI /Probability /LogConcave /Analysis /SymmetricGradientDerivative.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
2.67 kB
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