/- Released under Apache-2.0; see adjacent LICENSE. Completes the elementary normalized-u and u log(u)/loglog(y) limits for the literal equation13 floor/+2 parameters. All assertions are quantitative forall-epsilon/eventual statements; no smooth-number, PNT or main input. -/ import SmoothParameters namespace SmoothLogLimit noncomputable section open ManuscriptParameters SmoothParameters def r (y A : ℝ) : ℝ := Real.log (X y A : ℝ) / L y theorem normalized_u_identity (y A : ℝ) (hA : 4 ≤ A) (hy : SmoothParameters.threshold A (chooseB A) ≤ y) : u y A / (A * L2 y / L3 y) = r y A := by have hf := large_facts y A hA ((le_max_left _ _).trans hy) have hA0 : 0 < A := by linarith have hT : 0 < L2 y := by linarith [hf.2.2.1] have hR : 0 < L3 y := by linarith [hf.2.2.2.1] rw [u_identity y A hA hy] unfold r field_simp [hA0.ne', hT.ne', hR.ne'] theorem eventual_normalized_u (A : ℝ) (hA : 4 ≤ A) (ε : ℝ) (hε : 0 < ε) : ∃ Y : ℝ, 0 < Y ∧ ∀ y : ℝ, Y ≤ y → |u y A / (A * L2 y / L3 y) - 1| ≤ ε := by obtain ⟨Y, hY, he⟩ := eventual_log_ratio A hA ε hε refine ⟨max Y (SmoothParameters.threshold A (chooseB A)), hY.trans_le (le_max_left _ _), ?_⟩ intro y hy rw [normalized_u_identity y A hA ((le_max_right _ _).trans hy)] exact he y ((le_max_left _ _).trans hy) /-- Every logarithm factor is positive before the exact decomposition is used. -/ theorem log_u_identity (y A : ℝ) (hA : 4 ≤ A) (hy : SmoothParameters.threshold A (chooseB A) ≤ y) : Real.log (u y A) = L3 y + Real.log A - Real.log (L3 y) + Real.log (r y A) := by have hf := large_facts y A hA ((le_max_left _ _).trans hy) have hA0 : 0 < A := by linarith have hT : 0 < L2 y := by linarith [hf.2.2.1] have hR : 0 < L3 y := by linarith [hf.2.2.2.1] have hr : 0 < r y A := by have hh := (log_ratio_bounds y A hA hy).1 change 1 ≤ r y A at hh linarith rw [u_identity y A hA hy] change Real.log (r y A * (A * L2 y / L3 y)) = _ rw [Real.log_mul hr.ne' (div_pos (mul_pos hA0 hT) hR).ne', Real.log_div (mul_pos hA0 hT).ne' hR.ne', Real.log_mul hA0.ne' hT.ne'] change Real.log (r y A) + (Real.log A + L3 y - Real.log (L3 y)) = _ ring /-- A finite quantitative error bound, prior to taking any eventual limit. -/ theorem log_u_ratio_error (y A : ℝ) (hA : 4 ≤ A) (hy : SmoothParameters.threshold A (chooseB A) ≤ y) (h3 : 1 ≤ L3 y) : |Real.log (u y A) / L3 y - 1| ≤ (Real.log A + 1) / L3 y + 2 / Real.sqrt (L3 y) := by have hA0 : 0 < A := by linarith have h3pos : 0 < L3 y := by linarith have hs : 0 < Real.sqrt (L3 y) := Real.sqrt_pos.mpr h3pos have hr := log_ratio_bounds y A hA hy change 1 ≤ r y A ∧ r y A ≤ 1 + 7 / Real.sqrt (L y) ∧ r y A ≤ 2 at hr have hrpos : 0 < r y A := by linarith [hr.1] have hlr0 : 0 ≤ Real.log (r y A) := Real.log_nonneg hr.1 have hlr1 : Real.log (r y A) ≤ 1 := by have hh := Real.log_le_log hrpos hr.2.2 have hh2 := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ) < 2) linarith have hla0 : 0 ≤ Real.log A := Real.log_nonneg (by linarith) have hl30 : 0 ≤ Real.log (L3 y) := Real.log_nonneg h3 have hl3 : Real.log (L3 y) ≤ 2 * Real.sqrt (L3 y) := log_le_two_sqrt (L3 y) h3pos have habs : |Real.log A - Real.log (L3 y) + Real.log (r y A)| ≤ Real.log A + 1 + 2 * Real.sqrt (L3 y) := by apply abs_le.mpr constructor <;> linarith have he : Real.log (u y A) / L3 y - 1 = (Real.log A - Real.log (L3 y) + Real.log (r y A)) / L3 y := by rw [log_u_identity y A hA hy] field_simp; ring rw [he, abs_div, abs_of_pos h3pos] apply (div_le_div_of_nonneg_right habs h3pos.le).trans apply le_of_eq field_simp [h3pos.ne', hs.ne'] nlinarith [Real.sq_sqrt h3pos.le] /-- A triple exponential supplies the exact positive L3 lower bound. -/ theorem L3_ge_of_tower (y T : ℝ) (hy : Real.exp (Real.exp (Real.exp T)) ≤ y) : T ≤ L3 y := by have h1 := Real.log_le_log (Real.exp_pos _) hy rw [Real.log_exp] at h1 have h2 := Real.log_le_log (Real.exp_pos _) h1 rw [Real.log_exp] at h2 have h3 := Real.log_le_log (Real.exp_pos _) h2 rw [Real.log_exp] at h3 exact h3 theorem eventual_log_u_ratio (A : ℝ) (hA : 4 ≤ A) (ε : ℝ) (hε : 0 < ε) : ∃ Y : ℝ, 0 < Y ∧ ∀ y : ℝ, Y ≤ y → |Real.log (u y A) / L3 y - 1| ≤ ε := by let T := max 1 (max (2 * (Real.log A + 1) / ε) ((4 / ε) ^ 2)) let Y := max (SmoothParameters.threshold A (chooseB A)) (Real.exp (Real.exp (Real.exp T))) refine ⟨Y, (Real.exp_pos _).trans_le (le_max_right _ _), ?_⟩ intro y hy have ht : SmoothParameters.threshold A (chooseB A) ≤ y := (le_max_left _ _).trans hy have hT : T ≤ L3 y := L3_ge_of_tower y T ((le_max_right _ _).trans hy) have h3 : 1 ≤ L3 y := (le_max_left _ _).trans hT have h3pos : 0 < L3 y := by linarith have hs : 0 < Real.sqrt (L3 y) := Real.sqrt_pos.mpr h3pos have hfirst : 2 * (Real.log A + 1) / ε ≤ L3 y := (le_max_left _ _).trans ((le_max_right _ _).trans hT) have hsecond : (4 / ε) ^ 2 ≤ L3 y := (le_max_right _ _).trans ((le_max_right _ _).trans hT) have hsq : 4 / ε ≤ Real.sqrt (L3 y) := by nlinarith [Real.sq_sqrt h3pos.le, Real.sqrt_nonneg (L3 y), div_pos (by norm_num : (0 : ℝ) < 4) hε] have hh1 : (Real.log A + 1) / L3 y ≤ ε / 2 := by apply (div_le_iff₀ h3pos).mpr have hh := (div_le_iff₀ hε).mp hfirst nlinarith have hh2 : 2 / Real.sqrt (L3 y) ≤ ε / 2 := by apply (div_le_iff₀ hs).mpr have hh := (div_le_iff₀ hε).mp hsq nlinarith exact (log_u_ratio_error y A hA ht h3).trans (by linarith) theorem u_log_u_identity (y A : ℝ) (hA : 4 ≤ A) (hy : SmoothParameters.threshold A (chooseB A) ≤ y) : u y A * Real.log (u y A) / L2 y = A * r y A * (Real.log (u y A) / L3 y) := by have hf := large_facts y A hA ((le_max_left _ _).trans hy) have hT : 0 < L2 y := by linarith [hf.2.2.1] have hR : 0 < L3 y := by linarith [hf.2.2.2.1] rw [u_identity y A hA hy] change _ = A * (Real.log (X y A : ℝ) / L y) * _ field_simp [hT.ne', hR.ne'] /-- Literal equation23 limit, with no analytic smooth-number hypothesis. -/ theorem eventual_u_log_u (A : ℝ) (hA : 4 ≤ A) (ε : ℝ) (hε : 0 < ε) : ∃ Y : ℝ, 0 < Y ∧ ∀ y : ℝ, Y ≤ y → |u y A * Real.log (u y A) / L2 y - A| ≤ ε := by have hA0 : 0 < A := by linarith let δ := ε / (3 * A) have hδ : 0 < δ := by dsimp [δ]; positivity obtain ⟨Y1, hY1, he1⟩ := eventual_log_ratio A hA δ hδ obtain ⟨Y2, hY2, he2⟩ := eventual_log_u_ratio A hA δ hδ let Y := max (SmoothParameters.threshold A (chooseB A)) (max Y1 Y2) refine ⟨Y, hY1.trans_le ((le_max_left _ _).trans (le_max_right _ _)), ?_⟩ intro y hy have ht : SmoothParameters.threshold A (chooseB A) ≤ y := (le_max_left _ _).trans hy have h1 : |r y A - 1| ≤ δ := he1 y ((le_max_left _ _).trans ((le_max_right _ _).trans hy)) have h2 := he2 y ((le_max_right _ _).trans ((le_max_right _ _).trans hy)) have hr := log_ratio_bounds y A hA ht change 1 ≤ r y A ∧ r y A ≤ 1 + 7 / Real.sqrt (L y) ∧ r y A ≤ 2 at hr have hprod : |r y A * (Real.log (u y A) / L3 y) - 1| ≤ 3 * δ := by have he : r y A * (Real.log (u y A) / L3 y) - 1 = r y A * (Real.log (u y A) / L3 y - 1) + (r y A - 1) := by ring rw [he] apply (abs_add_le _ _).trans rw [abs_mul, abs_of_nonneg (show 0 ≤ r y A by linarith [hr.1])] have hh := mul_le_mul_of_nonneg_left h2 (show 0 ≤ r y A by linarith [hr.1]) have hh2 := mul_le_mul_of_nonneg_right hr.2.2 hδ.le linarith rw [u_log_u_identity y A hA ht] have he : A * r y A * (Real.log (u y A) / L3 y) - A = A * (r y A * (Real.log (u y A) / L3 y) - 1) := by ring rw [he, abs_mul, abs_of_pos hA0] apply (mul_le_mul_of_nonneg_left hprod hA0.le).trans apply le_of_eq dsimp [δ] field_simp end end SmoothLogLimit #print axioms SmoothLogLimit.r #print axioms SmoothLogLimit.normalized_u_identity #print axioms SmoothLogLimit.eventual_normalized_u #print axioms SmoothLogLimit.log_u_identity #print axioms SmoothLogLimit.log_u_ratio_error #print axioms SmoothLogLimit.L3_ge_of_tower #print axioms SmoothLogLimit.eventual_log_u_ratio #print axioms SmoothLogLimit.u_log_u_identity #print axioms SmoothLogLimit.eventual_u_log_u