File size: 2,670 Bytes
dd14c26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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