File size: 4,344 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 | import Mathlib
import OAI.Probability.GaussianRegression.Main
import OAI.Probability.MemoryPrecision.RealContinuation
namespace OAI
open MeasureTheory ProbabilityTheory Set Filter EuclideanGeometry
open scoped ENNReal NNReal RealInnerProductSpace Topology Pointwise
noncomputable section
universe u v
open MeasureTheory ProbabilityTheory Set Filter
open scoped ENNReal NNReal RealInnerProductSpace Topology Pointwise
namespace MemoryPrecision
def SuccessConstant : β := 6*StepConstant
lemma successConstant_one : 1 β€ SuccessConstant := by
have h := stepConstant_one
dsimp [SuccessConstant]
linarith
lemma stopping_factor_bound {d : β} (hd : 16 β€ d) (T : β) :
(T+1:β) β€ ((2:β)^d)^BlockCount T (d/8) := by
have hT := blockCount_mul_ge T (by omega : 0 < d/8)
have hp : d/8 β€ d := Nat.div_le_self _ _
have hTd : T β€ d * BlockCount T (d/8) := by nlinarith
have htwo : (T+1:β) β€ 2^T := Nat.lt_two_pow_self
have hpow : (2:β)^T β€ 2^(d * BlockCount T (d/8)) :=
pow_le_pow_rightβ (by norm_num) hTd
rw [pow_mul] at hpow
exact (by exact_mod_cast htwo : (T+1:β) β€ (2:β)^T).trans hpow
lemma stopping_step_bound {d N K : β} (hd : 16 β€ d) (hN : 1 β€ N) (hNK : N β€ K)
(T : β) :
(T+1:β) * RealStep d N ^ BlockCount T (d/8) β€
((2*StepConstant)^d * (K:β)^(1/((d/8:β):β))) ^ BlockCount T (d/8) := by
have hSp := stepConstant_pos
have hR := realStep_pos d hN
have hn0 : (0:β) β€ N := by positivity
have hroot : (N:β)^(1/((d/8:β):β)) β€ (K:β)^(1/((d/8:β):β)) :=
Real.rpow_le_rpow hn0 (by exact_mod_cast hNK) (by positivity)
calc
_ β€ ((2:β)^d)^BlockCount T (d/8) * RealStep d N ^ BlockCount T (d/8) :=
mul_le_mul_of_nonneg_right (stopping_factor_bound hd T) (by positivity)
_ = ((2*StepConstant)^d * (N:β)^(1/((d/8:β):β))) ^ BlockCount T (d/8) := by
rw [β mul_pow]
congr 1
simp only [RealStep, mul_pow]
ring
_ β€ _ := pow_le_pow_leftβ (by positivity)
(mul_le_mul_of_nonneg_left hroot (by positivity)) _
lemma stopping_step_bound_three {d N K T : β} (hd : 16 β€ d) (hN : 1 β€ N)
(hNK : N β€ K) (hT : 0 < T) :
3 * ((T+1:β) * RealStep d N ^ BlockCount T (d/8)) β€
(SuccessConstant^d * (K:β)^(1/((d/8:β):β))) ^ BlockCount T (d/8) := by
have hSp := stepConstant_pos
have hR := realStep_pos d hN
have hb := blockCount_pos hT (by omega : 0 < d/8)
have h3 : (3:β) β€ ((3:β)^d)^BlockCount T (d/8) := by
rw [β pow_mul]
have hdb : 1 β€ d * BlockCount T (d/8) := Nat.mul_pos (by omega) hb
simpa using pow_le_pow_rightβ (by norm_num : (1:β) β€ 3) hdb
have hroot0 : 0 β€ (K:β)^(1/((d/8:β):β)) := by positivity
calc
_ β€ ((3:β)^d)^BlockCount T (d/8) *
((2*StepConstant)^d * (K:β)^(1/((d/8:β):β))) ^ BlockCount T (d/8) :=
mul_le_mul h3 (stopping_step_bound hd hN hNK T)
(by positivity) (by positivity)
_ = _ := by
rw [β mul_pow]
congr 1
rw [β mul_assoc, β mul_pow]
congr 2
dsimp [SuccessConstant]
ring
lemma cap_constant_le {d : β} (hd : 1 β€ d) : (3*4^d:β) β€ 12^d := by
have h3 : (3:β) β€ 3^d := by
simpa using pow_le_pow_rightβ (by norm_num : (1:β) β€ 3) hd
calc
_ β€ 3^d*4^d := mul_le_mul_of_nonneg_right h3 (by positivity)
_ = _ := by rw [β mul_pow]; norm_num
lemma terminal_angular_zero_bound {d : β} (hd : 16 β€ d) {Ξ΅ : β}
(hΞ΅ : 0 < Ξ΅) (hΞ΅1 : Ξ΅ β€ 1/10) :
(3*4^d:β)*Ξ΅^(d-1) β€ 4^d*Ξ΅^(((d:β)-1)/2) := by
have hd' : (16:β) β€ d := by exact_mod_cast hd
have hΞ± : (1:β) β€ ((d:β)-1)/2 := by linarith
have hΞ΅a : Ξ΅^(((d:β)-1)/2) β€ Ξ΅ := by
simpa using Real.rpow_le_rpow_of_exponent_ge hΞ΅ (by linarith : Ξ΅ β€ 1) hΞ±
have hn : ((d-1:β):β) = (d:β)-1 := by rw [Nat.cast_sub (by omega), Nat.cast_one]
have he : Ξ΅^(d-1) = Ξ΅^(((d:β)-1)/2) * Ξ΅^(((d:β)-1)/2) := by
rw [β Real.rpow_add hΞ΅, β Real.rpow_natCast, hn]
congr 1
ring
rw [he]
have haux : 3*Ξ΅^(((d:β)-1)/2) β€ 1 := by linarith
calc
_ = (4^d*Ξ΅^(((d:β)-1)/2)) * (3*Ξ΅^(((d:β)-1)/2)) := by ring
_ β€ (4^d*Ξ΅^(((d:β)-1)/2)) * 1 := mul_le_mul_of_nonneg_left haux (by positivity)
_ = _ := mul_one _
end MemoryPrecision
end
end OAI
|