File size: 8,331 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 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 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | import Mathlib
import OAI.Probability.LogConcave.Sampling.ClosedFieldMean
namespace OAI
section
section
noncomputable section
namespace LogConcaveSampling
open MeasureTheory ProbabilityTheory
open scoped RealInnerProductSpace NNReal
theorem poincare_vector_variance {d e : ℕ} {μ : Measure (Point d)}
[IsProbabilityMeasure μ] {β : ℝ} (hβ : 0≤β) (hP : HasPoincare μ β)
(hm : Appell.HasMoments μ) {f : Point d → Point e} {K : ℝ≥0}
(hf : ContDiff ℝ 1 f) (hK : LipschitzWith K f) :
Integrable (fun z => ‖f z-∫w,f w ∂μ‖^2) μ ∧
(∫z,‖f z-∫w,f w ∂μ‖^2 ∂μ)≤(e:ℝ)*β*(K:ℝ)^2 := by
classical
let b := EuclideanSpace.basisFun (Fin e) ℝ
have hi : Integrable f μ := (Appell.HasGrowth.lipschitz hK).integrable hf.continuous.aestronglyMeasurable hm
have hg : Appell.HasGrowth (fun z => f z-∫w,f w ∂μ) := by
simpa only [sub_eq_add_neg] using (Appell.HasGrowth.lipschitz hK).add
(Appell.HasGrowth.const (-(∫w,f w ∂μ)))
have hisq := (hg.norm.pow 2).integrable ((hf.continuous.sub continuous_const).norm.pow 2).aestronglyMeasurable hm
have hmj (j : Fin e) : MemLp (fun z => inner ℝ (b j) (f z)) 2 μ :=
(Appell.HasGrowth.lipschitz ((innerSL ℝ (b j)).lipschitzWith.comp hK)).memLp
(by fun_prop) hm
have hei (j : Fin e) : Integrable (fun z => (inner ℝ (b j) (f z-∫w,f w ∂μ))^2) μ := by
have h := (hmj j).sub (memLp_const (inner ℝ (b j) (∫w,f w ∂μ)))
convert h.integrable_sq using 1
ext z
simp only [inner_sub_right,Pi.sub_apply]
have hv (j : Fin e) : (∫z,(inner ℝ (b j) (f z-∫w,f w ∂μ))^2 ∂μ)≤β*(K:ℝ)^2 := by
have h := hP.lipschitz_variance hβ ((innerSL ℝ (b j)).contDiff.comp hf)
((innerSL ℝ (b j)).lipschitzWith.comp hK) (hmj j)
simp only [NNReal.coe_mul,coe_nnnorm,innerSL_apply_norm,b.norm_eq_one,one_mul] at h
change Var[fun z => inner ℝ (b j) (f z);μ]≤β*(K:ℝ)^2 at h
rw [variance_eq_integral (hmj j).aemeasurable] at h
simpa only [inner_sub_right,integral_inner hi] using h
refine ⟨hisq,?_⟩
calc
_ = ∫z,∑j : Fin e,(inner ℝ (b j) (f z-∫w,f w ∂μ))^2 ∂μ := by
apply integral_congr_ae
filter_upwards [] with z
simpa only [Real.norm_eq_abs,sq_abs] using (b.sum_sq_norm_inner_right (f z-∫w,f w ∂μ)).symm
_ = ∑j : Fin e,∫z,(inner ℝ (b j) (f z-∫w,f w ∂μ))^2 ∂μ := integral_finsetSum _ (fun j _ => hei j)
_ ≤ ∑_j : Fin e,β*(K:ℝ)^2 := Finset.sum_le_sum (fun j _ => hv j)
_ = _ := by simp; ring
theorem poincare_sq_norm_center {d : ℕ} {μ : Measure (Point d)}
[IsProbabilityMeasure μ] {β : ℝ} (hβ : 0≤β) (hP : HasPoincare μ β)
(hm : Appell.HasMoments μ) :
Integrable (fun z => ‖z-∫w,w ∂μ‖^2) μ ∧
(∫z,‖z-∫w,w ∂μ‖^2 ∂μ)≤(d:ℝ)*β := by
simpa using poincare_vector_variance hβ hP hm (f:=id) contDiff_id (LipschitzWith.id)
lemma stdGaussian_sq_norm (d : ℕ) :
(∫z : Point d,‖z‖^2 ∂stdGaussian (Point d))=d := by
classical
let b := EuclideanSpace.basisFun (Fin d) ℝ
have hei (j : Fin d) : Integrable (fun z : Point d => (inner ℝ (b j) z)^2) (stdGaussian (Point d)) :=
((IsGaussian.memLp_two_id (μ:=stdGaussian (Point d))).continuousLinearMap_comp (innerSL ℝ (b j))).integrable_sq
calc
_ = ∫z,∑j : Fin d,(inner ℝ (b j) z)^2 ∂stdGaussian (Point d) := by
apply integral_congr_ae
filter_upwards [] with z
simpa only [Real.norm_eq_abs,sq_abs] using (b.sum_sq_norm_inner_right z).symm
_ = ∑j : Fin d,∫z,(inner ℝ (b j) z)^2 ∂stdGaussian (Point d) := integral_finsetSum _ (fun j _ => hei j)
_ = _ := by
have hj (j : Fin d) : (∫z : Point d,(inner ℝ (b j) z)^2 ∂stdGaussian (Point d))=1 := by
change (∫z : Point d,((innerSL ℝ (b j)) z)^2 ∂stdGaussian (Point d))=1
rw [GaussianPoincare.integral_dual_sq,innerSL_apply_norm,b.norm_eq_one,one_pow]
simp_rw [hj]
simp
end LogConcaveSampling
end
end
section
noncomputable section
namespace LogConcaveSampling
open MeasureTheory ProbabilityTheory
open scoped NNReal RealInnerProductSpace
lemma poincare_integral_norm_center_sharp {d : ℕ} {μ : Measure (Point d)}
[IsProbabilityMeasure μ] {β : ℝ} (hβ : 0≤β) (hP : HasPoincare μ β)
(hm : Appell.HasMoments μ) :
(∫z,‖z-∫w,w ∂μ‖ ∂μ)≤Real.sqrt ((d:ℝ)*β) := by
have hg : Appell.HasGrowth (fun z : Point d => z-∫w,w ∂μ) := by
simpa only [sub_eq_add_neg,id_eq] using
(Appell.HasGrowth.lipschitz (LipschitzWith.id (α:=Point d))).add
(Appell.HasGrowth.const (-(∫w,w ∂μ)))
have hlp : MemLp (fun z : Point d => ‖z-∫w,w ∂μ‖) 2 μ :=
hg.norm.memLp (by fun_prop) hm
have hh := integral_mul_sq_le hlp (memLp_const (1:ℝ) (μ:=μ))
simp only [mul_one,one_pow,integral_const,probReal_univ,smul_eq_mul] at hh
apply (Real.le_sqrt (integral_nonneg (fun _ => norm_nonneg _)) (by positivity)).mpr
exact hh.trans (poincare_sq_norm_center hβ hP hm).2
variable {d : ℕ} {F : Point d → ℝ} {lam : ℝ≥0}
(hF : Primitive F lam) (x : Point d) {r ρ : ℝ} (hr : 0≤r)
(hl : (lam:ℝ)*r^2≤1/2) (hρ0 : 0≤ρ) (hρ1 : ρ<1)
include hF hr hl hρ0 hρ1
lemma conditionalFieldMean_center_error_sharp (y : Point d) :
‖conditionalFieldMean F x r ρ y-primitiveField F x r
(ρ • y-((1-ρ^2)*r) • conditionalFieldMean F x r ρ y)‖ ≤
((lam:ℝ)*r)*Real.sqrt ((d:ℝ)*((Real.pi^2/2)*(1-ρ^2))) := by
let := conditionalLaw_probability hF x hr hl hρ0 hρ1 y
have hh := norm_integral_sub_map_mean_le (primitiveField_lipschitz hF x hr)
(conditional_identity_integrable hF x hr hl hρ0 hρ1 y)
have hb := poincare_integral_norm_center_sharp
(mul_nonneg (by positivity) (probability_time hρ0 hρ1).1.le)
(conditionalLaw_hasPoincare hF x hr hl hρ0 hρ1 y)
(conditionalLaw_hasExpMoments hF x hr hl hρ0 hρ1 y).hasMoments
have hg := hh.trans (mul_le_mul_of_nonneg_left hb (mul_nonneg lam.coe_nonneg hr))
simpa only [conditional_mean_identity hF x hr hl hρ0 hρ1 y,
NNReal.coe_mul,NNReal.coe_mk,conditionalFieldMean] using hg
lemma conditionalFieldMean_center_zero_bound (y : Point d) :
‖conditionalFieldMean F x r ρ y-primitiveField F x r 0‖ ≤
2*((lam:ℝ)*r)*(Real.pi*Real.sqrt d+‖y‖+r*‖primitiveField F x r 0‖) := by
let M := conditionalFieldMean F x r ρ y
let c := primitiveField F x r 0
let z := ρ • y-((1-ρ^2)*r) • M
have he := conditionalFieldMean_center_error_sharp hF x hr hl hρ0 hρ1 y
have ht := probability_time hρ0 hρ1
have hs : Real.sqrt ((d:ℝ)*((Real.pi^2/2)*(1-ρ^2)))≤Real.pi*Real.sqrt d := by
apply (Real.sqrt_le_iff).mpr
refine ⟨by positivity,?_⟩
rw [mul_pow,Real.sq_sqrt (Nat.cast_nonneg d)]
have hb := mul_le_mul_of_nonneg_left ht.2 (by positivity : 0≤(d:ℝ)*(Real.pi^2/2))
nlinarith [Real.pi_pos,sq_nonneg Real.pi]
have hz : ‖z‖≤‖y‖+r*‖M‖ := by
calc
_ ≤ ‖ρ • y‖+‖((1-ρ^2)*r) • M‖ := norm_sub_le _ _
_ = ρ*‖y‖+((1-ρ^2)*r)*‖M‖ := by simp only [norm_smul,Real.norm_eq_abs,
abs_of_nonneg hρ0,abs_of_nonneg (mul_nonneg ht.1.le hr)]
_ ≤ _ := add_le_add (mul_le_of_le_one_left (norm_nonneg _) hρ1.le)
(mul_le_mul_of_nonneg_right (mul_le_of_le_one_left hr ht.2) (norm_nonneg _))
have hc := (primitiveField_lipschitz hF x hr).dist_le_mul z 0
simp only [dist_eq_norm,sub_zero,NNReal.coe_mul,NNReal.coe_mk] at hc
have hh : ‖M-c‖≤((lam:ℝ)*r)*(Real.pi*Real.sqrt d)+( (lam:ℝ)*r)*(‖y‖+r*‖M‖) := by
calc
_ ≤ ‖M-primitiveField F x r z‖+‖primitiveField F x r z-c‖ :=
norm_sub_le_norm_sub_add_norm_sub _ _ _
_ ≤ _ := add_le_add (he.trans (mul_le_mul_of_nonneg_left hs (by positivity)))
(hc.trans (mul_le_mul_of_nonneg_left hz (by positivity)))
have hm : ‖M‖≤‖M-c‖+‖c‖ := norm_le_norm_sub_add _ _
have hh' := hh.trans (add_le_add le_rfl
(mul_le_mul_of_nonneg_left (add_le_add le_rfl (mul_le_mul_of_nonneg_left hm hr)) (by positivity : 0≤(lam:ℝ)*r)))
have hb := mul_le_mul_of_nonneg_right hl (norm_nonneg (M-c))
dsimp [M,c] at hh' hb ⊢
nlinarith
end LogConcaveSampling
end
end
end
end OAI
|