File size: 5,714 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 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | import Mathlib
import OAI.Probability.SKBarriers.Calculus.MarginalVariance
import OAI.Probability.SKBarriers.Calculus.BilinearSchur
namespace OAI
section
section
noncomputable section
open scoped BigOperators Topology
open MeasureTheory ProbabilityTheory Filter
noncomputable section
open MeasureTheory Set Filter
open scoped Topology Interval
noncomputable section
open MeasureTheory Set
open scoped Interval
namespace SK.Analytic
theorem hasDerivAt_score_comp
{E : Type} [NormedAddCommGroup E] [NormedSpace β E]
(V : E β β) (hV : ContDiff β 2 V) {g : β β E} {u : E} {t : β}
(hg : HasDerivAt g u t) (v : E) :
HasDerivAt (fun s => fderiv β V (g s) v) (Hessian V (g t) u v) t := by
have hd : Differentiable β (fderiv β V) :=
(hV.fderiv_right (m := 1) (by norm_num)).differentiable (by norm_num)
have h := (hd (g t)).hasFDerivAt.comp_hasDerivAt t hg
simpa only [map_zero, add_zero, Function.comp_def, Hessian] using
h.clm_apply (hasDerivAt_const t v)
def marginalPotential {E : Type} (V : E Γ β β β) (a b : β) (x : E) : β :=
-Real.log (intervalPartition (fun y => V (x,y)) a b)
theorem contDiff_marginalPotential
{E : Type} [NormedAddCommGroup E] [NormedSpace β E] [FiniteDimensional β E]
(V : E Γ β β β) (n : β) (hV : ContDiff β n V) {a b : β} (hab : a < b) :
ContDiff β n (marginalPotential V a b) := by
have hp : ContDiff β n (fun z => Real.exp (-V z)) := hV.neg.exp
have hZ := contDiff_intervalIntegral n (fun z => Real.exp (-V z)) hp a b
exact (hZ.log (fun x => ne_of_gt (intervalPartition_pos
(hV.continuous.comp (continuous_const.prodMk continuous_id)) hab))).neg
theorem marginal_hessian_lower
{E : Type} [NormedAddCommGroup E] [NormedSpace β E] [FiniteDimensional β E]
(V : E Γ β β β) (hV : ContDiff β 2 V)
(q : E β β) (hq : q 0 = 0) {c : β} (hc : 0 < c)
(hlower : β z u s, c * (q u + s^2) β€ Hessian V z (u,s) (u,s))
{a b : β} (hab : a < b) (x u : E) :
c*q u β€ Hessian (marginalPotential V a b) x u u := by
let g : β Γ β β E Γ β := fun z => (x+z.1 β’ u, z.2)
let eβ : E Γ β := (u,0)
let eβ : E Γ β := (0,1)
let v : β β β β β := fun t y => V (g (t,y))
let vβ : β β β β β := fun t y => fderiv β V (g (t,y)) eβ
let vβ : β β β β β := fun t y => Hessian V (g (t,y)) eβ eβ
let wβ : β β β β β := fun t y => fderiv β V (g (t,y)) eβ
let wβ : β β β β β := fun t y => Hessian V (g (t,y)) eβ eβ
let hxy : β β β β β := fun t y => Hessian V (g (t,y)) eβ eβ
have hg : ContDiff β 2 g := by dsimp only [g]; fun_prop
have hd : ContDiff β 1 (fderiv β V) := hV.fderiv_right (by norm_num)
have hdd : Continuous (fderiv β (fderiv β V)) := hd.continuous_fderiv (by norm_num)
have hvc : Continuous (Function.uncurry v) := hV.continuous.comp hg.continuous
have hdcont (e : E Γ β) : Continuous (fun z => fderiv β V (g z) e) :=
(hd.continuous.comp hg.continuous).clm_apply continuous_const
have hddcont (e e' : E Γ β) : Continuous (fun z => Hessian V (g z) e e') :=
((hdd.comp hg.continuous).clm_apply continuous_const).clm_apply continuous_const
have hgβ (t y : β) : HasDerivAt (fun s => g (s,y)) eβ t := by
simpa only [g, eβ, one_smul, id_eq] using
(((hasDerivAt_id t).smul_const u).const_add x).prodMk (hasDerivAt_const t y)
have hgβ (t y : β) : HasDerivAt (fun s => g (t,s)) eβ y := by
simpa only [g, eβ, id_eq] using
(hasDerivAt_const y (x+t β’ u)).prodMk (hasDerivAt_id y)
have hvd (t y : β) : HasDerivAt (fun s => v s y) (vβ t y) t := by
exact (hV.differentiable (by norm_num) _).hasFDerivAt.comp_hasDerivAt t (hgβ t y)
have hvβd (t y : β) : HasDerivAt (fun s => vβ s y) (vβ t y) t :=
hasDerivAt_score_comp V hV (hgβ t y) eβ
have hwd (t y : β) : HasDerivAt (v t) (wβ t y) y := by
exact (hV.differentiable (by norm_num) _).hasFDerivAt.comp_hasDerivAt y (hgβ t y)
have hwβd (t y : β) : HasDerivAt (wβ t) (wβ t y) y :=
hasDerivAt_score_comp V hV (hgβ t y) eβ
have hvβyd (t y : β) : HasDerivAt (vβ t) (hxy t y) y :=
hasDerivAt_score_comp V hV (hgβ t y) eβ
have hs (t y : β) : 0 < wβ t y β§ c*q u β€ vβ t y - hxy t y^2/wβ t y := by
apply bilinear_schur_lower (fderiv β (fderiv β V) (g (t,y)))
(hV.contDiffAt.isSymmSndFDerivAt (by norm_num)) q hq hc
(hlower (g (t,y))) u
have hBL := brascampLieb_interval_schur hab (v 0) (wβ 0) (wβ 0) (vβ 0)
(hxy 0) (vβ 0) (hwd 0) (hwβd 0) (hvβyd 0)
((hddcont eβ eβ).comp (continuous_const.prodMk continuous_id))
((hddcont eβ eβ).comp (continuous_const.prodMk continuous_id))
((hddcont eβ eβ).comp (continuous_const.prodMk continuous_id))
(fun y => (hs 0 y).1) (fun y => (hs 0 y).2)
have hW := contDiff_marginalPotential V 2 hV hab
have hfirst (t : β) := hasDerivAt_neg_log_intervalPartition v vβ hvc
(hdcont eβ) hvd hab t
have hsecond := hasDerivAt_interval_score v vβ vβ hvc (hdcont eβ)
(hddcont eβ eβ) hvd hvβd hab 0
have hscore : (fun t => fderiv β (marginalPotential V a b) (x+t β’ u) u) =
(fun t => intervalMean (v t) (vβ t) a b) := by
ext t
exact (hasDerivAt_affine_comp (marginalPotential V a b)
(hW.differentiable (by norm_num)) x u t).unique (hfirst t)
have hsecond' := hasDerivAt_affine_score (marginalPotential V a b) hW x u u 0
rw [hscore] at hsecond'
have heq := hsecond'.unique hsecond
simp only [zero_smul, add_zero] at heq
rw [heq]
exact hBL
end SK.Analytic
end
end
end
end
end
end OAI
|