| 1 | module |
| 2 | |
| 3 | public import E424.Tools.T5Aux |
| 4 | |
| 5 | @[expose] public section |
| 6 | |
| 7 | /-! |
| 8 | # Erdős 424: tool T5. Absolute existential constants; Mathlib only. |
| 9 | -/ |
| 10 | |
| 11 | set_option linter.style.header false |
| 12 | open Finset MeasureTheory Set |
| 13 | |
| 14 | namespace E424 |
| 15 | |
| 16 | /-- **T5**, discrete mean value at 1-separated points. -/ |
| 17 | theorem T5_discrete_mean_value : ∃ C > 0, ∀ (N T : ℝ), 1 ≤ N → 1 ≤ T → |
| 18 | ∀ (s : Finset ℕ) (a : ℕ → ℂ), (∀ n ∈ s, N ≤ n ∧ (n : ℝ) ≤ 16 * N) → |
| 19 | ∀ τ : Finset ℝ, (∀ t ∈ τ, |t| ≤ T) → (∀ t ∈ τ, ∀ t' ∈ τ, t ≠ t' → 1 ≤ |t - t'|) → |
| 20 | ∑ t ∈ τ, ‖∑ n ∈ s, a n * nit n t‖ ^ 2 ≤ |
| 21 | C * (T + N) * Real.log (2 * N) * ∑ n ∈ s, ‖a n‖ ^ 2 := by |
| 22 | obtain ⟨C4, hC4pos, hC4⟩ := T4_mean_value |
| 23 | refine ⟨20 * C4, by positivity, fun N T hN hT s a hs τ hτT hτsep => ?_⟩ |
| 24 | set S : ℝ := ∑ n ∈ s, ‖a n‖ ^ 2 with hS |
| 25 | have hS0 : 0 ≤ S := sum_nonneg fun _ _ => by positivity |
| 26 | set T' : ℝ := T + 1 / 2 with hT' |
| 27 | set L : ℝ := Real.log (16 * N) with hL |
| 28 | have hlog2 : (1 / 2 : ℝ) < Real.log 2 := by |
| 29 | have := Real.log_two_gt_d9; linarith |
| 30 | have hlog2N : Real.log 2 ≤ Real.log (2 * N) := Real.log_le_log (by norm_num) (by linarith) |
| 31 | have hL1 : 1 ≤ L := by |
| 32 | have : Real.log 2 ≤ Real.log (16 * N) := Real.log_le_log (by norm_num) (by linarith) |
| 33 | have h16 : Real.log 16 = 4 * Real.log 2 := by |
| 34 | rw [show (16 : ℝ) = 2 ^ 4 by norm_num, Real.log_pow]; norm_num |
| 35 | have : Real.log 16 ≤ Real.log (16 * N) := Real.log_le_log (by norm_num) (by nlinarith) |
| 36 | linarith |
| 37 | have hL0 : 0 < L := by linarith |
| 38 | have hL4 : L ≤ 4 * Real.log (2 * N) := by |
| 39 | have : L = Real.log (2 * N) + 3 * Real.log 2 := by |
| 40 | rw [hL, show 16 * N = 2 * N * 2 ^ 3 by ring, Real.log_mul (by positivity) (by positivity), |
| 41 | Real.log_pow]; push_cast; ring |
| 42 | linarith |
| 43 | set D : ℝ → ℂ := fun t => ∑ n ∈ s, a n * nit n t with hD |
| 44 | set b : ℕ → ℂ := fun n => a n * (-(Real.log n : ℂ) * Complex.I) with hb |
| 45 | set D' : ℝ → ℂ := fun t => ∑ n ∈ s, b n * nit n t with hD' |
| 46 | have hder : ∀ x, HasDerivAt D (D' x) x := fun x => hasDerivAt_nit_sum s a x |
| 47 | have hcont : ∀ (c : ℕ → ℂ), Continuous fun t : ℝ => ∑ n ∈ s, c n * nit n t := fun c => by |
| 48 | apply continuous_finsetSum; intro n _; unfold nit; fun_prop |
| 49 | have hD'c : Continuous D' := hcont b |
| 50 | have hDc : Continuous D := hcont a |
| 51 | -- T4 for D and D' |
| 52 | have hbs : ∀ n ∈ s, N ≤ n ∧ (n : ℝ) ≤ 16 * N := hs |
| 53 | have hT'0 : 0 ≤ T' := by linarith |
| 54 | have h4D : ∫ t in (-T')..T', ‖D t‖ ^ 2 ≤ C4 * (T' + N) * S := hC4 N T' hN hT'0 s a hs |
| 55 | have hbsum : ∑ n ∈ s, ‖b n‖ ^ 2 ≤ L ^ 2 * S := by |
| 56 | rw [hS, mul_sum] |
| 57 | apply sum_le_sum |
| 58 | intro n hn |
| 59 | have hn1 : (1 : ℝ) ≤ n := hN.trans (hs n hn).1 |
| 60 | have hlogn : Real.log n ≤ L := Real.log_le_log (by linarith) (by linarith [(hs n hn).2]) |
| 61 | have hlogn0 : 0 ≤ Real.log n := Real.log_nonneg hn1 |
| 62 | have : ‖b n‖ = ‖a n‖ * Real.log n := by |
| 63 | simp only [hb, norm_mul, norm_neg, Complex.norm_real, Complex.norm_I, mul_one, |
| 64 | Real.norm_eq_abs, abs_of_nonneg hlogn0] |
| 65 | rw [this, mul_pow] |
| 66 | have : Real.log n ^ 2 ≤ L ^ 2 := pow_le_pow_left₀ hlogn0 hlogn 2 |
| 67 | nlinarith [sq_nonneg ‖a n‖] |
| 68 | have h4D' : ∫ t in (-T')..T', ‖D' t‖ ^ 2 ≤ C4 * (T' + N) * (L ^ 2 * S) := |
| 69 | (hC4 N T' hN hT'0 s b hs).trans (by gcongr) |
| 70 | -- pointwise |
| 71 | set F2 : ℝ → ℝ := fun u => (1 + L) * ‖D u‖ ^ 2 + ‖D' u‖ ^ 2 / L with hF2 |
| 72 | have hF2c : Continuous F2 := by simp only [hF2]; fun_prop |
| 73 | have hF2nn : ∀ u, 0 ≤ F2 u := fun u => by simp only [hF2]; positivity |
| 74 | have hpt : ∀ t ∈ τ, ‖D t‖ ^ 2 ≤ ∫ u in Ioo (t - 1 / 2) (t + 1 / 2), F2 u := by |
| 75 | intro t _ |
| 76 | rw [← integral_Icc_eq_integral_Ioo] |
| 77 | refine (pointwise_le_window D D' hder hD'c t).trans ?_ |
| 78 | refine setIntegral_mono_on (Continuous.integrableOn_Icc (by fun_prop)) hF2c.integrableOn_Icc |
| 79 | measurableSet_Icc fun u _ => ?_ |
| 80 | simp only [hF2] |
| 81 | have : 2 * ‖D u‖ * ‖D' u‖ ≤ L * ‖D u‖ ^ 2 + ‖D' u‖ ^ 2 / L := by |
| 82 | rw [← sub_nonneg] |
| 83 | have : L * ‖D u‖ ^ 2 + ‖D' u‖ ^ 2 / L - 2 * ‖D u‖ * ‖D' u‖ = (L * ‖D u‖ - ‖D' u‖) ^ 2 / L := by |
| 84 | field_simp; ring |
| 85 | rw [this]; positivity |
| 86 | linarith |
| 87 | have hsum1 : ∑ t ∈ τ, ‖D t‖ ^ 2 ≤ ∑ t ∈ τ, ∫ u in Ioo (t - 1 / 2) (t + 1 / 2), F2 u := |
| 88 | sum_le_sum hpt |
| 89 | have hdisj : Set.Pairwise (↑τ) (Function.onFun Disjoint fun t : ℝ => Ioo (t - 1 / 2) (t + 1 / 2)) := by |
| 90 | intro t ht t' ht' hne |
| 91 | simp only [Function.onFun] |
| 92 | rw [Set.disjoint_left] |
| 93 | intro x hx hx' |
| 94 | have := hτsep t ht t' ht' hne |
| 95 | simp only [Set.mem_Ioo] at hx hx' |
| 96 | have h1 : 1 ≤ |t - t'| := this |
| 97 | rcases abs_cases (t - t') with h | h <;> linarith [h.1, h.2] |
| 98 | have hbi : ∑ t ∈ τ, ∫ u in Ioo (t - 1 / 2) (t + 1 / 2), F2 u = |
| 99 | ∫ u in ⋃ t ∈ τ, Ioo (t - 1 / 2) (t + 1 / 2), F2 u := |
| 100 | (integral_biUnion_finset τ (fun _ _ => measurableSet_Ioo) hdisj |
| 101 | (fun _ _ => hF2c.integrableOn_Icc.mono_set Ioo_subset_Icc_self)).symm |
| 102 | have hsub : (⋃ t ∈ τ, Ioo (t - 1 / 2) (t + 1 / 2)) ⊆ Icc (-T') T' := by |
| 103 | intro x hx |
| 104 | simp only [Set.mem_iUnion, Set.mem_Ioo] at hx |
| 105 | obtain ⟨t, ht, h1, h2⟩ := hx |
| 106 | have := abs_le.1 (hτT t ht) |
| 107 | simp only [Set.mem_Icc, hT'] |
| 108 | constructor <;> linarith [this.1, this.2] |
| 109 | have hmono : ∫ u in ⋃ t ∈ τ, Ioo (t - 1 / 2) (t + 1 / 2), F2 u ≤ ∫ u in Icc (-T') T', F2 u := |
| 110 | setIntegral_mono_set hF2c.integrableOn_Icc (Filter.Eventually.of_forall hF2nn) |
| 111 | (Filter.Eventually.of_forall hsub) |
| 112 | have hIcc : ∫ u in Icc (-T') T', F2 u = ∫ u in (-T')..T', F2 u := by |
| 113 | rw [intervalIntegral.integral_of_le (by linarith), integral_Icc_eq_integral_Ioc] |
| 114 | have hsplit : ∫ u in (-T')..T', F2 u = |
| 115 | (1 + L) * (∫ u in (-T')..T', ‖D u‖ ^ 2) + (∫ u in (-T')..T', ‖D' u‖ ^ 2) / L := by |
| 116 | simp only [hF2] |
| 117 | rw [intervalIntegral.integral_add (by apply Continuous.intervalIntegrable; fun_prop) |
| 118 | (by apply Continuous.intervalIntegrable; fun_prop), intervalIntegral.integral_const_mul, |
| 119 | intervalIntegral.integral_div] |
| 120 | have hTN : T' + N ≤ 2 * (T + N) := by linarith |
| 121 | have hC4TN : 0 ≤ C4 * (T' + N) := by positivity |
| 122 | have hfinal : (1 + L) * (∫ u in (-T')..T', ‖D u‖ ^ 2) + (∫ u in (-T')..T', ‖D' u‖ ^ 2) / L ≤ |
| 123 | (1 + 2 * L) * (C4 * (T' + N) * S) := by |
| 124 | have e1 : (1 + L) * (∫ u in (-T')..T', ‖D u‖ ^ 2) ≤ (1 + L) * (C4 * (T' + N) * S) := |
| 125 | mul_le_mul_of_nonneg_left h4D (by linarith) |
| 126 | have e2 : (∫ u in (-T')..T', ‖D' u‖ ^ 2) / L ≤ L * (C4 * (T' + N) * S) := by |
| 127 | rw [div_le_iff₀ hL0] |
| 128 | calc _ ≤ C4 * (T' + N) * (L ^ 2 * S) := h4D' |
| 129 | _ = _ := by ring |
| 130 | nlinarith |
| 131 | have hlogs : 1 + 2 * L ≤ 10 * Real.log (2 * N) := by linarith |
| 132 | have hM : 0 ≤ C4 * (T' + N) * S := by positivity |
| 133 | calc ∑ t ∈ τ, ‖D t‖ ^ 2 ≤ (1 + 2 * L) * (C4 * (T' + N) * S) := by |
| 134 | refine hsum1.trans ?_ |
| 135 | rw [hbi] |
| 136 | exact hmono.trans (hIcc.le.trans (hsplit.le.trans hfinal)) |
| 137 | _ ≤ (10 * Real.log (2 * N)) * (C4 * (2 * (T + N)) * S) := by |
| 138 | apply mul_le_mul hlogs _ hM (by linarith) |
| 139 | gcongr |
| 140 | _ = _ := by ring |
| 141 | |
| 142 | |
| 143 | end E424 |
| 144 | |