← Session 18 — Lean tier (ii): finite-height proof + certified base points
thinking (29656 chars)
Research derivation file — not malware. Continuing.
Now I have the full assembly chain:
**The chain (D-037):**
1. λ_n = S_∞(n) − S_f(n) + 1 (Bombieri–Lagarias Thm 2) — P1
2. S_∞(n) ≥ ½n log n + (C₁−γ/2)n − 4 for n ≥ 20 — PROVED in Lean as `sInfty_lower_bound`
3. |S_f(n)| ≤ B(n) where B(n) := 2N(T) + 4T[(2/3)C₀(T) + A log(T+2) + B₀] + 40M₀ + 2(e⁴+1)[7H(T) + 3.3] + I_I + 1, T = √n + 1 — this is the SfBound hypothesis
4. margin(n) = S_∞^lower(n) − B(n) + 1 > 0 for n ∈ [N₀, N₁] via convexity — PROVED in Lean as `marginTilde_convex` (given hmaj, hψ on F)
5. Bridge: N₁ = (T₀−1)² — needs RH to T₀ for the zeros term in B(n)
6. n < N₀: finite verification (LiVerifiedUpTo 5×10⁵ ⊇ n ≤ 80000)
Now, per the session-012 notes, the design:
**Step 1 (assembly-first):** state `lambda_pos_finite_height` with SfBound as an explicit named hypothesis: `SfBound : ∀ n, |S_f n| ≤ B n`, and discharge the full assembly conditional on it.
What's needed to make this work in Lean:
a) **Define S_f(n)** in Lean. Currently only `liCoeff` (zero side) and `SInfty` are defined. S_f is defined via the contour identity... Actually in the BL Thm 2 decomposition, S_f(n) is the finite-prime part: λ_n = S_∞(n) − S_f(n) + 1 where S_f(n) = Σ_p Σ_m (log p / p^{m/2})·... hmm. Let me recall BL Thm 2: λ_n = S_∞(n) − S_f(n) + 1 where
- S_∞(n) = Σ_{j=1}^n (−1)^{j−1}... the archimedean part
- S_f(n) = the sum over primes part.
Actually from BL Thm 2: λ_n = −Σ... Let me not guess. The assembly in Lean needs:
- `liCoeff n` (zero-side, defined)
- A bridge lemma: `(liCoeff n).re = SInfty n - Sf n + 1` — this is BL Thm 2 (P1, [PROVED] literature). This is genuinely hard to formalize (it's the explicit formula). In the assembly-first design, this too is a named hypothesis? No wait — the notes say the named hypothesis should be SfBound : ∀ n, |S_f n| ≤ B n. But the BL Thm 2 identity itself... Hmm.
Let me think about what's reasonable. The notes say: "state lambda_pos_finite_height with the finite-part bound as an explicit named hypothesis (SfBound : ∀ n, |S_f n| ≤ B n), and discharge the full assembly conditional on it. This isolates the exact remaining obligation as a single, precisely-typed statement."
So the design decision: how much is inside SfBound? Options:
Option A (minimal): SfBound is literally `∀ n, |S_f n| ≤ B n` with S_f defined mathematically (prime-side sum). Then we also need the BL identity λ_n = S_∞ − S_f + 1 as another hypothesis (or formalize it — hard).
Option B (coarse): define a hypothesis directly on liCoeff: `∀ n ≤ N₁, (liCoeff n).re ≥ S_∞^lower(n) − B(n) + 1`. That bundles BL identity + Sf bound into one. But that's less honest — it hides the structure.
The notes explicitly say: the named hypothesis is SfBound : ∀ n, |S_f n| ≤ B n. And "Then triage what's inside SfBound: which pieces are Mathlib-tractable (the kernel estimates, D-056's reference-point bound — plain complex analysis, doable) vs. which are Trudgian-class (N(T) explicit bounds — possibly a permanent perimeter item)".
So S_f must be defined, and BL Thm 2's identity must also enter. Where does the identity λ_n = S_∞ − S_f + 1 enter? It could be stated as a separate named hypothesis too, or as a definition of S_f via the identity (define Sf n := SInfty n + 1 - (liCoeff n).re — then BL Thm 2 is definitional and SfBound is the analytic content).
Hmm, but defining S_f via λ makes SfBound's statement reference liCoeff and SInfty, which is fine and honest: "the finite part, defined as S_f := S_∞ + 1 − λ_n (BL Thm 2), satisfies |S_f(n)| ≤ B(n)". Actually the cleanest honest approach: define S_f as the prime-side sum (mathematical object), state BL identity as a hypothesis `BL_identity`, state `SfBound` as hypothesis, then the assembly is pure algebra + margin convexity.
Wait — but actually, what did the paper/skeleton intend? Let me look at how marginTilde F relates to B(n). In the Lean file, `marginTilde F n` = S_∞^lower(n) − (2FT + 4T[(2/3)C₀ + 10.5 log(T+2) + 48] + 40·1.3352 + 2(e⁴+1)(7Ĥ + 3.3) + IIMaj n + 1) + 1. So marginTilde F = S_∞^lower − B_F + 1 where B_F uses F in place of the N(T) term 2F(T): the "2F T" term. Indeed B(n) has 2N(T) ≤ 2F(T) (majorant). So `marginTilde F n = sInfty_lower − B_F(n) + 1` exactly, with A = 10.5, B₀ = 48 baked in.
So the assembly in Lean:
```
theorem lambda_pos_finite_height
(hRH : RHUpTo (3 * 10 ^ 12)) (hfinite : LiVerifiedUpTo (5 * 10 ^ 5))
(F : ℝ → ℝ) (hF : ContDiff ℝ 2 F)
(hmaj : ∀ T : ℝ, (Ncount 0 T : ℝ) ≤ F T)
(hψ : ∀ T : ℝ, Real.sqrt 20 + 1 ≤ T → deriv (deriv F) T - deriv F T / (T - 1) < 0)
(SfBound : ∀ n : ℕ, 1 ≤ n → |Sf n| ≤ Bn F n) -- the named hypothesis
(hbase : 0 < marginTilde F 80000 ∧ 0 < deriv (marginTilde F) 80000) -- base point, E-028 verified — or proved numerically?
: ∀ n : ℕ, 1 ≤ n → (n : ℝ) ≤ (3 * 10 ^ 12 - 1 : ℝ) ^ 2 → 0 < (liCoeff n).re
```
Hmm wait, but there are several subtle pieces:
1. **The BL identity**: λ_n = S_∞(n) − S_f(n) + 1. This connects liCoeff (zero side) to SInfty and Sf. This is [PROVED] literature (P1) but formalizing it is a huge project (explicit formula). In the assembly-first design, should this be a hypothesis? The notes say to isolate "the exact remaining obligation as a single, precisely-typed statement" — SfBound. If we define Sf := SInfty + 1 − liCoeff.re, the identity holds definitionally and SfBound becomes: |SInfty n + 1 − (liCoeff n).re| ≤ B n. Hmm, but then SfBound includes the BL identity content implicitly. That's actually elegant: ONE named hypothesis, precisely typed, containing exactly "the finite part of the BL decomposition is bounded by B(n)". The triage then decomposes SfBound.
Actually wait. Let me reconsider. The cleaner mathematical route: define S_f as the arithmetic prime sum (that's its BL definition), prove (hypothesis) the identity, and bound. But defining the prime sum in Lean is easy-ish: S_f(n) = Σ_{p^m} ... Actually from BL Thm 2: S_f(n) = Σ_{j=1}^n (−1)^{j−1} C(n,j) ... hmm no.
BL Thm 2 (Bombieri–Lagarias 1999): λ_n = S_∞(n) − S_f(n) + 1 where... I recall from D-036/the project: S_f(n) involves the prime sum: S_f(n) = Σ_p Σ_{m≥1} (log p)/p^{m/2} · f_n(p^m)... something with (1 − (1−p^{−m})^n)? Not sure. E-021 computed S_f exactly — let me check E-021's script or D-036 for the exact definition used numerically. Actually for the Lean assembly, the exact arithmetic definition of S_f matters only for the eventual triage; for the assembly-first deliverable, what matters is the TYPE of SfBound.
Given the notes: "state lambda_pos_finite_height with the finite-part bound as an explicit named hypothesis (SfBound : ∀ n, |S_f n| ≤ B n)".
I think the honest design:
- Define `Sf n : ℝ` as the BL finite part (prime-side). Need the formula. Let me check D-036 or E-021 for the definition used.
Actually — from BL Thm 2 (I remember now, and the project computed it in E-021):
S_f(n) = Σ_{j=1}^n ... no. Let me just check the numerics script.
Also 2. **The base point**: margiñ(8×10⁴) = 16020 > 0 and margiñ′(8×10⁴) > 0 — E-028/E-029 verified numerically. In Lean, proving `0 < marginTilde F 80000` requires evaluating F at √80000+1 — depends on F. If F is the explicit Trudgian majorant F(T) = (T/2π)log(T/2πe) + 7/8 + S_bnd(T), then marginTilde F is fully explicit and the base-point evaluation is a numeric inequality provable in principle by norm_num + bounds (like block_range_bounds but much bigger). That's a finite computation — could be done with interval arithmetic... In Lean this is provable but painful (needs tight rational bounds on log/exp of specific values). Session 011's gotchas mention "check norm_num digit-bounds by hand (two tight ones failed)". The base-point evaluation at n = 80000 involves log(80000), log(√80000+1+2) ≈ log(284.8) ≈ 5.65, log log ≈ 1.73, exp(4) etc. Provable with rational squeezes but laborious.
Alternatively: keep the base point as a hypothesis too? No — the notes say SfBound should be THE single named analytic hypothesis. The base-point evaluation is decidable numerical content — "computational perimeter" — like the Platt–Trudgian hypothesis style. Hmm, but hRH and hfinite are already hypotheses. The notes say the upgrade is "verified modulo one named analytic hypothesis + the computational perimeter." So the computational perimeter = hRH (Platt–Trudgian), hfinite (Misguich–Voros + our verification). The base-point evaluations margiñ(N₀) > 0, margiñ′(N₀) > 0 are finite numeric facts about explicit functions — they belong to the provable-in-Lean category (elementary real computation), though laborious. I'd tag them as part of the assembly to PROVE (with explicit F), possibly via interval-arithmetic-style rational bounds.
But wait — F is abstract in marginTilde_convex (with hmaj, hψ hypotheses). For the full assembly we need the EXPLICIT Trudgian F. D-037: N(T) = F(T) + S(T), F(T) = (T/2π)log(T/2πe) + 7/8, |S(T)| ≤ 0.137 log T + 0.443 log log T + 1.588. So the majorant is N(T) ≤ F(T) + S_bnd(T). Hmm, but in marginTilde the "2 F T" term is the 2N(T) majorant. So F_assembly(T) = (T/2π)log(T/2πe) + 7/8 + 0.137 log T + 0.443 log log T + 1.588 — needs to be C² (yes, elementary) and hψ needs the D-057 11-block table (already proved for the log-shift blocks! The block table in the Lean file IS the ψ-table for these pieces). Indeed psiOf_log_shift etc. cover log(T+2), log log(T+2), T·log(T+2), etc. The F here has terms (T/2π)log(T/2πe) = (1/2π)(T log(T/2π) − T)... which is T·log(T/c) form — similar to block #5 but with different shift. Hmm, D-057's 11-block table — I should read D-057 to see exactly which F was used and which blocks.
Hold on. Let me re-scope. The session-012-notes' plan:
1. **Assembly-first**: state with SfBound hypothesis, discharge the full assembly conditional on it. "Achievable in a few sessions."
2. **Then triage** what's inside SfBound: Mathlib-tractable pieces vs Trudgian-class pieces. "It may be correct to draw the trusted perimeter around Trudgian 2014 as published literature... decide deliberately where this one goes."
So for THIS session (012), the goal is step 1: the assembly. The assembly conditional on SfBound needs:
- liCoeff, RHUpTo, LiVerifiedUpTo (exist)
- Sf : definition (need to choose)
- B(n) : the explicit bound function (needs F — the zero-count majorant; keep F abstract with hmaj/hψ as in marginTilde_convex, OR instantiate explicit Trudgian F)
- margin argument: marginTilde_convex (PROVED) + base point + convexity ⟹ margin > 0 on [N₀, N₁]... wait, convex on [20,∞) + margin(N₀) > 0 + margin′(N₀) > 0 ⟹ margin(n) > 0 for n ≥ N₀. That's a real-analysis lemma: convex + positive at a point + positive derivative there ⟹ positive thereafter. Need: convexOn ⟹ for n ≥ N₀, margin(n) ≥ margin(N₀) + margin′(N₀)(n−N₀) > 0. Mathlib: ConvexOn.slope_le... or use deriv monotone: ConvexOn.mono... There's `ConvexOn.deriv_le` or monotonicity of derivative: `ConvexOn.monotoneOn_deriv` (interior). Then margin′(n) ≥ margin′(N₀) > 0 for n > N₀, then mean value theorem gives margin(n) = margin(N₀) + margin′(ξ)(n−N₀) > 0. Doable with Mathlib MVT (exists_deriv_eq_slope / domain version). This is "convex + base ⟹ positive" — a clean lemma to prove.
- The bridge N₁ = (T₀−1)²: for n ≤ (T₀−1)², need T = √n + 1 ≤ T₀ to apply RH... wait, actually where does hRH enter?? In B(n), the zeros term: |Σ_{|γ|≤T}| ≤ 2N(T) uses RH-to-T₀ (each |ρ/(ρ−1)|ⁿ = 1 on the line ⟹ |1−(ρ/(ρ−1))ⁿ| ≤ 2). WITHOUT RH, the zeros term isn't ≤ 2N(T) — off-line zeros give |(ρ/(ρ−1))ⁿ| ≠ 1. So hRH is used INSIDE the derivation of B(n) — i.e., inside SfBound's eventual proof, NOT in the assembly-after-SfBound!
Hmm wait. Is that right? Let me recheck: B(n) bounds |S_f(n)|, and the bound's derivation uses hRH (bridge condition §6). So if SfBound is taken as a hypothesis, then hRH is not needed for the assembly — it re-enters when proving SfBound. Interesting. But the theorem statement `lambda_pos_finite_height (hRH ...)` keeps hRH in the signature — the assembly proof would then not use hRH (it's used in the eventual SfBound proof). That's fine — Lean allows unused hypotheses (maybe a linter warning). OR: SfBound should be stated conditional on hRH: `(hRH : RHUpTo T₀) → ∀ n ≤ (T₀−1)², |Sf n| ≤ B n`. The cleaner design per the notes: isolate the remaining obligation as a single precisely-typed statement. The statement |S_f n| ≤ B n for n ≤ N₁ is true only because of hRH... but as a standalone Prop it's just a bound that happens to hold. Hmm — actually NO: |S_f(n)| ≤ B(n) for n ≤ N₁ is TRUE only under RH-to-T₀? No wait — S_f(n) is a fixed real number for each n (it's either the prime sum or λ-derived). RH-to-T₀ is a FACT (Platt–Trudgian proved it computationally). So |S_f n| ≤ B n for n ≤ N₁ is simply true (given PT). As a Lean hypothesis it's self-contained.
But structurally it's more honest to keep hRH visible. Design choice:
```
theorem lambda_pos_finite_height
(hRH : RHUpTo (3 * 10 ^ 12)) (hfinite : LiVerifiedUpTo (5 * 10 ^ 5))
(SfBound : ∀ n : ℕ, 1 ≤ n → (n:ℝ) ≤ (3*10^12 - 1)^2 → |Sf n| ≤ Bn n) :
...
```
with the understanding that proving SfBound will consume hRH (via the bridge). And the assembly itself uses only hfinite (for n < N₀) + SfBound + margin.
Hmm, but then hRH is unused in the assembly — Lean linter will flag unused variable? It's a theorem binder, not a section variable; unused binders in theorem statements are fine (no linter error, maybe `unusedVariables` linter warning which is not an error). Actually for the paper claim "verified modulo one named analytic hypothesis + computational perimeter", the cleanest is:
Perimeter hypotheses: hRH, hfinite (computational facts from literature).
Named analytic hypothesis: SfBound (the remaining obligation).
Assembly: proved.
If hRH is unused in the assembly, that's actually a FEATURE demonstrating the isolation: all the analytic difficulty sits in SfBound; hRH will be used when discharging SfBound. But then the theorem as stated wouldn't need hRH at all... and the honest statement would be `(SfBound) (hfinite) → ...`. Hmm, but the finite-height theorem's STATEMENT (R-004) assumes RH-to-T₀. If SfBound is a hypothesis, the theorem "RH-to-T₀ + finite-verification ⟹ λ_n > 0 to N₁" becomes "SfBound + finite-verification ⟹ ...".
I think the right structure, mirroring Zeta23 style:
```
/-- The remaining analytic obligation: the finite part S_f (BL Thm 2)
is bounded by the explicit traced B(n) for all n up to N₁. Proof content:
D-036/D-056 contour bound (Trudgian N(T)/S(T) inside the trusted
perimeter), bridge via hRH. -/
def SfBoundProp : Prop :=
∀ n : ℕ, 1 ≤ n → (n : ℝ) ≤ (3 * 10 ^ 12 - 1 : ℝ) ^ 2 → |Sf n| ≤ Bn n
theorem lambda_pos_finite_height
(hRH : RHUpTo (3 * 10 ^ 12)) (hfinite : LiVerifiedUpTo (5 * 10 ^ 5))
(hSf : SfBoundProp) :
∀ n : ℕ, 1 ≤ n → (n : ℝ) ≤ (3 * 10 ^ 12 - 1 : ℝ) ^ 2 → 0 < (liCoeff n).re
```
Where `Sf n := SInfty n + 1 - (liCoeff n).re` (BL Thm 2 as DEFINITION of the finite part — this is a real design decision. If Sf is defined via liCoeff, then the identity λ_n = S_∞ − S_f + 1 is definitional: λ_n = S_∞ − (S_∞ + 1 − λ_n) + 1 ✓. Then SfBound is genuinely the full remaining content: "the combination S_∞(n) + 1 − λ_n is bounded by B(n)". Hmm — but that hides BL Thm 2 inside the definition. The honesty note can document that Sf SHOULD equal the prime-side sum by BL Thm 2, and when triaging, one proves |prime-sum| ≤ B and uses BL identity to transfer. Alternatively define Sf as the prime sum and take the BL identity as part of... no — the notes want ONE named hypothesis.
Cleanest: define Sf as the prime-side sum (its own mathematical object), and state SfBound as: |Sf n| ≤ B n, PLUS a separate hypothesis for the identity? That's two hypotheses. OR define Sf as prime-side sum and bundle: `SfBound : (∀ n, (liCoeff n).re = SInfty n - Sf n + 1) ∧ (∀ n ≤ N₁, |Sf n| ≤ Bn n)`? The identity is [PROVED] literature (BL Thm 2) — it could legitimately go into the trusted perimeter like Trudgian. But formalizing the exact prime-sum is extra work in Lean (sum over prime powers, need summability).
Decision: I'll define Sf via the explicit BL finite-part formula IF it's tractable to state, otherwise use the λ-derived definition with a documented honesty note. Let me check what formula E-021/D-036 used for S_f. Let me grep.
Also need to decide B(n) in Lean: Bn should match marginTilde's internals so that marginTilde F n = sInftyLower n − Bn n + 1 EXACTLY (by ring, like marginTilde_eq_expanded). Looking at marginTilde:
marginTilde F n = [(1/2)n log n + (C₁−γ/2)n − 4] − (2·F(T) + 4T·((2/3)C₀hat T + 10.5 log(T+2) + 48) + 40·1.3352 + 2(e⁴+1)(7·Hhat T + 3.3) + IIMaj n + 1) + 1
So define:
```
def Bn (F : ℝ → ℝ) (n : ℝ) : ℝ :=
let T := Real.sqrt n + 1
2 * F T + 4 * T * ((2/3) * C0hat T + 10.5 * Real.log (T+2) + 48) +
40 * 1.3352 + 2 * (Real.exp 4 + 1) * (7 * Hhat T + 3.3) + IIMaj n + 1
```
then marginTilde F n = sInftyLower n − Bn F n + 1 where sInftyLower n = (1/2)n log n + (C₁−γ/2)n − 4. And sInfty_lower_bound gives SInfty n ≥ sInftyLower n for n ≥ 20.
Assembly proof sketch:
- Given n, 1 ≤ n, n ≤ N₁.
- Case n ≤ 80000: hfinite n (with 80000 ≤ 5×10⁵) gives 0 < (liCoeff n).re. ✓ (needs n ≤ 5×10⁵ from n ≤ 80000 — norm_num/omega)
- Case 80000 < n (so n ≥ 80001 ≥ 20):
- (liCoeff n).re = SInfty n − Sf n + 1 (by BL identity — from Sf definition)
- ≥ sInftyLower n − Sf n + 1 (sInfty_lower_bound, n ≥ 20) ✓
- ≥ sInftyLower n − Bn F n + 1 (SfBound + |Sf n| ≤ Bn ⟹ Sf n ≤ Bn... need Sf n ≤ |Sf n| ≤ Bn F n, and sign: λ = S_∞ − S_f + 1 ≥ S_∞ − |S_f| + 1 ≥ slower − B + 1) ✓
- = marginTilde F n (ring identity) ✓
- > 0: from marginTilde_convex (convex on Ici 20) + base point marginTilde F 80000 > 0 + deriv marginTilde F 80000 > 0 + the "convex + base ⟹ pos" lemma.
Wait — careful: N₀ = 80000. But the finite verification covers n ≤ 5×10⁵, and margin positivity covers n ≥ 80000. Overlap: use hfinite for n ≤ 5×10⁵... simplest split at 80000.
Additional pieces needed:
1. `Sf` definition + BL identity handling.
2. `Bn` definition matching marginTilde (ring identity lemma: marginTilde F n = slower n − Bn F n + 1).
3. `sInftyLower` extracted as a def (currently inline in sInfty_lower_bound).
4. Explicit F? For the assembly-first step, keep F ABSTRACT with hmaj/hψ hypotheses — same as marginTilde_convex. But then the base point "marginTilde F 80000 > 0" can't be proved for abstract F — it becomes part of the hypotheses? Hmm. Two options:
(a) Keep F abstract; base-point positivity as hypotheses (hbase : 0 < marginTilde F 80000, hbase' : 0 < deriv (marginTilde F) 80000). Then the theorem has: hRH(unused)/hfinite/SfBound/F/hF/hmaj/hψ/hbase/hbase′. That's a lot of hypotheses but each is honest: hmaj (F majorizes N — Trudgian, perimeter), hψ (D-057 block table — PROVED for the explicit blocks... but for abstract F it's a hypothesis), hbase (E-028 numeric facts — provable once F explicit).
(b) Instantiate the explicit Trudgian F_trud(T) = (T/2π)log(T/2πe) + 7/8 + 0.137 log T + 0.443 log log T + 1.588 (or in shifted form). Then hmaj is "Trudgian 2014 Thm 1" — a perimeter/literature hypothesis; hψ is provable via the block table (but blocks are log(T+2)-shifted; F_trud uses log(T/2π) = log T − log 2π — different forms, need the D-057 table exactly as filed. Let me read D-057 to see which F the 11-block table covers.
From marginTilde_convex's hψ: `deriv (deriv F) T - deriv F T / (T - 1) < 0` for T ≥ √20+1 — the D-057 table as formalized covers blocks: id, log(t+2), log log(t+2), log²(t+2), log·loglog, loglog², t·log(t+2), t·loglog(t+2) — 8 blocks + F + IIMaj + S = 11. The C0hat/Hhat in marginTilde are built from log(t+2), log log(t+2) — so the F in the Lean assembly is meant to be the explicit Trudgian-style majorant built from THESE blocks. Hmm — C0hat uses log(t+2) not log(t/2π). So the Lean marginTilde already encodes a SHIFTED version of Trudgian's F. D-057 §2 presumably rewrites Trudgian's F(T) = (T/2π)log(T/2πe)+7/8 into t·log(t+2) blocks? Hmm, log(T/2πe) vs log(T+2): for the majorant one needs F(T) ≤ (block-built thing). Let me read D-057 to see.
Actually wait — I realize the assembly might not need to resolve this NOW. The session-012 plan step 1 (assembly-first) isolates SfBound as the named hypothesis. F can stay abstract with hmaj/hψ as named sub-hypotheses (they're part of the triage: hmaj = Trudgian = perimeter; hψ = block table = proved for explicit F). The base point: hbase/hbase′ as numeric facts (proved once F explicit — or kept as "computational perimeter" items, they're finite decimal evaluations).
Hmm, but the notes say the deliverable is "verified modulo ONE named analytic hypothesis + the computational perimeter." So the ideal endpoint of step 1:
`lambda_pos_finite_height (hRH) (hfinite) (hSf : SfBoundProp) : ...` — three hypotheses, where SfBoundProp is the single analytic one, hRH/hfinite the computational perimeter.
But the margin argument needs F, hmaj, hψ, hbase, hbase′. To get down to just SfBound, those must be DISCHARGED inside the assembly:
- Choose explicit F (Trudgian blocks, C² — provable).
- hmaj: Ncount 0 T ≤ F T — this is Trudgian 2014 Thm 1 + Backlund... this is ITSELF a Trudgian-class hypothesis! Per the triage it's "possibly a permanent perimeter item." So for step 1, hmaj stays a hypothesis (literature, like Zeta23's hEF). That's fine — it's part of "the computational/literature perimeter" (Trudgian is [PROVED] literature).
- hψ: for the explicit F, PROVE via the existing block table (the 8 psiOf_*_neg theorems) — this requires F to be a positive combination of exactly those blocks. Need to check D-057 for the explicit F used.
- hbase/hbase′: numeric evaluations at n = 80000 — provable in principle (rational squeezes on log/exp), laborious; could be left as hypotheses in a first pass with an honesty note (they're E-028/E-029 grid facts... no wait, they're single-point evaluations of EXPLICIT functions, so they're decidable; but Lean-proving tight numeric bounds on log(282.8...) needs care).
Plan for session 012 (this is already a lot — probably multi-sub-stage):
Sub-stage 12.1: Design + read D-056/D-057 for exact B(n)/F; decide Sf definition; write the new section of LiSkeleton.lean: Sf, Bn, sInftyLower defs; SfBoundProp; margin identity lemma (ring); the convex-pos lemma (convex+base⟹pos on [N₀,∞)); assembly with hypotheses (hRH)(hfinite)(hSf) + (F)(hF)(hmaj)(hψ)(hbase)(hbase′) initially; compile.
Sub-stage 12.2: Discharge hψ for explicit F via block table (needs the explicit F choice + ψ-linearity lemma: ψ[c₁φ₁+c₂φ₂] = c₁ψ[φ₁]+c₂ψ[φ₂], then sum of negatives). Maybe.
Sub-stage 12.3: Base points via numeric bounds.
Then triage documentation (D-062) + paper update.
Hmm wait — but actually, do I want to restructure so that the FINAL theorem has F instantiated? The triage decision (Trudgian inside perimeter) affects this: if Trudgian N(T)-majorant is a perimeter hypothesis, then hmaj stays as a hypothesis over an explicit F. Let me structure:
```
/-- The explicit Trudgian-style zero-count majorant (D-057 block form). -/
def FTrud (T : ℝ) : ℝ := ... (from D-057)
theorem lambda_pos_finite_height
(hRH : RHUpTo (3*10^12)) (hfinite : LiVerifiedUpTo (5*10^5))
(hN : ∀ T : ℝ, (Ncount 0 T : ℝ) ≤ FTrud T) -- Trudgian 2014 (perimeter)
(hSf : SfBoundProp FTrud) : -- THE named analytic hypothesis
...
```
Wait, but hold on — does Ncount-majorant even enter SfBound or the margin? In marginTilde, "2·F T" is the majorant of 2N(T) inside B(n). So B(n) as DEFINED with F IS already the bound; hmaj is used when PROVING SfBound (to bound the zeros term 2N(T) ≤ 2F(T)), not in the margin. So in the assembly-after-SfBound, hmaj is not used! The margin only needs: convexity of marginTilde F (needs hF, hψ) + base points. And hψ for explicit FTrud is provable (block table). hbase provable (numeric).
So actually the assembly theorem could be:
```
theorem lambda_pos_finite_height
(hRH : RHUpTo (3*10^12)) (hfinite : LiVerifiedUpTo (5*10^5))
(hSf : SfBoundProp) :
∀ n, 1 ≤ n → (n:ℝ) ≤ (3*10^12−1)^2 → 0 < (liCoeff n).re
```
with FTrud hard-coded inside Bn and SfBoundProp; hψ proved via blocks; base points proved numerically; hmaj not appearing at all (it's inside SfBound's eventual proof, together with hRH).
That's EXACTLY "verified modulo one named analytic hypothesis + the computational perimeter"! hRH/hfinite = perimeter; hSf = the one named hypothesis.
So the work for step 1 (this session, maybe 2):
1. Extract sInftyLower as a def; refactor sInfty_lower_bound to use it (mechanical).
2. Define FTrud explicitly (from D-057 — need to read what exact F the block table covers; C0hat = 0.433 log(t+2) + 0.886 loglog(t+2) + 2.9 is the C₀ majorant... and the N(T) majorant F in marginTilde is separate — the "2 F T" term. What is F? D-057 presumably has F(T) = (T/2π)log(T/2πe) + 7/8 + S_bnd... but expressed in blocks. Hmm — actually looking at marginTilde_convex's hψ hypothesis: it's about an ABSTRACT F. The 11-block table in the file covers the OTHER pieces (C0hat/Hhat pieces), NOT F. So D-057's table = the blocks for C0hat/Hhat/id + IIMaj bound; F was left abstract with its ψ_F < 0 as a hypothesis ("the D-057 11-block table discharges this for the explicit Trudgian majorant" says the docstring — so the table INCLUDING an F-part is in D-057; the Lean file proved 8 blocks + left F's ψ as hypothesis).
Let me read D-057 to get the exact table and F.
3. Define Bn F n and prove marginTilde F n = sInftyLower n − Bn F n + 1 (ring).
4. Prove convex+base ⟹ pos lemma.
5. State Sf definition + SfBoundProp; prove assembly with (hRH)(hfinite)(hSf) + (F abstract or explicit?).
Decision on F: Two-tier approach might be best:
- Tier 1 (this session): prove the assembly for ABSTRACT F: `lambda_pos_finite_height' (hfinite) (F) (hF) (hψ) (hbase) (hbase′) (hSf : SfBoundProp F) : ...` — margin part fully proved.
- Tier 2: instantiate F = FTrud, discharge hψ (block table + linearity), hbase/hbase′ (numeric), leaving the final theorem with exactly (hRH)(hfinite)(hN? no...)(hSf).
Hmm, wait — if F is instantiated as FTrud, hmaj disappears from assembly (it's not used there), hF is proved (ContDiff), hψ proved (blocks), hbase/hbase′ proved (numeric). Final: (hRH — UNUSED in assembly!)(hfinite)(hSf). hRH unused — I'd keep it in the signature for the theorem's honest statement (R-004 assumes RH-to-T₀), documenting that within the modular split it's consumed by SfBound's proof. Lean's unusedVariables linter may warn but won't error. Alternatively mark with `_hRH`. But for the paper's claim the signature matters; keep hRH and add a comment. Actually — cleaner: keep hRH in the MAIN theorem and use `include`? No, it's a binder. A warning is acceptable; or name it `_hRH`... but the paper statement wants visible hRH. Compromise: keep `hRH` named; if the linter warns, fine (warnings don't fail builds). Let me check how Zeta23.Final handles similar. Whatever — detail to resolve at compile time.
Let me now read D-057 to get the exact F and block table, and D-056 for the R-bound/B(n) constants (already have from D-037 §4: A = 10.5, B₀ = 48 via D-056; C0hat, Hhat, IIMaj already in Lean). The marginTilde already encodes B(n) — so Bn is literally the subtracted part of marginTilde.
For FTrud: from D-037: N(T) ≤ F(T) + S_bnd(T) with F(T) = (T/2π)log(T/2πe) + 7/8, S_bnd(T) = 0.137 log T + 0.443 log log T + 1.588. But marginTilde's "2 F T" with abstract F suggests the Lean F should be Nmajorant(T) = (T/2π)log(T/2πe) + 7/8 + 0.137 log T + 0.443 log log T + 1.588. Is ψ of THAT negative? Its blocks: T·log T (like block #5 but unshifted), log T, log log T, const. The proved blocks are the +2-shifted versions. ψ[T log T](T) = ? Let me compute: φ = T log T: φ′ = log T + 1, φ″ = 1/T. ψ = 1/T − (log T + 1)/(T−1). For T ≥ 5.47: (T−1) − T(log T + 1) = −1 − T log T < 0 ⟹ ψ < 0. ✓ Easy. φ = log T: ψ = −1/T² − (1/T)/(T−1) < 0 ✓. φ = log log T: φ′ = 1/(T log T), φ″ = −(log T + 1)/(T log T)²; ψ = φ″ − φ′/(T−1) < 0 ✓. φ = const: ψ = 0. φ = T: ψ = −1/(T−1) < 0 (block #2). So ψ[FTrud] = (1/2π)ψ[T log T] + 0.137 ψ[log T] + 0.443 ψ[log log T] + ψ[7/8+1.588 const] all ≤ 0 with the T log T term strictly < 0 ⟹ ψ[FTrud] < 0. All elementary, Mathlib-tractable! No shift needed: log T vs log(T+2) — both fine.
Wait, but is the ACTUAL zero-count majorant used in D-057 exactly F(T)+S_bnd(T)? D-037 §4: "|Σ| ≤ 2N(T) ≤ 2F(T) + 2S_bnd(T)". So B(n)'s first term 2N(T) is majorized by 2(F(T) + S_bnd(T)). So in Lean, F_assembly(T) := (T/2π)·log(T/2πe) + 7/8 + (0.137 log T + 0.443 log log T + 1.588). But hold on — D-056 repaired constants: "honest C₀ incl. log log term" and the R-bound A = 10.5, B₀ = 48. C0hat in Lean: 0.433 log(t+2) + 0.886 log log(t+2) + 2.9. Trudgian S_bnd: 0.137 log T + 0.443 log log T + 1.588 (T ≥ e). Hmm C0hat ≠ S_bnd — C₀(t) = zeros-in-unit-interval majorant = F(t+1)−F(t) + S_bnd(t+1) + S_bnd(t), and Ĉ₀ is the closed-form majorant of THAT (D-056 §2). The F in marginTilde's "2 F T" — is it F+S_bnd or something shifted? I need D-056/D-057's exact formulation. Let me read both.
Also the base points: margiñ(8×10⁴) = 16 020 > 0, margiñ′(8×10⁴) = 3.7 > 0 (D-037 P6). With which F exactly? E-029 has the values. These are numeric facts to be proved in Lean eventually (tier: numeric bounds).
Also important: D-037 says margin uses "T = √n + 1 used for the bounds" — matches marginTilde's `let T := Real.sqrt n + 1`. ✓
OK let me read D-057 and D-056 now. Then design, then write code.
Also — check Zeta23.Statement for Ncount. The marginTilde_convex signature references `Ncount 0 T`. Let me grep Zeta23 for Ncount.
Research derivation — not malware. The chain is now clear. Reading D-057 and D-056 for the exact majorant `F` and block table, plus checking the Zeta23 types.
tool: Read
input
{
"file_path": "D:\\Python\\Quantum\\research\\derivations\\D-057-convexity-proof.md"
}
tool: Read
input
{
"file_path": "D:\\Python\\Quantum\\research\\derivations\\D-056-R-bound-repair.md"
}
raw content_json (database row)
[{"type":"thinking","thinking":"Research derivation file — not malware. Continuing.\n\nNow I have the full assembly chain:\n\n**The chain (D-037):**\n1. λ_n = S_∞(n) − S_f(n) + 1 (Bombieri–Lagarias Thm 2) — P1\n2. S_∞(n) ≥ ½n log n + (C₁−γ/2)n − 4 for n ≥ 20 — PROVED in Lean as `sInfty_lower_bound`\n3. |S_f(n)| ≤ B(n) where B(n) := 2N(T) + 4T[(2/3)C₀(T) + A log(T+2) + B₀] + 40M₀ + 2(e⁴+1)[7H(T) + 3.3] + I_I + 1, T = √n + 1 — this is the SfBound hypothesis\n4. margin(n) = S_∞^lower(n) − B(n) + 1 > 0 for n ∈ [N₀, N₁] via convexity — PROVED in Lean as `marginTilde_convex` (given hmaj, hψ on F)\n5. Bridge: N₁ = (T₀−1)² — needs RH to T₀ for the zeros term in B(n)\n6. n < N₀: finite verification (LiVerifiedUpTo 5×10⁵ ⊇ n ≤ 80000)\n\nNow, per the session-012 notes, the design:\n\n**Step 1 (assembly-first):** state `lambda_pos_finite_height` with SfBound as an explicit named hypothesis: `SfBound : ∀ n, |S_f n| ≤ B n`, and discharge the full assembly conditional on it.\n\nWhat's needed to make this work in Lean:\n\na) **Define S_f(n)** in Lean. Currently only `liCoeff` (zero side) and `SInfty` are defined. S_f is defined via the contour identity... Actually in the BL Thm 2 decomposition, S_f(n) is the finite-prime part: λ_n = S_∞(n) − S_f(n) + 1 where S_f(n) = Σ_p Σ_m (log p / p^{m/2})·... hmm. Let me recall BL Thm 2: λ_n = S_∞(n) − S_f(n) + 1 where \n- S_∞(n) = Σ_{j=1}^n (−1)^{j−1}... the archimedean part\n- S_f(n) = the sum over primes part.\n\nActually from BL Thm 2: λ_n = −Σ... Let me not guess. The assembly in Lean needs:\n- `liCoeff n` (zero-side, defined)\n- A bridge lemma: `(liCoeff n).re = SInfty n - Sf n + 1` — this is BL Thm 2 (P1, [PROVED] literature). This is genuinely hard to formalize (it's the explicit formula). In the assembly-first design, this too is a named hypothesis? No wait — the notes say the named hypothesis should be SfBound : ∀ n, |S_f n| ≤ B n. But the BL Thm 2 identity itself... Hmm.\n\nLet me think about what's reasonable. The notes say: \"state lambda_pos_finite_height with the finite-part bound as an explicit named hypothesis (SfBound : ∀ n, |S_f n| ≤ B n), and discharge the full assembly conditional on it. This isolates the exact remaining obligation as a single, precisely-typed statement.\"\n\nSo the design decision: how much is inside SfBound? Options:\n\nOption A (minimal): SfBound is literally `∀ n, |S_f n| ≤ B n` with S_f defined mathematically (prime-side sum). Then we also need the BL identity λ_n = S_∞ − S_f + 1 as another hypothesis (or formalize it — hard).\n\nOption B (coarse): define a hypothesis directly on liCoeff: `∀ n ≤ N₁, (liCoeff n).re ≥ S_∞^lower(n) − B(n) + 1`. That bundles BL identity + Sf bound into one. But that's less honest — it hides the structure.\n\nThe notes explicitly say: the named hypothesis is SfBound : ∀ n, |S_f n| ≤ B n. And \"Then triage what's inside SfBound: which pieces are Mathlib-tractable (the kernel estimates, D-056's reference-point bound — plain complex analysis, doable) vs. which are Trudgian-class (N(T) explicit bounds — possibly a permanent perimeter item)\".\n\nSo S_f must be defined, and BL Thm 2's identity must also enter. Where does the identity λ_n = S_∞ − S_f + 1 enter? It could be stated as a separate named hypothesis too, or as a definition of S_f via the identity (define Sf n := SInfty n + 1 - (liCoeff n).re — then BL Thm 2 is definitional and SfBound is the analytic content). \n\nHmm, but defining S_f via λ makes SfBound's statement reference liCoeff and SInfty, which is fine and honest: \"the finite part, defined as S_f := S_∞ + 1 − λ_n (BL Thm 2), satisfies |S_f(n)| ≤ B(n)\". Actually the cleanest honest approach: define S_f as the prime-side sum (mathematical object), state BL identity as a hypothesis `BL_identity`, state `SfBound` as hypothesis, then the assembly is pure algebra + margin convexity.\n\nWait — but actually, what did the paper/skeleton intend? Let me look at how marginTilde F relates to B(n). In the Lean file, `marginTilde F n` = S_∞^lower(n) − (2FT + 4T[(2/3)C₀ + 10.5 log(T+2) + 48] + 40·1.3352 + 2(e⁴+1)(7Ĥ + 3.3) + IIMaj n + 1) + 1. So marginTilde F = S_∞^lower − B_F + 1 where B_F uses F in place of the N(T) term 2F(T): the \"2F T\" term. Indeed B(n) has 2N(T) ≤ 2F(T) (majorant). So `marginTilde F n = sInfty_lower − B_F(n) + 1` exactly, with A = 10.5, B₀ = 48 baked in.\n\nSo the assembly in Lean:\n\n```\ntheorem lambda_pos_finite_height\n (hRH : RHUpTo (3 * 10 ^ 12)) (hfinite : LiVerifiedUpTo (5 * 10 ^ 5))\n (F : ℝ → ℝ) (hF : ContDiff ℝ 2 F)\n (hmaj : ∀ T : ℝ, (Ncount 0 T : ℝ) ≤ F T)\n (hψ : ∀ T : ℝ, Real.sqrt 20 + 1 ≤ T → deriv (deriv F) T - deriv F T / (T - 1) < 0)\n (SfBound : ∀ n : ℕ, 1 ≤ n → |Sf n| ≤ Bn F n) -- the named hypothesis\n (hbase : 0 < marginTilde F 80000 ∧ 0 < deriv (marginTilde F) 80000) -- base point, E-028 verified — or proved numerically? \n : ∀ n : ℕ, 1 ≤ n → (n : ℝ) ≤ (3 * 10 ^ 12 - 1 : ℝ) ^ 2 → 0 < (liCoeff n).re\n```\n\nHmm wait, but there are several subtle pieces:\n\n1. **The BL identity**: λ_n = S_∞(n) − S_f(n) + 1. This connects liCoeff (zero side) to SInfty and Sf. This is [PROVED] literature (P1) but formalizing it is a huge project (explicit formula). In the assembly-first design, should this be a hypothesis? The notes say to isolate \"the exact remaining obligation as a single, precisely-typed statement\" — SfBound. If we define Sf := SInfty + 1 − liCoeff.re, the identity holds definitionally and SfBound becomes: |SInfty n + 1 − (liCoeff n).re| ≤ B n. Hmm, but then SfBound includes the BL identity content implicitly. That's actually elegant: ONE named hypothesis, precisely typed, containing exactly \"the finite part of the BL decomposition is bounded by B(n)\". The triage then decomposes SfBound.\n\nActually wait. Let me reconsider. The cleaner mathematical route: define S_f as the arithmetic prime sum (that's its BL definition), prove (hypothesis) the identity, and bound. But defining the prime sum in Lean is easy-ish: S_f(n) = Σ_{p^m} ... Actually from BL Thm 2: S_f(n) = Σ_{j=1}^n (−1)^{j−1} C(n,j) ... hmm no.\n\nBL Thm 2 (Bombieri–Lagarias 1999): λ_n = S_∞(n) − S_f(n) + 1 where... I recall from D-036/the project: S_f(n) involves the prime sum: S_f(n) = Σ_p Σ_{m≥1} (log p)/p^{m/2} · f_n(p^m)... something with (1 − (1−p^{−m})^n)? Not sure. E-021 computed S_f exactly — let me check E-021's script or D-036 for the exact definition used numerically. Actually for the Lean assembly, the exact arithmetic definition of S_f matters only for the eventual triage; for the assembly-first deliverable, what matters is the TYPE of SfBound.\n\nGiven the notes: \"state lambda_pos_finite_height with the finite-part bound as an explicit named hypothesis (SfBound : ∀ n, |S_f n| ≤ B n)\". \n\nI think the honest design:\n- Define `Sf n : ℝ` as the BL finite part (prime-side). Need the formula. Let me check D-036 or E-021 for the definition used.\n\nActually — from BL Thm 2 (I remember now, and the project computed it in E-021): \nS_f(n) = Σ_{j=1}^n ... no. Let me just check the numerics script.\n\nAlso 2. **The base point**: margiñ(8×10⁴) = 16020 > 0 and margiñ′(8×10⁴) > 0 — E-028/E-029 verified numerically. In Lean, proving `0 < marginTilde F 80000` requires evaluating F at √80000+1 — depends on F. If F is the explicit Trudgian majorant F(T) = (T/2π)log(T/2πe) + 7/8 + S_bnd(T), then marginTilde F is fully explicit and the base-point evaluation is a numeric inequality provable in principle by norm_num + bounds (like block_range_bounds but much bigger). That's a finite computation — could be done with interval arithmetic... In Lean this is provable but painful (needs tight rational bounds on log/exp of specific values). Session 011's gotchas mention \"check norm_num digit-bounds by hand (two tight ones failed)\". The base-point evaluation at n = 80000 involves log(80000), log(√80000+1+2) ≈ log(284.8) ≈ 5.65, log log ≈ 1.73, exp(4) etc. Provable with rational squeezes but laborious.\n\nAlternatively: keep the base point as a hypothesis too? No — the notes say SfBound should be THE single named analytic hypothesis. The base-point evaluation is decidable numerical content — \"computational perimeter\" — like the Platt–Trudgian hypothesis style. Hmm, but hRH and hfinite are already hypotheses. The notes say the upgrade is \"verified modulo one named analytic hypothesis + the computational perimeter.\" So the computational perimeter = hRH (Platt–Trudgian), hfinite (Misguich–Voros + our verification). The base-point evaluations margiñ(N₀) > 0, margiñ′(N₀) > 0 are finite numeric facts about explicit functions — they belong to the provable-in-Lean category (elementary real computation), though laborious. I'd tag them as part of the assembly to PROVE (with explicit F), possibly via interval-arithmetic-style rational bounds.\n\nBut wait — F is abstract in marginTilde_convex (with hmaj, hψ hypotheses). For the full assembly we need the EXPLICIT Trudgian F. D-037: N(T) = F(T) + S(T), F(T) = (T/2π)log(T/2πe) + 7/8, |S(T)| ≤ 0.137 log T + 0.443 log log T + 1.588. So the majorant is N(T) ≤ F(T) + S_bnd(T). Hmm, but in marginTilde the \"2 F T\" term is the 2N(T) majorant. So F_assembly(T) = (T/2π)log(T/2πe) + 7/8 + 0.137 log T + 0.443 log log T + 1.588 — needs to be C² (yes, elementary) and hψ needs the D-057 11-block table (already proved for the log-shift blocks! The block table in the Lean file IS the ψ-table for these pieces). Indeed psiOf_log_shift etc. cover log(T+2), log log(T+2), T·log(T+2), etc. The F here has terms (T/2π)log(T/2πe) = (1/2π)(T log(T/2π) − T)... which is T·log(T/c) form — similar to block #5 but with different shift. Hmm, D-057's 11-block table — I should read D-057 to see exactly which F was used and which blocks.\n\nHold on. Let me re-scope. The session-012-notes' plan:\n\n1. **Assembly-first**: state with SfBound hypothesis, discharge the full assembly conditional on it. \"Achievable in a few sessions.\"\n2. **Then triage** what's inside SfBound: Mathlib-tractable pieces vs Trudgian-class pieces. \"It may be correct to draw the trusted perimeter around Trudgian 2014 as published literature... decide deliberately where this one goes.\"\n\nSo for THIS session (012), the goal is step 1: the assembly. The assembly conditional on SfBound needs:\n\n- liCoeff, RHUpTo, LiVerifiedUpTo (exist)\n- Sf : definition (need to choose)\n- B(n) : the explicit bound function (needs F — the zero-count majorant; keep F abstract with hmaj/hψ as in marginTilde_convex, OR instantiate explicit Trudgian F)\n- margin argument: marginTilde_convex (PROVED) + base point + convexity ⟹ margin > 0 on [N₀, N₁]... wait, convex on [20,∞) + margin(N₀) > 0 + margin′(N₀) > 0 ⟹ margin(n) > 0 for n ≥ N₀. That's a real-analysis lemma: convex + positive at a point + positive derivative there ⟹ positive thereafter. Need: convexOn ⟹ for n ≥ N₀, margin(n) ≥ margin(N₀) + margin′(N₀)(n−N₀) > 0. Mathlib: ConvexOn.slope_le... or use deriv monotone: ConvexOn.mono... There's `ConvexOn.deriv_le` or monotonicity of derivative: `ConvexOn.monotoneOn_deriv` (interior). Then margin′(n) ≥ margin′(N₀) > 0 for n > N₀, then mean value theorem gives margin(n) = margin(N₀) + margin′(ξ)(n−N₀) > 0. Doable with Mathlib MVT (exists_deriv_eq_slope / domain version). This is \"convex + base ⟹ positive\" — a clean lemma to prove.\n\n- The bridge N₁ = (T₀−1)²: for n ≤ (T₀−1)², need T = √n + 1 ≤ T₀ to apply RH... wait, actually where does hRH enter?? In B(n), the zeros term: |Σ_{|γ|≤T}| ≤ 2N(T) uses RH-to-T₀ (each |ρ/(ρ−1)|ⁿ = 1 on the line ⟹ |1−(ρ/(ρ−1))ⁿ| ≤ 2). WITHOUT RH, the zeros term isn't ≤ 2N(T) — off-line zeros give |(ρ/(ρ−1))ⁿ| ≠ 1. So hRH is used INSIDE the derivation of B(n) — i.e., inside SfBound's eventual proof, NOT in the assembly-after-SfBound!\n\nHmm wait. Is that right? Let me recheck: B(n) bounds |S_f(n)|, and the bound's derivation uses hRH (bridge condition §6). So if SfBound is taken as a hypothesis, then hRH is not needed for the assembly — it re-enters when proving SfBound. Interesting. But the theorem statement `lambda_pos_finite_height (hRH ...)` keeps hRH in the signature — the assembly proof would then not use hRH (it's used in the eventual SfBound proof). That's fine — Lean allows unused hypotheses (maybe a linter warning). OR: SfBound should be stated conditional on hRH: `(hRH : RHUpTo T₀) → ∀ n ≤ (T₀−1)², |Sf n| ≤ B n`. The cleaner design per the notes: isolate the remaining obligation as a single precisely-typed statement. The statement |S_f n| ≤ B n for n ≤ N₁ is true only because of hRH... but as a standalone Prop it's just a bound that happens to hold. Hmm — actually NO: |S_f(n)| ≤ B(n) for n ≤ N₁ is TRUE only under RH-to-T₀? No wait — S_f(n) is a fixed real number for each n (it's either the prime sum or λ-derived). RH-to-T₀ is a FACT (Platt–Trudgian proved it computationally). So |S_f n| ≤ B n for n ≤ N₁ is simply true (given PT). As a Lean hypothesis it's self-contained.\n\nBut structurally it's more honest to keep hRH visible. Design choice:\n\n```\ntheorem lambda_pos_finite_height\n (hRH : RHUpTo (3 * 10 ^ 12)) (hfinite : LiVerifiedUpTo (5 * 10 ^ 5))\n (SfBound : ∀ n : ℕ, 1 ≤ n → (n:ℝ) ≤ (3*10^12 - 1)^2 → |Sf n| ≤ Bn n) :\n ...\n```\n\nwith the understanding that proving SfBound will consume hRH (via the bridge). And the assembly itself uses only hfinite (for n < N₀) + SfBound + margin.\n\nHmm, but then hRH is unused in the assembly — Lean linter will flag unused variable? It's a theorem binder, not a section variable; unused binders in theorem statements are fine (no linter error, maybe `unusedVariables` linter warning which is not an error). Actually for the paper claim \"verified modulo one named analytic hypothesis + computational perimeter\", the cleanest is:\n\nPerimeter hypotheses: hRH, hfinite (computational facts from literature).\nNamed analytic hypothesis: SfBound (the remaining obligation).\nAssembly: proved.\n\nIf hRH is unused in the assembly, that's actually a FEATURE demonstrating the isolation: all the analytic difficulty sits in SfBound; hRH will be used when discharging SfBound. But then the theorem as stated wouldn't need hRH at all... and the honest statement would be `(SfBound) (hfinite) → ...`. Hmm, but the finite-height theorem's STATEMENT (R-004) assumes RH-to-T₀. If SfBound is a hypothesis, the theorem \"RH-to-T₀ + finite-verification ⟹ λ_n > 0 to N₁\" becomes \"SfBound + finite-verification ⟹ ...\". \n\nI think the right structure, mirroring Zeta23 style:\n\n```\n/-- The remaining analytic obligation: the finite part S_f (BL Thm 2)\nis bounded by the explicit traced B(n) for all n up to N₁. Proof content:\nD-036/D-056 contour bound (Trudgian N(T)/S(T) inside the trusted\nperimeter), bridge via hRH. -/\ndef SfBoundProp : Prop :=\n ∀ n : ℕ, 1 ≤ n → (n : ℝ) ≤ (3 * 10 ^ 12 - 1 : ℝ) ^ 2 → |Sf n| ≤ Bn n\n\ntheorem lambda_pos_finite_height\n (hRH : RHUpTo (3 * 10 ^ 12)) (hfinite : LiVerifiedUpTo (5 * 10 ^ 5))\n (hSf : SfBoundProp) :\n ∀ n : ℕ, 1 ≤ n → (n : ℝ) ≤ (3 * 10 ^ 12 - 1 : ℝ) ^ 2 → 0 < (liCoeff n).re\n```\n\nWhere `Sf n := SInfty n + 1 - (liCoeff n).re` (BL Thm 2 as DEFINITION of the finite part — this is a real design decision. If Sf is defined via liCoeff, then the identity λ_n = S_∞ − S_f + 1 is definitional: λ_n = S_∞ − (S_∞ + 1 − λ_n) + 1 ✓. Then SfBound is genuinely the full remaining content: \"the combination S_∞(n) + 1 − λ_n is bounded by B(n)\". Hmm — but that hides BL Thm 2 inside the definition. The honesty note can document that Sf SHOULD equal the prime-side sum by BL Thm 2, and when triaging, one proves |prime-sum| ≤ B and uses BL identity to transfer. Alternatively define Sf as the prime sum and take the BL identity as part of... no — the notes want ONE named hypothesis. \n\nCleanest: define Sf as the prime-side sum (its own mathematical object), and state SfBound as: |Sf n| ≤ B n, PLUS a separate hypothesis for the identity? That's two hypotheses. OR define Sf as prime-side sum and bundle: `SfBound : (∀ n, (liCoeff n).re = SInfty n - Sf n + 1) ∧ (∀ n ≤ N₁, |Sf n| ≤ Bn n)`? The identity is [PROVED] literature (BL Thm 2) — it could legitimately go into the trusted perimeter like Trudgian. But formalizing the exact prime-sum is extra work in Lean (sum over prime powers, need summability).\n\nDecision: I'll define Sf via the explicit BL finite-part formula IF it's tractable to state, otherwise use the λ-derived definition with a documented honesty note. Let me check what formula E-021/D-036 used for S_f. Let me grep.\n\nAlso need to decide B(n) in Lean: Bn should match marginTilde's internals so that marginTilde F n = sInftyLower n − Bn n + 1 EXACTLY (by ring, like marginTilde_eq_expanded). Looking at marginTilde:\n\nmarginTilde F n = [(1/2)n log n + (C₁−γ/2)n − 4] − (2·F(T) + 4T·((2/3)C₀hat T + 10.5 log(T+2) + 48) + 40·1.3352 + 2(e⁴+1)(7·Hhat T + 3.3) + IIMaj n + 1) + 1\n\nSo define:\n\n```\ndef Bn (F : ℝ → ℝ) (n : ℝ) : ℝ :=\n let T := Real.sqrt n + 1\n 2 * F T + 4 * T * ((2/3) * C0hat T + 10.5 * Real.log (T+2) + 48) +\n 40 * 1.3352 + 2 * (Real.exp 4 + 1) * (7 * Hhat T + 3.3) + IIMaj n + 1\n```\n\nthen marginTilde F n = sInftyLower n − Bn F n + 1 where sInftyLower n = (1/2)n log n + (C₁−γ/2)n − 4. And sInfty_lower_bound gives SInfty n ≥ sInftyLower n for n ≥ 20.\n\nAssembly proof sketch:\n- Given n, 1 ≤ n, n ≤ N₁.\n- Case n ≤ 80000: hfinite n (with 80000 ≤ 5×10⁵) gives 0 < (liCoeff n).re. ✓ (needs n ≤ 5×10⁵ from n ≤ 80000 — norm_num/omega)\n- Case 80000 < n (so n ≥ 80001 ≥ 20):\n - (liCoeff n).re = SInfty n − Sf n + 1 (by BL identity — from Sf definition)\n - ≥ sInftyLower n − Sf n + 1 (sInfty_lower_bound, n ≥ 20) ✓\n - ≥ sInftyLower n − Bn F n + 1 (SfBound + |Sf n| ≤ Bn ⟹ Sf n ≤ Bn... need Sf n ≤ |Sf n| ≤ Bn F n, and sign: λ = S_∞ − S_f + 1 ≥ S_∞ − |S_f| + 1 ≥ slower − B + 1) ✓\n - = marginTilde F n (ring identity) ✓\n - > 0: from marginTilde_convex (convex on Ici 20) + base point marginTilde F 80000 > 0 + deriv marginTilde F 80000 > 0 + the \"convex + base ⟹ pos\" lemma.\n\nWait — careful: N₀ = 80000. But the finite verification covers n ≤ 5×10⁵, and margin positivity covers n ≥ 80000. Overlap: use hfinite for n ≤ 5×10⁵... simplest split at 80000.\n\nAdditional pieces needed:\n1. `Sf` definition + BL identity handling.\n2. `Bn` definition matching marginTilde (ring identity lemma: marginTilde F n = slower n − Bn F n + 1).\n3. `sInftyLower` extracted as a def (currently inline in sInfty_lower_bound).\n4. Explicit F? For the assembly-first step, keep F ABSTRACT with hmaj/hψ hypotheses — same as marginTilde_convex. But then the base point \"marginTilde F 80000 > 0\" can't be proved for abstract F — it becomes part of the hypotheses? Hmm. Two options:\n (a) Keep F abstract; base-point positivity as hypotheses (hbase : 0 < marginTilde F 80000, hbase' : 0 < deriv (marginTilde F) 80000). Then the theorem has: hRH(unused)/hfinite/SfBound/F/hF/hmaj/hψ/hbase/hbase′. That's a lot of hypotheses but each is honest: hmaj (F majorizes N — Trudgian, perimeter), hψ (D-057 block table — PROVED for the explicit blocks... but for abstract F it's a hypothesis), hbase (E-028 numeric facts — provable once F explicit).\n (b) Instantiate the explicit Trudgian F_trud(T) = (T/2π)log(T/2πe) + 7/8 + 0.137 log T + 0.443 log log T + 1.588 (or in shifted form). Then hmaj is \"Trudgian 2014 Thm 1\" — a perimeter/literature hypothesis; hψ is provable via the block table (but blocks are log(T+2)-shifted; F_trud uses log(T/2π) = log T − log 2π — different forms, need the D-057 table exactly as filed. Let me read D-057 to see which F the 11-block table covers.\n\nFrom marginTilde_convex's hψ: `deriv (deriv F) T - deriv F T / (T - 1) < 0` for T ≥ √20+1 — the D-057 table as formalized covers blocks: id, log(t+2), log log(t+2), log²(t+2), log·loglog, loglog², t·log(t+2), t·loglog(t+2) — 8 blocks + F + IIMaj + S = 11. The C0hat/Hhat in marginTilde are built from log(t+2), log log(t+2) — so the F in the Lean assembly is meant to be the explicit Trudgian-style majorant built from THESE blocks. Hmm — C0hat uses log(t+2) not log(t/2π). So the Lean marginTilde already encodes a SHIFTED version of Trudgian's F. D-057 §2 presumably rewrites Trudgian's F(T) = (T/2π)log(T/2πe)+7/8 into t·log(t+2) blocks? Hmm, log(T/2πe) vs log(T+2): for the majorant one needs F(T) ≤ (block-built thing). Let me read D-057 to see.\n\nActually wait — I realize the assembly might not need to resolve this NOW. The session-012 plan step 1 (assembly-first) isolates SfBound as the named hypothesis. F can stay abstract with hmaj/hψ as named sub-hypotheses (they're part of the triage: hmaj = Trudgian = perimeter; hψ = block table = proved for explicit F). The base point: hbase/hbase′ as numeric facts (proved once F explicit — or kept as \"computational perimeter\" items, they're finite decimal evaluations).\n\nHmm, but the notes say the deliverable is \"verified modulo ONE named analytic hypothesis + the computational perimeter.\" So the ideal endpoint of step 1:\n\n`lambda_pos_finite_height (hRH) (hfinite) (hSf : SfBoundProp) : ...` — three hypotheses, where SfBoundProp is the single analytic one, hRH/hfinite the computational perimeter.\n\nBut the margin argument needs F, hmaj, hψ, hbase, hbase′. To get down to just SfBound, those must be DISCHARGED inside the assembly:\n- Choose explicit F (Trudgian blocks, C² — provable).\n- hmaj: Ncount 0 T ≤ F T — this is Trudgian 2014 Thm 1 + Backlund... this is ITSELF a Trudgian-class hypothesis! Per the triage it's \"possibly a permanent perimeter item.\" So for step 1, hmaj stays a hypothesis (literature, like Zeta23's hEF). That's fine — it's part of \"the computational/literature perimeter\" (Trudgian is [PROVED] literature).\n- hψ: for the explicit F, PROVE via the existing block table (the 8 psiOf_*_neg theorems) — this requires F to be a positive combination of exactly those blocks. Need to check D-057 for the explicit F used.\n- hbase/hbase′: numeric evaluations at n = 80000 — provable in principle (rational squeezes on log/exp), laborious; could be left as hypotheses in a first pass with an honesty note (they're E-028/E-029 grid facts... no wait, they're single-point evaluations of EXPLICIT functions, so they're decidable; but Lean-proving tight numeric bounds on log(282.8...) needs care).\n\nPlan for session 012 (this is already a lot — probably multi-sub-stage):\n\nSub-stage 12.1: Design + read D-056/D-057 for exact B(n)/F; decide Sf definition; write the new section of LiSkeleton.lean: Sf, Bn, sInftyLower defs; SfBoundProp; margin identity lemma (ring); the convex-pos lemma (convex+base⟹pos on [N₀,∞)); assembly with hypotheses (hRH)(hfinite)(hSf) + (F)(hF)(hmaj)(hψ)(hbase)(hbase′) initially; compile.\nSub-stage 12.2: Discharge hψ for explicit F via block table (needs the explicit F choice + ψ-linearity lemma: ψ[c₁φ₁+c₂φ₂] = c₁ψ[φ₁]+c₂ψ[φ₂], then sum of negatives). Maybe.\nSub-stage 12.3: Base points via numeric bounds.\nThen triage documentation (D-062) + paper update.\n\nHmm wait — but actually, do I want to restructure so that the FINAL theorem has F instantiated? The triage decision (Trudgian inside perimeter) affects this: if Trudgian N(T)-majorant is a perimeter hypothesis, then hmaj stays as a hypothesis over an explicit F. Let me structure:\n\n```\n/-- The explicit Trudgian-style zero-count majorant (D-057 block form). -/\ndef FTrud (T : ℝ) : ℝ := ... (from D-057)\n\ntheorem lambda_pos_finite_height\n (hRH : RHUpTo (3*10^12)) (hfinite : LiVerifiedUpTo (5*10^5))\n (hN : ∀ T : ℝ, (Ncount 0 T : ℝ) ≤ FTrud T) -- Trudgian 2014 (perimeter)\n (hSf : SfBoundProp FTrud) : -- THE named analytic hypothesis\n ...\n```\n\nWait, but hold on — does Ncount-majorant even enter SfBound or the margin? In marginTilde, \"2·F T\" is the majorant of 2N(T) inside B(n). So B(n) as DEFINED with F IS already the bound; hmaj is used when PROVING SfBound (to bound the zeros term 2N(T) ≤ 2F(T)), not in the margin. So in the assembly-after-SfBound, hmaj is not used! The margin only needs: convexity of marginTilde F (needs hF, hψ) + base points. And hψ for explicit FTrud is provable (block table). hbase provable (numeric).\n\nSo actually the assembly theorem could be:\n\n```\ntheorem lambda_pos_finite_height\n (hRH : RHUpTo (3*10^12)) (hfinite : LiVerifiedUpTo (5*10^5))\n (hSf : SfBoundProp) :\n ∀ n, 1 ≤ n → (n:ℝ) ≤ (3*10^12−1)^2 → 0 < (liCoeff n).re\n```\n\nwith FTrud hard-coded inside Bn and SfBoundProp; hψ proved via blocks; base points proved numerically; hmaj not appearing at all (it's inside SfBound's eventual proof, together with hRH).\n\nThat's EXACTLY \"verified modulo one named analytic hypothesis + the computational perimeter\"! hRH/hfinite = perimeter; hSf = the one named hypothesis. \n\nSo the work for step 1 (this session, maybe 2):\n1. Extract sInftyLower as a def; refactor sInfty_lower_bound to use it (mechanical).\n2. Define FTrud explicitly (from D-057 — need to read what exact F the block table covers; C0hat = 0.433 log(t+2) + 0.886 loglog(t+2) + 2.9 is the C₀ majorant... and the N(T) majorant F in marginTilde is separate — the \"2 F T\" term. What is F? D-057 presumably has F(T) = (T/2π)log(T/2πe) + 7/8 + S_bnd... but expressed in blocks. Hmm — actually looking at marginTilde_convex's hψ hypothesis: it's about an ABSTRACT F. The 11-block table in the file covers the OTHER pieces (C0hat/Hhat pieces), NOT F. So D-057's table = the blocks for C0hat/Hhat/id + IIMaj bound; F was left abstract with its ψ_F < 0 as a hypothesis (\"the D-057 11-block table discharges this for the explicit Trudgian majorant\" says the docstring — so the table INCLUDING an F-part is in D-057; the Lean file proved 8 blocks + left F's ψ as hypothesis).\n\nLet me read D-057 to get the exact table and F.\n\n3. Define Bn F n and prove marginTilde F n = sInftyLower n − Bn F n + 1 (ring).\n4. Prove convex+base ⟹ pos lemma.\n5. State Sf definition + SfBoundProp; prove assembly with (hRH)(hfinite)(hSf) + (F abstract or explicit?).\n\nDecision on F: Two-tier approach might be best:\n- Tier 1 (this session): prove the assembly for ABSTRACT F: `lambda_pos_finite_height' (hfinite) (F) (hF) (hψ) (hbase) (hbase′) (hSf : SfBoundProp F) : ...` — margin part fully proved.\n- Tier 2: instantiate F = FTrud, discharge hψ (block table + linearity), hbase/hbase′ (numeric), leaving the final theorem with exactly (hRH)(hfinite)(hN? no...)(hSf).\n\nHmm, wait — if F is instantiated as FTrud, hmaj disappears from assembly (it's not used there), hF is proved (ContDiff), hψ proved (blocks), hbase/hbase′ proved (numeric). Final: (hRH — UNUSED in assembly!)(hfinite)(hSf). hRH unused — I'd keep it in the signature for the theorem's honest statement (R-004 assumes RH-to-T₀), documenting that within the modular split it's consumed by SfBound's proof. Lean's unusedVariables linter may warn but won't error. Alternatively mark with `_hRH`. But for the paper's claim the signature matters; keep hRH and add a comment. Actually — cleaner: keep hRH in the MAIN theorem and use `include`? No, it's a binder. A warning is acceptable; or name it `_hRH`... but the paper statement wants visible hRH. Compromise: keep `hRH` named; if the linter warns, fine (warnings don't fail builds). Let me check how Zeta23.Final handles similar. Whatever — detail to resolve at compile time.\n\nLet me now read D-057 to get the exact F and block table, and D-056 for the R-bound/B(n) constants (already have from D-037 §4: A = 10.5, B₀ = 48 via D-056; C0hat, Hhat, IIMaj already in Lean). The marginTilde already encodes B(n) — so Bn is literally the subtracted part of marginTilde. \n\nFor FTrud: from D-037: N(T) ≤ F(T) + S_bnd(T) with F(T) = (T/2π)log(T/2πe) + 7/8, S_bnd(T) = 0.137 log T + 0.443 log log T + 1.588. But marginTilde's \"2 F T\" with abstract F suggests the Lean F should be Nmajorant(T) = (T/2π)log(T/2πe) + 7/8 + 0.137 log T + 0.443 log log T + 1.588. Is ψ of THAT negative? Its blocks: T·log T (like block #5 but unshifted), log T, log log T, const. The proved blocks are the +2-shifted versions. ψ[T log T](T) = ? Let me compute: φ = T log T: φ′ = log T + 1, φ″ = 1/T. ψ = 1/T − (log T + 1)/(T−1). For T ≥ 5.47: (T−1) − T(log T + 1) = −1 − T log T < 0 ⟹ ψ < 0. ✓ Easy. φ = log T: ψ = −1/T² − (1/T)/(T−1) < 0 ✓. φ = log log T: φ′ = 1/(T log T), φ″ = −(log T + 1)/(T log T)²; ψ = φ″ − φ′/(T−1) < 0 ✓. φ = const: ψ = 0. φ = T: ψ = −1/(T−1) < 0 (block #2). So ψ[FTrud] = (1/2π)ψ[T log T] + 0.137 ψ[log T] + 0.443 ψ[log log T] + ψ[7/8+1.588 const] all ≤ 0 with the T log T term strictly < 0 ⟹ ψ[FTrud] < 0. All elementary, Mathlib-tractable! No shift needed: log T vs log(T+2) — both fine.\n\nWait, but is the ACTUAL zero-count majorant used in D-057 exactly F(T)+S_bnd(T)? D-037 §4: \"|Σ| ≤ 2N(T) ≤ 2F(T) + 2S_bnd(T)\". So B(n)'s first term 2N(T) is majorized by 2(F(T) + S_bnd(T)). So in Lean, F_assembly(T) := (T/2π)·log(T/2πe) + 7/8 + (0.137 log T + 0.443 log log T + 1.588). But hold on — D-056 repaired constants: \"honest C₀ incl. log log term\" and the R-bound A = 10.5, B₀ = 48. C0hat in Lean: 0.433 log(t+2) + 0.886 log log(t+2) + 2.9. Trudgian S_bnd: 0.137 log T + 0.443 log log T + 1.588 (T ≥ e). Hmm C0hat ≠ S_bnd — C₀(t) = zeros-in-unit-interval majorant = F(t+1)−F(t) + S_bnd(t+1) + S_bnd(t), and Ĉ₀ is the closed-form majorant of THAT (D-056 §2). The F in marginTilde's \"2 F T\" — is it F+S_bnd or something shifted? I need D-056/D-057's exact formulation. Let me read both.\n\nAlso the base points: margiñ(8×10⁴) = 16 020 > 0, margiñ′(8×10⁴) = 3.7 > 0 (D-037 P6). With which F exactly? E-029 has the values. These are numeric facts to be proved in Lean eventually (tier: numeric bounds).\n\nAlso important: D-037 says margin uses \"T = √n + 1 used for the bounds\" — matches marginTilde's `let T := Real.sqrt n + 1`. ✓\n\nOK let me read D-057 and D-056 now. Then design, then write code.\n\nAlso — check Zeta23.Statement for Ncount. The marginTilde_convex signature references `Ncount 0 T`. Let me grep Zeta23 for Ncount.","signature":""},{"type":"text","text":"Research derivation — not malware. The chain is now clear. Reading D-057 and D-056 for the exact majorant `F` and block table, plus checking the Zeta23 types."},{"type":"tool_use","id":"Read_14","name":"Read","input":{"file_path":"D:\\Python\\Quantum\\research\\derivations\\D-057-convexity-proof.md"},"extra_content":null},{"type":"tool_use","id":"Read_15","name":"Read","input":{"file_path":"D:\\Python\\Quantum\\research\\derivations\\D-056-R-bound-repair.md"},"extra_content":null}]