| | @@ -7,6 +7,8 @@ Suppose the log factorial ratio `T(n)` at scale `30n`, divided by `n`, tends to |
| 7 | 7 | Rounding `x/30` down gives the eventual lower bound `L*x ≤ ψ x` for every `L < C/30`. |
| 8 | 8 | Rounding up in the recurrence `ψ (30n) ≤ T(n) + ψ (5n)` bounds the limit superior |
| 9 | 9 | `S` of `ψ x / x` by `C/30 + S/6`. This gives the upper slope `C/25`. |
| 10 | +Counting the second interval at scale `210n` gives |
| 11 | +`S ≤ C/30 + S/6 − (C/30)/7 + S/10`, improving the upper slope to `3C/77`. |
| 10 | 12 | The Stirling limit in `ErdosSwarm.Erdos30Stirling` supplies `C` for the prime-power |
| 11 | 13 | interval argument in Erdős Problem 30. |
| 12 | 14 | -/ |
| | @@ -43,21 +45,27 @@ theorem eventually_mul_le_psi {C L : ℝ} |
| 43 | 45 | exact ((lt_div_iff₀ hx).mp hlow).le.trans |
| 44 | 46 | ((chebyshevLogRatio_le_psi (n x)).trans (psi_mono hfloor)) |
| 45 | 47 | |
| 48 | +private theorem eventually_psi_le_mul_of_limsup_lt {V : ℝ} |
| 49 | + (hV : limsup (fun x : ℝ => ψ x / x) atTop < V) : ∀ᶠ x : ℝ in atTop, ψ x ≤ V * x := by |
| 50 | + have hbdd : IsBoundedUnder (· ≤ ·) atTop (fun x : ℝ => ψ x / x) := by |
| 51 | + apply isBoundedUnder_of_eventually_le (a := Real.log 4 + 4) |
| 52 | + filter_upwards [eventually_gt_atTop (0 : ℝ)] with x hx |
| 53 | + exact (div_le_iff₀ hx).mpr (psi_le_const_mul_self hx.le) |
| 54 | + filter_upwards [eventually_lt_of_limsup_lt hV hbdd, eventually_gt_atTop (0 : ℝ)] with x h hx |
| 55 | + exact ((div_lt_iff₀ hx).mp h).le |
| 56 | + |
| 57 | +private theorem isCoboundedUnder_psi_div : |
| 58 | + IsCoboundedUnder (· ≤ ·) atTop (fun x : ℝ => ψ x / x) := by |
| 59 | + apply isCoboundedUnder_le_of_eventually_le atTop (x := 0) |
| 60 | + filter_upwards [eventually_ge_atTop (0 : ℝ)] with x hx |
| 61 | + exact div_nonneg (psi_nonneg x) hx |
| 62 | + |
| 46 | 63 | /-- Every slope above `C/25` is an eventual upper bound for `ψ` on the real line. -/ |
| 47 | 64 | theorem eventually_psi_le_mul {C U : ℝ} |
| 48 | 65 | (hT : Tendsto (fun n : ℕ => chebyshevLogRatio n / (n : ℝ)) atTop (nhds C)) |
| 49 | 66 | (hU : C / 25 < U) : ∀ᶠ x : ℝ in atTop, ψ x ≤ U * x := by |
| 50 | 67 | let f (x : ℝ) := ψ x / x |
| 51 | 68 | let S := limsup f atTop |
| 52 | | − have hbdd : IsBoundedUnder (· ≤ ·) atTop f := by |
| 53 | | − apply isBoundedUnder_of_eventually_le (a := Real.log 4 + 4) |
| 54 | | − filter_upwards [eventually_gt_atTop (0 : ℝ)] with x hx |
| 55 | | − exact (div_le_iff₀ hx).mpr (psi_le_const_mul_self hx.le) |
| 56 | | − have hcobdd : IsCoboundedUnder (· ≤ ·) atTop f := by |
| 57 | | − apply IsBoundedUnder.isCoboundedUnder_le |
| 58 | | − apply isBoundedUnder_of_eventually_ge (a := 0) |
| 59 | | − filter_upwards [eventually_gt_atTop (0 : ℝ)] with x hx |
| 60 | | − exact div_nonneg (psi_nonneg x) hx.le |
| 61 | 69 | let n (x : ℝ) := ⌈(1 / 30 : ℝ) * x⌉₊ |
| 62 | 70 | have hn : Tendsto n atTop atTop := |
| 63 | 71 | tendsto_nat_ceil_atTop.comp (tendsto_id.const_mul_atTop (by norm_num : (0 : ℝ) < 1 / 30)) |
| | @@ -69,19 +77,17 @@ theorem eventually_psi_le_mul {C U : ℝ} |
| 69 | 77 | have hlim := (tendsto_chebyshevLogRatio_rounded hT hn hscale).add |
| 70 | 78 | (hscale.const_mul (5 * V)) |
| 71 | 79 | have hle : f ≤ᶠ[atTop] (fun x => chebyshevLogRatio (n x) / x + 5 * V * ((n x : ℝ) / x)) := by |
| 72 | | − filter_upwards [hfive.eventually (eventually_lt_of_limsup_lt hV hbdd), |
| 73 | | − hn.eventually (eventually_gt_atTop 0), eventually_gt_atTop (0 : ℝ)] with x hsmall hnpos hx |
| 80 | + filter_upwards [hfive.eventually (eventually_psi_le_mul_of_limsup_lt hV), |
| 81 | + eventually_gt_atTop (0 : ℝ)] with x hsmall hx |
| 74 | 82 | have harg : x ≤ 30 * (n x : ℝ) := by |
| 75 | 83 | have h := Nat.le_ceil ((1 / 30 : ℝ) * x) |
| 76 | 84 | dsimp [n] |
| 77 | 85 | linarith only [h] |
| 78 | 86 | have hrec := psi_sub_le_chebyshevLogRatio (n x) |
| 79 | | − have hnreal : 0 < (n x : ℝ) := by exact_mod_cast hnpos |
| 80 | | − have hsmall' := (div_lt_iff₀ (by positivity : 0 < 5 * (n x : ℝ))).mp hsmall |
| 81 | 87 | dsimp [f] |
| 82 | 88 | rw [← mul_div_assoc, ← add_div, div_le_div_iff_of_pos_right hx] |
| 83 | | − linarith only [psi_mono harg, hrec, hsmall'] |
| 84 | | − calc S ≤ _ := limsup_le_limsup hle hcobdd hlim.isBoundedUnder_le |
| 89 | + linarith only [psi_mono harg, hrec, hsmall] |
| 90 | + calc S ≤ _ := limsup_le_limsup hle isCoboundedUnder_psi_div hlim.isBoundedUnder_le |
| 85 | 91 | _ = C / 30 + 5 * V * (1 / 30) := hlim.limsup_eq |
| 86 | 92 | _ = _ := by ring |
| 87 | 93 | have hS : S ≤ C / 25 := by |
| | @@ -90,8 +96,53 @@ theorem eventually_psi_le_mul {C U : ℝ} |
| 90 | 96 | intro V hV |
| 91 | 97 | linarith only [step V hV] |
| 92 | 98 | linarith only [this] |
| 93 | | − filter_upwards [eventually_lt_of_limsup_lt (hS.trans_lt hU) hbdd, |
| 94 | | − eventually_gt_atTop (0 : ℝ)] with x h hx |
| 95 | | − exact ((div_lt_iff₀ hx).mp h).le |
| 99 | + exact eventually_psi_le_mul_of_limsup_lt (hS.trans_lt hU) |
| 100 | + |
| 101 | +/-- Counting both intervals in the factorial ratio makes every slope above `3C/77` |
| 102 | +an eventual upper bound for `ψ`. -/ |
| 103 | +theorem eventually_psi_le_mul_of_two_intervals {C U : ℝ} |
| 104 | + (hT : Tendsto (fun n : ℕ => chebyshevLogRatio n / (n : ℝ)) atTop (nhds C)) |
| 105 | + (hU : 3 * C / 77 < U) : ∀ᶠ x : ℝ in atTop, ψ x ≤ U * x := by |
| 106 | + let f (x : ℝ) := ψ x / x |
| 107 | + let S := limsup f atTop |
| 108 | + let n (x : ℝ) := ⌈(1 / 210 : ℝ) * x⌉₊ |
| 109 | + have hn : Tendsto n atTop atTop := |
| 110 | + tendsto_nat_ceil_atTop.comp (tendsto_id.const_mul_atTop (by norm_num : (0 : ℝ) < 1 / 210)) |
| 111 | + have hscale : Tendsto (fun x => (n x : ℝ) / x) atTop (nhds (1 / 210)) := |
| 112 | + tendsto_nat_ceil_mul_div_atTop (by norm_num) |
| 113 | + have hseven : Tendsto (fun x => 7 * n x) atTop atTop := |
| 114 | + tendsto_atTop_mono (fun x => Nat.le_mul_of_pos_left (n x) (by decide : 0 < 7)) hn |
| 115 | + have hsevenScale : Tendsto (fun x => ((7 * n x : ℕ) : ℝ) / x) atTop (nhds (1 / 30)) := by |
| 116 | + convert hscale.const_mul 7 using 1 |
| 117 | + · ext x |
| 118 | + push_cast |
| 119 | + ring |
| 120 | + · norm_num |
| 121 | + have hratio := tendsto_chebyshevLogRatio_rounded hT hseven hsevenScale |
| 122 | + have harg (a : ℝ) (ha : 0 < a) : Tendsto (fun x => a * (n x : ℝ)) atTop atTop := |
| 123 | + (tendsto_natCast_atTop_atTop.comp hn).const_mul_atTop ha |
| 124 | + have step (V L : ℝ) (hV : S < V) (hL : L < C / 30) : |
| 125 | + S ≤ C / 30 + V / 6 - L / 7 + V / 10 := by |
| 126 | + have hupper := eventually_psi_le_mul_of_limsup_lt hV |
| 127 | + have hlower := eventually_mul_le_psi hT hL |
| 128 | + have hlim := hratio.add (hscale.const_mul (56 * V - 30 * L)) |
| 129 | + have hle : f ≤ᶠ[atTop] (fun x => |
| 130 | + chebyshevLogRatio (7 * n x) / x + (56 * V - 30 * L) * ((n x : ℝ) / x)) := by |
| 131 | + filter_upwards [(harg 35 (by norm_num)).eventually hupper, |
| 132 | + (harg 30 (by norm_num)).eventually hlower, (harg 21 (by norm_num)).eventually hupper, |
| 133 | + eventually_gt_atTop (0 : ℝ)] with x h35 h30 h21 hx |
| 134 | + have hceil : x ≤ 210 * (n x : ℝ) := by |
| 135 | + dsimp [n] |
| 136 | + linarith only [Nat.le_ceil ((1 / 210 : ℝ) * x)] |
| 137 | + dsimp [f] |
| 138 | + rw [← mul_div_assoc, ← add_div, div_le_div_iff_of_pos_right hx] |
| 139 | + linarith only [psi_mono hceil, psi_sub_add_psi_sub_le_chebyshevLogRatio (n x), h35, h30, h21] |
| 140 | + calc S ≤ _ := limsup_le_limsup hle isCoboundedUnder_psi_div hlim.isBoundedUnder_le |
| 141 | + _ = C / 30 + (56 * V - 30 * L) * (1 / 210) := hlim.limsup_eq |
| 142 | + _ = _ := by ring |
| 143 | + have hS : S ≤ 3 * C / 77 := by |
| 144 | + refine le_of_forall_pos_le_add fun ε hε => ?_ |
| 145 | + linarith only [step (S + ε) (C / 30 - ε) (lt_add_of_pos_right _ hε) (sub_lt_self _ hε), hε] |
| 146 | + exact eventually_psi_le_mul_of_limsup_lt (hS.trans_lt hU) |
| 96 | 147 | |
| 97 | 148 | end ErdosSwarm.Erdos30 |