File size: 3,305 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import Mathlib
import OAI.Probability.LogConcave.JetEstimates.NormalizedLaplace

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

namespace LogConcaveSampling.JetCalculus
open scoped Topology

variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {ΞΉ ΞΊ : Type*}

lemma mixedJet_add {f : E β†’ ℝ} (hf : ContDiff ℝ (⊀ : β„•βˆž) f)
    (v : ΞΉ β†’ E) (w : ΞΊ β†’ E) (l : List ΞΉ) (k : List ΞΊ) :
    mixedJet v w l k (fun x => f (x.1+x.2)) =
      jet (Sum.elim v w) (l.map Sum.inl++k.map Sum.inr) f 0 := by
  let A : E Γ— E β†’L[ℝ] E := ContinuousLinearMap.fst ℝ E E+ContinuousLinearMap.snd ℝ E E
  have hh := congrFun (jet_comp_affine hf A 0
    (Sum.elim (fun i => (v i,(0:E))) (fun j => ((0:E),w j)))
    (l.map Sum.inl++k.map Sum.inr)) 0
  have hdir : (fun i => A (Sum.elim (fun i => (v i,(0:E)))
      (fun j => ((0:E),w j)) i))=Sum.elim v w := by
    funext i
    cases i <;> simp [A]
  have hs : ContDiff ℝ (⊀ : β„•βˆž) (fun x : E Γ— E => f (x.1+x.2)) :=
    hf.comp (contDiff_fst.add contDiff_snd)
  rw [mixedJet_eq_joint hs]
  rw [hdir] at hh
  simpa [A] using hh

end LogConcaveSampling.JetCalculus

namespace LogConcaveSampling.JetCalculus
open scoped Topology

variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {ΞΉ : Type*}

lemma dir_dir {f : E β†’ ℝ} (hf : ContDiff ℝ (⊀ : β„•βˆž) f) (v w : E) :
    dir v (dir w f)=dir w (dir v f) := by
  funext x
  have hs : ContDiff ℝ (⊀ : β„•βˆž) (fderiv ℝ f) := hf.fderiv_right (by simp)
  have hd : Differentiable ℝ (fderiv ℝ f) := hs.differentiable (by simp)
  change (fderiv ℝ (fun y => fderiv ℝ f y w) x) v =
    (fderiv ℝ (fun y => fderiv ℝ f y v) x) w
  rw [fderiv_clm_apply (hd x) (differentiableAt_const _),
    fderiv_clm_apply (hd x) (differentiableAt_const _)]
  simpa only [add_apply,ContinuousLinearMap.comp_apply,
    zero_apply,ContinuousLinearMap.map_zero,zero_add,
    ContinuousLinearMap.flip_apply,fderiv_const_apply] using
    ((hf.contDiffAt (x := x)).isSymmSndFDerivAt (by
      simp only [minSmoothness_of_isRCLikeNormedField]
      exact WithTop.coe_le_coe.mpr (show (2:β„•βˆž)β‰€βŠ€ from le_top))).eq v w

lemma jet_perm {f : E β†’ ℝ} (hf : ContDiff ℝ (⊀ : β„•βˆž) f)
    (v : ΞΉ β†’ E) {l k : List ΞΉ} (hp : l.Perm k) : jet v l f=jet v k f := by
  induction hp with
  | nil => rfl
  | cons i hp ih => simp only [jet,ih]
  | swap i j l => exact dir_dir (smooth_jet hf v l) (v j) (v i)
  | trans h1 h2 ih1 ih2 => exact ih1.trans ih2

lemma dir_smul (v : E) (c : ℝ) (f : E β†’ ℝ) :
    dir (c β€’ v) f=fun x => c*dir v f x := by
  funext x
  simp only [dir,map_smul,smul_eq_mul]

lemma jet_smul {f : E β†’ ℝ} (hf : ContDiff ℝ (⊀ : β„•βˆž) f)
    (v : ΞΉ β†’ E) (l : List ΞΉ) (c : ℝ) :
    jet (fun i => c β€’ v i) l f=fun x => c^l.length*jet v l f x := by
  induction l with
  | nil => simp [jet]
  | cons i l ih =>
    simp only [jet,ih,List.length_cons]
    rw [dir_const_mul ((smooth_jet hf v l).differentiable (by simp)),dir_smul]
    funext x
    simp only [pow_succ,dir]
    ring

end LogConcaveSampling.JetCalculus

end UpperProof
end
end
end

end OAI