| 1 | module |
| 2 | |
| 3 | public import E424.HighBand.L31Aux2 |
| 4 | public import E424.Defs |
| 5 | |
| 6 | @[expose] public section |
| 7 | |
| 8 | /-! |
| 9 | # Lemma 31 auxiliaries, part 3: the parameter arithmetic |
| 10 | -/ |
| 11 | |
| 12 | set_option linter.style.header false |
| 13 | open Finset |
| 14 | |
| 15 | namespace E424 |
| 16 | |
| 17 | /-- `log L ≤ c L` for large `L`. -/ |
| 18 | theorem log_le_mul_eventually (c : ℝ) (hc : 0 < c) : ∃ L1 : ℝ, ∀ L ≥ L1, Real.log L ≤ c * L := by |
| 19 | obtain ⟨L1, h⟩ := Filter.eventually_atTop.1 (Real.isLittleO_log_id_atTop.def hc) |
| 20 | refine ⟨max L1 1, fun L hL => ?_⟩ |
| 21 | have := h L (le_trans (le_max_left _ _) hL) |
| 22 | have h1 : 0 ≤ L := by linarith [le_max_right L1 1] |
| 23 | have h2 : 0 ≤ Real.log L := Real.log_nonneg (by linarith [le_max_right L1 1]) |
| 24 | simpa [Real.norm_of_nonneg h1, Real.norm_of_nonneg h2] using this |
| 25 | |
| 26 | /-- The final parameter arithmetic of Lemma 31. `L = log lo`, `u = log N`, `la = log a` where the cell has |
| 27 | `a ∈ [z^99, z^200]`, `z = L^200000`, `ℓ + 1` is the power with `u ≤ (ℓ+1) la`, `ℓ la < u`, `ε = 1/ξ`. -/ |
| 28 | theorem arith_final (C : ℝ) (hC : 0 < C) : ∃ L0 : ℝ, ∀ (L u la ε : ℝ) (ℓ : ℕ), L0 ≤ L → L ≤ u → |
| 29 | u ≤ 1.01 * L → 0 ≤ ε → ε ≤ 1 → 1.98e7 * Real.log L ≤ la → la ≤ 4e7 * Real.log L → |
| 30 | (ℓ : ℝ) * la < u → u ≤ ((ℓ : ℝ) + 1) * la → |
| 31 | 2 * (200 * L ^ 100 * (200000 * Real.log L) + 1) * |
| 32 | ((((ℓ : ℝ) + 1) * (la + ε) - u + 1) * (2 * C * (Real.log 2 + ((ℓ : ℝ) + 1) * (la + ε))) * |
| 33 | (((200 * ((ℓ : ℝ) + 1) + 1) ^ 200) ^ ℓ)) * ((L ^ 200) ^ (2 * (ℓ + 1))) ≤ |
| 34 | Real.exp (0.006 * u) := by |
| 35 | obtain ⟨L1, hL1⟩ := log_le_mul_eventually 1e-8 (by norm_num) |
| 36 | refine ⟨max 5e7 (max L1 (1000 * |Real.log (80 * C)|)), fun L u la ε ℓ hL hLu hu hε0 hε1 hla1 hla2 |
| 37 | hl1 hl2 => ?_⟩ |
| 38 | have hL5 : 5e7 ≤ L := le_trans (le_max_left _ _) hL |
| 39 | have hLL1 : L1 ≤ L := le_trans (le_trans (le_max_left _ _) (le_max_right _ _)) hL |
| 40 | have hLC : 1000 * |Real.log (80 * C)| ≤ L := |
| 41 | le_trans (le_trans (le_max_right _ _) (le_max_right _ _)) hL |
| 42 | have hL0 : 0 < L := by linarith |
| 43 | set LL := Real.log L with hLLdef |
| 44 | have hLLle : LL ≤ 1e-8 * L := hL1 L hLL1 |
| 45 | have hLL1' : 1 ≤ LL := by |
| 46 | rw [hLLdef, Real.le_log_iff_exp_le hL0] |
| 47 | have := Real.exp_one_lt_d9 |
| 48 | linarith |
| 49 | have hl0 : (0 : ℝ) ≤ ℓ := Nat.cast_nonneg _ |
| 50 | have hla : 1 ≤ la := by linarith |
| 51 | have hlu : (ℓ : ℝ) < u := by nlinarith |
| 52 | have hk : (ℓ : ℝ) + 1 ≤ 2 * L := by linarith |
| 53 | have hkLL : (ℓ : ℝ) * LL ≤ u / 1.98e7 := by |
| 54 | have : (ℓ : ℝ) * (1.98e7 * LL) ≤ (ℓ : ℝ) * la := mul_le_mul_of_nonneg_left hla1 hl0 |
| 55 | linarith |
| 56 | have hεk : ((ℓ : ℝ) + 1) * ε ≤ (ℓ : ℝ) + 1 := by nlinarith |
| 57 | have hεk0 : 0 ≤ ((ℓ : ℝ) + 1) * ε := by positivity |
| 58 | -- the factors |
| 59 | have hA1u : ((ℓ : ℝ) + 1) * (la + ε) - u + 1 ≤ 4 * L := by nlinarith |
| 60 | have hA1l : 0 ≤ ((ℓ : ℝ) + 1) * (la + ε) - u + 1 := by nlinarith |
| 61 | have hlog2 : Real.log 2 ≤ 1 := by have := Real.log_two_lt_d9; linarith |
| 62 | have hlog2' : 0 ≤ Real.log 2 := Real.log_nonneg (by norm_num) |
| 63 | have hA2u : Real.log 2 + ((ℓ : ℝ) + 1) * (la + ε) ≤ 5 * L := by nlinarith |
| 64 | have hA2l : 0 ≤ Real.log 2 + ((ℓ : ℝ) + 1) * (la + ε) := by nlinarith |
| 65 | have hLge1 : 1 ≤ L := by linarith |
| 66 | have hcmax : (((200 * ((ℓ : ℝ) + 1) + 1) ^ 200) ^ ℓ) ≤ (L ^ 400) ^ (ℓ + 1) := by |
| 67 | have h1 : 200 * ((ℓ : ℝ) + 1) + 1 ≤ L ^ 2 := by nlinarith |
| 68 | calc _ ≤ ((L ^ 2) ^ 200) ^ ℓ := |
| 69 | pow_le_pow_left₀ (by positivity) (pow_le_pow_left₀ (by positivity) h1 _) _ |
| 70 | _ = (L ^ 400) ^ ℓ := by rw [← pow_mul L 2 200] |
| 71 | _ ≤ _ := pow_le_pow_right₀ (one_le_pow₀ hLge1) (Nat.le_succ ℓ) |
| 72 | have hVb : 200 * L ^ 100 * (200000 * LL) + 1 ≤ L ^ 102 := by |
| 73 | have hLLL : LL ≤ L := Real.log_le_self hL0.le |
| 74 | have hP : 1 ≤ L ^ 100 := one_le_pow₀ hLge1 |
| 75 | have : L ^ 102 = L * L * L ^ 100 := by ring |
| 76 | rw [this] |
| 77 | have h1 : 4e7 * LL * L ^ 100 ≤ 4e7 * L * L ^ 100 := by gcongr |
| 78 | have h2 : 5e7 * (L * L ^ 100) ≤ L * (L * L ^ 100) := by gcongr |
| 79 | have h3 : 1 ≤ L * L ^ 100 := by nlinarith |
| 80 | nlinarith |
| 81 | have hcmax0 : 0 ≤ (((200 * ((ℓ : ℝ) + 1) + 1) ^ 200) ^ ℓ) := by positivity |
| 82 | have hpow : (L ^ 200) ^ (2 * (ℓ + 1)) = (L ^ 400) ^ (ℓ + 1) := by |
| 83 | rw [← pow_mul, ← pow_mul]; ring_nf |
| 84 | rw [hpow] |
| 85 | have hmain : 2 * (200 * L ^ 100 * (200000 * LL) + 1) * |
| 86 | ((((ℓ : ℝ) + 1) * (la + ε) - u + 1) * (2 * C * (Real.log 2 + ((ℓ : ℝ) + 1) * (la + ε))) * |
| 87 | (((200 * ((ℓ : ℝ) + 1) + 1) ^ 200) ^ ℓ)) * ((L ^ 400) ^ (ℓ + 1)) ≤ |
| 88 | 80 * C * L ^ 104 * (L ^ 800) ^ (ℓ + 1) := by |
| 89 | have hP4 : 0 ≤ (L ^ 400) ^ (ℓ + 1) := by positivity |
| 90 | calc _ ≤ 2 * L ^ 102 * ((4 * L) * (2 * C * (5 * L)) * ((L ^ 400) ^ (ℓ + 1))) * |
| 91 | ((L ^ 400) ^ (ℓ + 1)) := by |
| 92 | gcongr |
| 93 | _ = 80 * C * L ^ 104 * ((L ^ 400) ^ (ℓ + 1) * (L ^ 400) ^ (ℓ + 1)) := by ring |
| 94 | _ = _ := by rw [← mul_pow, ← pow_add] |
| 95 | refine hmain.trans ?_ |
| 96 | have hCpos : 0 < 80 * C := by positivity |
| 97 | have e1 : L ^ 104 = Real.exp (104 * LL) := by |
| 98 | rw [show (104 : ℝ) = ((104 : ℕ) : ℝ) by norm_num, Real.exp_nat_mul, hLLdef, Real.exp_log hL0] |
| 99 | have e2 : (L ^ 800) ^ (ℓ + 1) = Real.exp (((ℓ : ℝ) + 1) * (800 * LL)) := by |
| 100 | have : L ^ 800 = Real.exp (800 * LL) := by |
| 101 | rw [show (800 : ℝ) = ((800 : ℕ) : ℝ) by norm_num, Real.exp_nat_mul, hLLdef, Real.exp_log hL0] |
| 102 | rw [this, ← Real.exp_nat_mul]; push_cast; rfl |
| 103 | rw [e1, e2, mul_assoc, ← Real.exp_add] |
| 104 | conv_lhs => rw [show 80 * C = Real.exp (Real.log (80 * C)) from (Real.exp_log hCpos).symm] |
| 105 | rw [← Real.exp_add] |
| 106 | apply Real.exp_le_exp.2 |
| 107 | have hlogC : Real.log (80 * C) ≤ 0.001 * L := by |
| 108 | have := le_abs_self (Real.log (80 * C)) |
| 109 | linarith |
| 110 | have h4 : (ℓ : ℝ) * (800 * LL) ≤ 800 * (u / 1.98e7) := by linarith |
| 111 | linarith |
| 112 | |
| 113 | end E424 |
| 114 | |