Development/AutomorphicArithmetic/CharacterBoxes/DivinNOfHypV.lean
51by_contra hl52exact hne (by unfold vvTerm; simp [hl])), ← Finset.sum_subtype_eq_sum_filter]53exact Finset.sum_le_sum fun l _ => (bd l).2 l.254refine ⟨?_, summable_of_sum_le (fun l => (bd l).1) part, Real.tsum_le_of_sum_le (fun l => (bd l).1) part⟩55intro p _ e56intros57exact h1 p e ‹_› ‹_›5859theorem log_sq_le_rpow {eps : ℝ} (h : 0 < eps) :60∃ x0 : ℝ, ∀ x ≥ x0, Real.log x ^ 2 ≤ x ^ eps := by61have h1 := (isLittleO_log_rpow_atTop (half_pos h)).bound one_pos62obtain ⟨x0, hx0⟩ := Filter.eventually_atTop.1 h163refine ⟨max x0 1, fun x hx => ?_⟩64have hx1 : 1 ≤ x := le_trans (le_max_right _ _) hx65have h2 := hx0 x (le_trans (le_max_left _ _) hx)66have hp : 0 ≤ x ^ (eps / 2) := Real.rpow_nonneg (by linarith) _67rw [Real.norm_eq_abs, Real.norm_eq_abs, abs_of_nonneg (Real.log_nonneg hx1), abs_of_nonneg hp,68one_mul] at h269have h3 : x ^ eps = (x ^ (eps / 2)) ^ 2 := by70rw [sq, ← Real.rpow_add (by linarith)]71congr 172ring73rw [h3]74exact pow_le_pow_left₀ (Real.log_nonneg hx1) h2 27576theorem divinN_at {D : D7} (L : SizeData₂ D) (j : ℕ) (C : ℝ) (hj : j ∈ SizeData₂.lifts D)77(hN : LinkN_at L j C) (hs : Summable (vvTerm D)) (hb : ∑' l, vvTerm D l ≤ L.sc.b)78(hd : L.dZ0 j = D.what₂.D0) (hlog : Real.log L.sc.x ^ 2 ≤ L.sc.x ^ L.sc.eps) :79DIVinN_at L j (|C| + 1) := by80have hx : 0 < L.sc.x := lt_trans one_pos L.sc.one_lt_alt81have hy : 1 ≤ L.sc.x ^ L.sc.eps := Real.one_le_rpow L.sc.one_lt_alt.le L.sc.eps_pos.le82have hf : (1 : ℝ) ≤ D.R.f := by83have : 0 < D.R.f := by unfold Ranks.f Ranks.n; positivity84exact_mod_cast this85have hm : (1 : ℝ) ≤ D.R.m := by86have h := Finset.mem_Icc.1 hj87exact_mod_cast le_trans h.1 h.288have hbpos : 0 < L.sc.b := Real.exp_pos _89have hNc : 0 ≤ L.Nc := by90simp only [SizeData₂.Nc, budgetNc, rankBudget, bSize]91positivity92have hB : L.B0 = (D.R.f : ℝ) * D.R.m * L.sc.b * L.sc.x ^ L.sc.eps := rfl93have hL : L.sc.L = L.sc.x ^ L.sc.eps := rfl94have hE := hN hs95rw [hd, hL] at hE96unfold DIVinN_at97refine le_trans hE (mul_le_mul_of_nonneg_left ?_ (Nat.cast_nonneg _))98set y := L.sc.x ^ L.sc.eps with hydef99have hfm : 1 ≤ (D.R.f : ℝ) * D.R.m := one_le_mul_of_one_le_of_one_le hf hm100have hbB : L.sc.b ≤ L.B0 := by