← Session 35 — ii′-6-R: Lagarias 6.1 right-tail re-proof (E-032/D-073)
thinking (14176 chars)
`iteratedDeriv_riemannZeta_conj (n : ℕ) (hz : z ≠ 1) : iteratedDeriv n riemannZeta (conj z) = conj (iteratedDeriv n riemannZeta z)` exists in LiTightR. For n = 1: iteratedDeriv 1 ζ = deriv ζ — need the bridge iteratedDeriv 1 f = deriv f (Mathlib: `iteratedDeriv_one` ✓ should exist).
`_root_.riemannZeta_conj` — the base case. Its form (used at LiCircleBound:41): `_root_.riemannZeta_conj` rewrites ζ(conj s) — let me check its exact statement: probably `riemannZeta_conj (s : ℂ) : riemannZeta ((starRingEnd ℂ) s) = (starRingEnd ℂ) (riemannZeta s)`. In LiTightR:2246: `exact _root_.riemannZeta_conj z` — as the n = 0 case of the conj equation ✓ so its statement is exactly that equation.
Now — imports for LiDogLeg.lean: needs Jlag (LiSides), iteratedDeriv_riemannZeta_conj (LiTightR), the Zeta23 rectangle API (Zeta23.FromPNTPlus.ResidueCalcOnRectangles via Zeta23.Analytic.RectangleLogDeriv or directly). LiSides imports Zeta23.Analytic.RectangleLogDeriv + NguyenRH1.LiPrincipal. LiTightR imports a lot (LiReflect, LiCircleBound...). Root NguyenRH1.lean imports everything — importing NguyenRH1.LiTightR pulls the whole tree, which is fine (built).
Hmm — actually for build-time efficiency and clean dependency structure: LiDogLeg imports NguyenRH1.LiSides (Jlag) + NguyenRH1.LiTightR (the conj lemma). That pulls essentially everything anyway.
Now write the file:
```lean
/-
NguyenRH1/LiDogLeg.lean — ii′-6-DL-1 (D-074, session 040): the zero-free
dog-leg deformation of the Lagarias horizontal right tail.
THE CONTENT: on the dog-leg rectangle [3, X_R]×[T, U] (T > 0), the
Lagarias integrand Jlag n s = (s/(s−1))ⁿ−1 · (−ζ′/ζ(s)) is analytic
UNCONDITIONALLY (s ≠ 1 since im > 0; ζ s ≠ 0 for re s ≥ 3 > 1 by
Mathlib's Euler-product nonvanishing — NO perimeter hypothesis, no
zero-avoidance at U). Cauchy's theorem then gives the EXACT deformation
identity
H(3→X_R, T) = H(3→X_R, U) − V(X_R, T→U) + V(3, T→U)
(the upper right tail = the high horizontal − the right drop + the left
lift), with the Jlag conjugation identity for the lower-side transfer.
-/
import Mathlib
import NguyenRH1.LiSides
import NguyenRH1.LiTightR
open Zeta23 Complex Filter Topology
open scoped Nat
noncomputable section
namespace NguyenRH1
/-! ## 1. Dog-leg analyticity (D-074 §3.1; no perimeter) -/
/-- The dog-leg corners (real-part/im-part forms matching rectZ/rectW). -/
def dogZ (T : ℝ) : ℂ := ((3 : ℝ) : ℂ) + (T : ℝ) * Complex.I
def dogW (XR U : ℝ) : ℂ := ((XR : ℝ) : ℂ) + (U : ℝ) * Complex.I
lemma dogZ_re (T : ℝ) : (dogZ T).re = 3 := by simp [dogZ]
lemma dogZ_im (T : ℝ) : (dogZ T).im = T := by simp [dogZ]
lemma dogW_re (XR U : ℝ) : (dogW XR U).re = XR := by simp [dogW]
lemma dogW_im (XR U : ℝ) : (dogW XR U).im = U := by simp [dogW]
/-- Jlag is differentiable at every point with 3 ≤ re, 0 < im:
ζ is zero-free for 1 < re (Mathlib `riemannZeta_ne_zero_of_one_lt_re`,
UNCONDITIONAL) and s ≠ 1 (im ≠ 0). NO perimeter hypothesis. -/
theorem Jlag_differentiableAt_dogleg {n : ℕ} {s : ℂ}
(hre : 3 ≤ s.re) (him : 0 < s.im) :
DifferentiableAt ℂ (Jlag n) s := by
apply Jlag_differentiableAt
· rintro rfl
simp at him
· exact riemannZeta_ne_zero_of_one_lt_re (by linarith)
/-- The dog-leg rectangle is a neighborhood of every one of its points'
differentiability — Jlag is holomorphic on the whole rectangle. -/
theorem holomorphicOn_Jlag_dogleg {n : ℕ} {T U XR : ℝ}
(hT : 0 < T) (hTU : T ≤ U) (hXR : 3 ≤ XR) :
HolomorphicOn (Jlag n) (Rectangle (dogZ T) (dogW XR U)) := by
intro s hs
rw [Rectangle, Set.mem_reProdIm] at hs -- hs : s.re ∈ uIcc .. ∧ s.im ∈ uIcc ..
...
```
Hmm — what's Rectangle's def in Zeta23? From LiAssembly: `s ∈ Rectangle z w` and they built membership via `Set.uIcc` and `⟨hr, hi⟩` (h1mem at line 94-100: `have hr : (1:ℂ).re ∈ Set.uIcc z.re w.re := ...; have hi : ...; exact ⟨hr, hi⟩`) — so Rectangle z w membership IS the pair ⟨re-mem, im-mem⟩ (mem_reProdIm or defeq). And RectangleBorder was used with `rw [RectangleBorder] at hb; simp only [Set.mem_union, Complex.mem_reProdIm, Set.mem_singleton_iff]`. So Rectangle z w = reProdIm (uIcc z.re w.re) (uIcc z.im w.im)? — the membership test: `Complex.mem_reProdIm : s ∈ s₁ ×ℂ s₂ ↔ s.re ∈ s₁ ∧ s.im ∈ s₂`. So:
```lean
theorem holomorphicOn_Jlag_dogleg {n : ℕ} {T U XR : ℝ}
(hT : 0 < T) (hTU : T ≤ U) (hXR : 3 ≤ XR) :
HolomorphicOn (Jlag n) (Rectangle (dogZ T) (dogW XR U)) := by
intro s hs
rw [Rectangle, Complex.mem_reProdIm] at hs
rw [dogZ_re, dogW_re, dogZ_im, dogW_im] at hs
have hre3 : 3 ≤ s.re := by
rw [Set.uIcc_of_le hXR] at hs
exact hs.1.1
have himpos : 0 < s.im := by
rw [Set.uIcc_of_le hTU] at hs
linarith [hs.2.1]
exact (Jlag_differentiableAt_dogleg hre3 himpos).differentiableWithinAt
```
Wait — rw [Set.uIcc_of_le hXR] at hs rewrites uIcc 3 XR to Icc 3 XR ✓; hs.1.1 : 3 ≤ s.re ✓. For im: uIcc T U with T ≤ U: hs.2.1 : T ≤ s.im; 0 < T ≤ s.im ✓ linarith.
But careful: does `rw [Rectangle, Complex.mem_reProdIm]` work? Rectangle is a def — rw with a def name needs an equational lemma — for defs, `rw [Rectangle]` works if Rectangle is defined by pattern (it generates equation lemmas) — LiAssembly used `rw [RectangleBorder] at hb` ✓ same pattern for Rectangle presumably ✓. If not, `unfold Rectangle at hs`. I'll write `rw [Rectangle, Complex.mem_reProdIm] at hs` and fall back to unfold if the build complains.
Also note: DifferentiableOn intro pattern: `intro s hs` — DifferentiableOn f s := ∀ x ∈ s, DifferentiableWithinAt ℂ f s x — so `intro s hs` then exact (...).differentiableWithinAt ✓.
Then:
```lean
/-- **The dog-leg rectangle integral vanishes** (Cauchy; the region is
unconditionally zero-free — empty residue sum, no perimeter). -/
theorem rectangleIntegral_Jlag_dogleg_eq_zero {n : ℕ} {T U XR : ℝ}
(hT : 0 < T) (hTU : T ≤ U) (hXR : 3 ≤ XR) :
RectangleIntegral (Jlag n) (dogZ T) (dogW XR U) = 0 :=
(holomorphicOn_Jlag_dogleg hT hTU hXR).vanishesOnRectangle subset_rfl
/-- The (2πi)⁻¹-normalized form (for API symmetry with rectInt'_Jlag). -/
theorem rectangleIntegral'_Jlag_dogleg_eq_zero {n : ℕ} {T U XR : ℝ}
(hT : 0 < T) (hTU : T ≤ U) (hXR : 3 ≤ XR) :
RectangleIntegral' (Jlag n) (dogZ T) (dogW XR U) = 0 := by
rw [RectangleIntegral', rectangleIntegral_Jlag_dogleg_eq_zero hT hTU hXR,
smul_zero]
/-- **The exact dog-leg deformation identity** (D-074 §3.2 (★), the
capstone for ii′-6-c): the low right-horizontal equals the high
horizontal minus the right drop plus the left lift. -/
theorem upper_right_horizontal_eq_dogleg {n : ℕ} {T U XR : ℝ}
(hT : 0 < T) (hTU : T ≤ U) (hXR : 3 ≤ XR) :
HIntegral (Jlag n) 3 XR T =
HIntegral (Jlag n) 3 XR U - VIntegral (Jlag n) XR T U +
VIntegral (Jlag n) 3 T U := by
have h0 := rectangleIntegral_Jlag_dogleg_eq_zero hT hTU hXR
unfold RectangleIntegral at h0
rw [dogZ_re, dogZ_im, dogW_re, dogW_im] at h0
linear_combination h0
```
And Jlag_conj:
```lean
/-! ## 2. The conjugation identity (for the lower-side transfer, DL-5) -/
/-- kFun is conjugation-symmetric (real-coefficient rational function). -/
theorem kFun_conj (n : ℕ) (s : ℂ) :
kFun n ((starRingEnd ℂ) s) = (starRingEnd ℂ) (kFun n s) := by
unfold kFun
simp [map_sub, map_div, map_pow, map_one]
/-- ζ′/ζ is conjugation-symmetric at points where ζ ≠ 0 (from
`riemannZeta_conj` + `iteratedDeriv_riemannZeta_conj`). -/
theorem Jlag_conj (n : ℕ) {s : ℂ} (hs : s ≠ 1) :
Jlag n ((starRingEnd ℂ) s) = (starRingEnd ℂ) (Jlag n s) := by
unfold Jlag
rw [kFun_conj, map_mul, _root_.riemannZeta_conj]
congr 1
have h1 : iteratedDeriv 1 riemannZeta ((starRingEnd ℂ) s) =
(starRingEnd ℂ) (iteratedDeriv 1 riemannZeta s) :=
iteratedDeriv_riemannZeta_conj 1 hs
rwa [iteratedDeriv_one, iteratedDeriv_one] at h1 -- hmm direction
```
Careful with the deriv-conj bridge: `iteratedDeriv_one : iteratedDeriv 1 f = deriv f` (Mathlib). h1 : iteratedDeriv 1 ζ (conj s) = conj (iteratedDeriv 1 ζ s). rw [iteratedDeriv_one] at h1 turns both sides into deriv ζ — but iteratedDeriv_one is an equation for `iteratedDeriv 1` — rw [iteratedDeriv_one] at h1 rewrites `iteratedDeriv 1 ?f` to `deriv ?f` at h1 ✓ both occurrences (rw rewrites all matching instances ✓). Then h1 : deriv ζ (conj s) = conj (deriv ζ s) ✓.
Then the goal after rw [kFun_conj, map_mul, riemannZeta_conj]:
`star (kFun n s) * (-(deriv ζ (star s) / star (ζ s))) = star (kFun n s * (-(deriv ζ s / ζ s)))` — hmm let me redo: Jlag n (star s) = kFun n (star s) * (-(ζ′(star s)/ζ(star s))) — rw [kFun_conj]: → star(kFun n s) * (-(ζ′(star s)/ζ(star s))). rw [_root_.riemannZeta_conj]: ζ(star s) → star(ζ s): → star(kFun n s) * (-(ζ′(star s)/star(ζ s))). RHS: star(Jlag n s) = star(kFun n s * (-(ζ′ s/ζ s))) — rw [map_mul]: star(kFun n s) * star(-(ζ′ s/ζ s)) = star(kFun n s) * (-(star(ζ′ s)/star(ζ s))) (map_neg, map_div inside star). So the remaining goal: deriv ζ (star s) = star (deriv ζ s) — the h1 ✓. So:
```lean
theorem Jlag_conj (n : ℕ) {s : ℂ} (hs : s ≠ 1) :
Jlag n ((starRingEnd ℂ) s) = (starRingEnd ℂ) (Jlag n s) := by
unfold Jlag
rw [kFun_conj, _root_.riemannZeta_conj]
have h1 : deriv riemannZeta ((starRingEnd ℂ) s) =
(starRingEnd ℂ) (deriv riemannZeta s) := by
have h := iteratedDeriv_riemannZeta_conj 1 hs
rwa [iteratedDeriv_one, iteratedDeriv_one] at h
rw [h1, map_mul, map_neg, map_div]
```
Let me double check the rw order. Goal: kFun n (star s) * (-(ζ′(star s)/ζ(star s))) = star (kFun n s * (-(ζ′ s/ζ s))).
- rw [kFun_conj]: LHS → star(kFun n s) * (-(ζ′(star s)/ζ(star s)))
- rw [_root_.riemannZeta_conj]: rewrites ζ (star s) → star (ζ s): LHS → star(kFun n s) * (-(ζ′(star s)/star(ζ s)))
- rw [h1]: ζ′(star s) → star (ζ′ s): LHS → star(kFun n s) * (-(star(ζ′ s)/star(ζ s)))
- rw [map_mul, map_neg, map_div] at the RHS: star(kFun n s * (-(ζ′ s/ζ s))): map_mul → star(kFun n s) * star(-(ζ′ s/ζ s)); map_neg → star(kFun n s) * (-star(ζ′ s/ζ s)); map_div → star(kFun n s) * (-(star(ζ′ s)/star(ζ s))) ✓ both sides equal — rfl.
But rw [map_mul, map_neg, map_div] will rewrite EVERYWHERE (both sides) — LHS has no star-except-inside... LHS after the three rewrites: star(kFun n s) * (-(star(ζ′ s)/star(ζ s))) — map_div/map_neg/map_mul could rewrite the star pieces further (map_div: star(a/b) → star a / star b — LHS has star(ζ′ s)/star(ζ s): map_div applies to `star (deriv ζ s / riemannZeta s)` — is that subterm present? LHS has -(star(ζ′ s)/star(ζ s)) — that's -((star(ζ′ s))/(star(ζ s))) — division of two stars, NOT star of a division — map_div rewrites star(a/b) not (star a)/(star b) ✓ no match ✓ good. The RHS rewrites as planned ✓. Then rfl closes automatically after rw (rw closes rfl goals) ✓.
Hmm, one concern: `unfold Jlag` — Jlag is a def; unfold works. kFun_conj's proof: `unfold kFun; simp [map_sub, map_div, map_pow, map_one]` — goal: (star s/(star s − 1))ⁿ − 1 = star ((s/(s−1))ⁿ − 1): simp with map lemmas: star((s/(s−1))ⁿ − 1) = (star(s/(s−1)))ⁿ − star 1 = ((star s)/(star(s−1)))ⁿ − 1 = ((star s)/(star s − 1))ⁿ − 1 ✓ — LHS/RHS should match after simp normalizes both. Order of operands: (star s − 1) vs (star s − star 1) — simp [map_one] ✓. Should be fine; if simp leaves it, `ring`-level or congr 1.
Also — do I need `s ≠ 1` for Jlag_conj? The iteratedDeriv_riemannZeta_conj needs hz : z ≠ 1 ✓ pass hs. (Jlag at s = 1 is junk-valued anyway.)
One more consideration — the build. LiDogLeg imports LiTightR (for iteratedDeriv_riemannZeta_conj) — LiTightR is a big file (~4300 lines) but already built (olean exists). The new file compiles against the existing oleans: `lake env lean NguyenRH1/LiDogLeg.lean` from the package dir for fast iteration, then `lake build NguyenRH1.LiDogLeg` for the olean, then root import + full build + audit.
Also — do NOT forget: freeze protocol — new files only ✓ (LiDogLeg.lean is new; root NguyenRH1.lean gets the new import line appended — that's an allowed addition (root import list changes were done every sub-stage)).
Let me also double check `riemannZeta_ne_zero_of_one_lt_re` is root-namespace: from the grep: `Mathlib/NumberTheory/LSeries/Dirichlet.lean:328: lemma riemannZeta_ne_zero_of_one_lt_re {s : ℂ} (hs : 1 < s.re)` — no _root_ marker shown, and Zeta23/FromPNTPlus/MediumPNT.lean:826 uses `apply riemannZeta_ne_zero_of_one_lt_re` unqualified ✓ root or open namespace — fine either way.
Also HolomorphicOn: it's `Zeta23`'s abbrev in the root Zeta23 namespace? From the grep: `Zeta23/FromPNTPlus/ResidueCalcOnRectangles.lean:103: abbrev HolomorphicOn` — inside what namespace? The file's `namespace Zeta23`? Let me check — residueTheorem_finset was `Zeta23.Analytic.residueTheorem_finset` (in Zeta23.Analytic.RectangleLogDeriv, namespace Zeta23.Analytic). But HolomorphicOn is in FromPNTPlus.ResidueCalcOnRectangles — namespace? The ZeroFree.lean used `Zeta23.Analytic.residueTheorem_finset` — and residueTheorem_finset is in Analytic/RectangleLogDeriv.lean (namespace Zeta23.Analytic). But HolomorphicOn is in FromPNTPlus/ResidueCalcOnRectangles.lean — different file. LiSides.lean uses `RectangleIntegral'` (from FromPNTPlus) unqualified with `open Zeta23` — so FromPNTPlus things are in namespace Zeta23 (root). HolomorphicOn likely `Zeta23.HolomorphicOn` — open Zeta23 makes it visible ✓. Its method .vanishesOnRectangle: `HolomorphicOn.vanishesOnRectangle` ✓ same namespace.
Also `Rectangle`, `RectangleBorder`, `HIntegral`, `VIntegral`, `RectangleIntegral`, `RectangleIntegral'` — all FromPNTPlus in Zeta23 namespace ✓ (LiSides/LiPrincipal use them with open Zeta23 ✓).
`integral_boundary_rect_eq_zero_of_differentiableOn` (used inside vanishesOnRectangle) — already compiled in Zeta23 ✓ no work.
`Complex.mem_reProdIm` — used in LiAssembly with `Complex.mem_reProdIm`? LiAssembly used `simp only [Set.mem_union, Complex.mem_reProdIm, Set.mem_singleton_iff]` ✓ exists.
`Set.uIcc_of_le : a ≤ b → Set.uIcc a b = Set.Icc a b` ✓ used in LiAssembly ✓.
Now — `Rectangle` def form: FromPNTPlus.Rectangle? `Rectangle z w : Set ℂ` — used in LiAssembly as a term with membership ⟨hr, hi⟩. If `rw [Rectangle]` fails I'll use `unfold Rectangle at hs` or `rw [show s ∈ Rectangle _ _ ↔ _ from Iff.rfl]`-style. Let me check its def quickly to get the membership form right.
Checking the `Rectangle` definition form for the membership rewrite, then writing LiDogLeg.lean.
tool: Bash
input
{
"command": "cd D:/Python/Quantum/zeta-23-lean && grep -rn \"def Rectangle\\b\\|abbrev Rectangle\\b\" Zeta23/FromPNTPlus/ | head -3 && grep -rn \"namespace Zeta23\" Zeta23/FromPNTPlus/ResidueCalcOnRectangles.lean | head -2",
"description": "Find Rectangle def and the file's namespace"
}
raw content_json (database row)
[{"type":"thinking","thinking":"`iteratedDeriv_riemannZeta_conj (n : ℕ) (hz : z ≠ 1) : iteratedDeriv n riemannZeta (conj z) = conj (iteratedDeriv n riemannZeta z)` exists in LiTightR. For n = 1: iteratedDeriv 1 ζ = deriv ζ — need the bridge iteratedDeriv 1 f = deriv f (Mathlib: `iteratedDeriv_one` ✓ should exist).\n\n`_root_.riemannZeta_conj` — the base case. Its form (used at LiCircleBound:41): `_root_.riemannZeta_conj` rewrites ζ(conj s) — let me check its exact statement: probably `riemannZeta_conj (s : ℂ) : riemannZeta ((starRingEnd ℂ) s) = (starRingEnd ℂ) (riemannZeta s)`. In LiTightR:2246: `exact _root_.riemannZeta_conj z` — as the n = 0 case of the conj equation ✓ so its statement is exactly that equation.\n\nNow — imports for LiDogLeg.lean: needs Jlag (LiSides), iteratedDeriv_riemannZeta_conj (LiTightR), the Zeta23 rectangle API (Zeta23.FromPNTPlus.ResidueCalcOnRectangles via Zeta23.Analytic.RectangleLogDeriv or directly). LiSides imports Zeta23.Analytic.RectangleLogDeriv + NguyenRH1.LiPrincipal. LiTightR imports a lot (LiReflect, LiCircleBound...). Root NguyenRH1.lean imports everything — importing NguyenRH1.LiTightR pulls the whole tree, which is fine (built).\n\nHmm — actually for build-time efficiency and clean dependency structure: LiDogLeg imports NguyenRH1.LiSides (Jlag) + NguyenRH1.LiTightR (the conj lemma). That pulls essentially everything anyway.\n\nNow write the file:\n\n```lean\n/-\nNguyenRH1/LiDogLeg.lean — ii′-6-DL-1 (D-074, session 040): the zero-free\ndog-leg deformation of the Lagarias horizontal right tail.\n\nTHE CONTENT: on the dog-leg rectangle [3, X_R]×[T, U] (T > 0), the\nLagarias integrand Jlag n s = (s/(s−1))ⁿ−1 · (−ζ′/ζ(s)) is analytic\nUNCONDITIONALLY (s ≠ 1 since im > 0; ζ s ≠ 0 for re s ≥ 3 > 1 by\nMathlib's Euler-product nonvanishing — NO perimeter hypothesis, no\nzero-avoidance at U). Cauchy's theorem then gives the EXACT deformation\nidentity\n H(3→X_R, T) = H(3→X_R, U) − V(X_R, T→U) + V(3, T→U)\n(the upper right tail = the high horizontal − the right drop + the left\nlift), with the Jlag conjugation identity for the lower-side transfer.\n-/\nimport Mathlib\nimport NguyenRH1.LiSides\nimport NguyenRH1.LiTightR\n\nopen Zeta23 Complex Filter Topology\nopen scoped Nat\n\nnoncomputable section\n\nnamespace NguyenRH1\n\n/-! ## 1. Dog-leg analyticity (D-074 §3.1; no perimeter) -/\n\n/-- The dog-leg corners (real-part/im-part forms matching rectZ/rectW). -/\ndef dogZ (T : ℝ) : ℂ := ((3 : ℝ) : ℂ) + (T : ℝ) * Complex.I\ndef dogW (XR U : ℝ) : ℂ := ((XR : ℝ) : ℂ) + (U : ℝ) * Complex.I\n\nlemma dogZ_re (T : ℝ) : (dogZ T).re = 3 := by simp [dogZ]\nlemma dogZ_im (T : ℝ) : (dogZ T).im = T := by simp [dogZ]\nlemma dogW_re (XR U : ℝ) : (dogW XR U).re = XR := by simp [dogW]\nlemma dogW_im (XR U : ℝ) : (dogW XR U).im = U := by simp [dogW]\n\n/-- Jlag is differentiable at every point with 3 ≤ re, 0 < im:\nζ is zero-free for 1 < re (Mathlib `riemannZeta_ne_zero_of_one_lt_re`,\nUNCONDITIONAL) and s ≠ 1 (im ≠ 0). NO perimeter hypothesis. -/\ntheorem Jlag_differentiableAt_dogleg {n : ℕ} {s : ℂ}\n (hre : 3 ≤ s.re) (him : 0 < s.im) :\n DifferentiableAt ℂ (Jlag n) s := by\n apply Jlag_differentiableAt\n · rintro rfl\n simp at him\n · exact riemannZeta_ne_zero_of_one_lt_re (by linarith)\n\n/-- The dog-leg rectangle is a neighborhood of every one of its points'\ndifferentiability — Jlag is holomorphic on the whole rectangle. -/\ntheorem holomorphicOn_Jlag_dogleg {n : ℕ} {T U XR : ℝ}\n (hT : 0 < T) (hTU : T ≤ U) (hXR : 3 ≤ XR) :\n HolomorphicOn (Jlag n) (Rectangle (dogZ T) (dogW XR U)) := by\n intro s hs\n rw [Rectangle, Set.mem_reProdIm] at hs -- hs : s.re ∈ uIcc .. ∧ s.im ∈ uIcc ..\n ...\n```\n\nHmm — what's Rectangle's def in Zeta23? From LiAssembly: `s ∈ Rectangle z w` and they built membership via `Set.uIcc` and `⟨hr, hi⟩` (h1mem at line 94-100: `have hr : (1:ℂ).re ∈ Set.uIcc z.re w.re := ...; have hi : ...; exact ⟨hr, hi⟩`) — so Rectangle z w membership IS the pair ⟨re-mem, im-mem⟩ (mem_reProdIm or defeq). And RectangleBorder was used with `rw [RectangleBorder] at hb; simp only [Set.mem_union, Complex.mem_reProdIm, Set.mem_singleton_iff]`. So Rectangle z w = reProdIm (uIcc z.re w.re) (uIcc z.im w.im)? — the membership test: `Complex.mem_reProdIm : s ∈ s₁ ×ℂ s₂ ↔ s.re ∈ s₁ ∧ s.im ∈ s₂`. So:\n\n```lean\ntheorem holomorphicOn_Jlag_dogleg {n : ℕ} {T U XR : ℝ}\n (hT : 0 < T) (hTU : T ≤ U) (hXR : 3 ≤ XR) :\n HolomorphicOn (Jlag n) (Rectangle (dogZ T) (dogW XR U)) := by\n intro s hs\n rw [Rectangle, Complex.mem_reProdIm] at hs\n rw [dogZ_re, dogW_re, dogZ_im, dogW_im] at hs\n have hre3 : 3 ≤ s.re := by\n rw [Set.uIcc_of_le hXR] at hs\n exact hs.1.1\n have himpos : 0 < s.im := by\n rw [Set.uIcc_of_le hTU] at hs\n linarith [hs.2.1]\n exact (Jlag_differentiableAt_dogleg hre3 himpos).differentiableWithinAt\n```\n\nWait — rw [Set.uIcc_of_le hXR] at hs rewrites uIcc 3 XR to Icc 3 XR ✓; hs.1.1 : 3 ≤ s.re ✓. For im: uIcc T U with T ≤ U: hs.2.1 : T ≤ s.im; 0 < T ≤ s.im ✓ linarith.\n\nBut careful: does `rw [Rectangle, Complex.mem_reProdIm]` work? Rectangle is a def — rw with a def name needs an equational lemma — for defs, `rw [Rectangle]` works if Rectangle is defined by pattern (it generates equation lemmas) — LiAssembly used `rw [RectangleBorder] at hb` ✓ same pattern for Rectangle presumably ✓. If not, `unfold Rectangle at hs`. I'll write `rw [Rectangle, Complex.mem_reProdIm] at hs` and fall back to unfold if the build complains.\n\nAlso note: DifferentiableOn intro pattern: `intro s hs` — DifferentiableOn f s := ∀ x ∈ s, DifferentiableWithinAt ℂ f s x — so `intro s hs` then exact (...).differentiableWithinAt ✓.\n\nThen:\n\n```lean\n/-- **The dog-leg rectangle integral vanishes** (Cauchy; the region is\nunconditionally zero-free — empty residue sum, no perimeter). -/\ntheorem rectangleIntegral_Jlag_dogleg_eq_zero {n : ℕ} {T U XR : ℝ}\n (hT : 0 < T) (hTU : T ≤ U) (hXR : 3 ≤ XR) :\n RectangleIntegral (Jlag n) (dogZ T) (dogW XR U) = 0 :=\n (holomorphicOn_Jlag_dogleg hT hTU hXR).vanishesOnRectangle subset_rfl\n\n/-- The (2πi)⁻¹-normalized form (for API symmetry with rectInt'_Jlag). -/\ntheorem rectangleIntegral'_Jlag_dogleg_eq_zero {n : ℕ} {T U XR : ℝ}\n (hT : 0 < T) (hTU : T ≤ U) (hXR : 3 ≤ XR) :\n RectangleIntegral' (Jlag n) (dogZ T) (dogW XR U) = 0 := by\n rw [RectangleIntegral', rectangleIntegral_Jlag_dogleg_eq_zero hT hTU hXR,\n smul_zero]\n\n/-- **The exact dog-leg deformation identity** (D-074 §3.2 (★), the\ncapstone for ii′-6-c): the low right-horizontal equals the high\nhorizontal minus the right drop plus the left lift. -/\ntheorem upper_right_horizontal_eq_dogleg {n : ℕ} {T U XR : ℝ}\n (hT : 0 < T) (hTU : T ≤ U) (hXR : 3 ≤ XR) :\n HIntegral (Jlag n) 3 XR T =\n HIntegral (Jlag n) 3 XR U - VIntegral (Jlag n) XR T U +\n VIntegral (Jlag n) 3 T U := by\n have h0 := rectangleIntegral_Jlag_dogleg_eq_zero hT hTU hXR\n unfold RectangleIntegral at h0\n rw [dogZ_re, dogZ_im, dogW_re, dogW_im] at h0\n linear_combination h0\n```\n\nAnd Jlag_conj:\n```lean\n/-! ## 2. The conjugation identity (for the lower-side transfer, DL-5) -/\n\n/-- kFun is conjugation-symmetric (real-coefficient rational function). -/\ntheorem kFun_conj (n : ℕ) (s : ℂ) :\n kFun n ((starRingEnd ℂ) s) = (starRingEnd ℂ) (kFun n s) := by\n unfold kFun\n simp [map_sub, map_div, map_pow, map_one]\n\n/-- ζ′/ζ is conjugation-symmetric at points where ζ ≠ 0 (from\n`riemannZeta_conj` + `iteratedDeriv_riemannZeta_conj`). -/\ntheorem Jlag_conj (n : ℕ) {s : ℂ} (hs : s ≠ 1) :\n Jlag n ((starRingEnd ℂ) s) = (starRingEnd ℂ) (Jlag n s) := by\n unfold Jlag\n rw [kFun_conj, map_mul, _root_.riemannZeta_conj]\n congr 1\n have h1 : iteratedDeriv 1 riemannZeta ((starRingEnd ℂ) s) =\n (starRingEnd ℂ) (iteratedDeriv 1 riemannZeta s) :=\n iteratedDeriv_riemannZeta_conj 1 hs\n rwa [iteratedDeriv_one, iteratedDeriv_one] at h1 -- hmm direction\n```\n\nCareful with the deriv-conj bridge: `iteratedDeriv_one : iteratedDeriv 1 f = deriv f` (Mathlib). h1 : iteratedDeriv 1 ζ (conj s) = conj (iteratedDeriv 1 ζ s). rw [iteratedDeriv_one] at h1 turns both sides into deriv ζ — but iteratedDeriv_one is an equation for `iteratedDeriv 1` — rw [iteratedDeriv_one] at h1 rewrites `iteratedDeriv 1 ?f` to `deriv ?f` at h1 ✓ both occurrences (rw rewrites all matching instances ✓). Then h1 : deriv ζ (conj s) = conj (deriv ζ s) ✓.\n\nThen the goal after rw [kFun_conj, map_mul, riemannZeta_conj]: \n`star (kFun n s) * (-(deriv ζ (star s) / star (ζ s))) = star (kFun n s * (-(deriv ζ s / ζ s)))` — hmm let me redo: Jlag n (star s) = kFun n (star s) * (-(ζ′(star s)/ζ(star s))) — rw [kFun_conj]: → star(kFun n s) * (-(ζ′(star s)/ζ(star s))). rw [_root_.riemannZeta_conj]: ζ(star s) → star(ζ s): → star(kFun n s) * (-(ζ′(star s)/star(ζ s))). RHS: star(Jlag n s) = star(kFun n s * (-(ζ′ s/ζ s))) — rw [map_mul]: star(kFun n s) * star(-(ζ′ s/ζ s)) = star(kFun n s) * (-(star(ζ′ s)/star(ζ s))) (map_neg, map_div inside star). So the remaining goal: deriv ζ (star s) = star (deriv ζ s) — the h1 ✓. So:\n\n```lean\ntheorem Jlag_conj (n : ℕ) {s : ℂ} (hs : s ≠ 1) :\n Jlag n ((starRingEnd ℂ) s) = (starRingEnd ℂ) (Jlag n s) := by\n unfold Jlag\n rw [kFun_conj, _root_.riemannZeta_conj]\n have h1 : deriv riemannZeta ((starRingEnd ℂ) s) =\n (starRingEnd ℂ) (deriv riemannZeta s) := by\n have h := iteratedDeriv_riemannZeta_conj 1 hs\n rwa [iteratedDeriv_one, iteratedDeriv_one] at h\n rw [h1, map_mul, map_neg, map_div]\n```\n\nLet me double check the rw order. Goal: kFun n (star s) * (-(ζ′(star s)/ζ(star s))) = star (kFun n s * (-(ζ′ s/ζ s))). \n- rw [kFun_conj]: LHS → star(kFun n s) * (-(ζ′(star s)/ζ(star s)))\n- rw [_root_.riemannZeta_conj]: rewrites ζ (star s) → star (ζ s): LHS → star(kFun n s) * (-(ζ′(star s)/star(ζ s)))\n- rw [h1]: ζ′(star s) → star (ζ′ s): LHS → star(kFun n s) * (-(star(ζ′ s)/star(ζ s)))\n- rw [map_mul, map_neg, map_div] at the RHS: star(kFun n s * (-(ζ′ s/ζ s))): map_mul → star(kFun n s) * star(-(ζ′ s/ζ s)); map_neg → star(kFun n s) * (-star(ζ′ s/ζ s)); map_div → star(kFun n s) * (-(star(ζ′ s)/star(ζ s))) ✓ both sides equal — rfl.\n\nBut rw [map_mul, map_neg, map_div] will rewrite EVERYWHERE (both sides) — LHS has no star-except-inside... LHS after the three rewrites: star(kFun n s) * (-(star(ζ′ s)/star(ζ s))) — map_div/map_neg/map_mul could rewrite the star pieces further (map_div: star(a/b) → star a / star b — LHS has star(ζ′ s)/star(ζ s): map_div applies to `star (deriv ζ s / riemannZeta s)` — is that subterm present? LHS has -(star(ζ′ s)/star(ζ s)) — that's -((star(ζ′ s))/(star(ζ s))) — division of two stars, NOT star of a division — map_div rewrites star(a/b) not (star a)/(star b) ✓ no match ✓ good. The RHS rewrites as planned ✓. Then rfl closes automatically after rw (rw closes rfl goals) ✓.\n\nHmm, one concern: `unfold Jlag` — Jlag is a def; unfold works. kFun_conj's proof: `unfold kFun; simp [map_sub, map_div, map_pow, map_one]` — goal: (star s/(star s − 1))ⁿ − 1 = star ((s/(s−1))ⁿ − 1): simp with map lemmas: star((s/(s−1))ⁿ − 1) = (star(s/(s−1)))ⁿ − star 1 = ((star s)/(star(s−1)))ⁿ − 1 = ((star s)/(star s − 1))ⁿ − 1 ✓ — LHS/RHS should match after simp normalizes both. Order of operands: (star s − 1) vs (star s − star 1) — simp [map_one] ✓. Should be fine; if simp leaves it, `ring`-level or congr 1.\n\nAlso — do I need `s ≠ 1` for Jlag_conj? The iteratedDeriv_riemannZeta_conj needs hz : z ≠ 1 ✓ pass hs. (Jlag at s = 1 is junk-valued anyway.)\n\nOne more consideration — the build. LiDogLeg imports LiTightR (for iteratedDeriv_riemannZeta_conj) — LiTightR is a big file (~4300 lines) but already built (olean exists). The new file compiles against the existing oleans: `lake env lean NguyenRH1/LiDogLeg.lean` from the package dir for fast iteration, then `lake build NguyenRH1.LiDogLeg` for the olean, then root import + full build + audit.\n\nAlso — do NOT forget: freeze protocol — new files only ✓ (LiDogLeg.lean is new; root NguyenRH1.lean gets the new import line appended — that's an allowed addition (root import list changes were done every sub-stage)).\n\nLet me also double check `riemannZeta_ne_zero_of_one_lt_re` is root-namespace: from the grep: `Mathlib/NumberTheory/LSeries/Dirichlet.lean:328: lemma riemannZeta_ne_zero_of_one_lt_re {s : ℂ} (hs : 1 < s.re)` — no _root_ marker shown, and Zeta23/FromPNTPlus/MediumPNT.lean:826 uses `apply riemannZeta_ne_zero_of_one_lt_re` unqualified ✓ root or open namespace — fine either way.\n\nAlso HolomorphicOn: it's `Zeta23`'s abbrev in the root Zeta23 namespace? From the grep: `Zeta23/FromPNTPlus/ResidueCalcOnRectangles.lean:103: abbrev HolomorphicOn` — inside what namespace? The file's `namespace Zeta23`? Let me check — residueTheorem_finset was `Zeta23.Analytic.residueTheorem_finset` (in Zeta23.Analytic.RectangleLogDeriv, namespace Zeta23.Analytic). But HolomorphicOn is in FromPNTPlus.ResidueCalcOnRectangles — namespace? The ZeroFree.lean used `Zeta23.Analytic.residueTheorem_finset` — and residueTheorem_finset is in Analytic/RectangleLogDeriv.lean (namespace Zeta23.Analytic). But HolomorphicOn is in FromPNTPlus/ResidueCalcOnRectangles.lean — different file. LiSides.lean uses `RectangleIntegral'` (from FromPNTPlus) unqualified with `open Zeta23` — so FromPNTPlus things are in namespace Zeta23 (root). HolomorphicOn likely `Zeta23.HolomorphicOn` — open Zeta23 makes it visible ✓. Its method .vanishesOnRectangle: `HolomorphicOn.vanishesOnRectangle` ✓ same namespace.\n\nAlso `Rectangle`, `RectangleBorder`, `HIntegral`, `VIntegral`, `RectangleIntegral`, `RectangleIntegral'` — all FromPNTPlus in Zeta23 namespace ✓ (LiSides/LiPrincipal use them with open Zeta23 ✓).\n\n`integral_boundary_rect_eq_zero_of_differentiableOn` (used inside vanishesOnRectangle) — already compiled in Zeta23 ✓ no work.\n\n`Complex.mem_reProdIm` — used in LiAssembly with `Complex.mem_reProdIm`? LiAssembly used `simp only [Set.mem_union, Complex.mem_reProdIm, Set.mem_singleton_iff]` ✓ exists.\n\n`Set.uIcc_of_le : a ≤ b → Set.uIcc a b = Set.Icc a b` ✓ used in LiAssembly ✓.\n\nNow — `Rectangle` def form: FromPNTPlus.Rectangle? `Rectangle z w : Set ℂ` — used in LiAssembly as a term with membership ⟨hr, hi⟩. If `rw [Rectangle]` fails I'll use `unfold Rectangle at hs` or `rw [show s ∈ Rectangle _ _ ↔ _ from Iff.rfl]`-style. Let me check its def quickly to get the membership form right.","signature":""},{"type":"text","text":"Checking the `Rectangle` definition form for the membership rewrite, then writing LiDogLeg.lean."},{"type":"tool_use","id":"Bash_169","name":"Bash","input":{"command":"cd D:/Python/Quantum/zeta-23-lean && grep -rn \"def Rectangle\\b\\|abbrev Rectangle\\b\" Zeta23/FromPNTPlus/ | head -3 && grep -rn \"namespace Zeta23\" Zeta23/FromPNTPlus/ResidueCalcOnRectangles.lean | head -2","description":"Find Rectangle def and the file's namespace"},"extra_content":null}]