← Session 27 — ii′-5c/5d: Davenport disc + FE-reflection bounds
thinking (27583 chars)
C0hat t = 0.433·log(t+2) + 0.886·log log(t+2) + 2.9. Monotonicity for t ≥ 1: log(t+2) ≥ log 3 > 1 > 0 and increasing; log log(t+2) increasing (log increasing, inner positive).
`C0hat_mono {a b : ℝ} (ha : 1 ≤ a) (hab : a ≤ b) : C0hat a ≤ C0hat b`:
```
unfold C0hat
have hapos : (0:ℝ) < a + 2 := by linarith
have hbpos : (0:ℝ) < b + 2 := by linarith
have h1 : Real.log (a + 2) ≤ Real.log (b + 2) := Real.log_le_log hapos (by linarith [hab])
have h2 : Real.log (Real.log (a + 2)) ≤ Real.log (Real.log (b + 2)) := by
apply Real.log_le_log
· -- 0 < log (a+2): a + 2 ≥ 3 > e?? log 3 > 1 since 3 > e: Real.le_log_iff_exp_le: 1 ≤ log 3 ⟺ e ≤ 3 ✓ exp_one_lt_d9
have h3 : (1:ℝ) ≤ Real.log (a + 2) := by
rw [Real.le_log_iff_exp_le hapos]
have he := Real.exp_one_lt_d9.le -- exp 1 ≤ 2.7182818286
linarith [hab... no: a ≥ 1 ⟹ a+2 ≥ 3 ≥ e ✓: he : Real.exp 1 < 2.718...: 2.718.. ≤ 3 ≤ a+2: linarith [he]]
...
· exact h1
-- assemble: 0.433·h1 + 0.886·h2 + 0
gcongr -- 0.433 * log(a+2) + 0.886 * log log(a+2) + 2.9 ≤ ... : gcongr with h1 h2 (coeffs nonneg)
```
gcongr should handle (0.433 ≥ 0 etc. via positivity side goals) ✓.
Real.log_le_log (hx : 0 < x) (h : x ≤ y) : log x ≤ log y ✓ banked journal-024.
Real.le_log_iff_exp_le — used in two_le_C0hat: `Real.le_log_iff_exp_le (by positivity : (0:ℝ) < t+2)` : 1 ≤ log(t+2) ↔ exp 1 ≤ t+2 ✓ (signature: Real.le_log_iff_exp_le (hx : 0 < x) : y ≤ Real.log x ↔ Real.exp y ≤ x ✓).
Now — the file. Let me also double-check `Finset.card_union_le` name: `Finset.card_union_le (s t : Finset α) : (s ∪ t).card ≤ s.card + t.card` ✓ exists. And Set.Finite.toFinset + mem lemma: `Set.Finite.mem_toFinset (hs : s.Finite) : x ∈ hs.toFinset ↔ x ∈ s` ✓ (used in exists_zero_avoiding_T). `Set.ncard_eq_toFinset_card _ hfin : Set.ncard s = hfin.toFinset.card`? — from ii′-4: `Set.ncard_eq_toFinset_card _ hfin` used with Nat.card_coe_set_eq: Nat.card s = Set.ncard s (Nat.card_coe_set_eq) then = toFinset.card (Set.ncard_eq_toFinset_card) ✓ clone those two lines.
Structure of the new file LiGapCircles.lean:
```
/-
NguyenRH1/LiGapCircles.lean — tier ii′ sub-stage 5e-i (D-068 §2): the
γ-gap circles for the partial-fraction identity's Liouville step.
...
-/
import Mathlib
import NguyenRH1.LiContour
open Zeta23 Complex Filter Topology
open scoped Nat
noncomputable section
namespace NguyenRH1
/-- C0hat is monotone for t ≥ 1. -/
theorem C0hat_mono {a b : ℝ} (ha : 1 ≤ a) (hab : a ≤ b) : C0hat a ≤ C0hat b := ...
/-- The three-window union of zero ordinates covering [4k+1.5, 4k+4], ×2-scaled. -/
-- inline in the main theorem
/-- **The γ-gap circle radius** (ii′-5e-i, D-068 §2): for each k ≥ 1 a radius
R ∈ [4k+2.5, 4k+3] with (i) dist(R/2, ℤ) ≥ 1/4 (the trivial-zero clearance
for the near-axis digamma bound) and (ii) every zero ordinate either far
(≥ 1) or at clearance ≥ 1/(16·C0hat(4k+4.5)) (the critical-annulus gap for
the circle bounds). Via the ×2-rescale trick on ii′-4's
exists_avoiding_midpoint (zero new pigeonhole code). -/
theorem exists_gapCircle_radius (hZC : ZeroCountProp) {k : ℕ} (hk : 1 ≤ k) :
∃ R : ℝ, 4 * (k:ℝ) + 5/2 ≤ R ∧ R ≤ 4 * (k:ℝ) + 3 ∧
(∀ m : ℤ, 1/4 ≤ |R/2 - (m:ℝ)|) ∧
∀ ρ : ℂ, IsNontrivialZero ρ →
(1 / (16 * C0hat (4 * (k:ℝ) + 4.5))) ≤ |ρ.im - R| ∨ 1 ≤ |ρ.im - R| := by
classical
-- the three window finsets
set t1 := 4 * (k:ℝ) + 1.5 with ht1
set t2 := 4 * (k:ℝ) + 2.5 with ht2
set t3 := 4 * (k:ℝ) + 3.5 with ht3
have ht1ge : 2 ≤ t1 := by rw [ht1]; have : (1:ℝ) ≤ (k:ℝ) := by exact_mod_cast hk; linarith
have ht2ge : 2 ≤ t2 := by rw [ht2]; have : (1:ℝ) ≤ (k:ℝ) := by exact_mod_cast hk; linarith
have ht3ge : 2 ≤ t3 := by rw [ht3]; have : (1:ℝ) ≤ (k:ℝ) := by exact_mod_cast hk; linarith
set W1 := (zeroWindow_finite t1).toFinset
set W2 := (zeroWindow_finite t2).toFinset
set W3 := (zeroWindow_finite t3).toFinset
have hW1card : (W1.card : ℝ) ≤ C0hat (t1 + 1) := by
have h1 := hZC t1 ht1ge
have h2 : Nat.card (zeroWindow t1) = W1.card := by
rw [Nat.card_coe_set_eq]
exact Set.ncard_eq_toFinset_card _ _ -- hmm: Set.ncard_eq_toFinset_card s hfin : Set.ncard s = hfin.toFinset.card — the args: from ii′-4: `Set.ncard_eq_toFinset_card _ hfin` — the _ is the set? signature: Set.ncard_eq_toFinset_card (s : Set α) (hs : s.Finite) : s.ncard = hs.toFinset.card? close enough — clone.
rw [h2] at h1
exact h1
... same for W2, W3 ...
set S : Finset ℝ := (W1 ∪ W2 ∪ W3).image (fun ρ : ℂ => 2 * ρ.im) with hS_def
have hScard : (S.card : ℝ) ≤ 3 * C0hat (4 * (k:ℝ) + 4.5) := by
refine (Nat.cast_le.mpr Finset.card_image_le).trans ?_ -- hmm: S.card ≤ (W1∪W2∪W3).card: Finset.card_image_le : (s.image f).card ≤ s.card ✓
refine (Nat.cast_le.mpr ((Finset.card_union_le _ _).trans ... )) ...
```
Let me write the card chain carefully:
```
have hcard1 : S.card ≤ (W1 ∪ W2 ∪ W3).card := Finset.card_image_le
have hcard2 : (W1 ∪ W2 ∪ W3).card ≤ W1.card + W2.card + W3.card := by
calc (W1 ∪ W2 ∪ W3).card ≤ (W1 ∪ W2).card + W3.card := Finset.card_union_le _ _
_ ≤ (W1.card + W2.card) + W3.card := by gcongr; exact Finset.card_union_le _ _ -- hmm add_le_add_right convention: (W1∪W2).card + W3.card ≤ (W1.card + W2.card) + W3.card: add_le_add_right (card_union_le) _?? per the SWAPPED convention: add_le_add_right (h : b ≤ c) (a) : a + b ≤ a + c — WRONG side. Use add_le_add_left (h : b ≤ c) (a) : b + a ≤ c + a ✓: add_le_add_left (Finset.card_union_le W1 W2) _ ✓... hmm wait actually let me double check the swapped convention from journal-025: "add_le_add_left (h : b ≤ c) (a) : b + a ≤ c + a; add_le_add_right (h : b ≤ c) (a) : a + b ≤ a + c" — YES swapped. So for (W1∪W2).card + W3.card ≤ (W1.card+W2.card) + W3.card: h : (W1∪W2).card ≤ W1.card+W2.card appended on the right by W3.card: b + a ≤ c + a form: add_le_add_left h _ ✓.
_ = W1.card + W2.card + W3.card := rfl
have hcard3 : ((W1.card + W2.card + W3.card : ℕ) : ℝ) ≤ 3 * C0hat (4 * (k:ℝ) + 4.5) := by
push_cast
have hm1 : C0hat (t1 + 1) ≤ C0hat (4 * (k:ℝ) + 4.5) := C0hat_mono (by linarith [ht1ge] : 1 ≤ t1 + 1) (by rw [ht1]; linarith : t1 + 1 ≤ 4k+4.5)
-- t1 + 1 = 4k+2.5 ≤ 4k+4.5 ✓
... similarly hm2, hm3 ...
linarith [hW1card, hW2card, hW3card, hm1, hm2, hm3]
have hScardNat : S.card ≤ ⌈3 * C0hat (4 * (k:ℝ) + 4.5)⌉₊ := by
have h := Nat.le_ceil (3 * C0hat (4 * (k:ℝ) + 4.5)) -- hmm: Nat.le_ceil : x ≤ ↑⌈x⌉₊
have h2 : (S.card : ℝ) ≤ (⌈3 * C0hat (4 * (k:ℝ) + 4.5)⌉₊ : ℝ) := hScard.trans h
exact Nat.cast_le.mp h2
obtain ⟨T', hT1, hT2, hT3⟩ := exists_avoiding_midpoint (8 * (k:ℝ) + 5) S hScardNat
-- wait: exists_avoiding_midpoint {k : ℕ} (a : ℝ) (S) (hcard : S.card ≤ k): with k := ⌈3C₀⌉₊: the clearance is 1/(2*(⌈3C₀⌉₊ + 1)).
set R := T' / 2 with hR_def
...
```
Then the four conclusion parts:
```
refine ⟨R, ?_, ?_, ?_, ?_⟩
· -- 4k+2.5 ≤ R: from 8k+5 ≤ T'
rw [hR_def]
have h1 : (8 * (k:ℝ) + 5) / 2 ≤ T' / 2 := by apply div_le_div_right... hmm: T' ≥ 8k+5: (8k+5)/2 ≤ T'/2: div_le_div_of_nonneg_left? no — div_le_div_right (hc : 0 < c) : a/c ≤ b/c ↔ a ≤ b: `div_le_div_right (hc : 0 < c) : a / c ≤ b / c ↔ a ≤ b` ✓ exists I think: rw [div_le_div_right (by norm_num : (0:ℝ) < 2)]; exact hT1 — and the LHS (8k+5)/2 = 4k+2.5: ring_nf... Let me: have : (4:ℝ)*(k:ℝ)+5/2 = (8*(k:ℝ)+5)/2 := by ring; rw [this]; exact div_le_div_of_le... — simplest: `by rw [hR_def]; rw [div_le_div_iff?]...` — cleanest:
have h1 : (8 : ℝ) * (k : ℝ) + 5 ≤ T' := hT1
rw [hR_def]
-- goal 4k + 5/2 ≤ T'/2
linarith [h1] -- 4k + 2.5 ≤ T'/2 ⟺ 8k + 5 ≤ T' ✓ linarith handles the /2
· have h2 : T' ≤ (8 : ℝ) * (k : ℝ) + 6 := hT2
rw [hR_def]
linarith [h2]
· -- ℤ clearance
intro m
-- R/2 = T'/4 ∈ [2k+1.25, 2k+1.5]
have hT'1 := hT1; have hT'2 := hT2
-- cases on m vs 2k+1 / 2k+2
have hm : (m : ℝ) ≤ 2*(k:ℝ) + 1 ∨ 2*(k:ℝ) + 2 ≤ (m:ℝ) := by
rcases lt_or_ge m (2*(k:ℤ) + 2) with h | h
· -- m < 2k+2 ⟹ m ≤ 2k+1
left
have h2 : m ≤ 2*(k:ℤ) + 1 := by omega -- omega with h : m < 2↑k+2 (int casts: k : ℕ → ℤ ↑k; 2*(k:ℤ)+2) — omega handles mixed ℕ/ℤ? omega handles ℕ→ℤ casts ✓
have h3 : ((2*(k:ℤ)+1 : ℤ) : ℝ) = 2*(k:ℝ) + 1 := by push_cast; ring
rw [← h3]
exact_mod_cast h2
· right
have h2 : (2*(k:ℤ) + 2 : ℤ) ≤ m := h
have h3 : ((2*(k:ℤ)+2 : ℤ) : ℝ) = 2*(k:ℝ) + 2 := by push_cast; ring
rw [← h3]
exact_mod_cast h2
rcases hm with hml | hmg
· -- R/2 − m ≥ 1/4
have hge : (1:ℝ)/4 ≤ R/2 - (m:ℝ) := by
rw [hR_def]
linarith [hT'1, hml] -- T'/4 − m ≥ (8k+5)/4 − (2k+1) = 1/4 ✓
rw [ge_iff_le] at *?? — goal 1/4 ≤ |R/2 − ↑m|: rw [abs_of_nonneg (by linarith [hge])]: hmm |R/2 − ↑m| = R/2 − ↑m since ≥ 1/4 > 0: abs_of_nonneg (hge.le... 0 ≤ R/2 − ↑m via hge.trans: (0:ℝ) ≤ 1/4 ≤ R/2−↑m: abs_of_nonneg (by linarith [hge]) then exact hge... let me: rw [abs_of_nonneg (by linarith [hge] : (0:ℝ) ≤ R/2 - (m:ℝ))]; exact hge
· -- m − R/2 ≥ 1/2
have hge : (1:ℝ)/4 ≤ (m:ℝ) - R/2 := by
rw [hR_def]
linarith [hT'2, hmg] -- m − T'/4 ≥ (2k+2) − (8k+6)/4 = 2k+2−2k−1.5 = 0.5 ≥ 1/4 ✓
rw [abs_of_nonpos (by linarith [hge] : R/2 - (m:ℝ) ≤ 0)] -- R/2 − m ≤ 0 ⟹ |R/2 − m| = −(R/2−m) = m − R/2
linarith [hge]
· -- γ clearance
intro ρ hρ
rcases le_or_lt ... — le_or_lt doesn't exist (journal-026)! use: rcases lt_or_ge (1:ℝ) |ρ.im - R| ... hmm — I want: 1 ≤ |ρ.im − R| ∨ |ρ.im − R| < 1: `lt_or_ge |ρ.im − R| 1 : |ρ.im−R| < 1 ∨ |ρ.im−R| ≥ 1`:
rcases lt_or_ge |ρ.im - R| 1 with hcase | hcase
swap
· exact Or.inr hcase -- 1 ≤ |ρ.im − R| ✓
· -- |ρ.im − R| < 1 ⟹ ρ.im ∈ (R−1, R+1) ⊆ [t1, t3+1]
left
have hR1 : 4*(k:ℝ) + 5/2 ≤ R := ... (reuse part 1 — restructure: prove the R bounds FIRST as haves before refine, so they're available)
```
Let me restructure: compute the R bounds as haves before the refine:
```
have hRlo : 4 * (k:ℝ) + 5/2 ≤ R := by rw [hR_def]; linarith [hT1]
have hRhi : R ≤ 4 * (k:ℝ) + 3 := by rw [hR_def]; linarith [hT2]
refine ⟨R, hRlo, hRhi, ?_, ?_⟩
```
Then part (d):
```
intro ρ hρ
rcases lt_or_ge |ρ.im - R| 1 with hcase | hcase
· left
-- ρ.im ∈ (R−1, R+1)
have hrange : t1 ≤ ρ.im ∧ ρ.im ≤ t3 + 1 := by
have h1 : R - 1 < ρ.im := by linarith [abs_lt.mp hcase |>.1] -- |ρ.im − R| < 1 ⟹ −1 < ρ.im − R: ρ.im > R − 1 ≥ 4k+1.5 = t1
have h2 : ρ.im < R + 1 := by linarith [abs_lt.mp hcase |>.2]
constructor
· rw [ht1]; linarith [h1, hRlo]
· rw [ht3]; linarith [h2, hRhi]
-- window membership: ρ ∈ W1 ∪ W2 ∪ W3
have hmem : ρ ∈ W1 ∪ W2 ∪ W3 := by
rcases lt_or_ge ρ.im t2 with hlt | hge -- t2 = 4k+2.5 = t1+1
· -- ρ.im < t2 = t1 + 1: ∈ W1 (zeroWindow t1: t1 ≤ im ≤ t1+1)
apply Finset.mem_union_left -- ρ ∈ W1 ∪ W2 ∪ W3 from ρ ∈ W1: (W1 ∪ W2) ∪ W3: mem_union_left: ρ ∈ W1 ∪ W2 → ...; mem_union_left (W3) (mem_union_left ...)... let me: Finset.mem_union.mpr (Or.inl (Finset.mem_union.mpr (Or.inr ...))) ugh. W1 ∪ W2 ∪ W3 parses as (W1 ∪ W2) ∪ W3. ρ ∈ W1: Finset.mem_union: ρ ∈ W1 ∪ W2 via Or.inl, then (W1∪W2) ∪ W3 via Or.inl:
have hρ1 : ρ ∈ W1 := by
-- W1 = (zeroWindow_finite t1).toFinset: membership ⟺ ∈ zeroWindow t1 = IsNontrivialZero ∧ t1 ≤ im ≤ t1+1
have := Set.Finite.mem_toFinset (zeroWindow_finite t1) -- x ∈ toFinset ↔ x ∈ zeroWindow t1 — wait .toFinset membership: Set.Finite.mem_toFinset (hs : s.Finite) : x ∈ hs.toFinset ↔ x ∈ s — hmm the signature: Set.Finite.mem_toFinset {s} (hs : s.Finite) {a} : a ∈ hs.toFinset ↔ a ∈ s ✓ (used in ii′-4 as Set.Finite.mem_toFinset hfin with explicit ρ via hWFmem).
apply (Set.Finite.mem_toFinset (zeroWindow_finite t1)).mpr
exact ⟨hρ, hrange.1, by rw [ht1, ht2] at *; linarith [hlt]⟩ -- t1+1 = 4k+2.5 = t2: ρ.im ≤ t1+1 ⟺ ρ.im ≤ t2: from hlt (ρ.im < t2): le ✓; careful the t1/t2 unfolding
exact Finset.mem_union_left _ (Finset.mem_union_left _ hρ1)
· rcases lt_or_ge ρ.im t3 with hlt2 | hge2
· -- t2 ≤ ρ.im < t3: ∈ W2 (zeroWindow t2: t2 ≤ im ≤ t2+1 = t3)
have hρ2 : ρ ∈ W2 := by
apply (Set.Finite.mem_toFinset (zeroWindow_finite t2)).mpr
exact ⟨hρ, hge, by rw [ht2, ht3] at *; linarith [hlt2]⟩
exact Finset.mem_union_left _ (Finset.mem_union_right _ hρ2)
· -- t3 ≤ ρ.im ≤ t3+1: ∈ W3
have hρ3 : ρ ∈ W3 := by
apply (Set.Finite.mem_toFinset (zeroWindow_finite t3)).mpr
exact ⟨hρ, hge2, hrange.2⟩
exact Finset.mem_union_right _ hρ3
-- 2·ρ.im ∈ S
have h2mem : 2 * ρ.im ∈ S := by
rw [hS_def]
exact Finset.mem_image.mpr ⟨ρ, hmem, rfl⟩
have hgap := hT3 (2 * ρ.im) h2mem -- 1/(2*(k₀+1)) ≤ |2ρ.im − T'|
-- |ρ.im − R| = |2ρ.im − T'|/2
have hhalve : |ρ.im - R| = |2 * ρ.im - T'| / 2 := by
rw [hR_def]
have h1 : 2 * ρ.im - T' = 2 * (ρ.im - T'/2) := by ring
rw [h1, abs_mul, abs_of_nonneg (by norm_num : (0:ℝ) ≤ 2)]
rw [hhalve]
-- 1/(16 C₀(4k+4.5)) ≤ |2ρ.im − T'|/2 from 1/(2(k₀+1)) ≤ |2ρ.im−T'| and k₀+1 ≤ 4C₀
have hk0 : (⌈3 * C0hat (4 * (k:ℝ) + 4.5)⌉₊ : ℝ) + 1 ≤ 4 * C0hat (4 * (k:ℝ) + 4.5) := by
have h1 := Nat.ceil_lt_add_one (by positivity?...) -- ⌈x⌉₊ < x + 1: Nat.ceil_lt_add_one (hx : 0 ≤ x) : ⌈x⌉₊ < x + 1 ✓ — need 0 ≤ 3*C0hat: C0hat ≥ 2 > 0 (two_le_C0hat with 1 ≤ 4k+4.5):
have hC2 : 2 ≤ C0hat (4 * (k:ℝ) + 4.5) := two_le_C0hat (by have : (1:ℝ) ≤ (k:ℝ) := by exact_mod_cast hk; linarith)
have h2 := Nat.ceil_lt_add_one (show (0:ℝ) ≤ 3 * C0hat (4*(k:ℝ)+4.5) by linarith [hC2])
-- ⌈3C₀⌉₊ < 3C₀ + 1 ⟹ ⌈⌉₊ + 1 ≤ 3C₀ + 2 ≤ 4C₀ (C₀ ≥ 2)
have h3 : ((⌈3 * C0hat (4*(k:ℝ)+4.5)⌉₊ : ℕ) : ℝ) < 3 * C0hat (4*(k:ℝ)+4.5) + 1 := by exact_mod_cast h2
linarith [h3, hC2]
-- chain: 1/(16 C₀) ≤ 1/(4(k₀+1))·... let me: 1/(2(k₀+1)) ≤ |2ρ.im−T'| and 2(k₀+1) ≤ 8C₀ ⟹ 1/(8C₀) ≤ 1/(2(k₀+1)) ≤ |..| ⟹ /2: 1/(16C₀) ≤ |ρ.im−R| ✓:
have hC2 : (2:ℝ) ≤ C0hat (4 * (k:ℝ) + 4.5) := ... (same as above — factor out)
have hchain : (1:ℝ) / (16 * C0hat (4 * (k:ℝ) + 4.5)) ≤ 1 / (2 * ((⌈3 * C0hat (4 * (k:ℝ) + 4.5)⌉₊ : ℝ) + 1)) / 2 := by
-- 16C₀ ≥ 2(k₀+1)·2·... : 16C₀ ≥ 8C₀ ≥ 4(k₀+1): both denominators: 16C₀ vs 4(k₀+1): 4(k₀+1) ≤ 16C₀ ⟺ k₀+1 ≤ 4C₀ ✓ hk0: so 1/(16C₀) ≤ 1/(4(k₀+1)): one_div_le_one_div_of_le (0 < 4(k₀+1)) (4(k₀+1) ≤ 16C₀) — hmm one_div_le_one_div_of_le (ha : 0 < a) (h : a ≤ b) : 1/b ≤ 1/a — careful direction: want 1/(16C₀) ≤ 1/(4(k₀+1)): with a := 4(k₀+1) ≤ b := 16C₀: one_div_le_one_div_of_le ha hab : 1/b ≤ 1/a ✓ = 1/(16C₀) ≤ 1/(4(k₀+1)) ✓. And 1/(4(k₀+1)) = 1/(2(k₀+1))/2 ✓ ring.
...
exact hchain.trans (by rw [div_le_div_iff?]... hmm: 1/(2(k₀+1))/2 ≤ |2ρ.im−T'|/2 from hgap: div_le_div_right? /2 on both sides: `div_le_div_of_nonneg...` — per journal-024/025 renames... use: by linarith? no — division: (div_le_div_right (by norm_num : (0:ℝ) < 2)).mpr hgap : 1/(2(k₀+1))/2 ≤ |2ρ.im−T'|/2 ✓ div_le_div_right (hc : 0 < c) : a/c ≤ b/c ↔ a ≤ b — I think this exists as div_le_div_right ✓ (it was in the renames list...). Then hchain.trans that.
· right
exact hcase
```
Hmm wait — `lt_or_ge` — does it exist? journal-026 said le_or_lt does NOT exist, lt_trichotomy does. For the two-way split: `lt_or_ge : a < b ∨ a ≥ b` — is that in this Mathlib? There's `lt_or_ge (a b : α) : a < b ∨ a ≥ b` — I believe it exists (Order/Basic: lt_or_ge). If not: `em (|ρ.im − R| < 1)` / `lt_or_lt...`. I'll write lt_or_ge and fall back to `Classical.em` if needed. Actually — safer: use `by_cases hcase : |ρ.im - R| < 1` — always works (Decidable via Classical). And for the ℤ-clearance split: `rcases lt_or_ge m (2*(k:ℤ)+2)` — replace with by_cases too: `by_cases h : m < 2*(k:ℤ)+2`. Since `classical` is on, by_cases works everywhere. Let me use by_cases throughout for safety.
Also note: for hT1/hT2 — exists_avoiding_midpoint's output: a ≤ T ∧ T ≤ a+1 with a = 8k+5: so hT1 : 8*(k:ℝ)+5 ≤ T', hT2 : T' ≤ 8*(k:ℝ)+5+1 = 8k+6 ✓.
One concern: the `set t1 := ... with ht1` etc. — using `set` then needing to unfold in membership proofs (`rw [ht1, ht2] at *` is illegal — rw at * with set equations... `rw [ht1]` rewrites t1 → its value — direction: ht1 : t1 = 4*(k:ℝ)+1.5: rw [ht1] at h replaces t1 by the value ✓ but then subsequent set-defined terms... messy. AVOID `set` for the window starts; just write the literals 4*(k:ℝ)+1.5 etc. or use plain `have`-style local notation via `let`... simplest: no set, write 4 * (k:ℝ) + 3/2 etc. Use fractions 3/2, 5/2, 7/2 instead of decimals 1.5/2.5/3.5 (norm_num-friendly; decimals are fine too since they're OfNat scientifically... 1.5 in ℝ is OfNat.ofNat 15/10? Decimals in Lean4 ℝ: 1.5 elaborates as 15/10 via the scientific literal — norm_num handles ✓ but ring/nlinarith also fine. I'll use fractions (3/2 etc.) — cleaner for ring).
Rewrite with t1 := 4k + 3/2, t2 := 4k + 5/2, t3 := 4k + 7/2; windows [t_i, t_i+1] cover [4k+3/2, 4k+9/2] = [4k+1.5, 4k+4.5]: hmm — the needed cover: (R−1, R+1) ⊆ [4k+3/2, 4k+9/2]? R ∈ [4k+5/2, 4k+3]: R−1 ∈ [4k+3/2, 4k+2] ≥ 4k+3/2 ✓; R+1 ≤ 4k+4 ≤ 4k+9/2 ✓. Three windows: [4k+3/2, 4k+5/2], [4k+5/2, 4k+7/2], [4k+7/2, 4k+9/2] ✓ contiguous ✓. C0hat args: t_i + 1 = 4k+5/2, 4k+7/2, 4k+9/2 ✓ ≤ 4k+9/2 = the mono target (4k + 4.5 ✓ same).
ZeroCountProp applicability: t_i ≥ 2: 4k+3/2 ≥ 2 for k ≥ 1 ✓ (4+1.5 = 5.5).
Zero-window membership from hrange: ρ.im ∈ [4k+3/2, 4k+9/2] hmm — from |ρ.im − R| < 1: ρ.im > R − 1 ≥ 4k+3/2 ✓ (strictly > — need ≥ for zeroWindow (a ≤ im): from > get ≤ via .le ✓); ρ.im < R + 1 ≤ 4k+4 ≤ 4k+9/2 ✓.
Then case split: ρ.im ≤ 4k+5/2 (∈ W1: needs 4k+3/2 ≤ im ✓ and im ≤ 4k+5/2 = t1+1 ✓); 4k+5/2 ≤ ρ.im ≤ 4k+7/2 (W2); 4k+7/2 ≤ ρ.im (≤ 4k+9/2 = t3+1: W3) — via by_cases twice.
The union membership: (W1 ∪ W2 ∪ W3) = ((W1 ∪ W2) ∪ W3):
- ρ ∈ W1: mem_union_left W3 (mem_union_left W2 hρ1)? Finset.mem_union_left (s₂) (h : a ∈ s₁) : a ∈ s₁ ∪ s₂ ✓ exists. So ρ ∈ (W1∪W2)∪W3: Finset.mem_union_left W3 (Finset.mem_union_left W2 hρ1) ✓.
- ρ ∈ W2: Finset.mem_union_left W3 (Finset.mem_union_right W1 hρ2) ✓.
- ρ ∈ W3: Finset.mem_union_right (W1∪W2) hρ3 ✓.
The W-membership proofs: W1 is `set` from (zeroWindow_finite t1).toFinset — again avoid set: use plain lets or direct terms. Since the finsets appear many times, use `let`-free local definitions via `have hW1def : W1 = ...`? No — just use plain `set` but ALWAYS reference membership via a helper:
```
set W1 := (zeroWindow_finite (4*(k:ℝ) + 3/2)).toFinset with hW1
have memW1 : ∀ ρ : ℂ, ρ ∈ W1 ↔ ρ ∈ zeroWindow (4*(k:ℝ) + 3/2) :=
fun ρ => Set.Finite.mem_toFinset _
```
Set.Finite.mem_toFinset (hs : s.Finite) : a ∈ hs.toFinset ↔ a ∈ s — with the set's definition hidden by set, the mem_toFinset's type will show W1's unfolding... `Set.Finite.mem_toFinset (zeroWindow_finite (4*(k:ℝ)+3/2)) : a ∈ (zeroWindow_finite _).toFinset ↔ a ∈ zeroWindow _` — since W1 is set-ALIASED (the toFinset term displays as W1 after set), the iff's LHS is `a ∈ W1` after set folds it ✓ (set replaces occurrences in goal/context; in NEW haves the underlying term is used, but Set.Finite.mem_toFinset _ with expected type ρ ∈ W1 ↔ ... — the unifier sees W1 := the toFinset (set introduces a let-like local def with hW1 : W1 = ...). Hmm — `set` makes W1 a local DEFINITION and the mem_toFinset term's type mentions the toFinset term, which is defeq to W1 ✓ exact/apply with ascription works:
```
have memW1 : ∀ ρ : ℂ, ρ ∈ W1 ↔ ρ ∈ zeroWindow (4*(k:ℝ) + 3/2) :=
fun ρ => Set.Finite.mem_toFinset (zeroWindow_finite _)
```
the type ascription forces W1 = toFinset defeq ✓ (set f := x with h makes f a local def equal to x — defeq ✓). OK.
And ZeroCountProp application: hZC (4k+3/2) (proof ≥ 2) : (Nat.card (zeroWindow (4k+3/2)) : ℝ) ≤ C0hat (4k+3/2 + 1). Then Nat.card = W1.card:
```
have hW1card : (W1.card : ℝ) ≤ C0hat (4 * (k:ℝ) + 3/2 + 1) := by
have h1 := hZC (4 * (k:ℝ) + 3/2) (by have hk1 : (1:ℝ) ≤ (k:ℝ) := by exact_mod_cast hk; linarith)
have h2 : Nat.card (zeroWindow (4 * (k:ℝ) + 3/2)) = W1.card := by
rw [Nat.card_coe_set_eq]
exact Set.ncard_eq_toFinset_card _ _
rw [h2] at h1
exact h1
```
Set.ncard_eq_toFinset_card _ _ : from ii′-4: `Set.ncard_eq_toFinset_card _ hfin` — args (s) (hs)? Their line: `exact Set.ncard_eq_toFinset_card _ hfin` — the _ is the set s, hfin the finiteness. With set W1 := hfin.toFinset: the goal Nat.card (...) = W1.card: after Nat.card_coe_set_eq: Set.ncard (...) = W1.card: Set.ncard_eq_toFinset_card s hfin : s.ncard = hfin.toFinset.card = W1.card (defeq via set) ✓ — the exact term `Set.ncard_eq_toFinset_card _ (zeroWindow_finite _)` adapts. Hmm — the second arg in ii′-4 was hfin (a named have). I'll inline (zeroWindow_finite _). Might need the set-ascribed: exact Set.ncard_eq_toFinset_card _ (zeroWindow_finite (4*(k:ℝ)+3/2)) — fine.
OK, also: `Finset.card_union_le` — check exact name: `Finset.card_union_le (s t : Finset α) : (s ∪ t).card ≤ s.card + t.card` ✓ exists I'm confident.
`Finset.card_image_le : (s.image f).card ≤ s.card` ✓.
`exists_avoiding_midpoint (8 * (k:ℝ) + 5) S hScardNat` — the implicit {k : ℕ} in the lemma is the CARD bound — with k₀ := ⌈3*C0hat(4k+9/2)⌉₊ — implicit, inferred from hScardNat : S.card ≤ ⌈...⌉₊ ✓. Returns ⟨T', hT1 : 8k+5 ≤ T', hT2 : T' ≤ 8k+5+1, hT3 : ∀ x ∈ S, 1/(2*(↑k₀+1)) ≤ |x − T'|⟩.
Hmm wait — exists_avoiding_midpoint {k : ℕ} (a : ℝ) (S : Finset ℝ) (hcard : S.card ≤ k) — the lemma's k is implicit and a is explicit ✓.
The hT3 clearance: 1 / (2 * ((k₀ : ℝ) + 1)) ≤ |x − T'| with k₀ = ⌈3*C0hat(4k+9/2)⌉₊ — the cast: ((k₀:ℕ):ℝ).
Then the final chain: 1/(16*C0hat(4k+9/2)) ≤ |ρ.im − R|:
|ρ.im − R| = |2ρ.im − T'|/2 ≥ (1/(2(k₀+1)))/2 = 1/(4(k₀+1)) and 4(k₀+1) ≤ 16·C0hat ⟹ 1/(16C₀) ≤ 1/(4(k₀+1)) ✓.
k₀+1 ≤ 4·C0hat(4k+9/2): k₀ = ⌈3C₀⌉₊ ≤ 3C₀ + 1 (Nat.ceil_lt_add_one: ⌈x⌉₊ < x+1 needs 0 ≤ x: 3C₀ ≥ 6 > 0 ✓) ⟹ k₀+1 ≤ 3C₀+2 ≤ 4C₀ ⟺ 2 ≤ C₀ ✓ two_le_C0hat (1 ≤ 4k+9/2 ✓).
Let me also double-check `Nat.ceil_lt_add_one (hx : 0 ≤ x) : ⌈x⌉₊ < x + 1` ✓ exists.
The one_div chain:
```
have hC2 : (2:ℝ) ≤ C0hat (4 * (k:ℝ) + 9/2) := two_le_C0hat (by ...)
have hk0 : ((⌈3 * C0hat (4 * (k:ℝ) + 9/2)⌉₊ : ℕ) : ℝ) + 1 ≤ 4 * C0hat (4 * (k:ℝ) + 9/2) := by
have h0 : (0:ℝ) ≤ 3 * C0hat (4 * (k:ℝ) + 9/2) := by linarith [hC2]
have h1 := Nat.ceil_lt_add_one h0 -- ⌈3C₀⌉₊ < 3C₀ + 1
have h2 : ((⌈3 * C0hat (4 * (k:ℝ) + 9/2)⌉₊ : ℕ) : ℝ) < 3 * C0hat (4 * (k:ℝ) + 9/2) + 1 := by exact_mod_cast h1
linarith [h2, hC2]
-- 1/(16 C₀) ≤ 1/(4 (k₀+1)):
have hone : (1:ℝ) / (16 * C0hat (4 * (k:ℝ) + 9/2)) ≤ 1 / (4 * ((⌈3 * C0hat (4 * (k:ℝ) + 9/2)⌉₊ : ℝ) + 1)) := by
apply one_div_le_one_div_of_le
· positivity -- 0 < 4*(k₀+1): k₀ ≥ 0... (k₀:ℝ) ≥ 0 via Nat.cast_nonneg: positivity might struggle with the ceil cast: use: by have : (0:ℝ) ≤ (⌈...⌉₊ : ℝ) := by positivity (Nat.cast_nonneg); linarith — hmm positivity on ↑(⌈..⌉₊): should work via Nat.cast_nonneg ✓ or explicit: have hk0pos : (0:ℝ) < 4 * (k₀:ℝ + 1)... let me write: apply one_div_le_one_div_of_le (show (0:ℝ) < 4 * (k₀+1) by ...) (show 4*(k₀+1) ≤ 16*C₀(...) by ...) — the second: 4(k₀+1) ≤ 16C₀ ⟺ k₀+1 ≤ 4C₀ ✓ hk0: linarith [hk0].
· -- 4*(k₀+1) ≤ 16*C₀: nlinarith [hk0, hC2]: 4*(k₀+1) ≤ 4*4C₀ = 16C₀: from hk0 (k₀+1 ≤ 4C₀): 4*(k₀+1) ≤ 16*C₀: linarith [hk0] — needs 4*(k₀+1) ≤ 4*(4*C₀) = 16 C₀: linarith [hk0] ✓ (linear).
-- then: 1/(4(k₀+1)) = (1/(2(k₀+1)))/2 ≤ |2ρ.im−T'|/2 = |ρ.im−R|:
have hhalf : (1:ℝ) / (4 * (k₀:ℝ + 1)) = 1 / (2 * (k₀:ℝ + 1)) / 2 := by ring
...
```
This is getting intricate; the k₀ name — let me set k₀ := ⌈3 * C0hat (4*(k:ℝ)+9/2)⌉₊ via `set k₀ := ... with hk₀` early, so all these forms share the atom. Careful: set with the ceil expression — then hScardNat : S.card ≤ k₀ etc. all use k₀ ✓ cleaner. But haves proving things ABOUT k₀ need hk₀ : k₀ = ⌈...⌉₊ unfolds via rw [hk₀]. OK.
And hhalve : |ρ.im − R| = |2*ρ.im − T'|/2:
```
have hhalve : |ρ.im - R| = |2 * ρ.im - T'| / 2 := by
rw [hR_def] -- hmm R is set: R := T'/2: goal |ρ.im − R| — after set, R is a local def; |2*ρ.im − T'|/2 with T' — hR_def : R = T'/2: rw [hR_def]: goal |ρ.im − T'/2| = |2*ρ.im − T'|/2:
have h1 : 2 * ρ.im - T' = 2 * (ρ.im - T'/2) := by ring
rw [h1, abs_mul]
have h2 : (2:ℝ)|... |(2 : ℝ) * (ρ.im - T'/2)| = |2| * |ρ.im − T'/2| = 2*|..|: abs_of_nonneg... |(2:ℝ)| = 2: abs_of_nonneg? |2| = 2 by norm_num (abs_of_nonneg)... rw [h1, abs_mul, show |(2:ℝ)| = 2 by norm_num]; ring
```
✓.
Also: the 2*ρ.im ∈ S membership: S := (W1∪W2∪W3).image (fun ρ : ℂ => 2 * ρ.im): Finset.mem_image.mpr ⟨ρ, hmem, rfl⟩ — rfl : (fun ρ => 2*ρ.im) ρ = 2*ρ.im ✓.
Alright — also the m : ℤ clearance: with R/2 = T'/4 ∈ [(8k+5)/4, (8k+6)/4]: (8k+5)/4 = 2k + 5/4 ✓, (8k+6)/4 = 2k+3/2 ✓. For m : ℤ: by_cases m ≤ 2k+1 (as integers): |R/2 − ↑m| = R/2 − ↑m (R/2 ≥ 2k+5/4 ≥ ↑m + 1/4 ⟹ positive) ≥ 1/4 ✓; else m ≥ 2k+2: |R/2 − ↑m| = ↑m − R/2 ≥ (2k+2) − (2k+3/2) = 1/2 ≥ 1/4 ✓.
In Lean:
```
intro m
have hk1 : (1:ℝ) ≤ (k:ℝ) := by exact_mod_cast hk
by_cases hmc : (m:ℝ) ≤ 2 * (k:ℝ) + 1
· have hge : (1:ℝ)/4 ≤ R/2 - (m:ℝ) := by rw [hR_def]; linarith [hT1, hmc]
rw [abs_of_nonneg (by linarith [hge])]
exact hge
· push Not at hmc -- 2k+1 < ↑m
have hmc2 : (2:ℝ) * (k:ℝ) + 2 ≤ (m:ℝ) := by
have h1 : 2*(k:ℤ) + 1 < m := by -- from hmc: 2k+1 < ↑m as reals ⟹ int: (2↑k+1 : ℤ) < m:
by_contra hcon
push Not at hcon -- m ≤ 2↑k+1
have : (m:ℝ) ≤ (2*(k:ℤ)+1 : ℤ) := by exact_mod_cast hcon
rw [show ((2*(k:ℤ)+1 : ℤ):ℝ) = 2*(k:ℝ)+1 by push_cast; ring] at this
linarith [hmc]
have h2 : (2*(k:ℤ) + 2 : ℤ) ≤ m := by omega -- from h1
have : ((2*(k:ℤ)+2 : ℤ):ℝ) ≤ (m:ℝ) := by exact_mod_cast h2
rw [show ((2*(k:ℤ)+2 : ℤ):ℝ) = 2*(k:ℝ)+2 by push_cast; ring] at this
exact this
have hge : (1:ℝ)/4 ≤ (m:ℝ) - R/2 := by rw [hR_def]; linarith [hT2, hmc2]
rw [abs_of_nonpos (by linarith [hge])]
linarith [hge]
```
The ℤ-vs-ℝ juggling for m: maybe simpler: m : ℤ: m ≤ ⌊...⌋... Actually cleanest: cases on `Int.le_or_gt m (2*(k:ℤ)+1)`? le_or_gt : a ≤ b ∨ a > b — does it exist? le_or_gt exists I think (Order/Basic: le_or_gt : a ≤ b ∨ b < a ✓ probably). But journal-026 said le_or_lt does NOT exist — le_or_gt might be the one that exists. Risky. Use by_cases (always safe):
```
by_cases hmc : m ≤ 2 * (k:ℤ) + 1
· -- m ≤ 2k+1 (int) ⟹ ↑m ≤ 2k+1 (real)
have hmcR : (m:ℝ) ≤ 2 * (k:ℝ) + 1 := by
have h1 : ((2*(k:ℤ)+1 : ℤ):ℝ) = 2*(k:ℝ) + 1 := by push_cast; ring
rw [← h1]
exact_mod_cast hmc
... (abs_of_nonneg route)
· push Not at hmc -- ¬(m ≤ 2k+1) ⟹ 2k+1 < m ⟹ 2k+2 ≤ m
have hmc2 : (2*(k:ℤ) + 2 : ℤ) ≤ m := by omega
have hmcR : (2:ℝ) * (k:ℝ) + 2 ≤ (m:ℝ) := by
have h1 : ((2*(k:ℤ)+2 : ℤ):ℝ) = 2*(k:ℝ) + 2 := by push_cast; ring
rw [← h1]
exact_mod_cast hmc2
...
```
omega with hmc : ¬(m ≤ 2*↑k+1): goal 2*↑k+2 ≤ m: omega handles ℤ linear with the ℕ-cast of k ✓ (omega supports ℕ→ℤ casts ✓).
OK. Now — assemble the full file. Also note: the ∃ R per k — the final statement's C0hat argument: 4*(k:ℝ) + 9/2. Let me use 9/2 consistently (not 4.5).
One more check — `lt_or_ge` avoided (by_cases used). `one_div_le_one_div_of_le (ha : 0 < a) (h : a ≤ b) : 1/b ≤ 1/a` ✓ (used in ii′-4 line 194 ✓ confirmed).
`abs_of_nonpos : a ≤ 0 → |a| = −a` ✓.
Let me also plan the file header comment per D-068 §2.
Length estimate ~230 lines. Write it now.
The machinery is clear. Writing `LiGapCircles.lean` (5e-i): the ×2-rescaled pigeonhole giving radii with both the ordinate-gap and the ℤ-clearance.
tool: Write
input
{
"file_path": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1\\LiGapCircles.lean",
"content": "/-\nNguyenRH1/LiGapCircles.lean \u2014 tier ii\u2032 sub-stage 5e-i (D-068 \u00a72): the\n\u03b3-gap circles for the partial-fraction identity's growth step.\n\n`exists_gapCircle_radius` (given the perimeter `ZeroCountProp`): for each\nk \u2265 1 a radius R \u2208 [4k+5/2, 4k+3] with\n (i) dist(R/2, \u2124) \u2265 1/4 \u2014 the trivial-zero clearance for the near-axis\n digamma bound (D-068 \u00a71 C2);\n (ii) every nontrivial zero ordinate either far (|\u03b3 \u2212 R| \u2265 1) or at\n clearance |\u03b3 \u2212 R| \u2265 1/(16\u00b7C0hat(4k+9/2)) \u2014 the critical-annulus\n gap for the circle bounds (D-068 \u00a71 C1).\nRoute: the \u00d72-RESCALE TRICK on ii\u2032-4's `exists_avoiding_midpoint` (the\n5c \u00d710-trick verbatim \u2014 zero new pigeonhole code): apply the unit-window\nmidpoint lemma at A = 8k+5 to the \u00d72-scaled ordinate finset of the zeros\nwith ordinate in [4k+3/2, 4k+9/2] (three unit windows, count \u2264\n3\u00b7C0hat(4k+9/2) via the perimeter + `C0hat_mono`), then halve.\n\nArchive references: D-068 \u00a72, D-067 \u00a76, journal-024 (\u00d710 trick),\njournal-026.\n-/\nimport Mathlib\nimport NguyenRH1.LiContour\n\nopen Zeta23 Complex Filter Topology\nopen scoped Nat\n\nnoncomputable section\n\nnamespace NguyenRH1\n\n/-- \u0108\u2080 is monotone for t \u2265 1 (both log and log log terms increase). -/\ntheorem C0hat_mono {a b : \u211d} (ha : 1 \u2264 a) (hab : a \u2264 b) : C0hat a \u2264 C0hat b := by\n have hapos : (0 : \u211d) < a + 2 := by linarith\n have h1 : Real.log (a + 2) \u2264 Real.log (b + 2) := Real.log_le_log hapos (by linarith)\n have hlog1 : (1 : \u211d) \u2264 Real.log (a + 2) := by\n rw [Real.le_log_iff_exp_le hapos]\n have he := Real.exp_one_lt_d9.le\n linarith\n have h2 : Real.log (Real.log (a + 2)) \u2264 Real.log (Real.log (b + 2)) :=\n Real.log_le_log (by linarith) h1\n unfold C0hat\n have h3 : (0 : \u211d) \u2264 (0.886 : \u211d) := by norm_num\n have h4 : (0 : \u211d) \u2264 (0.433 : \u211d) := by norm_num\n nlinarith [h1, h2, h3, h4]\n\n/-- **The \u03b3-gap circle radius** (ii\u2032-5e-i, D-068 \u00a72). -/\ntheorem exists_gapCircle_radius (hZC : ZeroCountProp) {k : \u2115} (hk : 1 \u2264 k) :\n \u2203 R : \u211d, 4 * (k : \u211d) + 5 / 2 \u2264 R \u2227 R \u2264 4 * (k : \u211d) + 3 \u2227\n (\u2200 m : \u2124, 1 / 4 \u2264 |R / 2 - (m : \u211d)|) \u2227\n \u2200 \u03c1 : \u2102, IsNontrivialZero \u03c1 \u2192\n (1 / (16 * C0hat (4 * (k : \u211d) + 9 / 2))) \u2264 |\u03c1.im - R| \u2228 1 \u2264 |\u03c1.im - R| := by\n classical\n have hk1 : (1 : \u211d) \u2264 (k : \u211d) := by exact_mod_cast hk\n -- the three window finsets covering [4k+3/2, 4k+9/2]\n set W1 := (zeroWindow_finite (4 * (k : \u211d) + 3 / 2)).toFinset\n set W2 := (zeroWindow_finite (4 * (k : \u211d) + 5 / 2)).toFinset\n set W3 := (zeroWindow_finite (4 * (k : \u211d) + 7 / 2)).toFinset\n have h2t1 : (2 : \u211d) \u2264 4 * (k : \u211d) + 3 / 2 := by linarith\n have h2t2 : (2 : \u211d) \u2264 4 * (k : \u211d) + 5 / 2 := by linarith\n have h2t3 : (2 : \u211d) \u2264 4 * (k : \u211d) + 7 / 2 := by linarith\n have hW1card : (W1.card : \u211d) \u2264 C0hat (4 * (k : \u211d) + 3 / 2 + 1) := by\n have h1 := hZC _ h2t1\n have h2 : Nat.card (zeroWindow (4 * (k : \u211d) + 3 / 2)) = W1.card := by\n rw [Nat.card_coe_set_eq]\n exact Set.ncard_eq_toFinset_card _ _\n rw [h2] at h1\n exact h1\n have hW2card : (W2.card : \u211d) \u2264 C0hat (4 * (k : \u211d) + 5 / 2 + 1) := by\n have h1 := hZC _ h2t2\n have h2 : Nat.card (zeroWindow (4 * (k : \u211d) + 5 / 2)) = W2.card := by\n rw [Nat.card_coe_set_eq]\n exact Set.ncard_eq_toFinset_card _ _\n rw [h2] at h1\n exact h1\n have hW3card : (W3.card : \u211d) \u2264 C0hat (4 * (k : \u211d) + 7 / 2 + 1) := by\n have h1 := hZC _ h2t3\n have h2 : Nat.card (zeroWindow (4 * (k : \u211d) + 7 / 2)) = W3.card := by\n rw [Nat.card_coe_set_eq]\n exact Set.ncard_eq_toFinset_card _ _\n rw [h2] at h1\n exact h1\n -- monotonicity of the three bounds up to C0hat (4k+9/2)\n have hm1 : C0hat (4 * (k : \u211d) + 3 / 2 + 1) \u2264 C0hat (4 * (k : \u211d) + 9 / 2) :=\n C0hat_mono (by linarith) (by linarith)\n have hm2 : C0hat (4 * (k : \u211d) + 5 / 2 + 1) \u2264 C0hat (4 * (k : \u211d) + 9 / 2) :=\n C0hat_mono (by linarith) (by linarith)\n have hm3 : C0hat (4 * (k : \u211d) + 7 / 2 + 1) \u2264 C0hat (4 * (k : \u211d) + 9 / 2) :=\n C0hat_mono (by linarith) (by linarith)\n -- the \u00d72-scaled ordinate finset\n set S : Finset \u211d := (W1 \u222a W2 \u222a W3).image (fun \u03c1 : \u2102 => 2 * \u03c1.im) with hS_def\n set k\u2080 := \u23083 * C0hat (4 * (k : \u211d) + 9 / 2)\u2309\u208a with hk\u2080\n have hC2 : (2 : \u211d) \u2264 C0hat (4 * (k : \u211d) + 9 / 2) := two_le_C0hat (by linarith)\n have hScardNat : S.card \u2264 k\u2080 := by\n have hcard1 : S.card \u2264 (W1 \u222a W2 \u222a W3).card := Finset.card_image_le\n have hcard2 : (W1 \u222a W2 \u222a W3).card \u2264 W1.card + W2.card + W3.card := by\n calc (W1 \u222a W2 \u222a W3).card \u2264 (W1 \u222a W2).card + W3.card := Finset.card_union_le _ _\n _ \u2264 (W1.card + W2.card) + W3.card :=\n add_le_add_left (Finset.card_union_le W1 W2) _\n _ = W1.card + W2.card + W3.card := rfl\n have hcard3 : ((W1.card + W2.card + W3.card : \u2115) : \u211d) \u2264 3 * C0hat (4 * (k : \u211d) + 9 / 2) := by\n push_cast\n linarith [hW1card, hW2card, hW3card, hm1, hm2, hm3]\n have h2 : (S.card : \u211d) \u2264 (k\u2080 : \u211d) :=\n (Nat.cast_le.mpr (hcard1.trans hcard2)).trans\n (hcard3.trans (by rw [hk\u2080]; exact Nat.le_ceil _))\n exact Nat.cast_le.mp h2\n obtain \u27e8T', hT1, hT2, hT3\u27e9 := exists_avoiding_midpoint (8 * (k : \u211d) + 5) S hScardNat\n set R := T' / 2 with hR_def\n have hRlo : 4 * (k : \u211d) + 5 / 2 \u2264 R := by rw [hR_def]; linarith [hT1]\n have hRhi : R \u2264 4 * (k : \u211d) + 3 := by rw [hR_def]; linarith [hT2]\n refine \u27e8R, hRlo, hRhi, ?_, ?_\u27e9\n \u00b7 -- (i) the \u2124-clearance: R/2 = T'/4 \u2208 [2k+5/4, 2k+3/2]\n intro m\n by_cases hmc : m \u2264 2 * (k : \u2124) + 1\n \u00b7 have hmcR : (m : \u211d) \u2264 2 * (k : \u211d) + 1 := by\n have h1 : ((2 * (k : \u2124) + 1 : \u2124) : \u211d) = 2 * (k : \u211d) + 1 := by push_cast; ring\n rw [\u2190 h1]\n exact_mod_cast hmc\n have hge : (1 : \u211d) / 4 \u2264 R / 2 - (m : \u211d) := by rw [hR_def]; linarith [hT1, hmcR]\n rw [abs_of_nonneg (by linarith [hge])]\n exact hge\n \u00b7 push Not at hmc\n have hmc2 : (2 * (k : \u2124) + 2 : \u2124) \u2264 m := by omega\n have hmcR : (2 : \u211d) * (k : \u211d) + 2 \u2264 (m : \u211d) := by\n have h1 : ((2 * (k : \u2124) + 2 : \u2124) : \u211d) = 2 * (k : \u211d) + 2 := by push_cast; ring\n rw [\u2190 h1]\n exact_mod_cast hmc2\n have hge : (1 : \u211d) / 4 \u2264 (m : \u211d) - R / 2 := by rw [hR_def]; linarith [hT2, hmcR]\n rw [abs_of_nonpos (by linarith [hge])]\n linarith [hge]\n \u00b7 -- (ii) the ordinate clearance\n intro \u03c1 h\u03c1\n by_cases hcase : |\u03c1.im - R| < 1\n \u00b7 left\n -- \u03c1.im \u2208 (R\u22121, R+1) \u2286 [4k+3/2, 4k+9/2]\n have hrange1 : 4 * (k : \u211d) + 3 / 2 \u2264 \u03c1.im := by\n have h1 := (abs_lt.mp hcase).1\n linarith [h1, hRlo]\n have hrange2 : \u03c1.im \u2264 4 * (k : \u211d) + 9 / 2 := by\n have h2 := (abs_lt.mp hcase).2\n linarith [h2, hRhi]\n -- window membership\n have hmem : \u03c1 \u2208 W1 \u222a W2 \u222a W3 := by\n by_cases hsplit1 : \u03c1.im \u2264 4 * (k : \u211d) + 5 / 2\n \u00b7 have h\u03c11 : \u03c1 \u2208 W1 := by\n apply (Set.Finite.mem_toFinset (zeroWindow_finite (4 * (k : \u211d) + 3 / 2))).mpr\n exact \u27e8h\u03c1, hrange1, hsplit1\u27e9\n exact Finset.mem_union_left _ (Finset.mem_union_left _ h\u03c11)\n \u00b7 push Not at hsplit1\n by_cases hsplit2 : \u03c1.im \u2264 4 * (k : \u211d) + 7 / 2\n \u00b7 have h\u03c12 : \u03c1 \u2208 W2 := by\n apply (Set.Finite.mem_toFinset (zeroWindow_finite (4 * (k : \u211d) + 5 / 2))).mpr\n exact \u27e8h\u03c1, hsplit1.le, hsplit2\u27e9\n exact Finset.mem_union_left _ (Finset.mem_union_right _ h\u03c12)\n \u00b7 push Not at hsplit2\n have h\u03c13 : \u03c1 \u2208 W3 := by\n apply (Set.Finite.mem_toFinset (zeroWindow_finite (4 * (k : \u211d) + 7 / 2))).mpr\n exact \u27e8h\u03c1, hsplit2.le, hrange2\u27e9\n exact Finset.mem_union_right _ h\u03c13\n have h2mem : 2 * \u03c1.im \u2208 S :=\n Finset.mem_image.mpr \u27e8\u03c1, hmem, rfl\u27e9\n have hgap := hT3 (2 * \u03c1.im) h2mem\n -- halving the \u00d72 clearance\n have hhalve : |\u03c1.im - R| = |2 * \u03c1.im - T'| / 2 := by\n rw [hR_def]\n have h1 : 2 * \u03c1.im - T' = 2 * (\u03c1.im - T' / 2) := by ring\n rw [h1, abs_mul, show |(2 : \u211d)| = 2 by norm_num]\n -- k\u2080 + 1 \u2264 4\u00b7C\u2080 \u27f9 1/(16 C\u2080) \u2264 1/(4 (k\u2080+1))\n have hk0bound : ((k\u2080 : \u211d) + 1) \u2264 4 * C0hat (4 * (k : \u211d) + 9 / 2) := by\n have h0 : (0 : \u211d) \u2264 3 * C0hat (4 * (k : \u211d) + 9 / 2) := by linarith [hC2]\n have h1 := Nat.ceil_lt_add_one h0\n have h2 : (k\u2080 : \u211d) < 3 * C0hat (4 * (k : \u211d) + 9 / 2) + 1 := by\n rw [hk\u2080]; exact_mod_cast h1\n linarith [h2, hC2]\n have hone : (1 : \u211d) / (16 * C0hat (4 * (k : \u211d) + 9 / 2))\n \u2264 1 / (4 * ((k\u2080 : \u211d) + 1)) := by\n apply one_div_le_one_div_of_le\n \u00b7 have hk\u2080pos : (0 : \u211d) \u2264 (k\u2080 : \u211d) := by positivity\n positivity\n \u00b7 linarith [hk0bound]\n rw [hhalve]\n refine hone.trans ?_\n have hgap2 : 1 / (4 * ((k\u2080 : \u211d) + 1)) \u2264 |2 * \u03c1.im - T'| / 2 := by\n have h1 : (4 : \u211d) * ((k\u2080 : \u211d) + 1) = 2 * ((k\u2080 : \u211d) + 1) * 2 := by ring\n rw [h1]\n rw [div_le_div_iff\u2080 (by positivity : (0 : \u211d) < 2 * ((k\u2080 : \u211d) + 1)) (by norm_num)]\n linarith [hgap]\n exact hgap2\n \u00b7 right\n exact (not_lt.mp hcase)\n\nend NguyenRH1\n\nend\n"
}
raw content_json (database row)
[{"type":"thinking","thinking":"C0hat t = 0.433·log(t+2) + 0.886·log log(t+2) + 2.9. Monotonicity for t ≥ 1: log(t+2) ≥ log 3 > 1 > 0 and increasing; log log(t+2) increasing (log increasing, inner positive). \n\n`C0hat_mono {a b : ℝ} (ha : 1 ≤ a) (hab : a ≤ b) : C0hat a ≤ C0hat b`:\n```\n unfold C0hat\n have hapos : (0:ℝ) < a + 2 := by linarith\n have hbpos : (0:ℝ) < b + 2 := by linarith\n have h1 : Real.log (a + 2) ≤ Real.log (b + 2) := Real.log_le_log hapos (by linarith [hab])\n have h2 : Real.log (Real.log (a + 2)) ≤ Real.log (Real.log (b + 2)) := by\n apply Real.log_le_log\n · -- 0 < log (a+2): a + 2 ≥ 3 > e?? log 3 > 1 since 3 > e: Real.le_log_iff_exp_le: 1 ≤ log 3 ⟺ e ≤ 3 ✓ exp_one_lt_d9\n have h3 : (1:ℝ) ≤ Real.log (a + 2) := by\n rw [Real.le_log_iff_exp_le hapos]\n have he := Real.exp_one_lt_d9.le -- exp 1 ≤ 2.7182818286\n linarith [hab... no: a ≥ 1 ⟹ a+2 ≥ 3 ≥ e ✓: he : Real.exp 1 < 2.718...: 2.718.. ≤ 3 ≤ a+2: linarith [he]]\n ...\n · exact h1\n -- assemble: 0.433·h1 + 0.886·h2 + 0\n gcongr -- 0.433 * log(a+2) + 0.886 * log log(a+2) + 2.9 ≤ ... : gcongr with h1 h2 (coeffs nonneg)\n```\ngcongr should handle (0.433 ≥ 0 etc. via positivity side goals) ✓.\n\nReal.log_le_log (hx : 0 < x) (h : x ≤ y) : log x ≤ log y ✓ banked journal-024.\n\nReal.le_log_iff_exp_le — used in two_le_C0hat: `Real.le_log_iff_exp_le (by positivity : (0:ℝ) < t+2)` : 1 ≤ log(t+2) ↔ exp 1 ≤ t+2 ✓ (signature: Real.le_log_iff_exp_le (hx : 0 < x) : y ≤ Real.log x ↔ Real.exp y ≤ x ✓).\n\nNow — the file. Let me also double-check `Finset.card_union_le` name: `Finset.card_union_le (s t : Finset α) : (s ∪ t).card ≤ s.card + t.card` ✓ exists. And Set.Finite.toFinset + mem lemma: `Set.Finite.mem_toFinset (hs : s.Finite) : x ∈ hs.toFinset ↔ x ∈ s` ✓ (used in exists_zero_avoiding_T). `Set.ncard_eq_toFinset_card _ hfin : Set.ncard s = hfin.toFinset.card`? — from ii′-4: `Set.ncard_eq_toFinset_card _ hfin` used with Nat.card_coe_set_eq: Nat.card s = Set.ncard s (Nat.card_coe_set_eq) then = toFinset.card (Set.ncard_eq_toFinset_card) ✓ clone those two lines.\n\nStructure of the new file LiGapCircles.lean:\n\n```\n/-\nNguyenRH1/LiGapCircles.lean — tier ii′ sub-stage 5e-i (D-068 §2): the\nγ-gap circles for the partial-fraction identity's Liouville step.\n...\n-/\nimport Mathlib\nimport NguyenRH1.LiContour\n\nopen Zeta23 Complex Filter Topology\nopen scoped Nat\n\nnoncomputable section\nnamespace NguyenRH1\n\n/-- C0hat is monotone for t ≥ 1. -/\ntheorem C0hat_mono {a b : ℝ} (ha : 1 ≤ a) (hab : a ≤ b) : C0hat a ≤ C0hat b := ...\n\n/-- The three-window union of zero ordinates covering [4k+1.5, 4k+4], ×2-scaled. -/\n-- inline in the main theorem\n\n/-- **The γ-gap circle radius** (ii′-5e-i, D-068 §2): for each k ≥ 1 a radius\nR ∈ [4k+2.5, 4k+3] with (i) dist(R/2, ℤ) ≥ 1/4 (the trivial-zero clearance\nfor the near-axis digamma bound) and (ii) every zero ordinate either far\n(≥ 1) or at clearance ≥ 1/(16·C0hat(4k+4.5)) (the critical-annulus gap for\nthe circle bounds). Via the ×2-rescale trick on ii′-4's\nexists_avoiding_midpoint (zero new pigeonhole code). -/\ntheorem exists_gapCircle_radius (hZC : ZeroCountProp) {k : ℕ} (hk : 1 ≤ k) :\n ∃ R : ℝ, 4 * (k:ℝ) + 5/2 ≤ R ∧ R ≤ 4 * (k:ℝ) + 3 ∧\n (∀ m : ℤ, 1/4 ≤ |R/2 - (m:ℝ)|) ∧\n ∀ ρ : ℂ, IsNontrivialZero ρ →\n (1 / (16 * C0hat (4 * (k:ℝ) + 4.5))) ≤ |ρ.im - R| ∨ 1 ≤ |ρ.im - R| := by\n classical\n -- the three window finsets\n set t1 := 4 * (k:ℝ) + 1.5 with ht1\n set t2 := 4 * (k:ℝ) + 2.5 with ht2\n set t3 := 4 * (k:ℝ) + 3.5 with ht3\n have ht1ge : 2 ≤ t1 := by rw [ht1]; have : (1:ℝ) ≤ (k:ℝ) := by exact_mod_cast hk; linarith\n have ht2ge : 2 ≤ t2 := by rw [ht2]; have : (1:ℝ) ≤ (k:ℝ) := by exact_mod_cast hk; linarith\n have ht3ge : 2 ≤ t3 := by rw [ht3]; have : (1:ℝ) ≤ (k:ℝ) := by exact_mod_cast hk; linarith\n set W1 := (zeroWindow_finite t1).toFinset\n set W2 := (zeroWindow_finite t2).toFinset\n set W3 := (zeroWindow_finite t3).toFinset\n have hW1card : (W1.card : ℝ) ≤ C0hat (t1 + 1) := by\n have h1 := hZC t1 ht1ge\n have h2 : Nat.card (zeroWindow t1) = W1.card := by\n rw [Nat.card_coe_set_eq]\n exact Set.ncard_eq_toFinset_card _ _ -- hmm: Set.ncard_eq_toFinset_card s hfin : Set.ncard s = hfin.toFinset.card — the args: from ii′-4: `Set.ncard_eq_toFinset_card _ hfin` — the _ is the set? signature: Set.ncard_eq_toFinset_card (s : Set α) (hs : s.Finite) : s.ncard = hs.toFinset.card? close enough — clone.\n rw [h2] at h1\n exact h1\n ... same for W2, W3 ...\n set S : Finset ℝ := (W1 ∪ W2 ∪ W3).image (fun ρ : ℂ => 2 * ρ.im) with hS_def\n have hScard : (S.card : ℝ) ≤ 3 * C0hat (4 * (k:ℝ) + 4.5) := by\n refine (Nat.cast_le.mpr Finset.card_image_le).trans ?_ -- hmm: S.card ≤ (W1∪W2∪W3).card: Finset.card_image_le : (s.image f).card ≤ s.card ✓\n refine (Nat.cast_le.mpr ((Finset.card_union_le _ _).trans ... )) ...\n```\nLet me write the card chain carefully:\n```\n have hcard1 : S.card ≤ (W1 ∪ W2 ∪ W3).card := Finset.card_image_le\n have hcard2 : (W1 ∪ W2 ∪ W3).card ≤ W1.card + W2.card + W3.card := by\n calc (W1 ∪ W2 ∪ W3).card ≤ (W1 ∪ W2).card + W3.card := Finset.card_union_le _ _\n _ ≤ (W1.card + W2.card) + W3.card := by gcongr; exact Finset.card_union_le _ _ -- hmm add_le_add_right convention: (W1∪W2).card + W3.card ≤ (W1.card + W2.card) + W3.card: add_le_add_right (card_union_le) _?? per the SWAPPED convention: add_le_add_right (h : b ≤ c) (a) : a + b ≤ a + c — WRONG side. Use add_le_add_left (h : b ≤ c) (a) : b + a ≤ c + a ✓: add_le_add_left (Finset.card_union_le W1 W2) _ ✓... hmm wait actually let me double check the swapped convention from journal-025: \"add_le_add_left (h : b ≤ c) (a) : b + a ≤ c + a; add_le_add_right (h : b ≤ c) (a) : a + b ≤ a + c\" — YES swapped. So for (W1∪W2).card + W3.card ≤ (W1.card+W2.card) + W3.card: h : (W1∪W2).card ≤ W1.card+W2.card appended on the right by W3.card: b + a ≤ c + a form: add_le_add_left h _ ✓.\n _ = W1.card + W2.card + W3.card := rfl\n have hcard3 : ((W1.card + W2.card + W3.card : ℕ) : ℝ) ≤ 3 * C0hat (4 * (k:ℝ) + 4.5) := by\n push_cast\n have hm1 : C0hat (t1 + 1) ≤ C0hat (4 * (k:ℝ) + 4.5) := C0hat_mono (by linarith [ht1ge] : 1 ≤ t1 + 1) (by rw [ht1]; linarith : t1 + 1 ≤ 4k+4.5)\n -- t1 + 1 = 4k+2.5 ≤ 4k+4.5 ✓\n ... similarly hm2, hm3 ...\n linarith [hW1card, hW2card, hW3card, hm1, hm2, hm3]\n have hScardNat : S.card ≤ ⌈3 * C0hat (4 * (k:ℝ) + 4.5)⌉₊ := by\n have h := Nat.le_ceil (3 * C0hat (4 * (k:ℝ) + 4.5)) -- hmm: Nat.le_ceil : x ≤ ↑⌈x⌉₊\n have h2 : (S.card : ℝ) ≤ (⌈3 * C0hat (4 * (k:ℝ) + 4.5)⌉₊ : ℝ) := hScard.trans h\n exact Nat.cast_le.mp h2\n obtain ⟨T', hT1, hT2, hT3⟩ := exists_avoiding_midpoint (8 * (k:ℝ) + 5) S hScardNat\n -- wait: exists_avoiding_midpoint {k : ℕ} (a : ℝ) (S) (hcard : S.card ≤ k): with k := ⌈3C₀⌉₊: the clearance is 1/(2*(⌈3C₀⌉₊ + 1)).\n set R := T' / 2 with hR_def\n ...\n```\nThen the four conclusion parts:\n```\n refine ⟨R, ?_, ?_, ?_, ?_⟩\n · -- 4k+2.5 ≤ R: from 8k+5 ≤ T'\n rw [hR_def]\n have h1 : (8 * (k:ℝ) + 5) / 2 ≤ T' / 2 := by apply div_le_div_right... hmm: T' ≥ 8k+5: (8k+5)/2 ≤ T'/2: div_le_div_of_nonneg_left? no — div_le_div_right (hc : 0 < c) : a/c ≤ b/c ↔ a ≤ b: `div_le_div_right (hc : 0 < c) : a / c ≤ b / c ↔ a ≤ b` ✓ exists I think: rw [div_le_div_right (by norm_num : (0:ℝ) < 2)]; exact hT1 — and the LHS (8k+5)/2 = 4k+2.5: ring_nf... Let me: have : (4:ℝ)*(k:ℝ)+5/2 = (8*(k:ℝ)+5)/2 := by ring; rw [this]; exact div_le_div_of_le... — simplest: `by rw [hR_def]; rw [div_le_div_iff?]...` — cleanest: \n have h1 : (8 : ℝ) * (k : ℝ) + 5 ≤ T' := hT1\n rw [hR_def]\n -- goal 4k + 5/2 ≤ T'/2\n linarith [h1] -- 4k + 2.5 ≤ T'/2 ⟺ 8k + 5 ≤ T' ✓ linarith handles the /2\n · have h2 : T' ≤ (8 : ℝ) * (k : ℝ) + 6 := hT2\n rw [hR_def]\n linarith [h2]\n · -- ℤ clearance\n intro m\n -- R/2 = T'/4 ∈ [2k+1.25, 2k+1.5]\n have hT'1 := hT1; have hT'2 := hT2\n -- cases on m vs 2k+1 / 2k+2\n have hm : (m : ℝ) ≤ 2*(k:ℝ) + 1 ∨ 2*(k:ℝ) + 2 ≤ (m:ℝ) := by\n rcases lt_or_ge m (2*(k:ℤ) + 2) with h | h\n · -- m < 2k+2 ⟹ m ≤ 2k+1\n left\n have h2 : m ≤ 2*(k:ℤ) + 1 := by omega -- omega with h : m < 2↑k+2 (int casts: k : ℕ → ℤ ↑k; 2*(k:ℤ)+2) — omega handles mixed ℕ/ℤ? omega handles ℕ→ℤ casts ✓\n have h3 : ((2*(k:ℤ)+1 : ℤ) : ℝ) = 2*(k:ℝ) + 1 := by push_cast; ring\n rw [← h3]\n exact_mod_cast h2\n · right\n have h2 : (2*(k:ℤ) + 2 : ℤ) ≤ m := h\n have h3 : ((2*(k:ℤ)+2 : ℤ) : ℝ) = 2*(k:ℝ) + 2 := by push_cast; ring\n rw [← h3]\n exact_mod_cast h2\n rcases hm with hml | hmg\n · -- R/2 − m ≥ 1/4\n have hge : (1:ℝ)/4 ≤ R/2 - (m:ℝ) := by\n rw [hR_def]\n linarith [hT'1, hml] -- T'/4 − m ≥ (8k+5)/4 − (2k+1) = 1/4 ✓\n rw [ge_iff_le] at *?? — goal 1/4 ≤ |R/2 − ↑m|: rw [abs_of_nonneg (by linarith [hge])]: hmm |R/2 − ↑m| = R/2 − ↑m since ≥ 1/4 > 0: abs_of_nonneg (hge.le... 0 ≤ R/2 − ↑m via hge.trans: (0:ℝ) ≤ 1/4 ≤ R/2−↑m: abs_of_nonneg (by linarith [hge]) then exact hge... let me: rw [abs_of_nonneg (by linarith [hge] : (0:ℝ) ≤ R/2 - (m:ℝ))]; exact hge\n · -- m − R/2 ≥ 1/2\n have hge : (1:ℝ)/4 ≤ (m:ℝ) - R/2 := by\n rw [hR_def]\n linarith [hT'2, hmg] -- m − T'/4 ≥ (2k+2) − (8k+6)/4 = 2k+2−2k−1.5 = 0.5 ≥ 1/4 ✓\n rw [abs_of_nonpos (by linarith [hge] : R/2 - (m:ℝ) ≤ 0)] -- R/2 − m ≤ 0 ⟹ |R/2 − m| = −(R/2−m) = m − R/2\n linarith [hge]\n · -- γ clearance\n intro ρ hρ\n rcases le_or_lt ... — le_or_lt doesn't exist (journal-026)! use: rcases lt_or_ge (1:ℝ) |ρ.im - R| ... hmm — I want: 1 ≤ |ρ.im − R| ∨ |ρ.im − R| < 1: `lt_or_ge |ρ.im − R| 1 : |ρ.im−R| < 1 ∨ |ρ.im−R| ≥ 1`: \n rcases lt_or_ge |ρ.im - R| 1 with hcase | hcase\n swap\n · exact Or.inr hcase -- 1 ≤ |ρ.im − R| ✓\n · -- |ρ.im − R| < 1 ⟹ ρ.im ∈ (R−1, R+1) ⊆ [t1, t3+1]\n left\n have hR1 : 4*(k:ℝ) + 5/2 ≤ R := ... (reuse part 1 — restructure: prove the R bounds FIRST as haves before refine, so they're available)\n```\nLet me restructure: compute the R bounds as haves before the refine:\n```\n have hRlo : 4 * (k:ℝ) + 5/2 ≤ R := by rw [hR_def]; linarith [hT1]\n have hRhi : R ≤ 4 * (k:ℝ) + 3 := by rw [hR_def]; linarith [hT2]\n refine ⟨R, hRlo, hRhi, ?_, ?_⟩\n```\nThen part (d):\n```\n intro ρ hρ\n rcases lt_or_ge |ρ.im - R| 1 with hcase | hcase\n · left\n -- ρ.im ∈ (R−1, R+1)\n have hrange : t1 ≤ ρ.im ∧ ρ.im ≤ t3 + 1 := by\n have h1 : R - 1 < ρ.im := by linarith [abs_lt.mp hcase |>.1] -- |ρ.im − R| < 1 ⟹ −1 < ρ.im − R: ρ.im > R − 1 ≥ 4k+1.5 = t1\n have h2 : ρ.im < R + 1 := by linarith [abs_lt.mp hcase |>.2]\n constructor\n · rw [ht1]; linarith [h1, hRlo]\n · rw [ht3]; linarith [h2, hRhi]\n -- window membership: ρ ∈ W1 ∪ W2 ∪ W3\n have hmem : ρ ∈ W1 ∪ W2 ∪ W3 := by\n rcases lt_or_ge ρ.im t2 with hlt | hge -- t2 = 4k+2.5 = t1+1\n · -- ρ.im < t2 = t1 + 1: ∈ W1 (zeroWindow t1: t1 ≤ im ≤ t1+1)\n apply Finset.mem_union_left -- ρ ∈ W1 ∪ W2 ∪ W3 from ρ ∈ W1: (W1 ∪ W2) ∪ W3: mem_union_left: ρ ∈ W1 ∪ W2 → ...; mem_union_left (W3) (mem_union_left ...)... let me: Finset.mem_union.mpr (Or.inl (Finset.mem_union.mpr (Or.inr ...))) ugh. W1 ∪ W2 ∪ W3 parses as (W1 ∪ W2) ∪ W3. ρ ∈ W1: Finset.mem_union: ρ ∈ W1 ∪ W2 via Or.inl, then (W1∪W2) ∪ W3 via Or.inl: \n have hρ1 : ρ ∈ W1 := by\n -- W1 = (zeroWindow_finite t1).toFinset: membership ⟺ ∈ zeroWindow t1 = IsNontrivialZero ∧ t1 ≤ im ≤ t1+1\n have := Set.Finite.mem_toFinset (zeroWindow_finite t1) -- x ∈ toFinset ↔ x ∈ zeroWindow t1 — wait .toFinset membership: Set.Finite.mem_toFinset (hs : s.Finite) : x ∈ hs.toFinset ↔ x ∈ s — hmm the signature: Set.Finite.mem_toFinset {s} (hs : s.Finite) {a} : a ∈ hs.toFinset ↔ a ∈ s ✓ (used in ii′-4 as Set.Finite.mem_toFinset hfin with explicit ρ via hWFmem).\n apply (Set.Finite.mem_toFinset (zeroWindow_finite t1)).mpr\n exact ⟨hρ, hrange.1, by rw [ht1, ht2] at *; linarith [hlt]⟩ -- t1+1 = 4k+2.5 = t2: ρ.im ≤ t1+1 ⟺ ρ.im ≤ t2: from hlt (ρ.im < t2): le ✓; careful the t1/t2 unfolding\n exact Finset.mem_union_left _ (Finset.mem_union_left _ hρ1)\n · rcases lt_or_ge ρ.im t3 with hlt2 | hge2\n · -- t2 ≤ ρ.im < t3: ∈ W2 (zeroWindow t2: t2 ≤ im ≤ t2+1 = t3)\n have hρ2 : ρ ∈ W2 := by\n apply (Set.Finite.mem_toFinset (zeroWindow_finite t2)).mpr\n exact ⟨hρ, hge, by rw [ht2, ht3] at *; linarith [hlt2]⟩\n exact Finset.mem_union_left _ (Finset.mem_union_right _ hρ2)\n · -- t3 ≤ ρ.im ≤ t3+1: ∈ W3\n have hρ3 : ρ ∈ W3 := by\n apply (Set.Finite.mem_toFinset (zeroWindow_finite t3)).mpr\n exact ⟨hρ, hge2, hrange.2⟩\n exact Finset.mem_union_right _ hρ3\n -- 2·ρ.im ∈ S\n have h2mem : 2 * ρ.im ∈ S := by\n rw [hS_def]\n exact Finset.mem_image.mpr ⟨ρ, hmem, rfl⟩\n have hgap := hT3 (2 * ρ.im) h2mem -- 1/(2*(k₀+1)) ≤ |2ρ.im − T'|\n -- |ρ.im − R| = |2ρ.im − T'|/2\n have hhalve : |ρ.im - R| = |2 * ρ.im - T'| / 2 := by\n rw [hR_def]\n have h1 : 2 * ρ.im - T' = 2 * (ρ.im - T'/2) := by ring\n rw [h1, abs_mul, abs_of_nonneg (by norm_num : (0:ℝ) ≤ 2)]\n rw [hhalve]\n -- 1/(16 C₀(4k+4.5)) ≤ |2ρ.im − T'|/2 from 1/(2(k₀+1)) ≤ |2ρ.im−T'| and k₀+1 ≤ 4C₀\n have hk0 : (⌈3 * C0hat (4 * (k:ℝ) + 4.5)⌉₊ : ℝ) + 1 ≤ 4 * C0hat (4 * (k:ℝ) + 4.5) := by\n have h1 := Nat.ceil_lt_add_one (by positivity?...) -- ⌈x⌉₊ < x + 1: Nat.ceil_lt_add_one (hx : 0 ≤ x) : ⌈x⌉₊ < x + 1 ✓ — need 0 ≤ 3*C0hat: C0hat ≥ 2 > 0 (two_le_C0hat with 1 ≤ 4k+4.5): \n have hC2 : 2 ≤ C0hat (4 * (k:ℝ) + 4.5) := two_le_C0hat (by have : (1:ℝ) ≤ (k:ℝ) := by exact_mod_cast hk; linarith)\n have h2 := Nat.ceil_lt_add_one (show (0:ℝ) ≤ 3 * C0hat (4*(k:ℝ)+4.5) by linarith [hC2])\n -- ⌈3C₀⌉₊ < 3C₀ + 1 ⟹ ⌈⌉₊ + 1 ≤ 3C₀ + 2 ≤ 4C₀ (C₀ ≥ 2)\n have h3 : ((⌈3 * C0hat (4*(k:ℝ)+4.5)⌉₊ : ℕ) : ℝ) < 3 * C0hat (4*(k:ℝ)+4.5) + 1 := by exact_mod_cast h2\n linarith [h3, hC2]\n -- chain: 1/(16 C₀) ≤ 1/(4(k₀+1))·... let me: 1/(2(k₀+1)) ≤ |2ρ.im−T'| and 2(k₀+1) ≤ 8C₀ ⟹ 1/(8C₀) ≤ 1/(2(k₀+1)) ≤ |..| ⟹ /2: 1/(16C₀) ≤ |ρ.im−R| ✓:\n have hC2 : (2:ℝ) ≤ C0hat (4 * (k:ℝ) + 4.5) := ... (same as above — factor out)\n have hchain : (1:ℝ) / (16 * C0hat (4 * (k:ℝ) + 4.5)) ≤ 1 / (2 * ((⌈3 * C0hat (4 * (k:ℝ) + 4.5)⌉₊ : ℝ) + 1)) / 2 := by\n -- 16C₀ ≥ 2(k₀+1)·2·... : 16C₀ ≥ 8C₀ ≥ 4(k₀+1): both denominators: 16C₀ vs 4(k₀+1): 4(k₀+1) ≤ 16C₀ ⟺ k₀+1 ≤ 4C₀ ✓ hk0: so 1/(16C₀) ≤ 1/(4(k₀+1)): one_div_le_one_div_of_le (0 < 4(k₀+1)) (4(k₀+1) ≤ 16C₀) — hmm one_div_le_one_div_of_le (ha : 0 < a) (h : a ≤ b) : 1/b ≤ 1/a — careful direction: want 1/(16C₀) ≤ 1/(4(k₀+1)): with a := 4(k₀+1) ≤ b := 16C₀: one_div_le_one_div_of_le ha hab : 1/b ≤ 1/a ✓ = 1/(16C₀) ≤ 1/(4(k₀+1)) ✓. And 1/(4(k₀+1)) = 1/(2(k₀+1))/2 ✓ ring.\n ...\n exact hchain.trans (by rw [div_le_div_iff?]... hmm: 1/(2(k₀+1))/2 ≤ |2ρ.im−T'|/2 from hgap: div_le_div_right? /2 on both sides: `div_le_div_of_nonneg...` — per journal-024/025 renames... use: by linarith? no — division: (div_le_div_right (by norm_num : (0:ℝ) < 2)).mpr hgap : 1/(2(k₀+1))/2 ≤ |2ρ.im−T'|/2 ✓ div_le_div_right (hc : 0 < c) : a/c ≤ b/c ↔ a ≤ b — I think this exists as div_le_div_right ✓ (it was in the renames list...). Then hchain.trans that.\n · right\n exact hcase\n```\nHmm wait — `lt_or_ge` — does it exist? journal-026 said le_or_lt does NOT exist, lt_trichotomy does. For the two-way split: `lt_or_ge : a < b ∨ a ≥ b` — is that in this Mathlib? There's `lt_or_ge (a b : α) : a < b ∨ a ≥ b` — I believe it exists (Order/Basic: lt_or_ge). If not: `em (|ρ.im − R| < 1)` / `lt_or_lt...`. I'll write lt_or_ge and fall back to `Classical.em` if needed. Actually — safer: use `by_cases hcase : |ρ.im - R| < 1` — always works (Decidable via Classical). And for the ℤ-clearance split: `rcases lt_or_ge m (2*(k:ℤ)+2)` — replace with by_cases too: `by_cases h : m < 2*(k:ℤ)+2`. Since `classical` is on, by_cases works everywhere. Let me use by_cases throughout for safety.\n\nAlso note: for hT1/hT2 — exists_avoiding_midpoint's output: a ≤ T ∧ T ≤ a+1 with a = 8k+5: so hT1 : 8*(k:ℝ)+5 ≤ T', hT2 : T' ≤ 8*(k:ℝ)+5+1 = 8k+6 ✓.\n\nOne concern: the `set t1 := ... with ht1` etc. — using `set` then needing to unfold in membership proofs (`rw [ht1, ht2] at *` is illegal — rw at * with set equations... `rw [ht1]` rewrites t1 → its value — direction: ht1 : t1 = 4*(k:ℝ)+1.5: rw [ht1] at h replaces t1 by the value ✓ but then subsequent set-defined terms... messy. AVOID `set` for the window starts; just write the literals 4*(k:ℝ)+1.5 etc. or use plain `have`-style local notation via `let`... simplest: no set, write 4 * (k:ℝ) + 3/2 etc. Use fractions 3/2, 5/2, 7/2 instead of decimals 1.5/2.5/3.5 (norm_num-friendly; decimals are fine too since they're OfNat scientifically... 1.5 in ℝ is OfNat.ofNat 15/10? Decimals in Lean4 ℝ: 1.5 elaborates as 15/10 via the scientific literal — norm_num handles ✓ but ring/nlinarith also fine. I'll use fractions (3/2 etc.) — cleaner for ring).\n\nRewrite with t1 := 4k + 3/2, t2 := 4k + 5/2, t3 := 4k + 7/2; windows [t_i, t_i+1] cover [4k+3/2, 4k+9/2] = [4k+1.5, 4k+4.5]: hmm — the needed cover: (R−1, R+1) ⊆ [4k+3/2, 4k+9/2]? R ∈ [4k+5/2, 4k+3]: R−1 ∈ [4k+3/2, 4k+2] ≥ 4k+3/2 ✓; R+1 ≤ 4k+4 ≤ 4k+9/2 ✓. Three windows: [4k+3/2, 4k+5/2], [4k+5/2, 4k+7/2], [4k+7/2, 4k+9/2] ✓ contiguous ✓. C0hat args: t_i + 1 = 4k+5/2, 4k+7/2, 4k+9/2 ✓ ≤ 4k+9/2 = the mono target (4k + 4.5 ✓ same).\n\nZeroCountProp applicability: t_i ≥ 2: 4k+3/2 ≥ 2 for k ≥ 1 ✓ (4+1.5 = 5.5).\n\nZero-window membership from hrange: ρ.im ∈ [4k+3/2, 4k+9/2] hmm — from |ρ.im − R| < 1: ρ.im > R − 1 ≥ 4k+3/2 ✓ (strictly > — need ≥ for zeroWindow (a ≤ im): from > get ≤ via .le ✓); ρ.im < R + 1 ≤ 4k+4 ≤ 4k+9/2 ✓.\n\nThen case split: ρ.im ≤ 4k+5/2 (∈ W1: needs 4k+3/2 ≤ im ✓ and im ≤ 4k+5/2 = t1+1 ✓); 4k+5/2 ≤ ρ.im ≤ 4k+7/2 (W2); 4k+7/2 ≤ ρ.im (≤ 4k+9/2 = t3+1: W3) — via by_cases twice.\n\nThe union membership: (W1 ∪ W2 ∪ W3) = ((W1 ∪ W2) ∪ W3): \n- ρ ∈ W1: mem_union_left W3 (mem_union_left W2 hρ1)? Finset.mem_union_left (s₂) (h : a ∈ s₁) : a ∈ s₁ ∪ s₂ ✓ exists. So ρ ∈ (W1∪W2)∪W3: Finset.mem_union_left W3 (Finset.mem_union_left W2 hρ1) ✓.\n- ρ ∈ W2: Finset.mem_union_left W3 (Finset.mem_union_right W1 hρ2) ✓.\n- ρ ∈ W3: Finset.mem_union_right (W1∪W2) hρ3 ✓.\n\nThe W-membership proofs: W1 is `set` from (zeroWindow_finite t1).toFinset — again avoid set: use plain lets or direct terms. Since the finsets appear many times, use `let`-free local definitions via `have hW1def : W1 = ...`? No — just use plain `set` but ALWAYS reference membership via a helper:\n```\n set W1 := (zeroWindow_finite (4*(k:ℝ) + 3/2)).toFinset with hW1\n have memW1 : ∀ ρ : ℂ, ρ ∈ W1 ↔ ρ ∈ zeroWindow (4*(k:ℝ) + 3/2) :=\n fun ρ => Set.Finite.mem_toFinset _\n```\nSet.Finite.mem_toFinset (hs : s.Finite) : a ∈ hs.toFinset ↔ a ∈ s — with the set's definition hidden by set, the mem_toFinset's type will show W1's unfolding... `Set.Finite.mem_toFinset (zeroWindow_finite (4*(k:ℝ)+3/2)) : a ∈ (zeroWindow_finite _).toFinset ↔ a ∈ zeroWindow _` — since W1 is set-ALIASED (the toFinset term displays as W1 after set), the iff's LHS is `a ∈ W1` after set folds it ✓ (set replaces occurrences in goal/context; in NEW haves the underlying term is used, but Set.Finite.mem_toFinset _ with expected type ρ ∈ W1 ↔ ... — the unifier sees W1 := the toFinset (set introduces a let-like local def with hW1 : W1 = ...). Hmm — `set` makes W1 a local DEFINITION and the mem_toFinset term's type mentions the toFinset term, which is defeq to W1 ✓ exact/apply with ascription works:\n```\n have memW1 : ∀ ρ : ℂ, ρ ∈ W1 ↔ ρ ∈ zeroWindow (4*(k:ℝ) + 3/2) :=\n fun ρ => Set.Finite.mem_toFinset (zeroWindow_finite _)\n```\nthe type ascription forces W1 = toFinset defeq ✓ (set f := x with h makes f a local def equal to x — defeq ✓). OK.\n\nAnd ZeroCountProp application: hZC (4k+3/2) (proof ≥ 2) : (Nat.card (zeroWindow (4k+3/2)) : ℝ) ≤ C0hat (4k+3/2 + 1). Then Nat.card = W1.card: \n```\n have hW1card : (W1.card : ℝ) ≤ C0hat (4 * (k:ℝ) + 3/2 + 1) := by\n have h1 := hZC (4 * (k:ℝ) + 3/2) (by have hk1 : (1:ℝ) ≤ (k:ℝ) := by exact_mod_cast hk; linarith)\n have h2 : Nat.card (zeroWindow (4 * (k:ℝ) + 3/2)) = W1.card := by\n rw [Nat.card_coe_set_eq]\n exact Set.ncard_eq_toFinset_card _ _\n rw [h2] at h1\n exact h1\n```\nSet.ncard_eq_toFinset_card _ _ : from ii′-4: `Set.ncard_eq_toFinset_card _ hfin` — args (s) (hs)? Their line: `exact Set.ncard_eq_toFinset_card _ hfin` — the _ is the set s, hfin the finiteness. With set W1 := hfin.toFinset: the goal Nat.card (...) = W1.card: after Nat.card_coe_set_eq: Set.ncard (...) = W1.card: Set.ncard_eq_toFinset_card s hfin : s.ncard = hfin.toFinset.card = W1.card (defeq via set) ✓ — the exact term `Set.ncard_eq_toFinset_card _ (zeroWindow_finite _)` adapts. Hmm — the second arg in ii′-4 was hfin (a named have). I'll inline (zeroWindow_finite _). Might need the set-ascribed: exact Set.ncard_eq_toFinset_card _ (zeroWindow_finite (4*(k:ℝ)+3/2)) — fine.\n\nOK, also: `Finset.card_union_le` — check exact name: `Finset.card_union_le (s t : Finset α) : (s ∪ t).card ≤ s.card + t.card` ✓ exists I'm confident.\n\n`Finset.card_image_le : (s.image f).card ≤ s.card` ✓.\n\n`exists_avoiding_midpoint (8 * (k:ℝ) + 5) S hScardNat` — the implicit {k : ℕ} in the lemma is the CARD bound — with k₀ := ⌈3*C0hat(4k+9/2)⌉₊ — implicit, inferred from hScardNat : S.card ≤ ⌈...⌉₊ ✓. Returns ⟨T', hT1 : 8k+5 ≤ T', hT2 : T' ≤ 8k+5+1, hT3 : ∀ x ∈ S, 1/(2*(↑k₀+1)) ≤ |x − T'|⟩.\n\nHmm wait — exists_avoiding_midpoint {k : ℕ} (a : ℝ) (S : Finset ℝ) (hcard : S.card ≤ k) — the lemma's k is implicit and a is explicit ✓.\n\nThe hT3 clearance: 1 / (2 * ((k₀ : ℝ) + 1)) ≤ |x − T'| with k₀ = ⌈3*C0hat(4k+9/2)⌉₊ — the cast: ((k₀:ℕ):ℝ).\n\nThen the final chain: 1/(16*C0hat(4k+9/2)) ≤ |ρ.im − R|:\n|ρ.im − R| = |2ρ.im − T'|/2 ≥ (1/(2(k₀+1)))/2 = 1/(4(k₀+1)) and 4(k₀+1) ≤ 16·C0hat ⟹ 1/(16C₀) ≤ 1/(4(k₀+1)) ✓.\n\nk₀+1 ≤ 4·C0hat(4k+9/2): k₀ = ⌈3C₀⌉₊ ≤ 3C₀ + 1 (Nat.ceil_lt_add_one: ⌈x⌉₊ < x+1 needs 0 ≤ x: 3C₀ ≥ 6 > 0 ✓) ⟹ k₀+1 ≤ 3C₀+2 ≤ 4C₀ ⟺ 2 ≤ C₀ ✓ two_le_C0hat (1 ≤ 4k+9/2 ✓).\n\nLet me also double-check `Nat.ceil_lt_add_one (hx : 0 ≤ x) : ⌈x⌉₊ < x + 1` ✓ exists.\n\nThe one_div chain: \n```\n have hC2 : (2:ℝ) ≤ C0hat (4 * (k:ℝ) + 9/2) := two_le_C0hat (by ...)\n have hk0 : ((⌈3 * C0hat (4 * (k:ℝ) + 9/2)⌉₊ : ℕ) : ℝ) + 1 ≤ 4 * C0hat (4 * (k:ℝ) + 9/2) := by\n have h0 : (0:ℝ) ≤ 3 * C0hat (4 * (k:ℝ) + 9/2) := by linarith [hC2]\n have h1 := Nat.ceil_lt_add_one h0 -- ⌈3C₀⌉₊ < 3C₀ + 1\n have h2 : ((⌈3 * C0hat (4 * (k:ℝ) + 9/2)⌉₊ : ℕ) : ℝ) < 3 * C0hat (4 * (k:ℝ) + 9/2) + 1 := by exact_mod_cast h1\n linarith [h2, hC2]\n -- 1/(16 C₀) ≤ 1/(4 (k₀+1)):\n have hone : (1:ℝ) / (16 * C0hat (4 * (k:ℝ) + 9/2)) ≤ 1 / (4 * ((⌈3 * C0hat (4 * (k:ℝ) + 9/2)⌉₊ : ℝ) + 1)) := by\n apply one_div_le_one_div_of_le\n · positivity -- 0 < 4*(k₀+1): k₀ ≥ 0... (k₀:ℝ) ≥ 0 via Nat.cast_nonneg: positivity might struggle with the ceil cast: use: by have : (0:ℝ) ≤ (⌈...⌉₊ : ℝ) := by positivity (Nat.cast_nonneg); linarith — hmm positivity on ↑(⌈..⌉₊): should work via Nat.cast_nonneg ✓ or explicit: have hk0pos : (0:ℝ) < 4 * (k₀:ℝ + 1)... let me write: apply one_div_le_one_div_of_le (show (0:ℝ) < 4 * (k₀+1) by ...) (show 4*(k₀+1) ≤ 16*C₀(...) by ...) — the second: 4(k₀+1) ≤ 16C₀ ⟺ k₀+1 ≤ 4C₀ ✓ hk0: linarith [hk0].\n · -- 4*(k₀+1) ≤ 16*C₀: nlinarith [hk0, hC2]: 4*(k₀+1) ≤ 4*4C₀ = 16C₀: from hk0 (k₀+1 ≤ 4C₀): 4*(k₀+1) ≤ 16*C₀: linarith [hk0] — needs 4*(k₀+1) ≤ 4*(4*C₀) = 16 C₀: linarith [hk0] ✓ (linear).\n -- then: 1/(4(k₀+1)) = (1/(2(k₀+1)))/2 ≤ |2ρ.im−T'|/2 = |ρ.im−R|:\n have hhalf : (1:ℝ) / (4 * (k₀:ℝ + 1)) = 1 / (2 * (k₀:ℝ + 1)) / 2 := by ring\n ...\n```\nThis is getting intricate; the k₀ name — let me set k₀ := ⌈3 * C0hat (4*(k:ℝ)+9/2)⌉₊ via `set k₀ := ... with hk₀` early, so all these forms share the atom. Careful: set with the ceil expression — then hScardNat : S.card ≤ k₀ etc. all use k₀ ✓ cleaner. But haves proving things ABOUT k₀ need hk₀ : k₀ = ⌈...⌉₊ unfolds via rw [hk₀]. OK.\n\nAnd hhalve : |ρ.im − R| = |2*ρ.im − T'|/2:\n```\n have hhalve : |ρ.im - R| = |2 * ρ.im - T'| / 2 := by\n rw [hR_def] -- hmm R is set: R := T'/2: goal |ρ.im − R| — after set, R is a local def; |2*ρ.im − T'|/2 with T' — hR_def : R = T'/2: rw [hR_def]: goal |ρ.im − T'/2| = |2*ρ.im − T'|/2: \n have h1 : 2 * ρ.im - T' = 2 * (ρ.im - T'/2) := by ring\n rw [h1, abs_mul]\n have h2 : (2:ℝ)|... |(2 : ℝ) * (ρ.im - T'/2)| = |2| * |ρ.im − T'/2| = 2*|..|: abs_of_nonneg... |(2:ℝ)| = 2: abs_of_nonneg? |2| = 2 by norm_num (abs_of_nonneg)... rw [h1, abs_mul, show |(2:ℝ)| = 2 by norm_num]; ring\n```\n✓.\n\nAlso: the 2*ρ.im ∈ S membership: S := (W1∪W2∪W3).image (fun ρ : ℂ => 2 * ρ.im): Finset.mem_image.mpr ⟨ρ, hmem, rfl⟩ — rfl : (fun ρ => 2*ρ.im) ρ = 2*ρ.im ✓.\n\nAlright — also the m : ℤ clearance: with R/2 = T'/4 ∈ [(8k+5)/4, (8k+6)/4]: (8k+5)/4 = 2k + 5/4 ✓, (8k+6)/4 = 2k+3/2 ✓. For m : ℤ: by_cases m ≤ 2k+1 (as integers): |R/2 − ↑m| = R/2 − ↑m (R/2 ≥ 2k+5/4 ≥ ↑m + 1/4 ⟹ positive) ≥ 1/4 ✓; else m ≥ 2k+2: |R/2 − ↑m| = ↑m − R/2 ≥ (2k+2) − (2k+3/2) = 1/2 ≥ 1/4 ✓.\nIn Lean:\n```\n intro m\n have hk1 : (1:ℝ) ≤ (k:ℝ) := by exact_mod_cast hk\n by_cases hmc : (m:ℝ) ≤ 2 * (k:ℝ) + 1\n · have hge : (1:ℝ)/4 ≤ R/2 - (m:ℝ) := by rw [hR_def]; linarith [hT1, hmc]\n rw [abs_of_nonneg (by linarith [hge])]\n exact hge\n · push Not at hmc -- 2k+1 < ↑m\n have hmc2 : (2:ℝ) * (k:ℝ) + 2 ≤ (m:ℝ) := by\n have h1 : 2*(k:ℤ) + 1 < m := by -- from hmc: 2k+1 < ↑m as reals ⟹ int: (2↑k+1 : ℤ) < m: \n by_contra hcon\n push Not at hcon -- m ≤ 2↑k+1\n have : (m:ℝ) ≤ (2*(k:ℤ)+1 : ℤ) := by exact_mod_cast hcon\n rw [show ((2*(k:ℤ)+1 : ℤ):ℝ) = 2*(k:ℝ)+1 by push_cast; ring] at this\n linarith [hmc]\n have h2 : (2*(k:ℤ) + 2 : ℤ) ≤ m := by omega -- from h1\n have : ((2*(k:ℤ)+2 : ℤ):ℝ) ≤ (m:ℝ) := by exact_mod_cast h2\n rw [show ((2*(k:ℤ)+2 : ℤ):ℝ) = 2*(k:ℝ)+2 by push_cast; ring] at this\n exact this\n have hge : (1:ℝ)/4 ≤ (m:ℝ) - R/2 := by rw [hR_def]; linarith [hT2, hmc2]\n rw [abs_of_nonpos (by linarith [hge])]\n linarith [hge]\n```\nThe ℤ-vs-ℝ juggling for m: maybe simpler: m : ℤ: m ≤ ⌊...⌋... Actually cleanest: cases on `Int.le_or_gt m (2*(k:ℤ)+1)`? le_or_gt : a ≤ b ∨ a > b — does it exist? le_or_gt exists I think (Order/Basic: le_or_gt : a ≤ b ∨ b < a ✓ probably). But journal-026 said le_or_lt does NOT exist — le_or_gt might be the one that exists. Risky. Use by_cases (always safe):\n```\n by_cases hmc : m ≤ 2 * (k:ℤ) + 1\n · -- m ≤ 2k+1 (int) ⟹ ↑m ≤ 2k+1 (real)\n have hmcR : (m:ℝ) ≤ 2 * (k:ℝ) + 1 := by\n have h1 : ((2*(k:ℤ)+1 : ℤ):ℝ) = 2*(k:ℝ) + 1 := by push_cast; ring\n rw [← h1]\n exact_mod_cast hmc\n ... (abs_of_nonneg route)\n · push Not at hmc -- ¬(m ≤ 2k+1) ⟹ 2k+1 < m ⟹ 2k+2 ≤ m\n have hmc2 : (2*(k:ℤ) + 2 : ℤ) ≤ m := by omega\n have hmcR : (2:ℝ) * (k:ℝ) + 2 ≤ (m:ℝ) := by\n have h1 : ((2*(k:ℤ)+2 : ℤ):ℝ) = 2*(k:ℝ) + 2 := by push_cast; ring\n rw [← h1]\n exact_mod_cast hmc2\n ...\n```\nomega with hmc : ¬(m ≤ 2*↑k+1): goal 2*↑k+2 ≤ m: omega handles ℤ linear with the ℕ-cast of k ✓ (omega supports ℕ→ℤ casts ✓).\n\nOK. Now — assemble the full file. Also note: the ∃ R per k — the final statement's C0hat argument: 4*(k:ℝ) + 9/2. Let me use 9/2 consistently (not 4.5).\n\nOne more check — `lt_or_ge` avoided (by_cases used). `one_div_le_one_div_of_le (ha : 0 < a) (h : a ≤ b) : 1/b ≤ 1/a` ✓ (used in ii′-4 line 194 ✓ confirmed).\n\n`abs_of_nonpos : a ≤ 0 → |a| = −a` ✓.\n\nLet me also plan the file header comment per D-068 §2.\n\nLength estimate ~230 lines. Write it now.","signature":""},{"type":"text","text":"The machinery is clear. Writing `LiGapCircles.lean` (5e-i): the ×2-rescaled pigeonhole giving radii with both the ordinate-gap and the ℤ-clearance."},{"type":"tool_use","id":"Write_226","name":"Write","input":{"file_path":"D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1\\LiGapCircles.lean","content":"/-\nNguyenRH1/LiGapCircles.lean — tier ii′ sub-stage 5e-i (D-068 §2): the\nγ-gap circles for the partial-fraction identity's growth step.\n\n`exists_gapCircle_radius` (given the perimeter `ZeroCountProp`): for each\nk ≥ 1 a radius R ∈ [4k+5/2, 4k+3] with\n (i) dist(R/2, ℤ) ≥ 1/4 — the trivial-zero clearance for the near-axis\n digamma bound (D-068 §1 C2);\n (ii) every nontrivial zero ordinate either far (|γ − R| ≥ 1) or at\n clearance |γ − R| ≥ 1/(16·C0hat(4k+9/2)) — the critical-annulus\n gap for the circle bounds (D-068 §1 C1).\nRoute: the ×2-RESCALE TRICK on ii′-4's `exists_avoiding_midpoint` (the\n5c ×10-trick verbatim — zero new pigeonhole code): apply the unit-window\nmidpoint lemma at A = 8k+5 to the ×2-scaled ordinate finset of the zeros\nwith ordinate in [4k+3/2, 4k+9/2] (three unit windows, count ≤\n3·C0hat(4k+9/2) via the perimeter + `C0hat_mono`), then halve.\n\nArchive references: D-068 §2, D-067 §6, journal-024 (×10 trick),\njournal-026.\n-/\nimport Mathlib\nimport NguyenRH1.LiContour\n\nopen Zeta23 Complex Filter Topology\nopen scoped Nat\n\nnoncomputable section\n\nnamespace NguyenRH1\n\n/-- Ĉ₀ is monotone for t ≥ 1 (both log and log log terms increase). -/\ntheorem C0hat_mono {a b : ℝ} (ha : 1 ≤ a) (hab : a ≤ b) : C0hat a ≤ C0hat b := by\n have hapos : (0 : ℝ) < a + 2 := by linarith\n have h1 : Real.log (a + 2) ≤ Real.log (b + 2) := Real.log_le_log hapos (by linarith)\n have hlog1 : (1 : ℝ) ≤ Real.log (a + 2) := by\n rw [Real.le_log_iff_exp_le hapos]\n have he := Real.exp_one_lt_d9.le\n linarith\n have h2 : Real.log (Real.log (a + 2)) ≤ Real.log (Real.log (b + 2)) :=\n Real.log_le_log (by linarith) h1\n unfold C0hat\n have h3 : (0 : ℝ) ≤ (0.886 : ℝ) := by norm_num\n have h4 : (0 : ℝ) ≤ (0.433 : ℝ) := by norm_num\n nlinarith [h1, h2, h3, h4]\n\n/-- **The γ-gap circle radius** (ii′-5e-i, D-068 §2). -/\ntheorem exists_gapCircle_radius (hZC : ZeroCountProp) {k : ℕ} (hk : 1 ≤ k) :\n ∃ R : ℝ, 4 * (k : ℝ) + 5 / 2 ≤ R ∧ R ≤ 4 * (k : ℝ) + 3 ∧\n (∀ m : ℤ, 1 / 4 ≤ |R / 2 - (m : ℝ)|) ∧\n ∀ ρ : ℂ, IsNontrivialZero ρ →\n (1 / (16 * C0hat (4 * (k : ℝ) + 9 / 2))) ≤ |ρ.im - R| ∨ 1 ≤ |ρ.im - R| := by\n classical\n have hk1 : (1 : ℝ) ≤ (k : ℝ) := by exact_mod_cast hk\n -- the three window finsets covering [4k+3/2, 4k+9/2]\n set W1 := (zeroWindow_finite (4 * (k : ℝ) + 3 / 2)).toFinset\n set W2 := (zeroWindow_finite (4 * (k : ℝ) + 5 / 2)).toFinset\n set W3 := (zeroWindow_finite (4 * (k : ℝ) + 7 / 2)).toFinset\n have h2t1 : (2 : ℝ) ≤ 4 * (k : ℝ) + 3 / 2 := by linarith\n have h2t2 : (2 : ℝ) ≤ 4 * (k : ℝ) + 5 / 2 := by linarith\n have h2t3 : (2 : ℝ) ≤ 4 * (k : ℝ) + 7 / 2 := by linarith\n have hW1card : (W1.card : ℝ) ≤ C0hat (4 * (k : ℝ) + 3 / 2 + 1) := by\n have h1 := hZC _ h2t1\n have h2 : Nat.card (zeroWindow (4 * (k : ℝ) + 3 / 2)) = W1.card := by\n rw [Nat.card_coe_set_eq]\n exact Set.ncard_eq_toFinset_card _ _\n rw [h2] at h1\n exact h1\n have hW2card : (W2.card : ℝ) ≤ C0hat (4 * (k : ℝ) + 5 / 2 + 1) := by\n have h1 := hZC _ h2t2\n have h2 : Nat.card (zeroWindow (4 * (k : ℝ) + 5 / 2)) = W2.card := by\n rw [Nat.card_coe_set_eq]\n exact Set.ncard_eq_toFinset_card _ _\n rw [h2] at h1\n exact h1\n have hW3card : (W3.card : ℝ) ≤ C0hat (4 * (k : ℝ) + 7 / 2 + 1) := by\n have h1 := hZC _ h2t3\n have h2 : Nat.card (zeroWindow (4 * (k : ℝ) + 7 / 2)) = W3.card := by\n rw [Nat.card_coe_set_eq]\n exact Set.ncard_eq_toFinset_card _ _\n rw [h2] at h1\n exact h1\n -- monotonicity of the three bounds up to C0hat (4k+9/2)\n have hm1 : C0hat (4 * (k : ℝ) + 3 / 2 + 1) ≤ C0hat (4 * (k : ℝ) + 9 / 2) :=\n C0hat_mono (by linarith) (by linarith)\n have hm2 : C0hat (4 * (k : ℝ) + 5 / 2 + 1) ≤ C0hat (4 * (k : ℝ) + 9 / 2) :=\n C0hat_mono (by linarith) (by linarith)\n have hm3 : C0hat (4 * (k : ℝ) + 7 / 2 + 1) ≤ C0hat (4 * (k : ℝ) + 9 / 2) :=\n C0hat_mono (by linarith) (by linarith)\n -- the ×2-scaled ordinate finset\n set S : Finset ℝ := (W1 ∪ W2 ∪ W3).image (fun ρ : ℂ => 2 * ρ.im) with hS_def\n set k₀ := ⌈3 * C0hat (4 * (k : ℝ) + 9 / 2)⌉₊ with hk₀\n have hC2 : (2 : ℝ) ≤ C0hat (4 * (k : ℝ) + 9 / 2) := two_le_C0hat (by linarith)\n have hScardNat : S.card ≤ k₀ := by\n have hcard1 : S.card ≤ (W1 ∪ W2 ∪ W3).card := Finset.card_image_le\n have hcard2 : (W1 ∪ W2 ∪ W3).card ≤ W1.card + W2.card + W3.card := by\n calc (W1 ∪ W2 ∪ W3).card ≤ (W1 ∪ W2).card + W3.card := Finset.card_union_le _ _\n _ ≤ (W1.card + W2.card) + W3.card :=\n add_le_add_left (Finset.card_union_le W1 W2) _\n _ = W1.card + W2.card + W3.card := rfl\n have hcard3 : ((W1.card + W2.card + W3.card : ℕ) : ℝ) ≤ 3 * C0hat (4 * (k : ℝ) + 9 / 2) := by\n push_cast\n linarith [hW1card, hW2card, hW3card, hm1, hm2, hm3]\n have h2 : (S.card : ℝ) ≤ (k₀ : ℝ) :=\n (Nat.cast_le.mpr (hcard1.trans hcard2)).trans\n (hcard3.trans (by rw [hk₀]; exact Nat.le_ceil _))\n exact Nat.cast_le.mp h2\n obtain ⟨T', hT1, hT2, hT3⟩ := exists_avoiding_midpoint (8 * (k : ℝ) + 5) S hScardNat\n set R := T' / 2 with hR_def\n have hRlo : 4 * (k : ℝ) + 5 / 2 ≤ R := by rw [hR_def]; linarith [hT1]\n have hRhi : R ≤ 4 * (k : ℝ) + 3 := by rw [hR_def]; linarith [hT2]\n refine ⟨R, hRlo, hRhi, ?_, ?_⟩\n · -- (i) the ℤ-clearance: R/2 = T'/4 ∈ [2k+5/4, 2k+3/2]\n intro m\n by_cases hmc : m ≤ 2 * (k : ℤ) + 1\n · have hmcR : (m : ℝ) ≤ 2 * (k : ℝ) + 1 := by\n have h1 : ((2 * (k : ℤ) + 1 : ℤ) : ℝ) = 2 * (k : ℝ) + 1 := by push_cast; ring\n rw [← h1]\n exact_mod_cast hmc\n have hge : (1 : ℝ) / 4 ≤ R / 2 - (m : ℝ) := by rw [hR_def]; linarith [hT1, hmcR]\n rw [abs_of_nonneg (by linarith [hge])]\n exact hge\n · push Not at hmc\n have hmc2 : (2 * (k : ℤ) + 2 : ℤ) ≤ m := by omega\n have hmcR : (2 : ℝ) * (k : ℝ) + 2 ≤ (m : ℝ) := by\n have h1 : ((2 * (k : ℤ) + 2 : ℤ) : ℝ) = 2 * (k : ℝ) + 2 := by push_cast; ring\n rw [← h1]\n exact_mod_cast hmc2\n have hge : (1 : ℝ) / 4 ≤ (m : ℝ) - R / 2 := by rw [hR_def]; linarith [hT2, hmcR]\n rw [abs_of_nonpos (by linarith [hge])]\n linarith [hge]\n · -- (ii) the ordinate clearance\n intro ρ hρ\n by_cases hcase : |ρ.im - R| < 1\n · left\n -- ρ.im ∈ (R−1, R+1) ⊆ [4k+3/2, 4k+9/2]\n have hrange1 : 4 * (k : ℝ) + 3 / 2 ≤ ρ.im := by\n have h1 := (abs_lt.mp hcase).1\n linarith [h1, hRlo]\n have hrange2 : ρ.im ≤ 4 * (k : ℝ) + 9 / 2 := by\n have h2 := (abs_lt.mp hcase).2\n linarith [h2, hRhi]\n -- window membership\n have hmem : ρ ∈ W1 ∪ W2 ∪ W3 := by\n by_cases hsplit1 : ρ.im ≤ 4 * (k : ℝ) + 5 / 2\n · have hρ1 : ρ ∈ W1 := by\n apply (Set.Finite.mem_toFinset (zeroWindow_finite (4 * (k : ℝ) + 3 / 2))).mpr\n exact ⟨hρ, hrange1, hsplit1⟩\n exact Finset.mem_union_left _ (Finset.mem_union_left _ hρ1)\n · push Not at hsplit1\n by_cases hsplit2 : ρ.im ≤ 4 * (k : ℝ) + 7 / 2\n · have hρ2 : ρ ∈ W2 := by\n apply (Set.Finite.mem_toFinset (zeroWindow_finite (4 * (k : ℝ) + 5 / 2))).mpr\n exact ⟨hρ, hsplit1.le, hsplit2⟩\n exact Finset.mem_union_left _ (Finset.mem_union_right _ hρ2)\n · push Not at hsplit2\n have hρ3 : ρ ∈ W3 := by\n apply (Set.Finite.mem_toFinset (zeroWindow_finite (4 * (k : ℝ) + 7 / 2))).mpr\n exact ⟨hρ, hsplit2.le, hrange2⟩\n exact Finset.mem_union_right _ hρ3\n have h2mem : 2 * ρ.im ∈ S :=\n Finset.mem_image.mpr ⟨ρ, hmem, rfl⟩\n have hgap := hT3 (2 * ρ.im) h2mem\n -- halving the ×2 clearance\n have hhalve : |ρ.im - R| = |2 * ρ.im - T'| / 2 := by\n rw [hR_def]\n have h1 : 2 * ρ.im - T' = 2 * (ρ.im - T' / 2) := by ring\n rw [h1, abs_mul, show |(2 : ℝ)| = 2 by norm_num]\n -- k₀ + 1 ≤ 4·C₀ ⟹ 1/(16 C₀) ≤ 1/(4 (k₀+1))\n have hk0bound : ((k₀ : ℝ) + 1) ≤ 4 * C0hat (4 * (k : ℝ) + 9 / 2) := by\n have h0 : (0 : ℝ) ≤ 3 * C0hat (4 * (k : ℝ) + 9 / 2) := by linarith [hC2]\n have h1 := Nat.ceil_lt_add_one h0\n have h2 : (k₀ : ℝ) < 3 * C0hat (4 * (k : ℝ) + 9 / 2) + 1 := by\n rw [hk₀]; exact_mod_cast h1\n linarith [h2, hC2]\n have hone : (1 : ℝ) / (16 * C0hat (4 * (k : ℝ) + 9 / 2))\n ≤ 1 / (4 * ((k₀ : ℝ) + 1)) := by\n apply one_div_le_one_div_of_le\n · have hk₀pos : (0 : ℝ) ≤ (k₀ : ℝ) := by positivity\n positivity\n · linarith [hk0bound]\n rw [hhalve]\n refine hone.trans ?_\n have hgap2 : 1 / (4 * ((k₀ : ℝ) + 1)) ≤ |2 * ρ.im - T'| / 2 := by\n have h1 : (4 : ℝ) * ((k₀ : ℝ) + 1) = 2 * ((k₀ : ℝ) + 1) * 2 := by ring\n rw [h1]\n rw [div_le_div_iff₀ (by positivity : (0 : ℝ) < 2 * ((k₀ : ℝ) + 1)) (by norm_num)]\n linarith [hgap]\n exact hgap2\n · right\n exact (not_lt.mp hcase)\n\nend NguyenRH1\n\nend\n"},"extra_content":null}]