Current task: —

← Session 24 — ii′-2…4: swaps, (4.10) design, contour + website roadmap fixes

#1191 assistant 2026-08-22 15:25:01.197 UTC · 485→4097 tok open ⤢
thinking (8587 chars)
Committed. Now ii′-4b: L1 kernel bounds. Append §4 to LiContour.lean: 1. `kFun_norm_le_two {n : ℕ} {s : ℂ} (hs : s.re ≤ 1/2) : ‖kFun n s‖ ≤ 2` Proof: - s ≠ 1 (re ≤ 1/2 < 1 = (1:ℂ).re) - ‖s‖ ≤ ‖s − 1‖: via normSq: `Complex.norm_le_iff_normSq_le`? hmm. Let me think about what's available: `Complex.normSq_le_normSq_iff_norm_le`? Easiest: `Complex.normSq s ≤ Complex.normSq (s - 1)` then take sqrt... Mathlib: `Complex.normSq_le_normSq` hmm. There is `Complex.normSq_eq_norm_sq : normSq z = ‖z‖^2` and conversely. So ‖s‖² ≤ ‖s−1‖² ⟹ ‖s‖ ≤ ‖s−1‖ (sq_le_sq... with nonneg: `sq_le_sq' `hmm: for a b ≥ 0: a² ≤ b² ⟹ a ≤ b: `pow_le_pow_left`... inverse: `le_of_pow_le_pow_left`? or `abs_le_of_sq_le_sq`. There's `Real.le_of_sq_le_sq`? Let me use: `pow_le_pow_iff_left`? I'll use: ‖s‖ ≤ ‖s−1‖ ⟺ ‖s‖² ≤ ‖s−1‖² (both nonneg): `pow_le_pow_iff_left (ha : 0 ≤ a) (hb : 0 ≤ b) : a^n ≤ b^n ↔ a ≤ b`? for n ≠ 0: `pow_le_pow_iff_left₀`? Exact name hunt needed; alternatively `abs_le_abs`... I'll write: ```lean have hnorm : ‖s‖ ≤ ‖s - 1‖ := by rw [← sq_le_sq₀ (norm_nonneg _) (norm_nonneg _), ← Complex.normSq_eq_norm_sq, ← Complex.normSq_eq_norm_sq] -- hmm ``` `sq_le_sq₀ : 0 ≤ a → 0 ≤ b → (a² ≤ b² ↔ a ≤ b)`? I think `sq_le_sq₀ (ha : 0 ≤ a) (hb : 0 ≤ b) : a ^ 2 ≤ b ^ 2 ↔ a ≤ b` exists (sq_le_sq₀). And `Complex.normSq_eq_norm_sq (z : ℂ) : normSq z = ‖z‖ ^ 2` ✓ exists. So: ```lean have hnorm : ‖s‖ ≤ ‖s - 1‖ := by have h : Complex.normSq s ≤ Complex.normSq (s - 1) := by rw [Complex.normSq_apply, Complex.normSq_apply] -- re²+im² forms simp only [sub_re, one_re, sub_im, one_im] -- (s−1).re = s.re − 1, (s−1).im = s.im − 0 nlinarith [hs] rw [Complex.normSq_eq_norm_sq, Complex.normSq_eq_norm_sq] at h -- h : ‖s‖^2 ≤ ‖s−1‖^2 nlinarith [norm_nonneg s, norm_nonneg (s - 1), h] -- a² ≤ b², a,b ≥ 0 ⟹ a ≤ b ``` nlinarith should do: from h and nonneg: suppose ‖s‖ > ‖s−1‖ then ‖s‖² > ‖s−1‖² (product of strict... nlinarith can multiply (‖s‖−‖s−1‖)(‖s‖+‖s−1‖) > 0). ✓ - Then ‖s/(s−1)‖ = ‖s‖/‖s−1‖ ≤ 1 (‖s−1‖ > 0 since s ≠ 1): `norm_div` + `div_le_one (norm positivity)`. - ‖(s/(s−1))^n‖ ≤ 1: `norm_pow` + `pow_le_one₀ (norm_nonneg) h` — `pow_le_one₀ : 0 ≤ a → a ≤ 1 → a^n ≤ 1` ✓. - ‖kFun n s‖ = ‖(s/(s−1))^n − 1‖ ≤ ‖(s/(s−1))^n‖ + ‖1‖ = ... ≤ 1 + 1: `norm_sub_le` + norm_one... but the 1 is (1 : ℂ) with norm 1 ✓. 2. Helper for the shift form: `kFun_add_one_eq {n} {s : ℂ} (hs : s ≠ 0) : kFun n (s + 1) = (1 + 1 / s) ^ n - 1`: kFun n (s+1) = ((s+1)/(s+1−1))^n − 1 = ((s+1)/s)^n − 1 and (s+1)/s = 1 + 1/s (field_simp with hs). Hmm — actually for the two shifted bounds, work directly with (1 + 1/s). The bound needs ‖1 + 1/s‖ ≤ 1 + (σ+1)/D etc. 3. Horizontal: `kFun_shift_norm_le_exp_four_add_one {n : ℕ} {s : ℂ} (hσ : s.re ≤ 3) (hT : (n : ℝ) ≤ s.im ^ 2) : ‖kFun n (s + 1)‖ ≤ Real.exp 4 + 1` Wait — D-036 says −3 ≤ σ ≤ 3 but for the normSq bound only σ ≤ 3 matters? Let me recheck: |1+1/s|² = 1 + (2σ+1)/D with D = σ²+T². Need |1+1/s| ≤ 1 + (σ+1)/D — shown via (1+x)² ≥ 1+(2σ+1)/D with x = (σ+1)/D — expansion: 1 + 2(σ+1)/D + (σ+1)²/D² vs 1 + (2σ+1)/D: difference = (2σ+2−2σ−1)/D + (σ+1)²/D² = 1/D + (σ+1)²/D² ≥ 0 ✓ regardless of σ sign. And 1+(σ+1)/D ≥ 0: D + σ + 1 ≥ 0: σ² + T² + σ + 1 = (σ+1/2)² + T² + 3/4 > 0 ✓ any σ. So the bound ‖1+1/s‖ ≤ 1 + (σ+1)/D holds for ALL σ. Then ≤ 1 + 4/n needs (σ+1)/D ≤ 4/n: σ+1 ≤ 4 (σ ≤ 3 ✓) and D ≥ n (D = σ²+T² ≥ T² ≥ n ✓ from hT; note s.im² = T² with T = s.im — s.im^2 ✓). Also need D > 0: D ≥ n; if n ≥ 1 fine; if n = 0: kFun 0 = 0, trivially ≤ e⁴+1. Also need s ≠ 0 for the kFun shift form: s ≠ 0 since D ≥ n ≥ 1 (case n ≥ 1) — handle n = 0 separately. Hmm wait — also (σ+1)/D ≤ 4/n needs D ≥ n AND σ+1 ≤ 4: (σ+1)/D ≤ 4/D ≤ 4/n ✓ (σ+1 ≤ 4; if σ+1 negative, (σ+1)/D ≤ 0 ≤ 4/n ✓ — so: (σ+1)/D ≤ 4/D requires σ+1 ≤ 4 ✓ and D > 0; then 4/D ≤ 4/n needs D ≥ n ✓ D,n > 0... 4/D ≤ 4/n ⟺ n ≤ D (4 > 0) ✓). Then ‖1+1/s‖ⁿ ≤ (1+4/n)ⁿ ≤ (exp(4/n))ⁿ = exp 4. pow_le_pow_left (0 ≤) (≤) n: `pow_le_pow_left (ha : 0 ≤ a) (hab : a ≤ b) (n : ℕ) : a^n ≤ b^n` ✓. (exp(4/n))ⁿ = exp(4/n · n) = exp 4 (n ≥ 1): `Real.exp_nat_mul`? Hmm: `← Real.exp_nat_mul`: Real.exp (n * x) = (Real.exp x)^n? The lemma: `Real.exp_nat_mul (x : ℝ) (n : ℕ) : Real.exp (n * x) = (Real.exp x) ^ n`? I believe it exists (Real.exp_nat_mul). So (exp(4/n))^n = exp(n·(4/n)) = exp 4 with n*(4/n) = 4 (n ≥ 1: field). Then ‖kFun n (s+1)‖ = ‖(1+1/s)ⁿ − 1‖ ≤ ‖(1+1/s)ⁿ‖ + 1 ≤ e⁴ + 1. ‖(1+1/s)ⁿ‖ = ‖1+1/s‖ⁿ (norm_pow ✓). The core real lemma: `norm_one_add_one_div_le {s : ℂ} (hs : s ≠ 0) : ‖1 + 1 / s‖ ≤ 1 + (s.re + 1) / Complex.normSq s`: - ‖1 + 1/s‖² = normSq (1+1/s) = (1 + s.re/D)² + (s.im/D)² where D = normSq s: (1/s).re = s.re / D: `Complex.div_re`: (z/w).re = (z.re*w.re + z.im*w.im)/normSq w. For z = 1: (1 : ℂ).re = 1, im = 0: (w.re)/normSq w ✓. (1/s).im = ((1).im*s.re − (1).re*s.im)/D = −s.im/D ✓. There might be simpler: `Complex.div_re`, `Complex.div_im` simp lemmas ✓ exist. normSq (1 + 1/s) = ((1+1/s).re)² + ((1+1/s).im)² = (1 + σ/D)² + (−T/D)² = 1 + 2σ/D + σ²/D² + T²/D² = 1 + (2σ+1)/D (since σ²+T² = D ✓ normSq_apply). - Then compare: 1 + (2σ+1)/D ≤ (1 + (σ+1)/D)², RHS ≥ 0, take sqrt: ‖1+1/s‖ = sqrt(normSq) ≤ 1+(σ+1)/D: ```lean have hle : Complex.normSq (1 + 1/s) ≤ (1 + (s.re + 1)/D)^2 := ... have hnonneg : 0 ≤ 1 + (s.re + 1)/D := ... -- (D + σ + 1)/D > 0 -- ‖z‖ = sqrt (normSq z): rw [Complex.norm_def?] ... ``` `Complex.norm_def : ‖z‖ = Complex.abs z`? and `Complex.abs_def : abs z = Real.sqrt (normSq z)`? hmm — `Complex.abs (z : ℂ) : ℝ = Real.sqrt (normSq z)`? `Complex.abs_apply : abs z = Real.sqrt (normSq z)`? I recall `Complex.abs_eq_sqrt_normSq`? Let me just search during implementation: options: `Complex.norm_eq_abs`, `Complex.abs_apply`, `Complex.abs_def'`. There IS `Complex.normSq_eq_norm_sq` so: ‖1+1/s‖² = normSq(1+1/s) ≤ RHS² with RHS ≥ 0 ⟹ ‖1+1/s‖ ≤ RHS via sq_le_sq₀-style: `pow_le_pow_left`-inverse: nlinarith can do it too (as with hnorm above). D = normSq s > 0 for s ≠ 0: `Complex.normSq_pos.mpr hs` ✓ exists. 4. Right vertical: `kFun_shift_norm_le_exp_sqrt_half_add_one {n : ℕ} {s : ℂ} (hn : 0 < n) (hσ : 2 * Real.sqrt n ≤ s.re) : ‖kFun n (s + 1)‖ ≤ Real.exp (Real.sqrt n / 2) + 1` - ‖1+1/s‖ ≤ 1 + 1/‖s‖ (`norm_add_le`, norm_one_div? `norm_div` + norm_one: ‖1/s‖ = 1/‖s‖ ✓; so ‖1+1/s‖ ≤ ‖1‖ + ‖1/s‖ = 1 + 1/‖s‖). - ‖s‖ ≥ s.re ≥ 2√n: `Complex.re_le_norm`? `Complex.abs_re_le_norm : |z.re| ≤ ‖z‖` ✓ exists (`Complex.abs_re_le_norm`). s.re ≥ 2√n ≥ 0 ⟹ ‖s‖ ≥ 2√n > 0 (n > 0). - 1/‖s‖ ≤ 1/(2√n) ✓. - (1 + 1/(2√n))ⁿ ≤ exp(n · (1/(2√n))) = exp(√n/2): n/(2√n) = √n/2: n = √n·√n (Real.mul_self_sqrt (n ≥ 0)) ⟹ n/(2√n) = √n/2 ✓ field_simp. - add_one_le_exp again. Hmm — wait: do I need hn : 0 < n? n = 0: kFun 0 = 0 ≤ exp + 1 ✓ trivially. With hn : 0 < n as hypothesis, fine (assembly has n ≥ 10⁵). 5. Trivial zero: `kFun_neg_two (n : ℕ) : kFun n (-2) = (2/3 : ℂ)^n - 1`: (−2)/(−2−1) = (−2)/(−3) = 2/3: field_simp/norm_num: `(-2 : ℂ) / (-2 - 1) = 2/3` — norm_num should handle: (−2)/(−3) = 2/3 ✓. `norm_kFun_neg_two_le_one (n) : ‖kFun n (-2)‖ ≤ 1`: kFun n (−2) = (2/3)^n − 1 as ℂ. ‖(2/3:ℂ)^n − 1‖: (2/3)^n is a positive real ≤ 1: (2/3:ℂ)^n = ((2/3)^n : ℝ) cast: `Complex.ofReal_pow`? (2/3 : ℂ) = ((2/3:ℝ):ℂ) ✓ norm_num; then (↑r)^n = ↑(r^n) ✓ ofReal_pow... push_cast. So kFun n (−2) = ((2/3)^n − 1 : ℝ) cast. ‖(↑x)‖ = |x| = 1 − (2/3)^n ≤ 1 since (2/3)^n ∈ [0,1]: pow_nonneg + pow_le_one₀. ‖·‖ of real cast: `Complex.norm_real`? `Complex.norm_ofReal : ‖↑r‖ = |r|` ✓ (`Complex.norm_ofReal` or `Complex.norm_real`). Then |x| = 1 − (2/3)^n: x = (2/3)^n − 1 ≤ 0 ⟹ |x| = 1 − (2/3)^n ✓ abs_of_nonpos. ≤ 1 ⟺ −(2/3)^n ≤ 0 ✓ pow_nonneg. Let me write §4 with these five lemmas and iterate. Also there's the question: should the horizontal bound's hypothesis be |re s| ≤ 3 or re s ≤ 3? The assembly (ii′-6) will use it on the horizontal segment σ ∈ [−5/2, 3]-ish; re s ≤ 3 suffices and is weaker. Keep re s ≤ 3. Also note for the horizontal lemma: hypothesis hT : (n:ℝ) ≤ s.im^2 — from T ≥ √n in assembly: T² ≥ n ✓. Names: - `kFun_norm_le_two` - `norm_one_add_one_div_le` (helper) - `kFun_shift_norm_le_exp_four_add_one` - `kFun_shift_norm_le_exp_sqrt_half_add_one` - `kFun_neg_two`, `norm_kFun_neg_two_le_one` Let me check a few lemma names first: Complex.normSq_eq_norm_sq, sq_le_sq₀, pow_le_one₀, Real.exp_nat_mul, Complex.div_re/div_im, Complex.abs_re_le_norm, Complex.norm_ofReal, Real.mul_self_sqrt, Complex.normSq_pos.
ii′-4a committed. Now **ii′-4b (L1 kernel bounds)**. First, verify the exact Mathlib lemma names I'll need.
tool: Bash
input
{
  "command": "cd D:/Python/Quantum/zeta-23-lean/.lake/packages/mathlib && grep -rn \"theorem normSq_eq_norm_sq\\|theorem normSq_pos\\|theorem abs_re_le_norm\\|theorem norm_ofReal\\|theorem div_re \\|theorem div_im \\|theorem ofReal_re\" Mathlib/Analysis/SpecialFunctions/Complex/*.lean Mathlib/Data/Complex/*.lean Mathlib/Analysis/Complex/Basic.lean 2>/dev/null | head; grep -rn \"theorem sq_le_sq\u2080\\|lemma sq_le_sq\u2080\\|theorem pow_le_one\u2080\\|theorem exp_nat_mul\\|theorem add_one_le_exp\\|theorem mul_self_sqrt\" Mathlib/ -r --include=*.lean | grep -v \"//\" | head -10",
  "description": "Verify Mathlib lemma names for L1 bounds"
}
raw content_json (database row)
[{"type":"thinking","thinking":"Committed. Now ii′-4b: L1 kernel bounds. Append §4 to LiContour.lean:\n\n1. `kFun_norm_le_two {n : ℕ} {s : ℂ} (hs : s.re ≤ 1/2) : ‖kFun n s‖ ≤ 2`\n   Proof: \n   - s ≠ 1 (re ≤ 1/2 < 1 = (1:ℂ).re)\n   - ‖s‖ ≤ ‖s − 1‖: via normSq: `Complex.norm_le_iff_normSq_le`? hmm. Let me think about what's available: `Complex.normSq_le_normSq_iff_norm_le`? Easiest: `Complex.normSq s ≤ Complex.normSq (s - 1)` then take sqrt... Mathlib: `Complex.normSq_le_normSq` hmm. There is `Complex.normSq_eq_norm_sq : normSq z = ‖z‖^2` and conversely. So ‖s‖² ≤ ‖s−1‖² ⟹ ‖s‖ ≤ ‖s−1‖ (sq_le_sq... with nonneg: `sq_le_sq' `hmm: for a b ≥ 0: a² ≤ b² ⟹ a ≤ b: `pow_le_pow_left`... inverse: `le_of_pow_le_pow_left`? or `abs_le_of_sq_le_sq`. There's `Real.le_of_sq_le_sq`? Let me use: `pow_le_pow_iff_left`? I'll use: ‖s‖ ≤ ‖s−1‖ ⟺ ‖s‖² ≤ ‖s−1‖² (both nonneg): `pow_le_pow_iff_left (ha : 0 ≤ a) (hb : 0 ≤ b) : a^n ≤ b^n ↔ a ≤ b`? for n ≠ 0: `pow_le_pow_iff_left₀`? Exact name hunt needed; alternatively `abs_le_abs`... I'll write: \n     ```lean\n     have hnorm : ‖s‖ ≤ ‖s - 1‖ := by\n       rw [← sq_le_sq₀ (norm_nonneg _) (norm_nonneg _), ← Complex.normSq_eq_norm_sq, ← Complex.normSq_eq_norm_sq]  -- hmm\n     ```\n     `sq_le_sq₀ : 0 ≤ a → 0 ≤ b → (a² ≤ b² ↔ a ≤ b)`? I think `sq_le_sq₀ (ha : 0 ≤ a) (hb : 0 ≤ b) : a ^ 2 ≤ b ^ 2 ↔ a ≤ b` exists (sq_le_sq₀). And `Complex.normSq_eq_norm_sq (z : ℂ) : normSq z = ‖z‖ ^ 2` ✓ exists. So:\n     ```lean\n     have hnorm : ‖s‖ ≤ ‖s - 1‖ := by\n       have h : Complex.normSq s ≤ Complex.normSq (s - 1) := by\n         rw [Complex.normSq_apply, Complex.normSq_apply]  -- re²+im² forms\n         simp only [sub_re, one_re, sub_im, one_im]  -- (s−1).re = s.re − 1, (s−1).im = s.im − 0\n         nlinarith [hs]\n       rw [Complex.normSq_eq_norm_sq, Complex.normSq_eq_norm_sq] at h\n       -- h : ‖s‖^2 ≤ ‖s−1‖^2\n       nlinarith [norm_nonneg s, norm_nonneg (s - 1), h]  -- a² ≤ b², a,b ≥ 0 ⟹ a ≤ b\n     ```\n     nlinarith should do: from h and nonneg: suppose ‖s‖ > ‖s−1‖ then ‖s‖² > ‖s−1‖² (product of strict... nlinarith can multiply (‖s‖−‖s−1‖)(‖s‖+‖s−1‖) > 0). ✓\n   - Then ‖s/(s−1)‖ = ‖s‖/‖s−1‖ ≤ 1 (‖s−1‖ > 0 since s ≠ 1): `norm_div` + `div_le_one (norm positivity)`.\n   - ‖(s/(s−1))^n‖ ≤ 1: `norm_pow` + `pow_le_one₀ (norm_nonneg) h` — `pow_le_one₀ : 0 ≤ a → a ≤ 1 → a^n ≤ 1` ✓.\n   - ‖kFun n s‖ = ‖(s/(s−1))^n − 1‖ ≤ ‖(s/(s−1))^n‖ + ‖1‖ = ... ≤ 1 + 1: `norm_sub_le` + norm_one... but the 1 is (1 : ℂ) with norm 1 ✓.\n\n2. Helper for the shift form: `kFun_add_one_eq {n} {s : ℂ} (hs : s ≠ 0) : kFun n (s + 1) = (1 + 1 / s) ^ n - 1`:\n   kFun n (s+1) = ((s+1)/(s+1−1))^n − 1 = ((s+1)/s)^n − 1 and (s+1)/s = 1 + 1/s (field_simp with hs). \n\n   Hmm — actually for the two shifted bounds, work directly with (1 + 1/s). The bound needs ‖1 + 1/s‖ ≤ 1 + (σ+1)/D etc.\n\n3. Horizontal: `kFun_shift_norm_le_exp_four_add_one {n : ℕ} {s : ℂ} (hσ : s.re ≤ 3) (hT : (n : ℝ) ≤ s.im ^ 2) : ‖kFun n (s + 1)‖ ≤ Real.exp 4 + 1`\n   \n   Wait — D-036 says −3 ≤ σ ≤ 3 but for the normSq bound only σ ≤ 3 matters? Let me recheck: |1+1/s|² = 1 + (2σ+1)/D with D = σ²+T². Need |1+1/s| ≤ 1 + (σ+1)/D — shown via (1+x)² ≥ 1+(2σ+1)/D with x = (σ+1)/D — expansion: 1 + 2(σ+1)/D + (σ+1)²/D² vs 1 + (2σ+1)/D: difference = (2σ+2−2σ−1)/D + (σ+1)²/D² = 1/D + (σ+1)²/D² ≥ 0 ✓ regardless of σ sign. And 1+(σ+1)/D ≥ 0: D + σ + 1 ≥ 0: σ² + T² + σ + 1 = (σ+1/2)² + T² + 3/4 > 0 ✓ any σ. So the bound ‖1+1/s‖ ≤ 1 + (σ+1)/D holds for ALL σ. Then ≤ 1 + 4/n needs (σ+1)/D ≤ 4/n: σ+1 ≤ 4 (σ ≤ 3 ✓) and D ≥ n (D = σ²+T² ≥ T² ≥ n ✓ from hT; note s.im² = T² with T = s.im — s.im^2 ✓). Also need D > 0: D ≥ n; if n ≥ 1 fine; if n = 0: kFun 0 = 0, trivially ≤ e⁴+1. Also need s ≠ 0 for the kFun shift form: s ≠ 0 since D ≥ n ≥ 1 (case n ≥ 1) — handle n = 0 separately.\n   \n   Hmm wait — also (σ+1)/D ≤ 4/n needs D ≥ n AND σ+1 ≤ 4: (σ+1)/D ≤ 4/D ≤ 4/n ✓ (σ+1 ≤ 4; if σ+1 negative, (σ+1)/D ≤ 0 ≤ 4/n ✓ — so: (σ+1)/D ≤ 4/D requires σ+1 ≤ 4 ✓ and D > 0; then 4/D ≤ 4/n needs D ≥ n ✓ D,n > 0... 4/D ≤ 4/n ⟺ n ≤ D (4 > 0) ✓).\n   \n   Then ‖1+1/s‖ⁿ ≤ (1+4/n)ⁿ ≤ (exp(4/n))ⁿ = exp 4. pow_le_pow_left (0 ≤) (≤) n: `pow_le_pow_left (ha : 0 ≤ a) (hab : a ≤ b) (n : ℕ) : a^n ≤ b^n` ✓.\n   (exp(4/n))ⁿ = exp(4/n · n) = exp 4 (n ≥ 1): `Real.exp_nat_mul`? Hmm: `← Real.exp_nat_mul`: Real.exp (n * x) = (Real.exp x)^n? The lemma: `Real.exp_nat_mul (x : ℝ) (n : ℕ) : Real.exp (n * x) = (Real.exp x) ^ n`? I believe it exists (Real.exp_nat_mul). So (exp(4/n))^n = exp(n·(4/n)) = exp 4 with n*(4/n) = 4 (n ≥ 1: field). \n\n   Then ‖kFun n (s+1)‖ = ‖(1+1/s)ⁿ − 1‖ ≤ ‖(1+1/s)ⁿ‖ + 1 ≤ e⁴ + 1.\n   ‖(1+1/s)ⁿ‖ = ‖1+1/s‖ⁿ (norm_pow ✓).\n\n   The core real lemma: `norm_one_add_one_div_le {s : ℂ} (hs : s ≠ 0) : ‖1 + 1 / s‖ ≤ 1 + (s.re + 1) / Complex.normSq s`:\n   - ‖1 + 1/s‖² = normSq (1+1/s) = (1 + s.re/D)² + (s.im/D)² where D = normSq s:\n     (1/s).re = s.re / D: `Complex.div_re`: (z/w).re = (z.re*w.re + z.im*w.im)/normSq w. For z = 1: (1 : ℂ).re = 1, im = 0: (w.re)/normSq w ✓. (1/s).im = ((1).im*s.re − (1).re*s.im)/D = −s.im/D ✓.\n     There might be simpler: `Complex.div_re`, `Complex.div_im` simp lemmas ✓ exist.\n     normSq (1 + 1/s) = ((1+1/s).re)² + ((1+1/s).im)² = (1 + σ/D)² + (−T/D)² = 1 + 2σ/D + σ²/D² + T²/D² = 1 + (2σ+1)/D (since σ²+T² = D ✓ normSq_apply).\n   - Then compare: 1 + (2σ+1)/D ≤ (1 + (σ+1)/D)², RHS ≥ 0, take sqrt: ‖1+1/s‖ = sqrt(normSq) ≤ 1+(σ+1)/D:\n     ```lean\n     have hle : Complex.normSq (1 + 1/s) ≤ (1 + (s.re + 1)/D)^2 := ...\n     have hnonneg : 0 ≤ 1 + (s.re + 1)/D := ...  -- (D + σ + 1)/D > 0\n     -- ‖z‖ = sqrt (normSq z): \n     rw [Complex.norm_def?] ...\n     ```\n     `Complex.norm_def : ‖z‖ = Complex.abs z`? and `Complex.abs_def : abs z = Real.sqrt (normSq z)`? hmm — `Complex.abs (z : ℂ) : ℝ = Real.sqrt (normSq z)`? `Complex.abs_apply : abs z = Real.sqrt (normSq z)`? I recall `Complex.abs_eq_sqrt_normSq`? Let me just search during implementation: options: `Complex.norm_eq_abs`, `Complex.abs_apply`, `Complex.abs_def'`. There IS `Complex.normSq_eq_norm_sq` so: ‖1+1/s‖² = normSq(1+1/s) ≤ RHS² with RHS ≥ 0 ⟹ ‖1+1/s‖ ≤ RHS via sq_le_sq₀-style: `pow_le_pow_left`-inverse: nlinarith can do it too (as with hnorm above).\n   \n   D = normSq s > 0 for s ≠ 0: `Complex.normSq_pos.mpr hs` ✓ exists.\n\n4. Right vertical: `kFun_shift_norm_le_exp_sqrt_half_add_one {n : ℕ} {s : ℂ} (hn : 0 < n) (hσ : 2 * Real.sqrt n ≤ s.re) : ‖kFun n (s + 1)‖ ≤ Real.exp (Real.sqrt n / 2) + 1`\n   - ‖1+1/s‖ ≤ 1 + 1/‖s‖ (`norm_add_le`, norm_one_div? `norm_div` + norm_one: ‖1/s‖ = 1/‖s‖ ✓; so ‖1+1/s‖ ≤ ‖1‖ + ‖1/s‖ = 1 + 1/‖s‖).\n   - ‖s‖ ≥ s.re ≥ 2√n: `Complex.re_le_norm`? `Complex.abs_re_le_norm : |z.re| ≤ ‖z‖` ✓ exists (`Complex.abs_re_le_norm`). s.re ≥ 2√n ≥ 0 ⟹ ‖s‖ ≥ 2√n > 0 (n > 0).\n   - 1/‖s‖ ≤ 1/(2√n) ✓.\n   - (1 + 1/(2√n))ⁿ ≤ exp(n · (1/(2√n))) = exp(√n/2): n/(2√n) = √n/2: n = √n·√n (Real.mul_self_sqrt (n ≥ 0)) ⟹ n/(2√n) = √n/2 ✓ field_simp.\n   - add_one_le_exp again.\n\n   Hmm — wait: do I need hn : 0 < n? n = 0: kFun 0 = 0 ≤ exp + 1 ✓ trivially. With hn : 0 < n as hypothesis, fine (assembly has n ≥ 10⁵).\n\n5. Trivial zero: `kFun_neg_two (n : ℕ) : kFun n (-2) = (2/3 : ℂ)^n - 1`:\n   (−2)/(−2−1) = (−2)/(−3) = 2/3: field_simp/norm_num: `(-2 : ℂ) / (-2 - 1) = 2/3` — norm_num should handle: (−2)/(−3) = 2/3 ✓.\n   `norm_kFun_neg_two_le_one (n) : ‖kFun n (-2)‖ ≤ 1`:\n   kFun n (−2) = (2/3)^n − 1 as ℂ. ‖(2/3:ℂ)^n − 1‖: (2/3)^n is a positive real ≤ 1: (2/3:ℂ)^n = ((2/3)^n : ℝ) cast: `Complex.ofReal_pow`? (2/3 : ℂ) = ((2/3:ℝ):ℂ) ✓ norm_num; then (↑r)^n = ↑(r^n) ✓ ofReal_pow... push_cast. So kFun n (−2) = ((2/3)^n − 1 : ℝ) cast. ‖(↑x)‖ = |x| = 1 − (2/3)^n ≤ 1 since (2/3)^n ∈ [0,1]: pow_nonneg + pow_le_one₀. ‖·‖ of real cast: `Complex.norm_real`? `Complex.norm_ofReal : ‖↑r‖ = |r|` ✓ (`Complex.norm_ofReal` or `Complex.norm_real`). Then |x| = 1 − (2/3)^n: x = (2/3)^n − 1 ≤ 0 ⟹ |x| = 1 − (2/3)^n ✓ abs_of_nonpos. ≤ 1 ⟺ −(2/3)^n ≤ 0 ✓ pow_nonneg.\n\nLet me write §4 with these five lemmas and iterate. Also there's the question: should the horizontal bound's hypothesis be |re s| ≤ 3 or re s ≤ 3? The assembly (ii′-6) will use it on the horizontal segment σ ∈ [−5/2, 3]-ish; re s ≤ 3 suffices and is weaker. Keep re s ≤ 3.\n\nAlso note for the horizontal lemma: hypothesis hT : (n:ℝ) ≤ s.im^2 — from T ≥ √n in assembly: T² ≥ n ✓.\n\nNames: \n- `kFun_norm_le_two`\n- `norm_one_add_one_div_le` (helper)\n- `kFun_shift_norm_le_exp_four_add_one`\n- `kFun_shift_norm_le_exp_sqrt_half_add_one`\n- `kFun_neg_two`, `norm_kFun_neg_two_le_one`\n\nLet me check a few lemma names first: Complex.normSq_eq_norm_sq, sq_le_sq₀, pow_le_one₀, Real.exp_nat_mul, Complex.div_re/div_im, Complex.abs_re_le_norm, Complex.norm_ofReal, Real.mul_self_sqrt, Complex.normSq_pos.","signature":""},{"type":"text","text":"ii′-4a committed. Now **ii′-4b (L1 kernel bounds)**. First, verify the exact Mathlib lemma names I'll need."},{"type":"tool_use","id":"Bash_76","name":"Bash","input":{"command":"cd D:/Python/Quantum/zeta-23-lean/.lake/packages/mathlib && grep -rn \"theorem normSq_eq_norm_sq\\|theorem normSq_pos\\|theorem abs_re_le_norm\\|theorem norm_ofReal\\|theorem div_re \\|theorem div_im \\|theorem ofReal_re\" Mathlib/Analysis/SpecialFunctions/Complex/*.lean Mathlib/Data/Complex/*.lean Mathlib/Analysis/Complex/Basic.lean 2>/dev/null | head; grep -rn \"theorem sq_le_sq₀\\|lemma sq_le_sq₀\\|theorem pow_le_one₀\\|theorem exp_nat_mul\\|theorem add_one_le_exp\\|theorem mul_self_sqrt\" Mathlib/ -r --include=*.lean | grep -v \"//\" | head -10","description":"Verify Mathlib lemma names for L1 bounds"},"extra_content":null}]