| | @@ -0,0 +1,107 @@ |
| 1 | +import FormalConjectures.ErdosProblems.«5» |
| 2 | +import ErdosSwarm.Erdos5 |
| 3 | +import ErdosSwarm.Erdos5Lower |
| 4 | + |
| 5 | +/-! |
| 6 | +# Erdős Problem 5: changing the prime-gap normalization |
| 7 | + |
| 8 | +Chebyshev's bounds squeeze the ratio of the two logarithms to one. Consequently |
| 9 | +the two normalized gap sequences have the same finite subsequential limits. |
| 10 | +-/ |
| 11 | + |
| 12 | +open Filter Real Topology |
| 13 | + |
| 14 | +namespace ErdosSwarm.Erdos5 |
| 15 | + |
| 16 | +private theorem tendsto_log_bound_div_log (c : ℝ) (hc : 0 < c) : |
| 17 | + Tendsto (fun n : ℕ => log (c * n * log n) / log n) atTop (𝓝 1) := by |
| 18 | + have hlog : Tendsto (fun n : ℕ => log (n : ℝ)) atTop atTop := |
| 19 | + tendsto_log_atTop.comp tendsto_natCast_atTop_atTop |
| 20 | + have hconst : Tendsto (fun n : ℕ => log c / log (n : ℝ)) atTop (𝓝 0) := |
| 21 | + Tendsto.div_atTop (a := log c) (by simp) hlog |
| 22 | + have hsmall : Tendsto (fun x : ℝ => log x / x) atTop (𝓝 0) := |
| 23 | + (Asymptotics.isLittleO_iff_tendsto (f := log) (g := id) |
| 24 | + (fun x hx => by simp [show x = 0 from hx])).1 isLittleO_log_id_atTop |
| 25 | + have hsum := (tendsto_const_nhds (x := (1 : ℝ))).add (hconst.add (hsmall.comp hlog)) |
| 26 | + simp only [add_zero] at hsum |
| 27 | + refine hsum.congr' ?_ |
| 28 | + filter_upwards [eventually_gt_atTop (1 : ℕ)] with n hn |
| 29 | + have hn' : (1 : ℝ) < n := by exact_mod_cast hn |
| 30 | + have hn0 : (0 : ℝ) < n := zero_lt_one.trans hn' |
| 31 | + have hl := log_pos hn' |
| 32 | + change 1 + (log c / log n + log (log n) / log n) = log (c * n * log n) / log n |
| 33 | + rw [log_mul (mul_ne_zero hc.ne' hn0.ne') hl.ne', log_mul hc.ne' hn0.ne'] |
| 34 | + field_simp |
| 35 | + ring |
| 36 | + |
| 37 | +/-- The logarithm of the indexed prime is asymptotic to the logarithm of its index. -/ |
| 38 | +theorem tendsto_log_nth_prime_div_log : |
| 39 | + Tendsto (fun n : ℕ => log (Nat.nth Nat.Prime n : ℝ) / log (n : ℝ)) atTop (𝓝 1) := by |
| 40 | + obtain ⟨c, hc, hlo⟩ := le_nth_prime |
| 41 | + obtain ⟨C, hhi⟩ := nth_prime_le |
| 42 | + refine tendsto_of_tendsto_of_tendsto_of_le_of_le' |
| 43 | + (tendsto_log_bound_div_log c hc) |
| 44 | + (tendsto_log_bound_div_log (max C 1) (lt_of_lt_of_le zero_lt_one (le_max_right _ _))) ?_ ?_ |
| 45 | + · filter_upwards [hlo, eventually_gt_atTop (1 : ℕ)] with n hn hn1 |
| 46 | + have hn' : (1 : ℝ) < n := by exact_mod_cast hn1 |
| 47 | + have hl := log_pos hn' |
| 48 | + have hn0 : (0 : ℝ) < n := zero_lt_one.trans hn' |
| 49 | + exact div_le_div_of_nonneg_right (log_le_log (by positivity) hn) hl.le |
| 50 | + · filter_upwards [hhi, eventually_gt_atTop (1 : ℕ)] with n hn hn1 |
| 51 | + have hn' : (1 : ℝ) < n := by exact_mod_cast hn1 |
| 52 | + have hl := log_pos hn' |
| 53 | + have hp : (0 : ℝ) < Nat.nth Nat.Prime n := by |
| 54 | + exact_mod_cast (Nat.prime_nth_prime n).pos |
| 55 | + have hbound : (Nat.nth Nat.Prime n : ℝ) ≤ max C 1 * n * log n := |
| 56 | + hn.trans (mul_le_mul_of_nonneg_right |
| 57 | + (mul_le_mul_of_nonneg_right (le_max_left _ _) (Nat.cast_nonneg _)) hl.le) |
| 58 | + exact div_le_div_of_nonneg_right (log_le_log hp hbound) hl.le |
| 59 | + |
| 60 | +/-- The consecutive prime gap normalized by the logarithm of the smaller prime. -/ |
| 61 | +noncomputable def primeNormalizedGap (n : ℕ) : ℝ := |
| 62 | + (primeGap n : ℝ) / log (Nat.nth Nat.Prime n : ℝ) |
| 63 | + |
| 64 | +/-- Both normalizations give the same finite limit along any strictly increasing subsequence. -/ |
| 65 | +theorem tendsto_primeNormalizedGap_iff {s : ℕ → ℕ} (hs : StrictMono s) {x : ℝ} : |
| 66 | + Tendsto (fun i => primeNormalizedGap (s i)) atTop (𝓝 x) ↔ |
| 67 | + Tendsto (fun i => _root_.Erdos5.normalizedGap (s i)) atTop (𝓝 x) := by |
| 68 | + have hratio := tendsto_log_nth_prime_div_log.comp hs.tendsto_atTop |
| 69 | + have hlogs : ∀ᶠ i : ℕ in atTop, 0 < log (s i : ℝ) := |
| 70 | + (hs.tendsto_atTop.eventually (eventually_gt_atTop (1 : ℕ))).mono fun i hi => |
| 71 | + log_pos (by exact_mod_cast hi) |
| 72 | + constructor |
| 73 | + · intro h |
| 74 | + have hm := h.mul hratio |
| 75 | + rw [mul_one] at hm |
| 76 | + refine hm.congr' ?_ |
| 77 | + refine Eventually.of_forall fun i => ?_ |
| 78 | + have hp : (1 : ℝ) < Nat.nth Nat.Prime (s i) := by |
| 79 | + exact_mod_cast (Nat.prime_nth_prime (s i)).one_lt |
| 80 | + change (primeGap (s i) : ℝ) / log (Nat.nth Nat.Prime (s i) : ℝ) * |
| 81 | + (log (Nat.nth Nat.Prime (s i) : ℝ) / log (s i : ℝ)) = |
| 82 | + (primeGap (s i) : ℝ) / log (s i : ℝ) |
| 83 | + rw [div_mul_div_comm, mul_comm (log (Nat.nth Nat.Prime (s i) : ℝ)), |
| 84 | + mul_div_mul_right _ _ (log_pos hp).ne'] |
| 85 | + · intro h |
| 86 | + have hd := h.div hratio one_ne_zero |
| 87 | + rw [div_one] at hd |
| 88 | + refine hd.congr' ?_ |
| 89 | + filter_upwards [hlogs] with i hi |
| 90 | + change ((primeGap (s i) : ℝ) / log (s i : ℝ)) / |
| 91 | + (log (Nat.nth Nat.Prime (s i) : ℝ) / log (s i : ℝ)) = primeNormalizedGap (s i) |
| 92 | + rw [primeNormalizedGap, div_div_div_cancel_right₀ hi.ne'] |
| 93 | + |
| 94 | +/-- The finite cluster set for the prime-log normalization equals the Formal Conjectures set. -/ |
| 95 | +theorem primeNormalizedGap_limitPointSet : |
| 96 | + {x : ℝ | MapClusterPt x atTop primeNormalizedGap} = _root_.Erdos5.limitPointSet := by |
| 97 | + ext x |
| 98 | + rw [_root_.Erdos5.mem_limitPointSet_iff] |
| 99 | + change MapClusterPt x atTop primeNormalizedGap ↔ _ |
| 100 | + constructor |
| 101 | + · intro h |
| 102 | + obtain ⟨s, hs, ht⟩ := h.tendsto_subseq |
| 103 | + exact ⟨s, hs, (tendsto_primeNormalizedGap_iff hs).1 ht⟩ |
| 104 | + · rintro ⟨s, hs, ht⟩ |
| 105 | + exact ((tendsto_primeNormalizedGap_iff hs).2 ht).mapClusterPt.of_comp hs.tendsto_atTop |
| 106 | + |
| 107 | +end ErdosSwarm.Erdos5 |