Download data/lean/OAI/Probability/LogConcave/Complexity/KernelAnalyticNormalizedBudget.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 21.1 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LogConcave/Complexity/KernelAnalyticNormalizedBudget.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/LogConcave/Complexity/KernelAnalyticNormalizedBudget.lean
-
curl -L -o KernelAnalyticNormalizedBudget.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/LogConcave/Complexity/KernelAnalyticNormalizedBudget.lean
21.1 kB
| import Mathlib | |
| import OAI.Probability.LogConcave.Numerics.TwoendsContinuous | |
| import OAI.Probability.LogConcave.Complexity.KernelActionNormalizedBudget | |
| namespace OAI | |
| section | |
| noncomputable section | |
| namespace LogConcaveSampling | |
| open Set MeasureTheory Quadrature | |
| open scoped Classical BigOperators NNReal | |
| def kernelAnalyticNormalizedBudget (n d : β) (T h D : β) : β := | |
| 32*(1+D^2+(βi,|zeroHermiteWeight (probabilityNodes (n+1)) 0 i|)^2)* | |
| (2*logMeshLength T*(Real.exp (Real.pi^2/4)*(TensorSum.terminalQ (n+1)).val.logCoefficient 0 2)* | |
| (1+Real.log ((d:β)+1))^((TensorSum.terminalQ (n+1)).val.logDegree 0)*2^(n+1)*h^n)^2 | |
| lemma kernelAnalyticNormalizedBudget_nonneg (n d : β) (T h D : β) : | |
| 0β€kernelAnalyticNormalizedBudget n d T h D := by | |
| unfold kernelAnalyticNormalizedBudget | |
| positivity | |
| lemma kernelAnalyticBudget_normalized {d : β} (F : Point d β β) (x : Point d) | |
| (lam : ββ₯0) (r D : β) {T h : β} (hT0 : 0<T) (hT1 : T<1) (hh : 0β€h) (n : β) : | |
| kernelAnalyticBudget n d lam r T h Dβ€ | |
| (((lam:β)*r^2)*circuitD F x)^2*kernelAnalyticNormalizedBudget n d T h D := by | |
| have hp := terminalDerivativeBudget_polylog (n+1) d lam r | |
| have ht := terminalDerivativeBudget_nonneg (n+1) d lam r | |
| have hlen := (logMeshLength_pos hT0 hT1).le | |
| have hd := circuitD_dimension F x | |
| unfold kernelAnalyticBudget kernelAnalyticNormalizedBudget | |
| calc | |
| _ β€ 32*(1+D^2+(βi,|zeroHermiteWeight (probabilityNodes (n+1)) 0 i|)^2)* | |
| (2*logMeshLength T*((lam:β)*r^2* | |
| (Real.exp (Real.pi^2/4)*(TensorSum.terminalQ (n+1)).val.logCoefficient 0 2)* | |
| (1+Real.log ((d:β)+1))^((TensorSum.terminalQ (n+1)).val.logDegree 0))*2^(n+1)*h^n)^2* | |
| (circuitD F x)^2 := by gcongr | |
| _ = _ := by ring | |
| def velocityNormalizedBudget (d k n m N : β) (lam Ap Ah Lp : ββ₯0) | |
| (r R T h Ο C J D : β) : β := | |
| 2*(βv,|terminalQuadratureWeight T h n v|)^2* | |
| kernelActionNormalizedBudget d k (n+1) m N lam Ap Ah Lp r R h Ο C J+ | |
| 2*kernelAnalyticNormalizedBudget n d T h D | |
| lemma velocityNormalizedBudget_nonneg (d k n m N : β) (lam Ap Ah Lp : ββ₯0) | |
| (r R T h Ο C J D : β) (hR : 0β€R) : | |
| 0β€velocityNormalizedBudget d k n m N lam Ap Ah Lp r R T h Ο C J D := by | |
| unfold velocityNormalizedBudget | |
| positivity [kernelActionNormalizedBudget_nonneg d k (n+1) m N lam Ap Ah Lp r R h Ο C J hR, | |
| kernelAnalyticNormalizedBudget_nonneg n d T h D] | |
| theorem velocityRmsBudget_normalized {d : β} {F : Point d β β} {lam : ββ₯0} | |
| (hF : Primitive F lam) (x : Point d) (Ap Ah Lp : ββ₯0) {r R T h Ο s C J D : β} | |
| (hr : 0<r) (hr1 : rβ€1) (hR : 0<R) (hT0 : 0<T) (hT1 : T<1) | |
| (hh : 0<h) (hΟ : 0<Ο) (hs : 0<s) (hC : 0β€C) (hJ : 0β€J) | |
| (hl : (lam:β)*r^2β€1/2) (hL : (lam:β)*rβ€1) (k n m N : β) : | |
| (r*s)β»ΒΉ^2*(2*((βv,|terminalQuadratureWeight T h n v|)* | |
| (βv,|terminalQuadratureWeight T h n v| * | |
| kernelActionRmsBudget F x lam Ap Ah Lp r R (probabilityNodeTime T h (n+1) v) h Ο C J k (n+1) m N))+ | |
| 2*kernelAnalyticBudget n d lam r T h D)β€ | |
| (((lam:β)*r/s)*circuitD F x)^2* | |
| velocityNormalizedBudget d k n m N lam Ap Ah Lp r R T h Ο C J D := by | |
| let Q := βv,|terminalQuadratureWeight T h n v| | |
| let E := kernelActionNormalizedBudget d k (n+1) m N lam Ap Ah Lp r R h Ο C J | |
| let B := (((lam:β)*r^2)*circuitD F x)^2 | |
| have hq : 0β€Q := by dsimp [Q]; positivity | |
| have hp (v : ProbabilityNode T h (n+1)) : | |
| kernelActionRmsBudget F x lam Ap Ah Lp r R (probabilityNodeTime T h (n+1) v) h Ο C J k (n+1) m Nβ€B*E := by | |
| have hv := probabilityNodeTime_mem hT0 hT1 hh (by omega : 0<n+1) v | |
| exact kernelActionRmsBudget_normalized hF x Ap Ah Lp hr.le hr1 hR hh.le hΟ hC hJ hl hL | |
| hv.1 (hv.2.trans_lt hT1) k (n+1) m N | |
| have hw := weighted_uniform_upper (fun v => |terminalQuadratureWeight T h n v|) _ | |
| (fun v => abs_nonneg _) hp | |
| have ha := kernelAnalyticBudget_normalized F x lam r D hT0 hT1 hh.le n | |
| have hb := mul_le_mul_of_nonneg_left | |
| (add_le_add (mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hw hq) (by norm_num : (0:β)β€2)) | |
| (mul_le_mul_of_nonneg_left ha (by norm_num : (0:β)β€2))) | |
| (sq_nonneg ((r*s)β»ΒΉ)) | |
| apply hb.trans_eq | |
| dsimp [Q,E,B,velocityNormalizedBudget] | |
| field_simp | |
| end LogConcaveSampling | |
| end | |
| end | |
| section | |
| noncomputable section | |
| namespace LogConcaveSampling | |
| open Set MeasureTheory Quadrature | |
| open scoped Classical BigOperators NNReal | |
| lemma square_root_two_budget {A B : β} (hA : 0β€A) (hB : 0β€B) (q : β) (N : β) : | |
| (2*Real.sqrt A+q^N*Real.sqrt B)^2β€8*A+2*q^(2*N)*B := by | |
| have hsA := Real.sq_sqrt hA | |
| have hsB := Real.sq_sqrt hB | |
| have he : q^(2*N)*B=(q^N*Real.sqrt B)^2 := by | |
| rw [show 2*N=N*2 by omega,pow_mul,mul_pow,hsB] | |
| nlinarith [sq_nonneg (2*Real.sqrt A-q^N*Real.sqrt B)] | |
| def centerStateQuadratureEnvelope (n : β) (Ξ± R : β) : β := | |
| 8*(singleCellBasisBudget n)^2*(Ξ±^2*(Rβ»ΒΉ)^4)^(n+2)*centeringStateBudget (n+2) | |
| def centerInitialEnvelope (Ξ± R : β) : β := | |
| 2*(Ξ±^2*(Rβ»ΒΉ)^4)*centeringStateBudget 1 | |
| def centerStateEnvelope (n N : β) (Ξ± R q E : β) : β := | |
| 8*(2*(centeringRowBudget n:β)^2*Ξ±^2*E+2*centerStateQuadratureEnvelope n Ξ± R)+ | |
| 2*q^(2*N)*centerInitialEnvelope Ξ± R | |
| def centerMeanEnvelope (n : β) (Ξ± R Z : β) : β := | |
| 2*(centeringRowBudget n:β)^2*(Real.pi^2/2)^2*Ξ±^2*Z+ | |
| 8*(singleCellBasisBudget n)^2*Ξ±^2*(Ξ±^2*(Rβ»ΒΉ)^4)^(n+1)*centeringMeanBudget (n+1) | |
| lemma centerStateQuadratureEnvelope_nonneg (n : β) (Ξ± R : β) : | |
| 0β€centerStateQuadratureEnvelope n Ξ± R := by | |
| unfold centerStateQuadratureEnvelope | |
| positivity [centeringStateBudget_nonneg (n+2)] | |
| lemma centerInitialEnvelope_nonneg (Ξ± R : β) : 0β€centerInitialEnvelope Ξ± R := by | |
| unfold centerInitialEnvelope | |
| positivity [centeringStateBudget_nonneg 1] | |
| lemma centerStateEnvelope_nonneg (n N : β) (Ξ± R q E : β) (hq : 0β€q) (hE : 0β€E) : | |
| 0β€centerStateEnvelope n N Ξ± R q E := by | |
| unfold centerStateEnvelope | |
| positivity [centerStateQuadratureEnvelope_nonneg n Ξ± R,centerInitialEnvelope_nonneg Ξ± R] | |
| lemma centerMeanEnvelope_nonneg (n : β) (Ξ± R Z : β) (hZ : 0β€Z) : | |
| 0β€centerMeanEnvelope n Ξ± R Z := by | |
| unfold centerMeanEnvelope | |
| positivity [centeringMeanBudget_nonneg (n+1)] | |
| lemma centeringStateQuadratureBudget_normalized {d : β} (F : Point d β β) (x : Point d) | |
| (n : β) (lam : ββ₯0) (r R s : β) : | |
| centeringStateQuadratureBudget n d lam r R sβ€ | |
| (circuitD F x)^2*centerStateQuadratureEnvelope n ((lam:β)*r/s) R := by | |
| have hd := circuitD_dimension F x | |
| have hc := centeringStateBudget_nonneg (n+2) | |
| unfold centeringStateQuadratureBudget centerStateQuadratureEnvelope | |
| push_cast | |
| nlinarith [mul_le_mul_of_nonneg_right hd | |
| (show 0β€8*(singleCellBasisBudget n)^2*(((lam:β)*r/s)^2*(Rβ»ΒΉ)^4)^(n+2)*centeringStateBudget (n+2) by positivity)] | |
| lemma centeringInitialBudget_normalized {d : β} (F : Point d β β) (x : Point d) | |
| (lam : ββ₯0) (r R s : β) : | |
| centeringInitialBudget d lam r R sβ€ | |
| (circuitD F x)^2*centerInitialEnvelope ((lam:β)*r/s) R := by | |
| have hd := circuitD_dimension F x | |
| have hc := centeringStateBudget_nonneg 1 | |
| unfold centeringInitialBudget centerInitialEnvelope | |
| push_cast | |
| nlinarith [mul_le_mul_of_nonneg_right hd | |
| (show 0β€2*(((lam:β)*r/s)^2*(Rβ»ΒΉ)^4)*centeringStateBudget 1 by positivity)] | |
| lemma centeringPicardBudget_normalized {d : β} (F : Point d β β) (x : Point d) | |
| (n N : β) (lam K : ββ₯0) (r R s E : β) (hE : 0β€E) : | |
| centeringPicardBudget n N d lam K r R s ((((lam:β)*r/s)*circuitD F x)^2*E)β€ | |
| (circuitD F x)^2*centerStateEnvelope n N ((lam:β)*r/s) R (centeringRowBudget n*K:ββ₯0) E := by | |
| have hQ := centeringStateQuadratureBudget_normalized F x n lam r R s | |
| have hI := centeringInitialBudget_normalized F x lam r R s | |
| unfold centeringPicardBudget | |
| apply (square_root_two_budget | |
| (by positivity [centeringStateQuadratureBudget_nonneg n d lam r R s]) | |
| (by unfold centeringInitialBudget; positivity [centeringStateBudget_nonneg 1]) | |
| (centeringRowBudget n*K:ββ₯0) N).trans | |
| have hq : 0β€((centeringRowBudget n*K:ββ₯0):β)^(2*N) := by positivity | |
| have hQ' := mul_le_mul_of_nonneg_left hQ (by norm_num : (0:β)β€16) | |
| have hI' := mul_le_mul_of_nonneg_left hI (show 0β€2*((centeringRowBudget n*K:ββ₯0):β)^(2*N) by positivity) | |
| unfold centerStateEnvelope | |
| nlinarith | |
| lemma centeringMeanBudget_normalized {d : β} (F : Point d β β) (x : Point d) | |
| (n : β) (lam : ββ₯0) (r R : β) {s T Z : β} (hs : 0<s) (hT0 : 0β€T) (hT1 : Tβ€1) (hZ : 0β€Z) : | |
| 2*(centeringRowBudget n:β)^2*((Real.pi^2/2)*T*((lam:β)*r))^2*((circuitD F x)^2*Z)+ | |
| 2*centeringMeanQuadratureBudget n d lam r R sβ€ | |
| (s*circuitD F x)^2*centerMeanEnvelope n ((lam:β)*r/s) R Z := by | |
| have hd := circuitD_dimension F x | |
| have hc := centeringMeanBudget_nonneg (n+1) | |
| have hT : T^2β€1 := by nlinarith | |
| have heβ := mul_le_mul_of_nonneg_left hT | |
| (show 0β€2*(centeringRowBudget n:β)^2*(Real.pi^2/2)^2*((lam:β)*r)^2*(circuitD F x)^2*Z by positivity) | |
| have heβ := mul_le_mul_of_nonneg_right hd | |
| (show 0β€8*(singleCellBasisBudget n)^2*((lam:β)*r)^2* | |
| (((lam:β)*r/s)^2*(Rβ»ΒΉ)^4)^(n+1)*centeringMeanBudget (n+1) by positivity) | |
| have hid : (s*circuitD F x)^2*centerMeanEnvelope n ((lam:β)*r/s) R Z= | |
| 2*(centeringRowBudget n:β)^2*(Real.pi^2/2)^2*((lam:β)*r)^2*(circuitD F x)^2*Z+ | |
| 8*(singleCellBasisBudget n)^2*((lam:β)*r)^2* | |
| (((lam:β)*r/s)^2*(Rβ»ΒΉ)^4)^(n+1)*centeringMeanBudget (n+1)*(circuitD F x)^2 := by | |
| unfold centerMeanEnvelope | |
| field_simp | |
| rw [hid] | |
| unfold centeringMeanQuadratureBudget | |
| nlinarith | |
| end LogConcaveSampling | |
| end | |
| end | |
| section | |
| noncomputable section | |
| namespace LogConcaveSampling | |
| open Filter Asymptotics | |
| open scoped Topology | |
| def dimensionLog (d : β) : β := 1+Real.log ((d:β)+1) | |
| lemma dimensionLog_nonneg (d : β) : 0β€dimensionLog d := by | |
| have hh : 0β€Real.log ((d:β)+1) := Real.log_nonneg (by linarith [Nat.cast_nonneg (Ξ±:=β) d]) | |
| unfold dimensionLog | |
| linarith | |
| lemma dimensionLog_isBigO_log : dimensionLog =O[atTop] (fun d : β => Real.log (d:β)) := by | |
| have ht : Tendsto (fun d : β => (d:β)) atTop atTop := tendsto_natCast_atTop_atTop | |
| have hlog : βαΆ d : β in atTop,1β€Real.log (d:β) := | |
| (Real.tendsto_log_atTop.comp ht).eventually_ge_atTop 1 | |
| apply IsBigO.of_bound 3 | |
| filter_upwards [eventually_ge_atTop (2:β),hlog] with d hd hl | |
| have hd0 : (0:β)<d := by exact_mod_cast (by omega : 0<d) | |
| have hd1 : (2:β)β€d := by exact_mod_cast hd | |
| have ht : Real.log ((d:β)+1)β€2*Real.log (d:β) := by | |
| calc | |
| _ β€ Real.log ((d:β)^2) := Real.log_le_log (by positivity) (by nlinarith) | |
| _ = _ := by rw [Real.log_pow]; norm_num | |
| rw [Real.norm_of_nonneg (dimensionLog_nonneg d),Real.norm_of_nonneg (by linarith : 0β€Real.log (d:β))] | |
| unfold dimensionLog | |
| linarith | |
| lemma dimensionLog_pow_isLittleO (k : β) {s : β} (hs : 0<s) : | |
| (fun d : β => dimensionLog d^k) =o[atTop] (fun d : β => (d:β)^s) := by | |
| have hh := (isLittleO_log_rpow_rpow_atTop (k:β) hs).comp_tendsto | |
| (tendsto_natCast_atTop_atTop (R:=β)) | |
| simp only [Real.rpow_natCast,Function.comp_def] at hh | |
| exact (dimensionLog_isBigO_log.pow k).trans_isLittleO hh | |
| theorem polylog_power_absorb (C : β) (k : β) {a b : β} (hab : b<a) : | |
| βαΆ d : β in atTop, |C| *dimensionLog d^k*(d:β)^(-a)β€(d:β)^(-b) := by | |
| have hh := ((dimensionLog_pow_isLittleO k (sub_pos.mpr hab)).const_mul_left |C|).mul_isBigO | |
| (isBigO_refl (fun d : β => (d:β)^(-a)) atTop) | |
| have he : (fun d : β => (d:β)^(a-b)*(d:β)^(-a)) =αΆ [atTop] | |
| (fun d : β => (d:β)^(-b)) := by | |
| filter_upwards [eventually_ge_atTop (1:β)] with d hd | |
| have hd0 : (0:β)<d := by exact_mod_cast hd | |
| rw [βReal.rpow_add hd0] | |
| congr 1 | |
| ring | |
| have hbnd := (hh.congr' Filter.EventuallyEq.rfl he).def (by norm_num : (0:β)<1) | |
| filter_upwards [hbnd] with d hd | |
| simpa only [one_mul,Real.norm_of_nonneg (by positivity [dimensionLog_nonneg d] : 0β€|C| *dimensionLog d^k*(d:β)^(-a)), | |
| Real.norm_of_nonneg (by positivity : 0β€(d:β)^(-b))] using hd | |
| end LogConcaveSampling | |
| end | |
| end | |
| section | |
| noncomputable section | |
| namespace LogConcaveSampling | |
| open Filter Asymptotics | |
| open scoped Topology | |
| def LogPowerRate (f : β β β) (a : β) : Prop := | |
| βk : β, f =O[atTop] (fun d => dimensionLog d^k*(d:β)^(-a)) | |
| lemma dimensionLog_one_le (d : β) : 1β€dimensionLog d := by | |
| unfold dimensionLog | |
| have h := Real.log_nonneg (by linarith [Nat.cast_nonneg (Ξ±:=β) d] : 1β€(d:β)+1) | |
| linarith | |
| namespace LogPowerRate | |
| lemma congr {f g : β β β} {a : β} (h : LogPowerRate f a) (he : f=αΆ [atTop] g) : LogPowerRate g a := by | |
| obtain β¨k,hkβ© := h | |
| exact β¨k,hk.congr' he Filter.EventuallyEq.rflβ© | |
| lemma mono {f : β β β} {a b : β} (h : LogPowerRate f a) (hba : bβ€a) : LogPowerRate f b := by | |
| obtain β¨k,hkβ© := h | |
| refine β¨k,hk.trans (IsBigO.of_bound 1 ?_)β© | |
| filter_upwards [eventually_ge_atTop (1:β)] with d hd | |
| have hd1 : (1:β)β€d := by exact_mod_cast hd | |
| have hd0 : (0:β)<d := lt_of_lt_of_le zero_lt_one hd1 | |
| simp only [one_mul,Real.norm_of_nonneg (by positivity [dimensionLog_nonneg d] : | |
| 0β€dimensionLog d^k*(d:β)^(-a)), Real.norm_of_nonneg (by positivity [dimensionLog_nonneg d] : | |
| 0β€dimensionLog d^k*(d:β)^(-b))] | |
| exact mul_le_mul_of_nonneg_left (Real.rpow_le_rpow_of_exponent_le hd1 (by linarith)) (by positivity [dimensionLog_nonneg d]) | |
| lemma const (C : β) : LogPowerRate (fun _ => C) 0 := by | |
| refine β¨0,?_β© | |
| simpa only [pow_zero,neg_zero,Real.rpow_zero,mul_one] using | |
| (isBigO_const_const C (by norm_num : (1:β)β 0) atTop : (fun _ : β => C)=O[atTop] (fun _ => (1:β))) | |
| lemma power (a : β) : LogPowerRate (fun d => (d:β)^(-a)) a := by | |
| refine β¨0,?_β© | |
| simpa only [pow_zero,one_mul] using (isBigO_refl (fun d : β => (d:β)^(-a)) atTop) | |
| lemma log : LogPowerRate dimensionLog 0 := by | |
| refine β¨1,?_β© | |
| simpa only [pow_one,neg_zero,Real.rpow_zero,mul_one] using (isBigO_refl dimensionLog atTop) | |
| lemma mul {f g : β β β} {a b : β} (hf : LogPowerRate f a) (hg : LogPowerRate g b) : | |
| LogPowerRate (fun d => f d*g d) (a+b) := by | |
| obtain β¨k,hkβ© := hf | |
| obtain β¨l,hlβ© := hg | |
| refine β¨k+l,(hk.mul hl).congr' Filter.EventuallyEq.rfl ?_β© | |
| filter_upwards [eventually_ge_atTop (1:β)] with d hd | |
| have hd0 : (0:β)<d := by exact_mod_cast hd | |
| rw [pow_add,neg_add,Real.rpow_add hd0] | |
| ring | |
| lemma pow {f : β β β} {a : β} (hf : LogPowerRate f a) (n : β) : | |
| LogPowerRate (fun d => f d^n) (n*a) := by | |
| induction n with | |
| | zero => simpa using const 1 | |
| | succ n ih => | |
| have h := ih.mul hf | |
| simpa only [pow_succ,Nat.cast_add,Nat.cast_one,add_mul,one_mul] using h | |
| lemma const_mul {f : β β β} {a : β} (hf : LogPowerRate f a) (C : β) : | |
| LogPowerRate (fun d => C*f d) a := by | |
| simpa only [zero_add] using (const C).mul hf | |
| lemma mul_const {f : β β β} {a : β} (hf : LogPowerRate f a) (C : β) : | |
| LogPowerRate (fun d => f d*C) a := by | |
| simpa only [add_zero] using hf.mul (const C) | |
| lemma add {f g : β β β} {a : β} (hf : LogPowerRate f a) (hg : LogPowerRate g a) : | |
| LogPowerRate (fun d => f d+g d) a := by | |
| obtain β¨k,hkβ© := hf | |
| obtain β¨l,hlβ© := hg | |
| have bound (i j : β) : (fun d : β => dimensionLog d^i*(d:β)^(-a)) =O[atTop] | |
| (fun d => dimensionLog d^(i+j)*(d:β)^(-a)) := by | |
| apply IsBigO.of_bound 1 | |
| filter_upwards [] with d | |
| rw [one_mul,Real.norm_of_nonneg (by positivity [dimensionLog_nonneg d]), | |
| Real.norm_of_nonneg (by positivity [dimensionLog_nonneg d])] | |
| exact mul_le_mul_of_nonneg_right (pow_le_pow_rightβ (dimensionLog_one_le d) (by omega)) (by positivity) | |
| exact β¨k+l,(hk.trans (bound k l)).add (hl.trans (by simpa only [Nat.add_comm] using bound l k))β© | |
| lemma of_le_abs {f g : β β β} {a : β} (hg : LogPowerRate g a) | |
| (hfg : βαΆ d in atTop, |f d|β€|g d|) : LogPowerRate f a := by | |
| obtain β¨k,hkβ© := hg | |
| exact β¨k,(IsBigO.of_bound 1 (by simpa only [one_mul,Real.norm_eq_abs] using hfg)).trans hkβ© | |
| lemma eventually_small {f : β β β} {a b : β} (hf : LogPowerRate f a) (hba : b<a) : | |
| βαΆ d in atTop, |f d|β€(d:β)^(-b) := by | |
| obtain β¨k,hkβ© := hf | |
| obtain β¨C,hCβ© := hk.bound | |
| have hp := polylog_power_absorb C k hba | |
| filter_upwards [hC,hp] with d hd hp | |
| have hdn : 0β€dimensionLog d^k*(d:β)^(-a) := by positivity [dimensionLog_nonneg d] | |
| rw [Real.norm_eq_abs,Real.norm_of_nonneg hdn] at hd | |
| calc | |
| _ β€ C*(dimensionLog d^k*(d:β)^(-a)) := hd | |
| _ β€ |C| *(dimensionLog d^k*(d:β)^(-a)) := mul_le_mul_of_nonneg_right (le_abs_self C) hdn | |
| _ β€ _ := by simpa only [mul_assoc] using hp | |
| end LogPowerRate | |
| end LogConcaveSampling | |
| end | |
| end | |
| section | |
| noncomputable section | |
| namespace LogConcaveSampling | |
| open Filter Asymptotics Set MeasureTheory Quadrature | |
| open scoped Topology Classical BigOperators | |
| namespace LogPowerRate | |
| lemma abs {f : β β β} {a : β} (hf : LogPowerRate f a) : LogPowerRate (fun d => |f d|) a := by | |
| exact of_le_abs hf (Eventually.of_forall (fun d => by simp)) | |
| lemma div_const {f : β β β} {a : β} (hf : LogPowerRate f a) (C : β) : | |
| LogPowerRate (fun d => f d/C) a := by | |
| simpa only [div_eq_mul_inv] using hf.mul_const Cβ»ΒΉ | |
| lemma of_le {f g : β β β} {a : β} (hg : LogPowerRate g a) | |
| (hf : βαΆ d : β in atTop,0β€f d) (hfg : βαΆ d : β in atTop,f dβ€g d) : LogPowerRate f a := by | |
| apply of_le_abs hg | |
| filter_upwards [hf,hfg] with d hd he | |
| rw [abs_of_nonneg hd,abs_of_nonneg (hd.trans he)] | |
| exact he | |
| lemma inv_power (a : β) : LogPowerRate (fun d => ((d:β)^(-a))β»ΒΉ) (-a) := by | |
| apply (power (-a)).congr | |
| filter_upwards [eventually_ge_atTop (1:β)] with d hd | |
| have hd0 : (0:β)β€d := Nat.cast_nonneg d | |
| rw [Real.rpow_neg hd0] | |
| lemma log_nat : LogPowerRate (fun d : β => Real.log (d:β)) 0 := by | |
| apply of_le log | |
| Β· filter_upwards [eventually_ge_atTop (1:β)] with d hd | |
| exact Real.log_nonneg (by exact_mod_cast hd) | |
| Β· filter_upwards [eventually_ge_atTop (1:β)] with d hd | |
| have hp : (0:β)<d := by exact_mod_cast hd | |
| have he := Real.log_le_log hp (by linarith : (d:β)β€(d:β)+1) | |
| unfold dimensionLog | |
| linarith | |
| lemma log_power (a : β) : LogPowerRate (fun d : β => Real.log ((d:β)^(-a))) 0 := by | |
| apply (log_nat.const_mul (-a)).congr | |
| filter_upwards [eventually_ge_atTop (1:β)] with d hd | |
| rw [Real.log_rpow (by exact_mod_cast hd : (0:β)<d)] | |
| end LogPowerRate | |
| lemma logMeshLength_le_scale {T R : β} (hT0 : 0<T) (hT1 : T<1) | |
| (hR : 0<R) (hRT : R^2β€1-T^2) : | |
| logMeshLength Tβ€Real.log 2-2*Real.log R := by | |
| have hden : 0<1-T := by linarith | |
| have hRR : R^2/2β€1-T := by nlinarith | |
| have he := Real.log_le_log (by positivity : 0<R^2/2) hRR | |
| rw [Real.log_div (by positivity : R^2β 0) (by norm_num),Real.log_pow] at he | |
| unfold logMeshLength | |
| norm_num at he | |
| linarith | |
| lemma logMeshLength_rate {T : β β β} (a : β) | |
| (hT0 : βαΆ d : β in atTop,0<T d) (hT1 : βαΆ d : β in atTop,T d<1) | |
| (hRT : βαΆ d : β in atTop,((d:β)^(-a))^2β€1-(T d)^2) : | |
| LogPowerRate (fun d => logMeshLength (T d)) 0 := by | |
| apply LogPowerRate.of_le ((LogPowerRate.const (Real.log 2)).add | |
| ((LogPowerRate.log_power a).const_mul (-2))) | |
| Β· filter_upwards [hT0,hT1] with d hd0 hd1 | |
| exact (logMeshLength_pos hd0 hd1).le | |
| Β· filter_upwards [hT0,hT1,hRT,eventually_ge_atTop (1:β)] with d hd0 hd1 hRT hd | |
| have hp : (0:β)<d := by exact_mod_cast hd | |
| simpa only [sub_eq_add_neg,neg_mul] using | |
| logMeshLength_le_scale hd0 hd1 (Real.rpow_pos_of_pos hp (-a)) hRT | |
| lemma terminalQuadratureWeight_rate (n : β) (D : β) (hD : 0β€D) | |
| (hDu : βtβIcc (0:β) 1,βi,|basisDerivative (probabilityNodes (n+1)) i t|β€D) | |
| {T : β β β} (a b : β) | |
| (hT0 : βαΆ d : β in atTop,0<T d) (hT1 : βαΆ d : β in atTop,T d<1) | |
| (hRT : βαΆ d : β in atTop,((d:β)^(-a))^2β€1-(T d)^2) | |
| (hsmall : βαΆ d : β in atTop,(d:β)^(-b)β€Real.log 2) | |
| (hlarge : βαΆ d : β in atTop,(d:β)^(-b)β€logMeshLength (T d)) : | |
| LogPowerRate (fun d => βv,|terminalQuadratureWeight (T d) ((d:β)^(-b)) n v|) (-b) := by | |
| have hlen := logMeshLength_rate a hT0 hT1 hRT | |
| have he := ((LogPowerRate.inv_power b).const_mul 4).mul | |
| ((LogPowerRate.const (βi,|zeroHermiteWeight (probabilityNodes (n+1)) 0 i|)).add | |
| (((hlen.add (LogPowerRate.log_power b).abs).add (LogPowerRate.const (Real.log 4))).const_mul ((n+2)*D))) | |
| simp only [add_zero] at he | |
| apply LogPowerRate.of_le he | |
| Β· exact Eventually.of_forall (fun d => by positivity) | |
| Β· filter_upwards [hT0,hT1,hsmall,hlarge,eventually_ge_atTop (1:β)] with d hd0 hd1 hs hl hd | |
| have hp : (0:β)<d := by exact_mod_cast hd | |
| simpa only [div_eq_mul_inv] using terminalQuadratureWeight_sum hd0 hd1 | |
| (Real.rpow_pos_of_pos hp (-b)) hs hl n D hD hDu | |
| end LogConcaveSampling | |
| end | |
| end | |
| end OAI | |