Download data/lean/OAI/Probability/DirectionalWalk/EntropyUpperBound.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 17 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/DirectionalWalk/EntropyUpperBound.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/DirectionalWalk/EntropyUpperBound.lean
-
curl -L -o EntropyUpperBound.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/DirectionalWalk/EntropyUpperBound.lean
17 kB
| import OAI.Probability.DirectionalWalk.DyadicCover | |
| namespace OAI | |
| open MeasureTheory ProbabilityTheory Filter Preorder | |
| open scoped ENNReal BigOperators Topology | |
| namespace DirectionalZeroOne | |
| open scoped Classical | |
| lemma axisCube_log_bound {d : β} (e : Step d) (J : β) (hJ : 0 < J) : | |
| Real.log (Fintype.card (AxisCubeSite e (2^J) ((2^J)^2+1))+1) β€ | |
| (d+1)*6*J := by | |
| have hc := card_axisCubeSite_le e (2^J) ((2^J)^2+1) | |
| have hpow : (2:β)^(2*J) = ((2:β)^J)^2 := by rw [Nat.mul_comm 2 J,pow_mul] | |
| have hb : 2*((2:β)^J)^2+3 β€ 2^(2*J+3) := by | |
| rw [pow_add,hpow] | |
| have hh : 1 β€ ((2:β)^J)^2 := one_le_powβ (one_le_powβ (by norm_num)) | |
| norm_num at * | |
| omega | |
| have hbase : 2*((2:β)^J)^2+3 = 2*(((2:β)^J)^2+1)+1 := by ring | |
| rw [hbase] at hb | |
| have hp : (2*(((2:β)^J)^2+1)+1)^d β€ 2^((2*J+3)*d) := by | |
| rw [pow_mul] | |
| exact Nat.pow_le_pow_left hb d | |
| have hc' : Fintype.card (AxisCubeSite e (2^J) ((2^J)^2+1))+1 β€ 2^((2*J+3)*d+1) := by | |
| have hh := hc.trans hp | |
| have h1 : 1 β€ (2:β)^((2*J+3)*d) := one_le_powβ (by norm_num) | |
| rw [pow_succ (2:β) ((2*J+3)*d)] | |
| omega | |
| have hh := Real.log_le_log (by positivity : 0 < (Fintype.card (AxisCubeSite e (2^J) ((2^J)^2+1)) : β)+1) | |
| (show (Fintype.card (AxisCubeSite e (2^J) ((2^J)^2+1)) : β)+1 β€ (2:β)^((2*J+3)*d+1) by exact_mod_cast hc') | |
| rw [Real.log_pow] at hh | |
| have hl : Real.log 2 β€ 1 := by linarith [Real.log_le_sub_one_of_pos (by norm_num : (0:β)<2)] | |
| have hm : 0 β€ (((2*J+3)*d+1 : β) : β) := Nat.cast_nonneg _ | |
| have hv := mul_le_mul_of_nonneg_left hl hm | |
| push_cast at hh hv | |
| have hj : (1:β) β€ J := by exact_mod_cast hJ | |
| have hd : (0:β) β€ d := Nat.cast_nonneg _ | |
| nlinarith | |
| lemma summable_shifted_axisTail {d : β} (ΞΌ : Measure (Row d)) [IsProbabilityMeasure ΞΌ] | |
| (hell : StrictEllipticity ΞΌ) (e : Step d) | |
| (hp : 0 < annealed ΞΌ 0 (nonBacktracking (axisDirection e))) : | |
| Summable (fun l => (2:β)^l*(axisWidthTail ΞΌ e (2^(l-1))).toReal) := by | |
| apply (summable_nat_add_iff 1).mp | |
| simpa only [Nat.add_sub_cancel,pow_succ,mul_assoc,mul_comm,mul_left_comm] using | |
| (summable_dyadic_axisWidthTail ΞΌ hell e hp).mul_left 2 | |
| lemma axis_delta_dyadic {d : β} (ΞΌ : Measure (Row d)) [IsProbabilityMeasure ΞΌ] | |
| (hell : StrictEllipticity ΞΌ) (e : Step d) | |
| (hp : 0 < annealed ΞΌ 0 (nonBacktracking (axisDirection e))) | |
| (l G : β) (hG : 1 β€ G) (hGl : G β€ l) : | |
| axisReachProb ΞΌ e (2^l-2^(l-G))-axisReachProb ΞΌ e (2^l) β€ | |
| ENNReal.ofReal ((1/2 : β)^G*((2:β)^l*(axisWidthTail ΞΌ e (2^(l-1))).toReal)) := by | |
| let := slabLaw_probability ΞΌ (axisDirection e) hp | |
| have hlow : (2:β)^(l-G) β€ 2^l := Nat.pow_le_pow_right (by norm_num) (Nat.sub_le _ _) | |
| have hhalf : (2:β)^(l-1) β€ 2^l-2^(l-G) := by | |
| have hh : (2:β)^(l-G) β€ 2^(l-1) := Nat.pow_le_pow_right (by norm_num) (by omega) | |
| have hpow : (2:β)^l = 2^(l-1)*2 := by | |
| conv_lhs => rw [show l = (l-1)+1 by omega,pow_succ] | |
| omega | |
| have hr := (axis_renewal_tail_bound ΞΌ hell e hp (Nat.sub_le ((2:β)^l) ((2:β)^(l-G)))).2 | |
| have ht := ENNReal.toReal_mono (measure_ne_top _ _) (axisWidthTail_antitone ΞΌ e hhalf) | |
| change (axisWidthTail ΞΌ e (2^l-2^(l-G))).toReal β€ (axisWidthTail ΞΌ e (2^(l-1))).toReal at ht | |
| have hpow : (2:β)^(l-G) = (1/2 : β)^G*(2:β)^l := by | |
| have he : l = (l-G)+G := by omega | |
| rw [show (2:β)^l = (2:β)^(l-G)*(2:β)^G from by rw [β pow_add, β he]] | |
| rw [div_pow,one_pow] | |
| field_simp | |
| have hreal : (axisReachProb ΞΌ e (2^l-2^(l-G))).toReal-(axisReachProb ΞΌ e (2^l)).toReal β€ | |
| (1/2 : β)^G*((2:β)^l*(axisWidthTail ΞΌ e (2^(l-1))).toReal) := by | |
| have hrr : ((2^l : β) : β)-((2^l-2^(l-G) : β) : β) = (2:β)^(l-G) := by | |
| rw [Nat.cast_sub hlow];push_cast;ring | |
| rw [hrr] at hr | |
| exact hr.trans (by simpa only [hpow,mul_assoc] using mul_le_mul_of_nonneg_left ht (by positivity : (0:β)β€(2:β)^(l-G))) | |
| apply (ENNReal.toReal_le_toReal (lt_of_le_of_lt tsub_le_self (measure_lt_top _ _)).ne ENNReal.ofReal_ne_top).mp | |
| change (axisReachProb ΞΌ e (2^l-2^(l-G))-axisReachProb ΞΌ e (2^l)).toReal β€ (ENNReal.ofReal _).toReal | |
| rw [ENNReal.toReal_sub_of_le (axisReachProb_antitone ΞΌ e (Nat.sub_le _ _)) (measure_ne_top _ _), | |
| ENNReal.toReal_ofReal (by positivity)] | |
| exact hreal | |
| lemma dyadic_markov_ratio (l G c : β) (h : G+c β€ l) (W : β) : | |
| ((4*2^(l-G-c) : β) : β)*W/((2^(l-G) : β) : β) = 4*W*(1/2 : β)^c := by | |
| have he : l-G = (l-G-c)+c := by omega | |
| push_cast | |
| rw [show (2:β)^(l-G) = (2:β)^(l-G-c)*(2:β)^c from by rw [β pow_add, β he]] | |
| rw [div_pow,one_pow] | |
| field_simp | |
| lemma commonBand_good_label {d : β} (ΞΌ : Measure (Row d)) [IsProbabilityMeasure ΞΌ] | |
| (hell : StrictEllipticity ΞΌ) (e : Step d) | |
| (hp : β b, 0 < annealed ΞΌ 0 (nonBacktracking (axisDirection (placedAxis e b)))) | |
| (J G c l m : β) (hG : 0 < G) (hl : G+c β€ l) (hlJ : l < J) | |
| (hΞ : (1/2 : β)^G*((2:β)^l*(axisWidthTail ΞΌ e (2^(l-1))).toReal) β€ (1/2 : β)^m) : | |
| letI : β b, IsProbabilityMeasure (slabLaw ΞΌ (axisDirection (placedAxis e b))) := | |
| fun b => slabLaw_probability ΞΌ _ (hp b) | |
| let Ξ½ := fun b => slabLaw ΞΌ (axisDirection (placedAxis e b)) | |
| (annealed ΞΌ 0).real (nonBacktracking (axisDirection e))^2 β€ | |
| 4*(β« Z, (firstCommonWidth (placedWidth e) Z : β) βtwoTapeLaw Ξ½)*(1/2 : β)^c + | |
| (β j β Finset.Icc (l-(G+c)) l, (twoTapeLaw Ξ½).real (commonBandContact e (2^j))) + | |
| (β« a, slabRadius a βΞ½ false)*(1/2 : β)^J + | |
| ((annealed ΞΌ 0).real (nonBacktracking (axisDirection e)))β»ΒΉ * | |
| ((annealed ΞΌ 0).real (nonBacktracking (axisDirection (oppositeStep e))))β»ΒΉ * | |
| ((24 / posteriorExponent)*((d+1)*6*J)*(m+1)^2*(1/2 : β)^m) := by | |
| let : β b, IsProbabilityMeasure (slabLaw ΞΌ (axisDirection (placedAxis e b))) := fun b => slabLaw_probability ΞΌ _ (hp b) | |
| let Ξ½ := fun b => slabLaw ΞΌ (axisDirection (placedAxis e b)) | |
| have hlpos : 0 < (2:β)^l := by positivity | |
| have hh := commonBand_lower_real ΞΌ hell e hp (2^l) (2^J) (2^(l-G)) (2^(l+1)) m | |
| (l-G-c) l (by positivity) (Nat.pow_le_pow_right (by norm_num) hlJ.le) | |
| (Nat.pow_le_pow_right (by norm_num) (Nat.sub_le _ _)) (by rw [pow_succ];omega) | |
| (by omega) (by positivity) (by rw [pow_succ];omega) | |
| ((axis_delta_dyadic ΞΌ hell e (hp false) l G hG (by omega)).trans (ENNReal.ofReal_le_ofReal hΞ)) | |
| dsimp only at hh | |
| rw [dyadic_markov_ratio l G c hl,show l-G-c = l-(G+c) by omega] at hh | |
| have hrad : (β« a, slabRadius a βΞ½ false)/((2^J : β) : β) = | |
| (β« a, slabRadius a βΞ½ false)*(1/2 : β)^J := by push_cast;rw [div_pow,one_pow];ring | |
| rw [hrad] at hh | |
| have hlog := axisCube_log_bound e J (by omega) | |
| have hc : 0 β€ ((annealed ΞΌ 0).real (nonBacktracking (axisDirection e)))β»ΒΉ * | |
| ((annealed ΞΌ 0).real (nonBacktracking (axisDirection (oppositeStep e))))β»ΒΉ := by positivity | |
| have hm : 0 β€ (24/posteriorExponent)*(m+1)^2*(1/2 : β)^m := by have := posteriorExponent_pos;positivity | |
| have hb := mul_le_mul_of_nonneg_left hlog (mul_nonneg hc hm) | |
| nlinarith | |
| lemma sum_trailing_windows (p : β β β) (hp : β j, 0 β€ p j) (J w : β) : | |
| (β l β Finset.range J, β j β Finset.Icc (l-w) l, p j) β€ | |
| (w+1)*β j β Finset.range J, p j := by | |
| classical | |
| have hid (l : β) (hl : l β Finset.range J) : | |
| (β j β Finset.Icc (l-w) l, p j) = | |
| β j β Finset.range J, if j β€ l β§ l β€ j+w then p j else 0 := by | |
| rw [β Finset.sum_filter] | |
| congr 1 | |
| ext j | |
| simp only [Finset.mem_filter,Finset.mem_range,Finset.mem_Icc] | |
| have hl' := Finset.mem_range.mp hl | |
| omega | |
| rw [Finset.sum_congr rfl hid,Finset.sum_comm,Finset.mul_sum] | |
| apply Finset.sum_le_sum | |
| intro j hj | |
| rw [β Finset.sum_filter,Finset.sum_const, nsmul_eq_mul] | |
| have hc : ((Finset.range J).filter (fun l => j β€ l β§ l β€ j+w)).card β€ w+1 := by | |
| have hs : (Finset.range J).filter (fun l => j β€ l β§ l β€ j+w) β Finset.Icc j (j+w) := by | |
| intro l hl | |
| exact Finset.mem_Icc.mpr (Finset.mem_filter.mp hl).2 | |
| have hh := Finset.card_le_card hs | |
| simp only [Nat.card_Icc] at hh | |
| omega | |
| exact mul_le_mul_of_nonneg_right (by exact_mod_cast hc) (hp j) | |
| lemma sum_early_labels (J w : β) (c : β) (hc : 0 β€ c) : | |
| (β l β Finset.range J, if l < w then c else 0) β€ w*c := by | |
| classical | |
| rw [β Finset.sum_filter,Finset.sum_const,nsmul_eq_mul] | |
| have hs : ((Finset.range J).filter (fun l => l < w)) β Finset.range w := by | |
| intro l hl | |
| exact Finset.mem_range.mpr (Finset.mem_filter.mp hl).2 | |
| have hh := Finset.card_le_card hs | |
| simp only [Finset.card_range] at hh | |
| exact mul_le_mul_of_nonneg_right (by exact_mod_cast hh) hc | |
| lemma window_count_lower (p a : β β β) (hp : β j, 0 β€ p j) (ha : β j, 0 β€ a j) | |
| (S C c : β) (hS : β J, β l β Finset.range J, a l β€ S) | |
| (hC : 0 < C) (hc : 0 < c) (hSC : 4*S β€ C) | |
| (J w : β) (hwJ : 4*w β€ J) | |
| (hgood : β l, w β€ l β l < J β a l β€ C/J β c β€ β j β Finset.Icc (l-w) l, p j) : | |
| c*J/2 β€ (w+1)*β j β Finset.range J, p j := by | |
| classical | |
| by_cases hJ : J = 0 | |
| Β· subst J | |
| simp | |
| have hJ0 : (0:β) < J := by exact_mod_cast Nat.pos_of_ne_zero hJ | |
| have hpoint (l : β) (hl : l β Finset.range J) : | |
| c β€ (if l < w then c else 0)+(β j β Finset.Icc (l-w) l, p j)+(c*J/C)*a l := by | |
| have hs : 0 β€ β j β Finset.Icc (l-w) l, p j := Finset.sum_nonneg (fun j _ => hp j) | |
| have he : 0 β€ (c*J/C)*a l := mul_nonneg (by positivity) (ha l) | |
| by_cases hlw : l < w | |
| Β· simp only [hlw,βreduceIte] | |
| linarith | |
| simp only [hlw,βreduceIte,zero_add] | |
| by_cases hg : a l β€ C/J | |
| Β· linarith [hgood l (by omega) (Finset.mem_range.mp hl) hg] | |
| Β· have hh : C/J β€ a l := le_of_not_ge hg | |
| have hm := mul_le_mul_of_nonneg_left hh (by positivity : 0 β€ c*J/C) | |
| have hid : (c*J/C)*(C/J) = c := by field_simp | |
| rw [hid] at hm | |
| linarith | |
| have hh := Finset.sum_le_sum hpoint | |
| simp only [Finset.sum_add_distrib,Finset.sum_const,Finset.card_range,nsmul_eq_mul, | |
| β Finset.mul_sum] at hh | |
| have hearly := sum_early_labels J w c hc.le | |
| have hwindows := sum_trailing_windows p hp J w | |
| have htail := mul_le_mul_of_nonneg_left (hS J) (by positivity : 0 β€ c*J/C) | |
| have htail' : (c*J/C)*S β€ c*J/4 := by | |
| apply (le_div_iffβ (by norm_num : (0:β)<4)).mpr | |
| have hh := mul_le_mul_of_nonneg_left hSC (by positivity : 0 β€ c*J/C) | |
| have hid : (c*J/C)*C = c*J := by field_simp | |
| rw [hid] at hh | |
| nlinarith | |
| have hearly' : w*c β€ c*J/4 := by | |
| have hw : (4:β)*w β€ J := by exact_mod_cast hwJ | |
| nlinarith | |
| linarith | |
| lemma tendsto_dyadic_quadratic : | |
| Tendsto (fun t : β => ((t:β)+1)^2*(1/2 : β)^t) atTop (π 0) := by | |
| have h0 := tendsto_pow_const_mul_const_pow_of_lt_one 0 (by norm_num : (0:β)β€1/2) (by norm_num : (1/2:β)<1) | |
| have h1 := tendsto_pow_const_mul_const_pow_of_lt_one 1 (by norm_num : (0:β)β€1/2) (by norm_num : (1/2:β)<1) | |
| have h2 := tendsto_pow_const_mul_const_pow_of_lt_one 2 (by norm_num : (0:β)β€1/2) (by norm_num : (1/2:β)<1) | |
| have hh := (h2.add (h1.const_mul 2)).add h0 | |
| convert hh using 1 <;> simp only [pow_zero,pow_one,mul_zero,add_zero] | |
| ext t | |
| ring | |
| lemma eventually_dyadic_quadratic_lt (D Ξ΅ : β) (hΞ΅ : 0 < Ξ΅) : | |
| βαΆ t : β in atTop, D*(((t:β)+1)^2*(1/2 : β)^t) < Ξ΅ := by | |
| have hh := tendsto_dyadic_quadratic.const_mul D | |
| simp only [mul_zero] at hh | |
| exact hh.eventually (gt_mem_nhds hΞ΅) | |
| lemma dyadic_decay_le_quadratic (t : β) : | |
| (1/2 : β)^t β€ ((t:β)+1)^2*(1/2 : β)^t := by | |
| have ht : (0:β) β€ t := Nat.cast_nonneg _ | |
| have hp : (0:β) β€ (1/2:β)^t := by positivity | |
| nlinarith [mul_le_mul_of_nonneg_right (show (1:β) β€ ((t:β)+1)^2 by nlinarith) hp] | |
| lemma self_dyadic_decay_le_quadratic (t : β) : | |
| t*(1/2 : β)^t β€ ((t:β)+1)^2*(1/2 : β)^t := by | |
| have ht : (0:β) β€ t := Nat.cast_nonneg _ | |
| exact mul_le_mul_of_nonneg_right (by nlinarith : (t:β) β€ ((t:β)+1)^2) (by positivity) | |
| lemma dyadic_decay_antitone : Antitone (fun t : β => (1/2 : β)^t) := by | |
| intro a b hab | |
| exact pow_le_pow_of_le_one (by norm_num) (by norm_num) hab | |
| lemma dyadic_power_cancel (a b : β) : | |
| (2:β)^a*(1/2 : β)^(a+b) = (1/2 : β)^b := by | |
| simp only [pow_add,div_pow,one_pow] | |
| field_simp | |
| lemma dyadic_delta_identity (a t : β) : | |
| (1/2 : β)^(2*t)*((2:β)^t/(2:β)^a) = (1/2 : β)^(a+t) := by | |
| simp only [show 2*t=t+t by omega,pow_add,div_pow,one_pow] | |
| field_simp | |
| lemma dyadic_large_parameters (K c : β) (hK : 0 < K) | |
| (C R E B P : β) (hC : 0 < C) (hR : 0 β€ R) (hE : 0 β€ E) | |
| (hB : 0 β€ B) (hP : 0 < P) : | |
| β t : β, c+1 β€ t β§ 0 < t β§ | |
| C β€ (2:β)^t β§ | |
| 4*(2*t+c) β€ (2:β)^(2*K*t) β§ | |
| R*(1/2 : β)^((2:β)^(2*K*t)) β€ P/8 β§ | |
| E*((2:β)^(2*K*t) : β)*(((2*K+1)*t : β)+1 : β)^2*(1/2 : β)^((2*K+1)*t) β€ P/8 β§ | |
| ((K*t : β):β)*Real.log 2*(2:β)^(K*t)*B β€ ((2:β)^(2*K*t) : β) := by | |
| have hP8 : (0:β) < P/8 := by positivity | |
| obtain β¨t,ht,htC,htwin,htR,htE,htBβ© := ((eventually_ge_atTop (c+1)).and | |
| ((eventually_dyadic_quadratic_lt C 1 (by norm_num)).and | |
| ((eventually_dyadic_quadratic_lt (8+4*c) 1 (by norm_num)).and | |
| ((eventually_dyadic_quadratic_lt R (P/8) hP8).and | |
| ((eventually_dyadic_quadratic_lt (E*(2*K+2)^2) (P/8) hP8).and | |
| (eventually_dyadic_quadratic_lt (K*Real.log 2*B) 1 (by norm_num))))))).exists | |
| have htpos : 0 < t := by omega | |
| have ht0 : (0:β) β€ t := Nat.cast_nonneg _ | |
| have hK0 : (0:β) β€ K := Nat.cast_nonneg _ | |
| have hc0 : (0:β) β€ c := Nat.cast_nonneg _ | |
| have htKt : t β€ K*t := by nlinarith only [hK] | |
| have ht2Kt : t β€ 2*K*t := by nlinarith only [htKt] | |
| have hpow : (2:β)^t β€ 2^(2*K*t) := Nat.pow_le_pow_right (by norm_num) ht2Kt | |
| have htJ : t β€ (2:β)^(2*K*t) := (Nat.lt_two_pow_self (n := t)).le.trans hpow | |
| have hCpow : C β€ (2:β)^t := by | |
| have hh := (mul_le_mul_of_nonneg_left (dyadic_decay_le_quadratic t) hC.le).trans htC.le | |
| simpa only [div_pow,one_pow,β div_eq_mul_one_div,div_le_one (by positivity : (0:β)<(2:β)^t)] using hh | |
| have hw : 4*(2*t+c) β€ (2:β)^t := by | |
| have hpol : (4:β)*(2*t+c) β€ (8+4*c)*((t:β)+1)^2 := by | |
| have hx : (0:β) β€ (8+4*c)*(t:β)^2+(8+8*c)*t+8 := by positivity | |
| nlinarith only [hx] | |
| have hh := (mul_le_mul_of_nonneg_right hpol (by positivity : (0:β)β€(1/2:β)^t)).trans (by nlinarith only [htwin] : (8+4*c)*((t:β)+1)^2*(1/2:β)^t β€ 1) | |
| have hh' : (4:β)*(2*t+c) β€ (2:β)^t := by | |
| simpa only [div_pow,one_pow,β div_eq_mul_one_div,div_le_one (by positivity : (0:β)<(2:β)^t)] using hh | |
| exact_mod_cast hh' | |
| have hr : R*(1/2 : β)^((2:β)^(2*K*t)) β€ P/8 := | |
| (mul_le_mul_of_nonneg_left ((dyadic_decay_antitone htJ).trans (dyadic_decay_le_quadratic t)) hR).trans htR.le | |
| have hm : ((2*K+1)*t : β) = 2*K*t+t := by ring | |
| have hrealM : ((((2*K+1)*t : β):β)+1)^2 β€ (2*K+2)^2*((t:β)+1)^2 := by | |
| have hcmp : (((2*K+1)*t : β):β)+1 β€ (2*K+2)*((t:β)+1) := by | |
| push_cast | |
| nlinarith only [hK0,ht0] | |
| simpa only [mul_pow] using (sq_le_sqβ (by positivity) (by positivity)).mpr hcmp | |
| have herror : E*((2:β)^(2*K*t) : β)*(((2*K+1)*t : β)+1 : β)^2*(1/2 : β)^((2*K+1)*t) β€ P/8 := by | |
| have hi : (2:β)^(2*K*t)*(1/2 : β)^((2*K+1)*t) = (1/2 : β)^t := by | |
| rw [hm] | |
| exact dyadic_power_cancel (2*K*t) t | |
| have heq : E*((2:β)^(2*K*t) : β)*(((2*K+1)*t : β)+1 : β)^2*(1/2 : β)^((2*K+1)*t) = | |
| E*((((2*K+1)*t : β):β)+1)^2*(1/2 : β)^t := by | |
| calc | |
| _ = (E*((((2*K+1)*t : β):β)+1)^2)*((2:β)^(2*K*t)*(1/2 : β)^((2*K+1)*t)) := by push_cast;ring | |
| _ = _ := by rw [hi] | |
| rw [heq] | |
| have hm' := mul_le_mul_of_nonneg_left hrealM (mul_nonneg hE (by positivity : (0:β)β€(1/2:β)^t)) | |
| have he' : E*(β((2*K+1)*t)+1)^2*(1/2:β)^t β€ E*(2*K+2)^2*(((t:β)+1)^2*(1/2:β)^t) := by | |
| nlinarith only [hm'] | |
| exact he'.trans htE.le | |
| have hcor : ((K*t : β):β)*Real.log 2*(2:β)^(K*t)*B β€ ((2:β)^(2*K*t) : β) := by | |
| have hcoef : 0 β€ (K:β)*Real.log 2*B := by positivity | |
| have hh := (mul_le_mul_of_nonneg_left | |
| (mul_le_mul_of_nonneg_left (dyadic_decay_antitone htKt) ht0 |>.trans (self_dyadic_decay_le_quadratic t)) hcoef).trans htB.le | |
| have hp2 : (2:β)^(2*K*t) = (2:β)^(K*t)*(2:β)^(K*t) := by rw [β pow_add];congr 1;ring | |
| push_cast | |
| rw [hp2] | |
| have hh' : (K:β)*Real.log 2*B*t β€ (2:β)^(K*t) := by | |
| have hx : ((K:β)*Real.log 2*B*t)*(1/2:β)^(K*t) β€ 1 := by nlinarith only [hh] | |
| simpa only [div_pow,one_pow,β div_eq_mul_one_div,div_le_one (by positivity : (0:β)<(2:β)^(K*t))] using hx | |
| nlinarith only [mul_le_mul_of_nonneg_right hh' (by positivity : (0:β)β€(2:β)^(K*t))] | |
| exact β¨t,ht,htpos,hCpow,hw.trans hpow,hr,herror,hcorβ© | |
| end DirectionalZeroOne | |
| end OAI | |