| 1 | module |
| 2 | |
| 3 | public import E424.Rigidity |
| 4 | |
| 5 | @[expose] public section |
| 6 | |
| 7 | /-! |
| 8 | # Proposition D, proved from the lemmas of section 5 |
| 9 | -/ |
| 10 | |
| 11 | set_option linter.style.header false |
| 12 | open Finset Filter |
| 13 | |
| 14 | namespace E424 |
| 15 | |
| 16 | theorem D_add {η N0 : ℝ} (hη : 0 < η) {W : Win} (h : W.Adm η N0) (a b : ℕ) : |
| 17 | W.D (a + b) ≤ W.D a + W.D b + 4 * a / (W.lo * W.len) := by |
| 18 | have hL := h.len_pos hη |
| 19 | have hlo := h.lo_pos |
| 20 | have h1 : W.D (a + b) ≤ W.D a + W.E fun n => ind (F (n + a + b) ≠ F (n + a)) := by |
| 21 | unfold Win.D |
| 22 | rw [← Win.E_add] |
| 23 | refine Win.E_mono hL.le fun n _ => ?_ |
| 24 | refine le_trans (ind_mono ?_) (ind_or_le _ _) |
| 25 | intro hne |
| 26 | by_contra hcon |
| 27 | rw [not_or, not_not, not_not] at hcon |
| 28 | exact hne (by rw [← add_assoc, hcon.2, hcon.1]) |
| 29 | have h2 := abs_le.mp (L17_shift W (by linarith [h.three_le]) h.lo_lt.le a |
| 30 | (fun n => ind (F (n + b) ≠ F n)) 1 fun n => by |
| 31 | rw [abs_of_nonneg (ind_nonneg _)]; exact ind_le_one _) |
| 32 | have h3 : (W.E fun n => ind (F (n + a + b) ≠ F (n + a))) ≤ W.D b + 4 * a / (W.lo * W.len) := by |
| 33 | unfold Win.D Win.E |
| 34 | rw [← div_div, ← add_div] |
| 35 | refine div_le_div_of_nonneg_right ?_ hL.le |
| 36 | have := h2.2 |
| 37 | beta_reduce at this |
| 38 | rw [mul_one] at this |
| 39 | linarith |
| 40 | linarith |
| 41 | |
| 42 | theorem D_zero (W : Win) : W.D 0 = 0 := by |
| 43 | simp [Win.D, Win.E, Win.sum, ind] |
| 44 | |
| 45 | /-- **Lemma 24**, final form. -/ |
| 46 | theorem L24 (K η : ℝ) (hη : 0 < η) : ∃ C > 0, ∃ N0 : ℝ, ∀ W J T x, Setup K η N0 W J T x → |
| 47 | ∀ h : ℕ, 1 ≤ h → (h : ℝ) ≤ W.lo ^ (0.01 : ℝ) → |
| 48 | W.D h ≤ C * (1 + Real.log h) * dp W J x := by |
| 49 | obtain ⟨C1, hC1, N1, h1⟩ := L23 K η hη |
| 50 | obtain ⟨C2, hC2, N2, h2⟩ := L24_double K η hη |
| 51 | refine ⟨2 * (C1 + C2 + 1), by positivity, max (max N1 N2) (4 / η), fun W J T x hS => ?_⟩ |
| 52 | have hS1 := hS.mono ((le_max_left N1 N2).trans (le_max_left _ (4 / η))) |
| 53 | have hS2 := hS.mono ((le_max_right N1 N2).trans (le_max_left _ (4 / η))) |
| 54 | have hd := hS.dp_pos |
| 55 | have hD1 := h1 W J T x hS1 |
| 56 | have hsm := (small_le_edge hη (hS.adm.mono (le_max_right _ _)) le_rfl).trans hS.edge_le_dp |
| 57 | have key : ∀ h : ℕ, 1 ≤ h → (h : ℝ) ≤ W.lo ^ (0.01 : ℝ) → |
| 58 | W.D h ≤ (C1 + C2 + 1) * (1 + Nat.log 2 h) * dp W J x := by |
| 59 | intro h |
| 60 | induction h using Nat.strong_induction_on with |
| 61 | | _ h ih => |
| 62 | intro hh hle |
| 63 | rcases Nat.lt_or_ge h 2 with hlt | hge |
| 64 | · have : h = 1 := by omega |
| 65 | subst this |
| 66 | simp only [Nat.log_one_right, Nat.cast_zero, add_zero, mul_one] |
| 67 | nlinarith |
| 68 | · obtain ⟨m, hm⟩ : ∃ m, m = h / 2 := ⟨_, rfl⟩ |
| 69 | have hm1 : 1 ≤ m := by omega |
| 70 | have hmh : m < h := by omega |
| 71 | have hmle : (m : ℝ) ≤ W.lo ^ (0.01 : ℝ) := le_trans (by exact_mod_cast hmh.le) hle |
| 72 | have hlog : Nat.log 2 h = Nat.log 2 m + 1 := by |
| 73 | rw [Nat.log_of_one_lt_of_le (by norm_num) hge, hm] |
| 74 | have e1 := ih m hmh hm1 hmle |
| 75 | have e2 := h2 W J T x hS2 m hm1 hmle |
| 76 | have e3 : W.D h ≤ W.D (2 * m) + (C1 + 1) * dp W J x := by |
| 77 | rcases Nat.even_or_odd' h with ⟨c, hc | hc⟩ |
| 78 | · have : 2 * m = h := by omega |
| 79 | rw [this]; nlinarith |
| 80 | · have : h = 1 + 2 * m := by omega |
| 81 | rw [this] |
| 82 | have := D_add hη hS.adm 1 (2 * m) |
| 83 | rw [Nat.cast_one, mul_one] at this |
| 84 | linarith |
| 85 | rw [hlog]; push_cast |
| 86 | nlinarith |
| 87 | intro h hh hle |
| 88 | refine (key h hh hle).trans ?_ |
| 89 | have hlog : (Nat.log 2 h : ℝ) ≤ 2 * Real.log h := by |
| 90 | have e1 : (2 : ℝ) ^ Nat.log 2 h ≤ h := by exact_mod_cast Nat.pow_log_le_self 2 (by omega) |
| 91 | have e2 := Real.log_le_log (by positivity) e1 |
| 92 | rw [Real.log_pow] at e2 |
| 93 | have := Real.log_two_gt_d9 |
| 94 | have : (0 : ℝ) ≤ Nat.log 2 h := Nat.cast_nonneg _ |
| 95 | nlinarith |
| 96 | have hlogh : 0 ≤ Real.log h := Real.log_nonneg (by exact_mod_cast hh) |
| 97 | have : 1 + (Nat.log 2 h : ℝ) ≤ 2 * (1 + Real.log h) := by linarith |
| 98 | calc (C1 + C2 + 1) * (1 + Nat.log 2 h) * dp W J x |
| 99 | ≤ (C1 + C2 + 1) * (2 * (1 + Real.log h)) * dp W J x := by gcongr |
| 100 | _ = _ := by ring |
| 101 | |
| 102 | /-- `x ≤ A + B x^{3/4}` implies `x ≤ 2A + 16 B^4`. -/ |
| 103 | theorem bootstrap {x a b : ℝ} (hx : 0 ≤ x) (ha : 0 ≤ a) |
| 104 | (h : x ≤ a + b * x ^ (3 / 4 : ℝ)) : x ≤ 2 * a + 16 * b ^ 4 := by |
| 105 | rcases le_or_gt (x / 2) a with h1 | h1 |
| 106 | · have : 0 ≤ 16 * b ^ 4 := by positivity |
| 107 | linarith |
| 108 | · have hx0 : 0 < x := by linarith |
| 109 | have h2 : x / 2 ≤ b * x ^ (3 / 4 : ℝ) := by linarith |
| 110 | set u := x ^ (1 / 4 : ℝ) with hu |
| 111 | have hu0 : 0 < u := Real.rpow_pos_of_pos hx0 _ |
| 112 | have hx4 : x = u ^ 4 := by |
| 113 | rw [hu, ← Real.rpow_natCast, ← Real.rpow_mul hx]; norm_num |
| 114 | have hx3 : x ^ (3 / 4 : ℝ) = u ^ 3 := by |
| 115 | rw [hu, ← Real.rpow_natCast, ← Real.rpow_mul hx]; norm_num |
| 116 | rw [hx3, hx4] at h2 |
| 117 | have h3 : u ≤ 2 * b := by |
| 118 | have : u ^ 3 * u ≤ u ^ 3 * (2 * b) := by nlinarith |
| 119 | exact le_of_mul_le_mul_left this (by positivity) |
| 120 | have h4 : u ^ 4 ≤ (2 * b) ^ 4 := pow_le_pow_left₀ hu0.le h3 4 |
| 121 | rw [hx4]; nlinarith |
| 122 | |
| 123 | /-- **Lemma 25**: `δ' ≤ C (J⁻² log³ J + edge)` for the least admissible `x`. -/ |
| 124 | theorem L25 (K η : ℝ) (hη : 0 < η) : ∃ C > 0, ∃ N0 : ℝ, ∀ (W : Win) (J : ℕ) (T : ℕ → Finset ℕ), |
| 125 | W.Adm η N0 → 3 ≤ J → (J : ℝ) ≤ K * Real.log (Real.log W.lo) → |
| 126 | (54 * (J : ℝ) ^ 6 ≤ W.lo ^ (0.01 : ℝ)) → |
| 127 | (∀ ρ : ℕ, ρ = 53 ∨ ρ = 23 → RigHyp K W J ρ (T ρ)) → |
| 128 | ∃ x, Setup K η N0 W J T x ∧ dp W J x ≤ C * (Real.log J ^ 3 / (J : ℝ) ^ 2 + W.edge) := by |
| 129 | obtain ⟨C1, hC1, N1, h21⟩ := L21 K η hη |
| 130 | obtain ⟨C2, hC2, N2, h24⟩ := L24 K η hη |
| 131 | obtain ⟨C3, hC3, N3, h25⟩ := L25_step K η hη |
| 132 | set Cy := C1 + 12 * C2 with hCy |
| 133 | have hCy0 : 0 < Cy := by positivity |
| 134 | set Cb := C3 * Cy ^ (3 / 4 : ℝ) with hCb |
| 135 | have hCb0 : 0 < Cb := by positivity |
| 136 | refine ⟨4 * (C3 + 1) + 16 * Cb ^ 4, by positivity, max (max N1 N2) N3, ?_⟩ |
| 137 | intro W J T hW hJ3 hJK hJ6 hrig |
| 138 | -- choose `x` as the maximum of the unknowns |
| 139 | set I : Finset (ℕ × ℕ) := ({53, 23} : Finset ℕ) ×ˢ range 54 with hI |
| 140 | have hIne : I.Nonempty := ⟨(53, 0), by simp [hI]⟩ |
| 141 | obtain ⟨p0, hp0, hmax⟩ := exists_max_image I (fun p => Dl W (T p.1) p.2) hIne |
| 142 | set x := Dl W (T p0.1) p0.2 with hx |
| 143 | have hρ0 : p0.1 = 53 ∨ p0.1 = 23 := by |
| 144 | have := (mem_product.mp hp0).1; simpa using this |
| 145 | have ha0 : p0.2 < 54 := mem_range.mp (mem_product.mp hp0).2 |
| 146 | have hx0 : 0 ≤ x := div_nonneg (abs_nonneg _) (ms_nonneg _) |
| 147 | have hS : Setup K η (max (max N1 N2) N3) W J T x := by |
| 148 | refine ⟨hW, hJ3, hJK, hrig, hx0, fun ρ hρ a ha => hmax (ρ, a) ?_⟩ |
| 149 | simp only [hI, mem_product, mem_range] |
| 150 | exact ⟨by simpa using hρ, ha⟩ |
| 151 | refine ⟨x, hS, ?_⟩ |
| 152 | have hS1 := hS.mono ((le_max_left N1 N2).trans (le_max_left _ N3)) |
| 153 | have hS2 := hS.mono ((le_max_right N1 N2).trans (le_max_left _ N3)) |
| 154 | have hS3 := hS.mono (le_max_right _ N3) |
| 155 | have hd := hS.dp_pos |
| 156 | have hedge := edge_pos hW |
| 157 | have hJ0 : (0 : ℝ) < J := by positivity |
| 158 | have hJ3' : (3 : ℝ) ≤ J := by exact_mod_cast hJ3 |
| 159 | have hlJ : 1 ≤ Real.log J := by |
| 160 | rw [Real.le_log_iff_exp_le hJ0]; linarith [Real.exp_one_lt_d9] |
| 161 | set d := dp W J x with hdd |
| 162 | set y := Cy * Real.log J * d with hy |
| 163 | have hyD : ∀ h ≤ 54 * J ^ 6, W.D h ≤ y := by |
| 164 | intro h hh |
| 165 | rcases Nat.eq_zero_or_pos h with rfl | hpos |
| 166 | · rw [D_zero]; positivity |
| 167 | · have hhR : (h : ℝ) ≤ 54 * (J : ℝ) ^ 6 := by exact_mod_cast hh |
| 168 | refine (h24 W J T x hS2 h hpos (hhR.trans hJ6)).trans ?_ |
| 169 | have hh0 : (0 : ℝ) < h := by exact_mod_cast hpos |
| 170 | have hl : Real.log h ≤ 10 * Real.log J := by |
| 171 | have e1 : (h : ℝ) ≤ (J : ℝ) ^ 10 := by |
| 172 | refine hhR.trans ?_ |
| 173 | have : (54 : ℝ) ≤ (J : ℝ) ^ 4 := by |
| 174 | calc (54 : ℝ) ≤ 3 ^ 4 := by norm_num |
| 175 | _ ≤ _ := by gcongr |
| 176 | calc 54 * (J : ℝ) ^ 6 ≤ (J : ℝ) ^ 4 * (J : ℝ) ^ 6 := by gcongr |
| 177 | _ = (J : ℝ) ^ 10 := by ring |
| 178 | have e2 := Real.log_le_log hh0 e1 |
| 179 | rw [Real.log_pow] at e2 |
| 180 | exact_mod_cast e2 |
| 181 | have : C2 * (1 + Real.log h) ≤ Cy * Real.log J := by rw [hCy]; nlinarith |
| 182 | rw [hy] |
| 183 | exact mul_le_mul_of_nonneg_right this hd.le |
| 184 | have hyG : W.mu G1 ≤ y := by |
| 185 | refine (h21 W J T x hS1).1.trans ?_ |
| 186 | rw [hy] |
| 187 | refine mul_le_mul_of_nonneg_right ?_ hd.le |
| 188 | rw [hCy]; nlinarith |
| 189 | have hstep := h25 W J T x hS3 y hyD hyG p0.1 hρ0 p0.2 ha0 |
| 190 | rw [← hx] at hstep |
| 191 | have hJ2 : (J : ℝ) ^ (-(2 : ℝ)) = 1 / (J : ℝ) ^ 2 := by |
| 192 | rw [Real.rpow_neg hJ0.le, one_div]; norm_num |
| 193 | rw [hJ2] at hstep |
| 194 | have hypow : y ^ (3 / 4 : ℝ) = Cy ^ (3 / 4 : ℝ) * Real.log J ^ (3 / 4 : ℝ) * d ^ (3 / 4 : ℝ) := by |
| 195 | rw [hy, Real.mul_rpow (by positivity) hd.le, Real.mul_rpow hCy0.le (by linarith)] |
| 196 | set b := Cb * ((J : ℝ) ^ (-(1 / 2) : ℝ) * Real.log J ^ (3 / 4 : ℝ)) with hb |
| 197 | have hb0 : 0 ≤ b := by |
| 198 | have : 0 ≤ Real.log J := by linarith |
| 199 | positivity |
| 200 | have hineq : d ≤ (C3 + 1) * (1 / (J : ℝ) ^ 2 + W.edge) + b * d ^ (3 / 4 : ℝ) := by |
| 201 | have e : C3 * ((J : ℝ) ^ (-(1 / 2) : ℝ) * y ^ (3 / 4 : ℝ)) = b * d ^ (3 / 4 : ℝ) := by |
| 202 | rw [hypow, hb, hCb]; ring |
| 203 | have e2 : d = x + 1 / (J : ℝ) ^ 2 + W.edge := rfl |
| 204 | nlinarith |
| 205 | have hfin := bootstrap hd.le (by positivity) hineq |
| 206 | have hb4 : b ^ 4 = Cb ^ 4 * (Real.log J ^ 3 / (J : ℝ) ^ 2) := by |
| 207 | have e1 : ((J : ℝ) ^ (-(1 / 2) : ℝ)) ^ 4 = 1 / (J : ℝ) ^ 2 := by |
| 208 | rw [← Real.rpow_natCast, ← Real.rpow_mul hJ0.le, |
| 209 | show (-(1 / 2) : ℝ) * ((4 : ℕ) : ℝ) = -((2 : ℕ) : ℝ) by norm_num, Real.rpow_neg hJ0.le, |
| 210 | Real.rpow_natCast, one_div] |
| 211 | have e2 : (Real.log J ^ (3 / 4 : ℝ)) ^ 4 = Real.log J ^ 3 := by |
| 212 | rw [← Real.rpow_natCast, ← Real.rpow_mul (by linarith), |
| 213 | show (3 / 4 : ℝ) * ((4 : ℕ) : ℝ) = ((3 : ℕ) : ℝ) by norm_num, Real.rpow_natCast] |
| 214 | have e3 : b ^ 4 = Cb ^ 4 * (((J : ℝ) ^ (-(1 / 2) : ℝ)) ^ 4 * (Real.log J ^ (3 / 4 : ℝ)) ^ 4) := by |
| 215 | rw [hb]; ring |
| 216 | rw [e3, e1, e2]; ring |
| 217 | rw [hb4] at hfin |
| 218 | have hlog3 : 1 / (J : ℝ) ^ 2 ≤ Real.log J ^ 3 / (J : ℝ) ^ 2 := by |
| 219 | gcongr; exact one_le_pow₀ hlJ |
| 220 | have hq0 : 0 ≤ Real.log J ^ 3 / (J : ℝ) ^ 2 := by positivity |
| 221 | have hCb4 : 0 ≤ Cb ^ 4 := by positivity |
| 222 | nlinarith |
| 223 | |
| 224 | /-- The function controlling all of Proposition D, in `t = log log lo`, tends to 0. -/ |
| 225 | theorem rate_tendsto (a b c : ℝ) : Tendsto |
| 226 | (fun t : ℝ => a * (1 + b * t) * (c * t ^ (-(3 / 2) : ℝ) + Real.exp (-(1 / 3) * t))) atTop (nhds 0) := by |
| 227 | have h1 : Tendsto (fun t : ℝ => t ^ (-(3 / 2) : ℝ)) atTop (nhds 0) := |
| 228 | tendsto_rpow_neg_atTop (by norm_num) |
| 229 | have h2 : Tendsto (fun t : ℝ => t ^ (-(1 / 2) : ℝ)) atTop (nhds 0) := |
| 230 | tendsto_rpow_neg_atTop (by norm_num) |
| 231 | have h3 : Tendsto (fun t : ℝ => Real.exp (-(1 / 3) * t)) atTop (nhds 0) := |
| 232 | Real.tendsto_exp_atBot.comp (tendsto_id.const_mul_atTop_of_neg (by norm_num)) |
| 233 | have h4 : Tendsto (fun t : ℝ => t * Real.exp (-(1 / 3) * t)) atTop (nhds 0) := by |
| 234 | have := tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero 1 (1 / 3) (by norm_num) |
| 235 | refine this.congr fun t => ?_ |
| 236 | rw [Real.rpow_one] |
| 237 | have h5 : Tendsto (fun t : ℝ => a * c * t ^ (-(3 / 2) : ℝ) + a * b * c * t ^ (-(1 / 2) : ℝ) + |
| 238 | a * Real.exp (-(1 / 3) * t) + a * b * (t * Real.exp (-(1 / 3) * t))) atTop (nhds 0) := by |
| 239 | simpa using (((h1.const_mul (a * c)).add (h2.const_mul (a * b * c))).add (h3.const_mul a)).add |
| 240 | (h4.const_mul (a * b)) |
| 241 | refine h5.congr' ?_ |
| 242 | filter_upwards [eventually_gt_atTop 0] with t ht |
| 243 | have : t ^ (-(1 / 2) : ℝ) = t * t ^ (-(3 / 2) : ℝ) := by |
| 244 | rw [← Real.rpow_one_add' ht.le (by norm_num)]; norm_num |
| 245 | rw [this]; ring |
| 246 | |
| 247 | set_option maxHeartbeats 2000000 in |
| 248 | /-- **Proposition D.** -/ |
| 249 | theorem PropD (η : ℝ) (hη : 0 < η) (C3 : ℕ) (e : ℝ) (he : 0 < e) : ∃ N0 : ℝ, ∀ W : Win, W.Adm η N0 → |
| 250 | (W.mu (Es 2) ≤ e ∧ W.mu (Es 3) ≤ e ∧ W.mu (Es 9) ≤ e ∧ |
| 251 | W.mu G1 ≤ e ∧ W.mu G2 ≤ e ∧ W.mu G3 ≤ e) ∧ |
| 252 | (∀ h : ℕ, 1 ≤ h → (h : ℝ) ≤ Real.log W.lo ^ C3 → W.D h ≤ e) ∧ |
| 253 | (∀ (z : ℝ) (S : Finset ℕ), 3 ≤ z → IsFam z S → (∀ s ∈ S, s ∈ A ∧ s % 3 = 2) → |
| 254 | z ^ 200 ≤ Real.exp (Real.sqrt (Real.log W.lo)) → W.E (badCount S) ≤ e) := by |
| 255 | obtain ⟨K, hK1, hrig⟩ := exists_rig |
| 256 | obtain ⟨N1, hrig⟩ := hrig η hη |
| 257 | obtain ⟨C20, hC20, N2, h20⟩ := L20 K η hη |
| 258 | obtain ⟨C21, hC21, N3, h21⟩ := L21 K η hη |
| 259 | obtain ⟨C24, hC24, N4, h24⟩ := L24 K η hη |
| 260 | obtain ⟨C25, hC25, N5, h25⟩ := L25 K η hη |
| 261 | obtain ⟨Cf, hCf, N6, hfam⟩ := famRigid η hη |
| 262 | -- the target smallness `y` |
| 263 | set y : ℝ := min (min 1 e) ((e / (2 * Cf)) ^ (4 / 3 : ℝ)) with hy |
| 264 | have hy0 : 0 < y := by positivity |
| 265 | have hy1 : y ≤ 1 := (min_le_left _ _).trans (min_le_left _ _) |
| 266 | have hye : y ≤ e := (min_le_left _ _).trans (min_le_right _ _) |
| 267 | have hyf : Cf * y ^ (3 / 4 : ℝ) ≤ e / 2 := by |
| 268 | have e1 : y ^ (3 / 4 : ℝ) ≤ ((e / (2 * Cf)) ^ (4 / 3 : ℝ)) ^ (3 / 4 : ℝ) := |
| 269 | Real.rpow_le_rpow hy0.le (min_le_right _ _) (by norm_num) |
| 270 | rw [← Real.rpow_mul (by positivity)] at e1 |
| 271 | norm_num at e1 |
| 272 | calc Cf * y ^ (3 / 4 : ℝ) ≤ Cf * (e / (2 * Cf)) := by gcongr |
| 273 | _ = e / 2 := by field_simp |
| 274 | set Cm : ℝ := (C20 + C21 + C24) * C25 with hCm |
| 275 | have hCm0 : 0 < Cm := by positivity |
| 276 | set c : ℝ := 216 * K ^ (3 / 2 : ℝ) with hc |
| 277 | -- everything that has to hold for large `lo` |
| 278 | have hll : Tendsto (fun lo : ℝ => Real.log (Real.log lo)) atTop atTop := |
| 279 | Real.tendsto_log_atTop.comp Real.tendsto_log_atTop |
| 280 | have ev1 := hll.eventually ((rate_tendsto Cm (C3 + 2) c).eventually (gt_mem_nhds hy0)) |
| 281 | have ev2 : ∀ᶠ lo : ℝ in atTop, 54 * (K * Real.log (Real.log lo)) ^ 6 ≤ lo ^ (0.01 : ℝ) := by |
| 282 | have h := isLittleO_log_rpow_rpow_atTop (6 : ℝ) (show (0 : ℝ) < 0.01 by norm_num) |
| 283 | have h' := h.bound (show 0 < 1 / (54 * K ^ 6) by positivity) |
| 284 | filter_upwards [h', eventually_ge_atTop (Real.exp 1), hll.eventually_ge_atTop 0] with lo h1 h2 h3 |
| 285 | have hlo : 0 < lo := (Real.exp_pos 1).trans_le h2 |
| 286 | have hl : 1 ≤ Real.log lo := by rwa [Real.le_log_iff_exp_le hlo] |
| 287 | have hl2 : Real.log (Real.log lo) ≤ Real.log lo := Real.log_le_self (by linarith) |
| 288 | rw [Real.norm_of_nonneg (by positivity), Real.norm_of_nonneg (by positivity), |
| 289 | show (6 : ℝ) = ((6 : ℕ) : ℝ) by norm_num, Real.rpow_natCast] at h1 |
| 290 | calc 54 * (K * Real.log (Real.log lo)) ^ 6 ≤ 54 * (K * Real.log lo) ^ 6 := by gcongr |
| 291 | _ = 54 * K ^ 6 * Real.log lo ^ 6 := by ring |
| 292 | _ ≤ 54 * K ^ 6 * (1 / (54 * K ^ 6) * lo ^ (0.01 : ℝ)) := by gcongr |
| 293 | _ = lo ^ (0.01 : ℝ) := by field_simp |
| 294 | have ev3 : ∀ᶠ lo : ℝ in atTop, Real.log lo ^ C3 ≤ lo ^ (0.01 : ℝ) ∧ Real.log lo ^ 2 ≤ lo ^ (0.01 : ℝ) := by |
| 295 | have h := isLittleO_log_rpow_rpow_atTop (C3 : ℝ) (show (0 : ℝ) < 0.01 by norm_num) |
| 296 | have g := isLittleO_log_rpow_rpow_atTop (2 : ℝ) (show (0 : ℝ) < 0.01 by norm_num) |
| 297 | filter_upwards [h.bound one_pos, g.bound one_pos, eventually_ge_atTop 1] with lo h1 h2 h3 |
| 298 | have hl : 0 ≤ Real.log lo := Real.log_nonneg h3 |
| 299 | have hlo : 0 ≤ lo := by linarith |
| 300 | rw [Real.norm_of_nonneg (by positivity), Real.norm_of_nonneg (by positivity), one_mul, |
| 301 | Real.rpow_natCast] at h1 |
| 302 | rw [Real.norm_of_nonneg (by positivity), Real.norm_of_nonneg (by positivity), one_mul, |
| 303 | show (2 : ℝ) = ((2 : ℕ) : ℝ) by norm_num, Real.rpow_natCast] at h2 |
| 304 | exact ⟨h1, h2⟩ |
| 305 | have ev4 := Real.tendsto_log_atTop.eventually_ge_atTop (100 : ℝ) |
| 306 | have ev5 := hll.eventually_ge_atTop (1 : ℝ) |
| 307 | have ev6 := Real.tendsto_log_atTop.eventually |
| 308 | ((tendsto_rpow_neg_atTop (show (0 : ℝ) < 1 / 3 by norm_num)).eventually |
| 309 | (gt_mem_nhds (show 0 < e / (2 * Cf) by positivity))) |
| 310 | obtain ⟨Nv, hNv⟩ := eventually_atTop.mp |
| 311 | (((ev1.and ev2).and (ev3.and ev4)).and (ev5.and ev6)) |
| 312 | refine ⟨max Nv (max N1 (max N2 (max N3 (max N4 (max N5 N6))))), fun W hW => ?_⟩ |
| 313 | have m0 : Nv ≤ W.lo := (le_max_left _ _).trans hW.le_lo |
| 314 | obtain ⟨⟨⟨a1, a2⟩, ⟨a3, a3'⟩, a4⟩, a5, a6⟩ := hNv W.lo m0 |
| 315 | have hW1 : W.Adm η N1 := hW.mono (by simp) |
| 316 | have hW2 : W.Adm η N2 := hW.mono (by simp) |
| 317 | have hW3 : W.Adm η N3 := hW.mono (by simp) |
| 318 | have hW4 : W.Adm η N4 := hW.mono (by simp) |
| 319 | have hW5 : W.Adm η N5 := hW.mono (by simp) |
| 320 | have hW6 : W.Adm η N6 := hW.mono (by simp) |
| 321 | obtain ⟨J, T, hJ3, hJK, hKJ, hR⟩ := hrig W hW1 |
| 322 | set t := Real.log (Real.log W.lo) with ht |
| 323 | have ht0 : 0 < t := by linarith |
| 324 | have hJ0 : (0 : ℝ) < J := by positivity |
| 325 | obtain ⟨x, hS, hd⟩ := h25 W J T hW5 hJ3 hJK (le_trans (by gcongr) a2) hR |
| 326 | have hdpos := hS.dp_pos |
| 327 | set d := dp W J x with hdd |
| 328 | -- bound for `d` |
| 329 | have hedge : W.edge = Real.exp (-(1 / 3) * t) := by |
| 330 | unfold Win.edge |
| 331 | rw [Real.rpow_def_of_pos (by linarith), ← ht, mul_comm] |
| 332 | have hdt : d ≤ C25 * (c * t ^ (-(3 / 2) : ℝ) + Real.exp (-(1 / 3) * t)) := by |
| 333 | refine hd.trans ?_ |
| 334 | rw [hedge] |
| 335 | gcongr |
| 336 | have hlJ : Real.log J ≤ 6 * (J : ℝ) ^ (1 / 6 : ℝ) := by |
| 337 | have := Real.log_le_rpow_div hJ0.le (show (0 : ℝ) < 1 / 6 by norm_num) |
| 338 | linarith [this] |
| 339 | have hlJ0 : 0 ≤ Real.log J := Real.log_nonneg (by |
| 340 | have : (3 : ℝ) ≤ J := by exact_mod_cast hJ3 |
| 341 | linarith) |
| 342 | have e1 : Real.log J ^ 3 ≤ 216 * (J : ℝ) ^ (1 / 2 : ℝ) := by |
| 343 | calc Real.log J ^ 3 ≤ (6 * (J : ℝ) ^ (1 / 6 : ℝ)) ^ 3 := pow_le_pow_left₀ hlJ0 hlJ 3 |
| 344 | _ = 216 * ((J : ℝ) ^ (1 / 6 : ℝ)) ^ 3 := by ring |
| 345 | _ = 216 * (J : ℝ) ^ (1 / 2 : ℝ) := by |
| 346 | rw [← Real.rpow_natCast, ← Real.rpow_mul hJ0.le]; norm_num |
| 347 | have e2 : Real.log J ^ 3 / (J : ℝ) ^ 2 ≤ 216 * (J : ℝ) ^ (-(3 / 2) : ℝ) := by |
| 348 | rw [div_le_iff₀ (by positivity), mul_assoc, ← Real.rpow_natCast (J : ℝ) 2, ← Real.rpow_add hJ0] |
| 349 | refine e1.trans (le_of_eq ?_) |
| 350 | norm_num |
| 351 | refine e2.trans ?_ |
| 352 | rw [hc, mul_assoc] |
| 353 | gcongr |
| 354 | have e3 : t / K ≤ J := by rw [div_le_iff₀ (by linarith)]; linarith |
| 355 | calc (J : ℝ) ^ (-(3 / 2) : ℝ) ≤ (t / K) ^ (-(3 / 2) : ℝ) := |
| 356 | Real.rpow_le_rpow_of_nonpos (by positivity) e3 (by norm_num) |
| 357 | _ = K ^ (3 / 2 : ℝ) * t ^ (-(3 / 2) : ℝ) := by |
| 358 | rw [Real.div_rpow ht0.le (by linarith), Real.rpow_neg (by linarith : (0:ℝ) ≤ K)] |
| 359 | field_simp |
| 360 | have hC3 : (0 : ℝ) ≤ C3 := Nat.cast_nonneg _ |
| 361 | have hmain : (C20 + C21 + C24) * (1 + (C3 + 2) * t) * d ≤ y := by |
| 362 | refine le_trans ?_ a1.le |
| 363 | rw [hCm] |
| 364 | calc (C20 + C21 + C24) * (1 + (C3 + 2) * t) * d |
| 365 | ≤ (C20 + C21 + C24) * (1 + (C3 + 2) * t) * |
| 366 | (C25 * (c * t ^ (-(3 / 2) : ℝ) + Real.exp (-(1 / 3) * t))) := by gcongr |
| 367 | _ = _ := by ring |
| 368 | have hfac : ∀ c' : ℝ, 0 ≤ c' → c' ≤ C20 + C21 + C24 → c' * d ≤ y := fun c' h0 h1 => by |
| 369 | refine le_trans ?_ hmain |
| 370 | refine mul_le_mul_of_nonneg_right ?_ hdpos.le |
| 371 | have : 1 ≤ 1 + (C3 + 2) * t := by |
| 372 | have : 0 ≤ (C3 + 2) * t := by positivity |
| 373 | linarith |
| 374 | nlinarith |
| 375 | have hS' : ∀ N', W.Adm η N' → Setup K η N' W J T x := fun N' h => |
| 376 | ⟨h, hS.three_le, hS.J_le, hS.rig, hS.x_nonneg, hS.bound⟩ |
| 377 | have hlo1 : 1 ≤ Real.log W.lo := hW.one_lt_log.le |
| 378 | have hDm : ∀ m : ℕ, m ≤ C3 + 2 → Real.log W.lo ^ m ≤ W.lo ^ (0.01 : ℝ) → ∀ h : ℕ, 1 ≤ h → |
| 379 | (h : ℝ) ≤ Real.log W.lo ^ m → W.D h ≤ y := by |
| 380 | intro m hm hm' h hh hle |
| 381 | refine (h24 W J T x (hS' N4 hW4) h hh (hle.trans hm')).trans ?_ |
| 382 | refine le_trans ?_ hmain |
| 383 | have hh0 : (0 : ℝ) < h := by exact_mod_cast hh |
| 384 | have hl : Real.log h ≤ (C3 + 2) * t := by |
| 385 | have e1 := Real.log_le_log hh0 hle |
| 386 | rw [Real.log_pow, ← ht] at e1 |
| 387 | refine e1.trans ?_ |
| 388 | gcongr |
| 389 | exact_mod_cast hm |
| 390 | have hl0 : 0 ≤ Real.log h := Real.log_nonneg (by exact_mod_cast hh) |
| 391 | refine mul_le_mul_of_nonneg_right ?_ hdpos.le |
| 392 | have : C24 ≤ C20 + C21 + C24 := by linarith |
| 393 | gcongr |
| 394 | have h21' := h21 W J T x (hS' N3 hW3) |
| 395 | have hE : ∀ s : ℕ, s = 2 ∨ s = 3 ∨ s = 9 → W.mu (Es s) ≤ y := fun s hs => |
| 396 | (h20 W J T x (hS' N2 hW2) s hs).trans (hfac C20 hC20.le (by linarith)) |
| 397 | have hG : ∀ S : Set ℕ, W.mu S ≤ C21 * dp W J x → W.mu S ≤ y := fun S h => |
| 398 | h.trans (hfac C21 hC21.le (by linarith)) |
| 399 | refine ⟨⟨(hE 2 (by simp)).trans hye, (hE 3 (by simp)).trans hye, (hE 9 (by simp)).trans hye, |
| 400 | (hG _ h21'.1).trans hye, (hG _ h21'.2.1).trans hye, (hG _ h21'.2.2).trans hye⟩, |
| 401 | fun h hh hle => (hDm C3 (by omega) a3 h hh hle).trans hye, fun z S hz hfamS hSA hzs => ?_⟩ |
| 402 | have h100 : ∀ h : ℕ, 1 ≤ h → (h : ℝ) ≤ 100 * Real.log W.lo → W.D h ≤ y := fun h hh hle => |
| 403 | hDm 2 (by omega) a3' h hh (hle.trans (by nlinarith)) |
| 404 | have := hfam W hW6 y hy0.le hy1 (hE 3 (by simp)) (hE 9 (by simp)) (hG _ h21'.1) (hG _ h21'.2.2) |
| 405 | h100 z S hz hfamS hSA hzs |
| 406 | refine this.trans ?_ |
| 407 | have a6' : W.edge < e / (2 * Cf) := a6 |
| 408 | have : Cf * W.edge ≤ e / 2 := by |
| 409 | calc Cf * W.edge ≤ Cf * (e / (2 * Cf)) := by gcongr |
| 410 | _ = e / 2 := by field_simp |
| 411 | linarith |
| 412 | |
| 413 | end E424 |
| 414 | |