This journal is in preparation. Submissions are open as a pilot and the editorial board is being formed. Articles marked Demonstration show the format only.
Journal of Machine-Verified MathematicsPeer-reviewed mathematics with machine-checked proofs, for the age of AI

E424/HighBand/L31Aux4.lean

All files · 228 lines · source at the verified commit

1module
2
3public import E424.HighBand.L31Aux3
4public import E424.RoughElements.L12
5
6@[expose] public section
7
8/-!
9# Lemma 31 auxiliaries, part 4: one cell
10-/
11
12set_option linter.style.header false
13open Finset
14
15namespace E424
16
17/-- Geometry of the cell of `s0 ∈ S`: with `v = ⌊ξ log s0⌋`, `a = e^{v/ξ}` satisfies `z^99 ≤ a ≤ z^200`
18and every `s ∈ S` of the same cell lies in `[a, a e^{1/ξ}]`. -/
19theorem cell_geom {z xi : ℝ} (hz : 3 ≤ z) (hxi : 1 ≤ xi) {S : Finset ℕ} (hS : IsFam z S)
20 (hlow : ∀ s ∈ S, z ^ 100 ≤ s) {s0 : ℕ} (hs0 : s0 ∈ S) :
21 ∃ a : ℝ, z ^ 99 ≤ a ∧ a ≤ z ^ 200 ∧ Real.log a = (⌊xi * Real.log s0⌋₊ : ℝ) / xi ∧
22 ∀ s ∈ S, ⌊xi * Real.log s⌋₊ = ⌊xi * Real.log s0⌋₊ → a ≤ s ∧ (s : ℝ) ≤ a * Real.exp (1 / xi) := by
23 have hxi0 : 0 < xi := by linarith
24 set v := ⌊xi * Real.log s0⌋₊ with hv
25 set a := Real.exp ((v : ℝ) / xi) with ha
26 have hgen : ∀ s ∈ S, ⌊xi * Real.log s⌋₊ = v → a ≤ s ∧ (s : ℝ) < a * Real.exp (1 / xi) := by
27 intro s hs hsv
28 have hs1 : (1 : ℝ) < s := by linarith [(hS s hs).1]
29 have hlog : 0 ≤ Real.log s := (Real.log_pos hs1).le
30 have h1 := Nat.floor_le (mul_nonneg hxi0.le hlog)
31 have h2 := Nat.lt_floor_add_one (xi * Real.log s)
32 rw [hsv] at h1 h2
33 have hspos : (0 : ℝ) < s := by linarith
34 constructor
35 · rw [ha, ← Real.exp_log hspos]
36 apply Real.exp_le_exp.2
37 rw [div_le_iff₀ hxi0]; linarith
38 · rw [ha, ← Real.exp_add, ← Real.exp_log hspos]
39 apply Real.exp_lt_exp.2
40 rw [← add_div, lt_div_iff₀ hxi0]; linarith
41 obtain ⟨h0a, h0b⟩ := hgen s0 hs0 hv.symm
42 have hs0z := hS s0 hs0
43 have hexp : Real.exp (1 / xi) ≤ 3 := by
44 have h1 : 1 / xi ≤ 1 := by rw [div_le_one hxi0]; exact hxi
45 have := Real.exp_one_lt_d9
46 linarith [Real.exp_le_exp.2 h1]
47 have hapos : 0 < a := Real.exp_pos _
48 refine ⟨a, ?_, h0a.trans hs0z.2.1, by rw [ha, Real.log_exp], fun s hs hsv => ?_⟩
49 · have h1 : z ^ 100 < 3 * a := by
50 have := hlow s0 hs0
51 nlinarith [Real.exp_pos (1 / xi)]
52 have h2 : z * z ^ 99 < z * a := by
53 calc z * z ^ 99 = z ^ 100 := by ring
54 _ < 3 * a := h1
55 _ ≤ z * a := by gcongr
56 exact le_of_lt (lt_of_mul_lt_mul_left h2 (by linarith))
57 · exact ⟨(hgen s hs hsv).1, (hgen s hs hsv).2.le⟩
58
59/-- Mass of a cell: `∑_{s ∈ S, a ≤ s ≤ a e^ε} 1/s ≤ 1` from Lemma 12(c), when `log z` is large. -/
60theorem cell_mass : ∃ C12 > 0, ∀ z : ℝ, 3 ≤ z → 5 * C12 ≤ Real.log z → ∀ S : Finset ℕ, IsFam z S →
61 ∀ a ε : ℝ, z ^ 99 ≤ a → 0 ≤ ε → ε ≤ 1 →
62 ∑ s ∈ S.filter (fun s : ℕ => a ≤ (s : ℝ) ∧ (s : ℝ) ≤ a * Real.exp ε), 1 / (s : ℝ) ≤ 1 := by
63 obtain ⟨C, hC, h12⟩ := L12_short
64 refine ⟨C, hC, fun z hz hlogz S hS a ε ha hε0 hε1 => ?_⟩
65 have hz1 : 1 < z := by linarith
66 have hlz : 0 < Real.log z := Real.log_pos hz1
67 have hexp1 : 1 ≤ Real.exp ε := Real.one_le_exp hε0
68 have hexp3 : Real.exp ε ≤ 3 := by
69 have := Real.exp_one_lt_d9
70 linarith [Real.exp_le_exp.2 hε1]
71 have hza : z ≤ a / 2 := by
72 have : z * z ^ 98 = z ^ 99 := by ring
73 have h98 : 2 ≤ z ^ 98 := by
74 calc (2 : ℝ) ≤ z := by linarith
75 _ = z ^ 1 := (pow_one z).symm
76 _ ≤ z ^ 98 := pow_le_pow_right₀ (by linarith) (by norm_num)
77 nlinarith
78 have hxpos : 0 < a / 2 := by linarith
79 have hl : z ≤ a / 2 * (2 * Real.exp ε - 1) := by
80 have : a / 2 ≤ a / 2 * (2 * Real.exp ε - 1) := by
81 apply le_mul_of_one_le_right hxpos.le; linarith
82 linarith
83 have hsub : (S.filter fun s : ℕ => a ≤ (s : ℝ) ∧ (s : ℝ) ≤ a * Real.exp ε) ⊆
84 S.filter fun s : ℕ => a / 2 < (s : ℝ) ∧ (s : ℝ) ≤ a / 2 * (1 + (2 * Real.exp ε - 1)) := by
85 intro s hs
86 obtain ⟨hs1, hs2, hs3⟩ := mem_filter.1 hs
87 refine mem_filter.2 ⟨hs1, by linarith, ?_⟩
88 nlinarith
89 have := h12 z (by linarith) S hS (a / 2) (2 * Real.exp ε - 1) hxpos hl
90 calc _ ≤ ∑ s ∈ S.filter (fun s : ℕ => a / 2 < (s : ℝ) ∧ (s : ℝ) ≤ a / 2 * (1 + (2 * Real.exp ε - 1))),
91 1 / (s : ℝ) :=
92 sum_le_sum_of_subset_of_nonneg hsub fun _ _ _ => by positivity
93 _ ≤ C * (2 * Real.exp ε - 1) / Real.log z := this
94 _ ≤ 1 := by
95 rw [div_le_one hlz]
96 nlinarith
97
98/-- **One cell.** For `lo` with `log lo` large, a `1`-separated set `τ ⊂ [-N, N]` on which the cell
99polynomial of `s0 ∈ S` exceeds `(log lo)^{-200}` has at most `N^{0.006} / (2 V)` points,
100where `V = 200 ξ log z + 1` bounds the number of cells. -/
101theorem cell_sep : ∃ L0 : ℝ, ∀ lo : ℝ, Real.exp L0 ≤ lo → ∀ (cS : ℝ) (ρ : ℕ) (S : Finset ℕ),
102 BlockFam cS (K2 lo) ρ S → ∀ N : ℝ, lo ≤ N → N ≤ lo ^ (1.01 : ℝ) → ∀ s0 ∈ S,
103 ∀ τ : Finset ℝ, (∀ t ∈ τ, |t| ≤ N) → (∀ t ∈ τ, ∀ t' ∈ τ, t ≠ t' → 1 ≤ |t - t'|) →
104 (∀ t ∈ τ, (Real.log lo ^ 200)⁻¹ < ‖Pv lo S ⌊xi lo * Real.log (s0 : ℕ)⌋₊ t‖) →
105 (τ.card : ℝ) ≤ Real.exp (0.006 * Real.log N) /
106 (2 * (200 * Real.log lo ^ 100 * (200000 * Real.log (Real.log lo)) + 1)) := by
107 obtain ⟨C, hC, hcc⟩ := cell_count
108 obtain ⟨C12, hC12, hm⟩ := cell_mass
109 obtain ⟨L0a, harith⟩ := arith_final C hC
110 refine ⟨max L0a (max (Real.exp (5 * C12)) 3), fun lo hlo' cS ρ S hSB N hloN hNlo s0 hs0 τ hτN hsep hτδ => ?_⟩
111 have hlo : max L0a (max (Real.exp (5 * C12)) 3) ≤ Real.log lo :=
112 (Real.le_log_iff_exp_le (lt_of_lt_of_le (Real.exp_pos _) hlo')).2 hlo'
113 have hL0a : L0a ≤ Real.log lo := le_trans (le_max_left _ _) hlo
114 have hLe : Real.exp (5 * C12) ≤ Real.log lo := le_trans (le_trans (le_max_left _ _) (le_max_right _ _)) hlo
115 have hL3 : 3 ≤ Real.log lo := le_trans (le_trans (le_max_right _ _) (le_max_right _ _)) hlo
116 set L := Real.log lo with hLdef
117 set LL := Real.log L with hLLdef
118 have hL0 : 0 < L := by linarith
119 have hlo0 : 0 < lo := lt_of_lt_of_le (Real.exp_pos _) hlo'
120 have hlo1 : 1 < lo := (Real.log_pos_iff hlo0.le).1 (by linarith)
121 have hN0 : 0 < N := by linarith
122 have hz_eq : K2 lo = L ^ 200000 := by simp [K2, C2, hLdef]
123 have hxi_eq : xi lo = L ^ 100 := rfl
124 set z := K2 lo with hzdef
125 have hz3 : 3 ≤ z := by
126 rw [hz_eq]
127 calc (3 : ℝ) ≤ L := hL3
128 _ = L ^ 1 := (pow_one L).symm
129 _ ≤ L ^ 200000 := pow_le_pow_right₀ (by linarith) (by norm_num)
130 have hlogz : Real.log z = 200000 * LL := by rw [hz_eq, Real.log_pow]; push_cast; ring
131 have hLL5 : 5 * C12 ≤ LL := by
132 rw [hLLdef, Real.le_log_iff_exp_le hL0]; exact hLe
133 clear_value z
134 have hxi1 : 1 ≤ xi lo := by rw [hxi_eq]; exact one_le_pow₀ (by linarith)
135 have hxi0 : 0 < xi lo := by linarith
136 obtain ⟨hfam, hmem, -⟩ := hSB
137 have hlow : ∀ s ∈ S, z ^ 100 ≤ (s : ℝ) := fun s hs => (hmem s hs).2.2
138 obtain ⟨a, haz1, haz2, hlog_a, hcell⟩ := cell_geom hz3 hxi1 hfam hlow hs0
139 set v := ⌊xi lo * Real.log (s0 : ℕ)⌋₊ with hv
140 set ε := 1 / xi lo with hε
141 have hε0 : 0 ≤ ε := div_nonneg zero_le_one hxi0.le
142 have hε1 : ε ≤ 1 := by rw [hε, div_le_one hxi0]; exact hxi1
143 have hz1 : 1 ≤ z := by linarith
144 have ha1 : 1 ≤ a := le_trans (one_le_pow₀ hz1) haz1
145 have ha0 : 0 < a := by linarith
146 set la := Real.log a with hla
147 have hla1 : 1.98e7 * LL ≤ la := by
148 have := Real.log_le_log (pow_pos (by linarith) _) haz1
149 rw [Real.log_pow, hlogz] at this
150 push_cast at this
151 linarith
152 have hla2 : la ≤ 4e7 * LL := by
153 have := Real.log_le_log ha0 haz2
154 rw [Real.log_pow, hlogz] at this
155 push_cast at this
156 linarith
157 have hLL1 : 1 ≤ LL := by
158 rw [hLLdef, Real.le_log_iff_exp_le hL0]
159 have := Real.exp_one_lt_d9
160 linarith
161 have hla0 : 0 < la := by linarith
162 -- u = log N
163 set u := Real.log N with hu
164 have hLu : L ≤ u := Real.log_le_log hlo0 hloN
165 have huL : u ≤ 1.01 * L := by
166 have := Real.log_le_log hN0 hNlo
167 rwa [Real.log_rpow hlo0] at this
168 -- the exponent
169 set k := ⌈u / la⌉₊ with hk
170 have hupos : 0 < u / la := div_pos (by linarith) hla0
171 have hk1 : 1 ≤ k := Nat.ceil_pos.2 hupos
172 obtain ⟨ℓ, hℓ⟩ : ∃ ℓ, k = ℓ + 1 := ⟨k - 1, by omega⟩
173 have hl1 : (ℓ : ℝ) * la < u := by
174 have h := Nat.ceil_lt_add_one hupos.le
175 rw [← hk, hℓ] at h
176 push_cast at h
177 have : (ℓ : ℝ) < u / la := by linarith
178 rwa [lt_div_iff₀ hla0] at this
179 have hl2 : u ≤ ((ℓ : ℝ) + 1) * la := by
180 have h := Nat.le_ceil (u / la)
181 rw [← hk, hℓ] at h
182 push_cast at h
183 rwa [div_le_iff₀ hla0] at h
184 have hNa : N ≤ a ^ (ℓ + 1) := by
185 rw [← Real.log_le_log_iff hN0 (by positivity), Real.log_pow]
186 push_cast; exact hl2
187 -- the cell
188 set Sv := S.filter (fun s => ⌊xi lo * Real.log (s : ℕ)⌋₊ = v) with hSv
189 have hSvfam : IsFam z Sv := fun s hs => hfam s (mem_filter.1 hs).1
190 have hSvmass : ∑ s ∈ Sv, 1 / (s : ℝ) ≤ 1 := by
191 have hsub : Sv ⊆ S.filter (fun s : ℕ => a ≤ (s : ℝ) ∧ (s : ℝ) ≤ a * Real.exp ε) := by
192 intro s hs
193 obtain ⟨hsS, hsv⟩ := mem_filter.1 hs
194 exact mem_filter.2 ⟨hsS, hcell s hsS hsv⟩
195 refine le_trans (sum_le_sum_of_subset_of_nonneg hsub fun _ _ _ => by positivity) ?_
196 refine hm z hz3 ?_ S hfam a ε haz1 hε0 hε1
197 rw [hlogz]; linarith
198 have hrng : ∀ s ∈ Sv, a ≤ (s : ℝ) ∧ (s : ℝ) ≤ a * Real.exp ε := fun s hs =>
199 hcell s (mem_filter.1 hs).1 (mem_filter.1 hs).2
200 have hδ : 0 < (L ^ 200)⁻¹ := by positivity
201 have hmain := hcc z hz3 Sv hSvfam hSvmass ℓ N a (a * Real.exp ε) (by linarith) ha1
202 (le_mul_of_one_le_right ha0.le (Real.one_le_exp hε0)) hrng hNa _ hδ τ hτN hsep hτδ
203 have hlogM : Real.log (a * Real.exp ε) = la + ε := by
204 rw [Real.log_mul ha0.ne' (Real.exp_pos _).ne', Real.log_exp]
205 have hA : Real.log ((a * Real.exp ε) ^ (ℓ + 1) / N) + 1 =
206 ((ℓ : ℝ) + 1) * (la + ε) - u + 1 := by
207 rw [Real.log_div (by positivity) hN0.ne', Real.log_pow, hlogM]; push_cast; ring
208 have hB : Real.log (2 * (a * Real.exp ε) ^ (ℓ + 1)) = Real.log 2 + ((ℓ : ℝ) + 1) * (la + ε) := by
209 rw [Real.log_mul (by norm_num) (by positivity), Real.log_pow, hlogM]; push_cast; ring
210 rw [hA, hB] at hmain
211 have hfin := harith L u la ε ℓ hL0a hLu huL hε0 hε1 hla1 hla2 hl1 hl2
212 have hVb : 0 < 2 * (200 * L ^ 100 * (200000 * LL) + 1) := by positivity
213 rw [le_div_iff₀ hVb]
214 have hP : 0 < (L ^ 200) ^ (2 * (ℓ + 1)) := by positivity
215 rw [inv_pow] at hmain
216 have h := (mul_inv_le_iff₀ hP).1 hmain
217 calc (τ.card : ℝ) * (2 * (200 * L ^ 100 * (200000 * LL) + 1)) ≤
218 ((L ^ 200) ^ (2 * (ℓ + 1)) *
219 ((((ℓ : ℝ) + 1) * (la + ε) - u + 1) * (2 * C * (Real.log 2 + ((ℓ : ℝ) + 1) * (la + ε))) *
220 (((200 * ((ℓ : ℝ) + 1) + 1) ^ 200) ^ ℓ))) * (2 * (200 * L ^ 100 * (200000 * LL) + 1)) := by
221 exact mul_le_mul_of_nonneg_right (by rw [mul_comm]; exact h) hVb.le
222 -- hide the powers: `ring` would expand `(200 * (ℓ + 1) + 1) ^ 200` and the kernel would need minutes
223 _ = _ := by
224 generalize ((200 * ((ℓ : ℝ) + 1) + 1) ^ 200) ^ ℓ = Y, L ^ 100 = X, L ^ 200 = Z; ring
225 _ ≤ _ := hfin
226
227end E424
228