Skip to main content
AlexKontorovich/PrimeNumberTheoremAnd
Source indexedtheorem · leanprover/lean4:v4.32.0

FKS2.Table4Ext.cell_eps_le_admissible_quarter

PrimeNumberTheoremAnd.IEANTN.FKS2Tables.Table4ExtGenQuarterCore · PrimeNumberTheoremAnd/IEANTN/FKS2Tables/Table4ExtGenQuarterCore.lean:40 to 160

Source documentation

Transport for a B = 1/4 row via the squared check. hCge carries the DOUBLED rate 2·(C/√R), hrB carries √R = R^{1/2} ≤ rB. Recovers the half-power curve by taking square roots outside the kernel.

Exact Lean statement

theorem cell_eps_le_admissible_quarter
    (P : CellParams) (A C R : ℝ)
    (hRpos : 0 < R) (hApos : 0 < A)
    (hAq : ((P.Aq : ℚ) : ℝ) = A)
    (hCge : 2 * (C / Real.sqrt R) ≤ ((P.c64 * 64 : ℚ) : ℝ))
    (hrB : Real.sqrt R ≤ ((P.rB : ℚ) : ℝ))
    (c : Cell) (hc : checkCellGenQuarter P c = true) :
    ∀ x ∈ Set.Icc (exp (c.b : ℝ)) (exp (c.b' : ℝ)),
      (c.eps : ℝ) ≤ admissible_bound A 0.25 C R x

Complete declaration

Lean source

Canonical source
Full Lean sourceLean 4
theorem cell_eps_le_admissible_quarter    (P : CellParams) (A C R : )    (hRpos : 0 < R) (hApos : 0 < A)    (hAq : ((P.Aq : ) : ) = A)    (hCge : 2 * (C / Real.sqrt R)  ((P.c64 * 64 : ) : ))    (hrB : Real.sqrt R  ((P.rB : ) : ))    (c : Cell) (hc : checkCellGenQuarter P c = true) :     x  Set.Icc (exp (c.b : )) (exp (c.b' : )),      (c.eps : )  admissible_bound A 0.25 C R x := by  unfold checkCellGenQuarter at hc  split at hc  case isFalse => simp at hc  case isTrue hle =>    simp only [Bool.and_eq_true, decide_eq_true_eq] at hc    obtain ⟨⟨⟨⟨⟨heps, hslo0, hrBpos, hslo, hshi, hcheck := hc    have hslab := verify_expr_le_on_interval_dyadic (expSplitC P.c64)      (powRhs (P.Aq * P.Aq / (c.eps * c.eps * P.rB)) 1) c.slo, c.shi, hle (-50) 8      (by norm_num) hcheck    intro x hx    obtain hx_lo, hx_hi := hx    have hxpos : (0 : ) < x := lt_of_lt_of_le (exp_pos _) hx_lo    have hb_le : (c.b : )  Real.log x := (Real.le_log_iff_exp_le hxpos).mpr hx_lo    have hb'_ge : Real.log x  (c.b' : ) := (Real.log_le_iff_le_exp hxpos).mpr hx_hi    have hlog_nonneg : (0 : )  Real.log x := le_trans (Nat.cast_nonneg _) hb_le    set s :  := Real.sqrt (Real.log x) with hs_def    have h0lo : (0 : )  (c.slo : ) := by exact_mod_cast hslo0    have h0hi : (0 : )  (c.shi : ) := by      have : ((c.slo : ) : )  ((c.shi : ) : ) := by exact_mod_cast hle      linarith    have hs_lo : (c.slo : )  s := by      have h1 : ((c.slo : )) ^ 2  Real.log x := by        have hq : ((c.slo : )) * ((c.slo : ))  ((c.b : ) : ) := by exact_mod_cast hslo        calc ((c.slo : )) ^ 2 = ((c.slo : )) * ((c.slo : )) := pow_two _          _  ((c.b : ) : ) := hq          _  Real.log x := hb_le      calc (c.slo : ) = Real.sqrt (((c.slo : )) ^ 2) := (Real.sqrt_sq h0lo).symm        _  s := Real.sqrt_le_sqrt h1    have hs_hi : s  (c.shi : ) := by      have h1 : Real.log x  ((c.shi : )) ^ 2 := by        have hq : ((c.b' : ) : )  ((c.shi : )) * ((c.shi : )) := by exact_mod_cast hshi        calc Real.log x  ((c.b' : ) : ) := hb'_ge          _  ((c.shi : )) * ((c.shi : )) := hq          _ = ((c.shi : )) ^ 2 := (pow_two _).symm      calc s  Real.sqrt (((c.shi : )) ^ 2) := Real.sqrt_le_sqrt h1        _ = (c.shi : ) := Real.sqrt_sq h0hi    have hineq := hslab s hs_lo, hs_hi    rw [eval_expSplitC, eval_powRhs] at hineq    have hexp64 : exp ((P.c64 : ) * s) ^ (64 : ) = exp (((P.c64 * 64 : ) : ) * s) := by      rw [ Real.exp_nat_mul]; congr 1; push_cast; ring    rw [hexp64] at hineq    have heps_pos : (0 : ) < (c.eps : ) := by exact_mod_cast heps    have hrBpos' : (0 : ) < (P.rB : ) := by exact_mod_cast hrBpos    have hs_nonneg : (0 : )  s := Real.sqrt_nonneg _    have hsqrtR_pos : (0 : ) < Real.sqrt R := Real.sqrt_pos.mpr hRpos    -- pow 1 simplification    rw [pow_one] at hineq    -- LHS: exp(2(C/√R)·s) ≤ exp((c64·64)·s)    have hCs : 2 * (C / Real.sqrt R) * s  ((P.c64 * 64 : ) : ) * s :=      mul_le_mul_of_nonneg_right hCge hs_nonneg    have hLHS : exp (2 * (C / Real.sqrt R) * s)  exp (((P.c64 * 64 : ) : ) * s) :=      Real.exp_le_exp.mpr hCs    -- RHS coefficient: Aq²/(eps²·rB) ≤ A²/(eps²·√R)    have hqle : ((P.Aq * P.Aq / (c.eps * c.eps * P.rB) : ) : )         A * A / ((c.eps : ) * (c.eps : ) * Real.sqrt R) := by      rw [show ((P.Aq * P.Aq / (c.eps * c.eps * P.rB) : ) : )            = A * A / ((c.eps : ) * (c.eps : ) * (P.rB : )) by push_cast [hAq]; ring]      apply div_le_div_of_nonneg_left (by positivity) (by positivity)      exact mul_le_mul_of_nonneg_left hrB (by positivity)    -- squared chain: exp(2(C/√R)s) ≤ (A²/(eps²·√R))·s    have hsq_chain : exp (2 * (C / Real.sqrt R) * s)         (A * A / ((c.eps : ) * (c.eps : ) * Real.sqrt R)) * s := by      calc exp (2 * (C / Real.sqrt R) * s)           exp (((P.c64 * 64 : ) : ) * s) := hLHS        _  ((P.Aq * P.Aq / (c.eps * c.eps * P.rB) : ) : ) * s := hineq        _  (A * A / ((c.eps : ) * (c.eps : ) * Real.sqrt R)) * s :=            mul_le_mul_of_nonneg_right hqle hs_nonneg    -- take square roots: exp((C/√R)s) ≤ (A/(eps·R^{1/4}))·√s    have hRq_pos : (0:) < R ^ ((1:)/4) := Real.rpow_pos_of_pos hRpos _    have hR14sq : (R ^ ((1:)/4)) ^ 2 = Real.sqrt R := by      rw [ Real.rpow_natCast (R ^ ((1:)/4)) 2,  Real.rpow_mul hRpos.le,        Real.sqrt_eq_rpow]; norm_num    have hsqrt_step : exp (C / Real.sqrt R * s)         (A / ((c.eps : ) * R ^ ((1:)/4))) * Real.sqrt s := by      have hlhs_sq : Real.sqrt (exp (2 * (C / Real.sqrt R) * s)) = exp (C / Real.sqrt R * s) := by        rw [show 2 * (C / Real.sqrt R) * s = (C / Real.sqrt R * s) + (C / Real.sqrt R * s) by ring,          Real.exp_add, Real.sqrt_mul_self (exp_nonneg _)]      have hZnn : (0:)  A * A / ((c.eps : ) * (c.eps : ) * Real.sqrt R) := by positivity      have hmono := Real.sqrt_le_sqrt hsq_chain      rw [hlhs_sq, Real.sqrt_mul hZnn] at hmono      have hsqrtZ : Real.sqrt (A * A / ((c.eps : ) * (c.eps : ) * Real.sqrt R))          = A / ((c.eps : ) * R ^ ((1:)/4)) := by        rw [show A * A / ((c.eps : ) * (c.eps : ) * Real.sqrt R)              = (A / ((c.eps : ) * R ^ ((1:)/4))) ^ 2 by            rw [div_pow, mul_pow, hR14sq]; ring]        exact Real.sqrt_sq (by positivity)      rw [hsqrtZ] at hmono      exact hmono    -- curve identity for B = 1/4: admissible = (A/R^{1/4})·√s·exp(−(C/√R)·s)    have hs_rpow : s = Real.log x ^ ((1:)/2) := by rw [hs_def, Real.sqrt_eq_rpow]    have hsqrts : Real.sqrt s = Real.log x ^ ((1:)/4) := by      rw [hs_def, Real.sqrt_eq_rpow, Real.sqrt_eq_rpow,  Real.rpow_mul hlog_nonneg]; norm_num    have hcurve : admissible_bound A 0.25 C R x        = (A / R ^ ((1:)/4)) * Real.sqrt s * exp (-(C / Real.sqrt R * s)) := by      unfold admissible_bound      have e1 : (Real.log x / R) ^ (0.25:) = Real.sqrt s / R ^ ((1:)/4) := by        rw [show (0.25:) = (1:)/4 by norm_num, Real.div_rpow hlog_nonneg hRpos.le,  hsqrts]      have e2 : (Real.log x / R) ^ ((1:)/2) = s / Real.sqrt R := by        rw [Real.div_rpow hlog_nonneg hRpos.le, Real.sqrt_eq_rpow R,  hs_rpow]      rw [e1, e2, show -C * (s / Real.sqrt R) = -(C / Real.sqrt R * s) by ring]      ring    -- assemble: eps ≤ (A/R^{1/4})·√s·exp(−(C/√R)s)    rw [hcurve, Real.exp_neg]    have hstep2 : (c.eps : ) * exp (C / Real.sqrt R * s)  (A / R ^ ((1:)/4)) * Real.sqrt s := by      have hmul := mul_le_mul_of_nonneg_left hsqrt_step heps_pos.le      calc (c.eps : ) * exp (C / Real.sqrt R * s)           (c.eps : ) * ((A / ((c.eps : ) * R ^ ((1:)/4))) * Real.sqrt s) := hmul        _ = (A / R ^ ((1:)/4)) * Real.sqrt s := by field_simp    have hexp_pos : (0:) < exp (C / Real.sqrt R * s) := exp_pos _    have h4 := mul_le_mul_of_nonneg_right hstep2 (le_of_lt (inv_pos.mpr hexp_pos))    rw [mul_assoc, mul_inv_cancel₀ (ne_of_gt hexp_pos), mul_one] at h4    exact h4