← Session 14 — Phase 5 kickoff: paper draft + honesty audit
thinking (12932 chars)
Conventions clear. Now write the NguyenRH1 package. Files:
research/lean/NguyenRH1/
- lakefile.toml
- lean-toolchain
- NguyenRH1.lean
- NguyenRH1/LiSkeleton.lean
- NguyenRH1/SuzukiSkeleton.lean
- NguyenRH1/PrintAxioms.lean
LiSkeleton.lean content (careful with Mathlib names):
```lean
import Zeta23.Statement -- brings IsNontrivialZero, zeroMult, zerosIn, RiemannHypothesis (Mathlib)
import Mathlib -- heavy; better targeted imports. Mathlib top-level import is fine for skeleton but slow. Use targeted: Mathlib.NumberTheory.LSeries.RiemannZeta, Mathlib.Analysis.SpecialFunctions.Log.Basic etc. For skeleton safety, `import Mathlib` is simplest and guaranteed to have everything; compile time is long but cache covers Mathlib (our file only compiles itself). Importing all of Mathlib in one file is common for scratch. OK.
namespace NguyenRH1
open Zeta23 Complex
/-- R-004 finite-height Li theorem — statement skeleton.
λ_n defined as the zero-sum (convergence content isolated: tsum is 0 if not summable;
the SUMMABILITY is part of the mathematical content to be formalized later). -/
noncomputable def liCoeff (n : ℕ) : ℂ :=
∑' ρ : {ρ // IsNontrivialZero ρ}, (zeroMult ρ : ℂ) * (1 - (1 - 1/ρ)^n)
```
Wait: zeroMult is in Zeta23 namespace. IsNontrivialZero : ℂ → Prop. Subtype {ρ // IsNontrivialZero ρ} — needs ρ : ℂ inference: {ρ : ℂ // IsNontrivialZero ρ}.
1/ρ : ℂ division fine. tsum over a subtype of ℂ: needs TopologicalSpace ℂ ✓, CommMonoidWithZero? tsum needs AddCommMonoid + TopologicalSpace — ℂ ✓. Fintype not needed for ∑' (that's tsum). OK.
But note: this counts with multiplicity via zeroMult — matches λ_n = Σ' (with multiplicity) ✓.
Theorem statement:
```lean
/-- "RH verified to height T₀" as a Prop (Platt–Trudgian T₀ = 3×10¹², interval arithmetic). -/
def RHUpTo (T₀ : ℝ) : Prop :=
∀ ρ : ℂ, IsNontrivialZero ρ → |ρ.im| ≤ T₀ → ρ.re = 1/2
```
Hmm: zerosIn uses T₁ < im ≤ T₂; height to T₀ should include negative im — |ρ.im| ≤ T₀ fine.
```lean
/-- Finite Li verification input (computed: E-011/E-015 to 3000; Misguich–Voros to 5×10⁵). -/
def LiVerifiedUpTo (N : ℕ) : Prop := ∀ n : ℕ, 1 ≤ n → n ≤ N → 0 < (liCoeff n).re
```
Actually λ_n is real (zeros come in conjugate pairs); stating 0 < liCoeff n as complex — better take .re or state liCoeff n = conj... For skeleton: `0 < (liCoeff n).re` fine, note in comment.
Main statement:
```lean
theorem lambda_pos_finite_height
(hRH : RHUpTo (3 * 10^12)) (hfinite : LiVerifiedUpTo (5 * 10^5)) :
∀ n : ℕ, 1 ≤ n → (n : ℝ) ≤ ((3 * 10^12 : ℝ) - 1)^2 → 0 < (liCoeff n).re := by
sorry
```
S_∞ lower bound skeleton:
```lean
/-- Archimedean contribution, exact odd-m identity form (D-037). -/
noncomputable def SInfty (n : ℕ) : ℝ :=
(1 - (Real.log (4 * Real.pi) + Real.eulerMascheroniConstant) / 2) * n - 1 +
∑' m : {m : ℕ // Odd m ∧ 3 ≤ m}, ((1 - 1/(m : ℝ))^n - 1 + n/(m : ℝ))
```
eulerMascheroniConstant exists in Mathlib ✓ (Real.eulerMascheroniConstant).
```lean
theorem sInfty_lower_bound (n : ℕ) (hn : 20 ≤ n) :
(1/2) * n * Real.log n + ((Real.eulerMascheroniConstant - 1 - Real.log (2 * Real.pi))/2 - Real.eulerMascheroniConstant/2) * n - 4 ≤ SInfty n := by sorry
```
Type coercions: n : ℕ used in ℝ expressions need (n : ℝ). Fine.
Margin convexity: the margin function depends on B(n) with C₀, H, N(T)... too much machinery; honest skeleton: state convexity of the explicit assembled function? I'll define margin with the explicit traced bound using Real.log etc. and N(T) as an abstract nonneg function with the Trudgian bound hypothesis? Convexity of margin as we proved is a specific computation. Skeleton option: state `ConvexOn ℝ (Set.Ici 20) marginFun` where marginFun defined explicitly with C₀ as a parameter satisfying a bound hypothesis... but then convexity doesn't follow. Simplest honest skeleton: define C₀ via its explicit Trudgian majorant (0.433 log(t+2) + 2.5 + log log term — honest form from D-056: C₀(t) = ? I'd need the exact formula). Risk of misstating constants. Alternative: skip margin convexity in v1 skeleton, note as next step. Hmm — Appendix B lists it as target (i). Let me include it with C₀ as an explicit function given by the honest Trudgian form. From D-056: "honest C₀ incl. log log term" — I don't have the exact formula in context. To avoid misstatement, I'll state convexity for margin built from a generic C₀ with the hypothesis that C₀ equals the explicit Trudgian majorant... circular.
Decision: v1 skeleton includes: RHUpTo, LiVerifiedUpTo, liCoeff, lambda_pos_finite_height, SInfty + sInfty_lower_bound. Margin convexity: state with margin defined via an abstract bound function B : ℝ → ℝ and hypothesis-driven? No — state it as: `theorem margin_convex (B : ℝ → ℝ) (hB : B = fun n => ...) : ConvexOn ...` — still needs the explicit B.
Pragmatic: include a `marginConvex` statement parameterized by the explicit bound as an opaque constant:
```lean
/-- The traced finite-part bound B(n) (D-037 (4.1)); the explicit formula is the
formalization content — for the skeleton it is an opaque function with its
defining equation as a hypothesis where needed. -/
opaque Bbound : ℝ → ℝ
```
opaque introduces... opaque uses Classical.choice but is axiom-clean (opaque is implemented via axiom? `opaque` in Lean 4 adds an axiom-like opaque constant! It shows in #print axioms? Opaque constants are... they compile to `constant` which IS an axiom. That would violate the audit. Avoid opaque. Use a variable hypothesis instead:
```lean
theorem margin_convex_skeleton (B : ℝ → ℝ)
(hB : ∀ n, B n = <explicit>) : ConvexOn ℝ (Set.Ici 20) (fun n => ...) := sorry
```
The explicit formula is long; I have it from the draft: B(n) = 2N(√n+1) + 4T[⅔C₀(T) + 10.5 log(T+2) + 48] + 40M₀ + 2(e⁴+1)[7H(T)+3.3] + I_I + 1 with N(T), C₀, H needing definitions. N(T) = Riemann–von Mangoldt count — Zeta23 has Ncount! Ncount T₁ T₂ : ℕ. So N(√n+1) := Ncount 0 (√n+1)? zerosIn T₁ T₂ uses T₁ < im ≤ T₂, positive im only; the contour N(T) counts |γ| ≤ T both signs... In the Li context N(T) = # zeros with 0 < γ ≤ T usually. Fine: use Ncount 0 T.
C₀(t): "explicit unit-interval zero count (honest Trudgian form incl. log log)". For the skeleton I can DEFINE C₀ as the counting function (Ncount t (t+1)) and H, and state margin convexity. That's actually faithful! C₀(t) := (Ncount t (t+1) : ℝ), M₀ := 1.3352, H(T) := 3 C₀² + 10.5 log(T+2) + 48. I_I : explicit but I don't have its closed form in context — D-037 has it. For skeleton v1, set I_I as a variable with bound hypothesis? Simpler: include I_I as a parameter function with hypothesis 0 ≤ I_I n ≤ (something)? The convexity proof (D-057) handled I_I via direct bound. Statement-level: include I_I as a free nonneg function and the statement would be false in general...
OK — pragmatic v1: state margin convexity for the explicit function WITH I_I + 1 folded as a function I_I : ℝ → ℝ universally quantified with hypothesis `hI : ∀ n, |I_I n| ≤ 1`?? False statement risk: convexity might depend on I_I's oscillation. D-057's majorant chain handled it — meaning they bounded |I_I''| presumably. Without the details in context, I risk stating something false. Better to leave margin convexity out of v1 skeleton and document why (needs I_I explicit form from D-037 §…; scheduled). OR quickly grep D-037/D-057 for the margin function form. D-057 has "margiñ" — the majorant chain. Let me grep D-057 for the exact margiñ definition to state it faithfully.
Let me not gold-plate: v1 = Li theorem + S_∞ bound + (if D-057 gives a clean closed form) margin convexity. Grep D-057 quickly.
SuzukiSkeleton.lean:
- F(z) := z² ξ(½−iz)/ξ'(½−iz). Mathlib: riemannZeta; completed ξ? Mathlib has `completedRiemannZeta` (Λ(s) = π^(−s/2)Γ(s/2)ζ(s)?) and `completedRiemannZeta₀`. ξ(s) = (s−1)/2 ·... hmm. ξ(s) = ½ s(s−1) π^(−s/2) Γ(s/2) ζ(s) = ½ s(s−1) Λ... Mathlib's completedRiemannZeta is π^(−s/2)Γ(s/2)ζ(s) (I think that's `completedRiemannZeta`), and there's `riemannXi`?? Not sure. Safer: define xi via completedRiemannZeta if it exists: ξ(s) = (s*(s−1)/2) * completedRiemannZeta s — if completedRiemannZeta = π^{−s/2}Γ(s/2)ζ(s), then ξ(s) = ½s(s−1)Λ(s)? The standard: Λ(s) := π^(−s/2)Γ(s/2)ζ(s), ξ(s) := ½ s(s−1) Λ(s). Mathlib's completedRiemannZeta documentation: "completed Riemann zeta function Λ(s)". I'll define
```lean
noncomputable def xi (s : ℂ) : ℂ := s * (s - 1) / 2 * completedRiemannZeta s
```
If completedRiemannZeta doesn't exist under that name in v4.33, compile will fail and I'll fix. It's in Mathlib.NumberTheory.LSeries.RiemannZeta or ZetaModular... I recall `completedRiemannZeta` exists (differentiability of completedRiemannZeta₀ etc.). OK.
- W as a function family parameter: the factorization theorem:
```lean
theorem factorization (W F : ℂ → ℂ) ... -- vacuous if W is free
```
Vacuous statements are dishonest skeletons. Better: state the SHAPE: for the W defined from Suzuki's construction — not available. So Suzuki skeleton can only be: given the deficiency vectors (functions v₊ v₋ : ℝ → ℂ), define
```lean
noncomputable def suzukiW (a θ : ℝ) (v₊ v₋ : ℝ → ℂ) (z : ℂ) : ℂ :=
(z - I) * ∫ x in -a..a, v₊ x * Complex.exp (I*z*x) + Complex.exp (I*θ) * (z + I) * ∫ x in -a..a, v₋ x * Complex.exp (I*z*x)
```
and state: suzukiW a θ v₊ v₋ = F * (R0 + Rτ) — but Rτ is defined as W/F − R₀, making it tautological. The factorization's CONTENT is R₀'s closed form asymptotic. Statement:
```lean
theorem R003_factorization (a θ : ℝ) (v₊ v₋ : ℝ → ℂ) :
suzukiW a θ v₊ v₋ = fun z => F z * (suzukiW a θ v₊ v₋ z / F z) -- trivially true where F ≠ 0
```
Trivial = pointless. Honest approach for Suzuki: state the asymptotic skeleton theorem:
```lean
/-- R-003 content: W/F − R₀ = o(eᵃ)-controlled tail (statement skeleton; the real statement
quantifies the o(eᵃ) uniformly on compacts — D-026/D-059). -/
theorem tail_cancellation_statement : ... := sorry
```
I'll state it as: ∃ R0 Rτ, W = F·(R0 + Rτ) ∧ (R0 explicit) ∧ (Rτ small on compacts). With W a parameter family — acceptable as skeleton since it records the theorem shape. Keep it simple:
```lean
theorem R003_exact_factorization
(a θ : ℝ) (v₊ v₋ : ℝ → ℂ) :
∃ R₀ Rτ : ℂ → ℂ,
(∀ z, suzukiW a θ v₊ v₋ z = Fskeleton z * (R₀ z + Rτ z)) ∧
(∀ z, R₀ z = 2 * Complex.exp (a + I*θ/2) * Complex.sin (a*z - θ/2) + R₀corr z ...) -- too complex
```
Simplify: state existence with R₀ = leading sine + o-term captured as "Rτ' uniformly small"? For skeleton, I'll state:
```lean
theorem R003_exact_factorization (a θ : ℝ) (v₊ v₋ : ℝ → ℂ) :
∃ Rτ : ℂ → ℂ, ∀ z : ℂ,
suzukiW a θ v₊ v₋ z =
Fskeleton z * (2 * cexp (a + I*θ/2) * csin (a*z - θ/2) + Rτ z) := sorry
```
This is faithful in shape (R₀ leading term + tail Rτ; the o(eᵃ) folded into Rτ). Good enough for skeleton with a comment noting the o(eᵃ) precision is the D-026 content.
Hmm wait — is the factorization right? W = F·(R₀ + R_τ) with R₀ = 2e^{a+iθ/2} sin(az−θ/2) + o(eᵃ). Yes.
Also the D1 reduction and Cor 1.6 implication could be stated as Prop-level skeleton:
```lean
/-- Suzuki Corollary 1.6 (limit formula ⟹ RH), statement skeleton. -/
def LimitFormulaHolds : Prop := ∃ θ : ℝ → ℝ, ∃ φ : ℝ → ℂ → ℂ, True -- placeholder shape
```
Too vacuous. Skip; document. Actually a cleaner statement-level target: `theorem cor_1_6_skeleton (h : LimitFormula) : RiemannHypothesis := sorry` where LimitFormula is a Prop parameter — that records the logical shape (some limit formula ⟹ RH). It IS nearly vacuous but serves as the formal anchor for the dependency graph. I'll include a minimal version with honest comments.
Valley skeleton: needs model-space infra. Statement-level: parameterize K : ℝ → ℝ → ℂ (kernel) and state plateau/floor bounds conditional on RH:
```lean
theorem valley_law_skeleton (K : ℝ → ℂ → ℂ) (hK : K = modelKernel) (hRH : RiemannHypothesis) (a : ℝ) (ha : 1 ≤ a) :
(∀ z : ℝ, (K a z).re ≤ 2*a) ∧ ... := sorry
```
with modelKernel undefined... needs a def. Define modelKernel via the variational sup over L²(-a,a)? Could do:
```lean
noncomputable def modelKernelDiagonal (a : ℝ) (Q : (ℝ → ℂ) → ℝ) (z : ℝ) : ℝ :=
⨆ v : {v : ℝ → ℂ // True}, ... -- sup over functions; conditionally complete lattice issues (ℝ not complete lattice — use sSup with bdd above). Skeleton pain.
```
Keep valley skeleton abstract-honest: variable K with hypothesis that it equals the variational supremum (statement of the variational identity as a def via sSup over a set of reals — that's fine: `sSup {x : ℝ | ∃ v : ℝ → ℂ, x = ...}` unbounded sSup = 0 in conditionally complete... sSup of unbounded set is 0 by convention? In Mathlib, sSup of a set not bounded above is 0 (Real). For a skeleton def that's acceptable with a comment.)
OK, I've deliberated enough. Write the three files with honest comments marking SKELETON status. Keep statements simple to maximize compile success; I'll iterate against the compiler once the build is ready.
Check cache progress + start writing files.
Conventions absorbed. Writing the NguyenRH1 package now — three skeleton files with honest SKELETON markers, plus a PrintAxioms script.
tool: Write ok
input
{
"file_path": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\lakefile.toml",
"content": "name = \"NguyenRH1\"\nversion = \"0.1.0\"\ndefaultTargets = [\"NguyenRH1\"]\n\n[leanOptions]\npp.unicode.fun = true\nrelaxedAutoImplicit = false\n\n# Path overrides reusing the vendored zeta-23-lean checkout (tag v1.0) and its\n# already-fetched Mathlib build, so nothing is downloaded or rebuilt twice.\n[[require]]\nname = \"mathlib\"\npath = \"../../../zeta-23-lean/.lake/packages/mathlib\"\n\n[[require]]\nname = \"Zeta23\"\npath = \"../../../zeta-23-lean\"\n\n[[lean_lib]]\nname = \"NguyenRH1\"\n"
}
result 2026-08-20 02:26:11Z → 2026-08-24 17:45:33Z
{
"type": "create",
"filePath": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\patch_s10b.py",
"content": "p = 'NguyenRH1/LiTightR.lean'\nsrc = open(p, encoding='utf-8').read()\n\n# 1. sum_congr per-element form\nold = \"\"\" rw [Finset.sum_congr rfl h2] at h\"\"\"\nnew = \"\"\" rw [Finset.sum_congr rfl (fun i _ => h2 i)] at h\"\"\"\nassert old in src\nsrc = src.replace(old, new)\n\n# 2. HasSum via the of_nonneg bridge\nold = \"\"\" rw [HasSum]\n rw [show (fun N => \u2211 k \u2208 Finset.range N, (1 / ((k : \u211d) + 4) - 1 / ((k : \u211d) + 5)))\n = fun N : \u2115 => 1 / 4 - 1 / ((N : \u211d) + 4) from funext hsum]\n have h4 : (1 : \u211d) / 4 = 1 / 4 - 0 := by ring\n rw [h4]\n exact Filter.Tendsto.sub tendsto_const_nhds hlim\"\"\"\nnew = \"\"\" have hnn : \u2200 k : \u2115, (0 : \u211d) \u2264 1 / ((k : \u211d) + 4) - 1 / ((k : \u211d) + 5) := by\n intro k\n have h1 : 1 / ((k : \u211d) + 5) \u2264 1 / ((k : \u211d) + 4) :=\n one_div_le_one_div_of_le (by positivity : (0 : \u211d) < (k : \u211d) + 4) (by linarith)\n linarith\n rw [hasSum_iff_tendsto_nat_of_nonneg hnn]\n rw [show (fun N => \u2211 k \u2208 Finset.range N, (1 / ((k : \u211d) + 4) - 1 / ((k : \u211d) + 5)))\n = fun N : \u2115 => 1 / 4 - 1 / ((N : \u211d) + 4) from funext hsum]\n have h4 : (1 : \u211d) / 4 = 1 / 4 - 0 := by ring\n rw [h4]\n exact Filter.Tendsto.sub tendsto_const_nhds hlim\"\"\"\nassert old in src\nsrc = src.replace(old, new)\n\n# 3. farW_le_inv_mul_sub hypothesis at call sites (k+5: 2 \u2264 k+5)\nsrc = src.replace(\"farW_le_inv_mul_sub (k := k + 5) (by omega : 1 \u2264 k + 5)\",\n \"farW_le_inv_mul_sub (k := k + 5) (by omega : 2 \u2264 k + 5)\")\n\n# 4. div form: 1/((k+5)*(k+4)) = 1/(k+4)/(k+5) via div_div + mul_comm\nold = \"\"\" _ = 1 / ((k : \u211d) + 4) / ((k : \u211d) + 5) := by\n rw [div_mul_div_comm, mul_comm ((k : \u211d) + 5) ((k : \u211d) + 4), one_mul]\"\"\"\nnew = \"\"\" _ = 1 / ((k : \u211d) + 4) / ((k : \u211d) + 5) := by\n rw [div_div, mul_comm ((k : \u211d) + 5) ((k : \u211d) + 4)]\"\"\"\nassert old in src\nsrc = src.replace(old, new)\n\n# 5. drop the bad third rw in farW_shift5_summable\nold = \"\"\" rw [Real.norm_eq_abs, abs_of_nonneg (farW_nonneg _),\n abs_of_nonneg (by positivity : (0 : \u211d) \u2264 1 / ((k : \u211d) + 4) / ((k : \u211d) + 5))]\n exact h2\"\"\"\nnew = \"\"\" rw [Real.norm_eq_abs, abs_of_nonneg (farW_nonneg _)]\n exact h2\"\"\"\nassert old in src\nsrc = src.replace(old, new)\n\n# 6. farW_exact_four equalities via explicit rw chains\nold = \"\"\" have h1 : farW 1 \u2264 1 / 1.414 := by\n have h2 : farW 1 = 1 / Real.sqrt 2 := by\n rw [farW]\n norm_num\n rw [h2]\n exact one_div_le_one_div_of_le (by norm_num : (0 : \u211d) < 1.414) hsqrt2\n have h2' : farW 2 \u2264 1 / 4.46 := by\n have h3 : farW 2 = 1 / ((2 : \u211d) * Real.sqrt 5) := by\n rw [farW]\n norm_num\n rw [h3]\"\"\"\nnew = \"\"\" have h1 : farW 1 \u2264 1 / 1.414 := by\n have h2 : farW 1 = 1 / Real.sqrt 2 := by\n rw [farW, Nat.cast_one, one_pow, show (1 : \u211d) + 1 = 2 from rfl, one_mul]\n rw [h2]\n exact one_div_le_one_div_of_le (by norm_num : (0 : \u211d) < 1.414) hsqrt2\n have h2' : farW 2 \u2264 1 / 4.46 := by\n have h3 : farW 2 = 1 / ((2 : \u211d) * Real.sqrt 5) := by\n rw [farW, Nat.cast_ofNat, show (2 : \u211d) ^ 2 = 4 by norm_num,\n show (1 : \u211d) + 4 = 5 by norm_num]\n rw [h3]\"\"\"\nassert old in src\nsrc = src.replace(old, new)\n\nold = \"\"\" have h3' : farW 3 \u2264 1 / 9.48 := by\n have h4 : farW 3 = 1 / ((3 : \u211d) * Real.sqrt 10) := by\n rw [farW]\n norm_num\n rw [h4]\"\"\"\nnew = \"\"\" have h3' : farW 3 \u2264 1 / 9.48 := by\n have h4 : farW 3 = 1 / ((3 : \u211d) * Real.sqrt 10) := by\n rw [farW, Nat.cast_ofNat, show (3 : \u211d) ^ 2 = 9 by norm_num,\n show (1 : \u211d) + 9 = 10 by norm_num]\n rw [h4]\"\"\"\nassert old in src\nsrc = src.replace(old, new)\n\nold = \"\"\" have h4' : farW 4 \u2264 1 / 16.492 := by\n have h5 : farW 4 = 1 / ((4 : \u211d) * Real.sqrt 17) := by\n rw [farW]\n norm_num\n rw [h5]\"\"\"\nnew = \"\"\" have h4' : farW 4 \u2264 1 / 16.492 := by\n have h5 : farW 4 = 1 / ((4 : \u211d) * Real.sqrt 17) := by\n rw [farW, Nat.cast_ofNat, show (4 : \u211d) ^ 2 = 16 by norm_num,\n show (1 : \u211d) + 16 = 17 by norm_num]\n rw [h5]\"\"\"\nassert old in src\nsrc = src.replace(old, new)\n\nopen(p, 'w', encoding='utf-8').write(src)\nprint(\"done\")\n",
"structuredPatch": [],
"originalFile": null
}
tool: Write ok
input
{
"file_path": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\lean-toolchain",
"content": "leanprover/lean4:v4.33.0-rc2\n"
}
result 2026-08-20 02:26:11Z → 2026-08-20 02:26:11Z
{
"type": "create",
"filePath": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\lean-toolchain",
"content": "leanprover/lean4:v4.33.0-rc2\n",
"structuredPatch": [],
"originalFile": null
}
tool: Write ok
input
{
"file_path": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1.lean",
"content": "/-\nNguyenRH1.lean \u2014 root of the NGUYEN-RH-1 Phase-5 skeleton library.\n\nStatement-level Lean 4 skeletons for the project's new results\n(paper draft.tex \u00a73), built on zeta-23-lean (tag v1.0) conventions.\nEvery proof is `sorry` at this stage BY DESIGN: this is task 5.1's\nfirst pass \u2014 get the *statements* machine-checked against Mathlib +\nZeta23 types. `#print axioms` on any declaration here shows `sorryAx`\nuntil the corresponding proof is formalized; that marker is the\nhonesty tag, mirrored by the [SKELETON] comments.\n\nContents:\n NguyenRH1.LiSkeleton \u2014 R-004 finite-height Li theorem + the\n archimedean lower bound (draft \u00a73.1)\n NguyenRH1.SuzukiSkeleton \u2014 R-003 exact factorization (draft \u00a73.2)\n NguyenRH1.ValleySkeleton \u2014 valley law statements (draft \u00a73.3)\n-/\nimport NguyenRH1.LiSkeleton\nimport NguyenRH1.SuzukiSkeleton\nimport NguyenRH1.ValleySkeleton\n"
}
result 2026-08-20 02:26:11Z → 2026-08-24 17:47:14Z
{
"type": "create",
"filePath": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\patch_s10c.py",
"content": "p = 'NguyenRH1/LiTightR.lean'\nsrc = open(p, encoding='utf-8').read()\n\n# h3 cast form\nold = \"\"\" have h3 : 1 / ((0 : \u211d) + 4) = 1 / 4 := by norm_num\"\"\"\nnew = \"\"\" have h3 : 1 / (((0 : \u2115) : \u211d) + 4) = 1 / 4 := by norm_num\"\"\"\nassert old in src\nsrc = src.replace(old, new)\n\n# Tendsto ending\nold = \"\"\" rw [hasSum_iff_tendsto_nat_of_nonneg hnn]\n rw [show (fun N => \u2211 k \u2208 Finset.range N, (1 / ((k : \u211d) + 4) - 1 / ((k : \u211d) + 5)))\n = fun N : \u2115 => 1 / 4 - 1 / ((N : \u211d) + 4) from funext hsum]\n have h4 : (1 : \u211d) / 4 = 1 / 4 - 0 := by ring\n rw [h4]\n exact Filter.Tendsto.sub tendsto_const_nhds hlim\"\"\"\nnew = \"\"\" rw [hasSum_iff_tendsto_nat_of_nonneg hnn]\n rw [show (fun N => \u2211 k \u2208 Finset.range N, (1 / ((k : \u211d) + 4) - 1 / ((k : \u211d) + 5)))\n = fun N : \u2115 => 1 / 4 - 1 / ((N : \u211d) + 4) from funext hsum]\n have h4 : Filter.Tendsto (fun N : \u2115 => (1 : \u211d) / 4 - 1 / ((N : \u211d) + 4)) Filter.atTop\n (\ud835\udcdd ((1 : \u211d) / 4 - 0)) :=\n Filter.Tendsto.sub tendsto_const_nhds hlim\n simpa using h4\"\"\"\nassert old in src\nsrc = src.replace(old, new)\n\n# Real.le_sqrt takes 0 \u2264 y (the sqrt argument)\nfor a, b in [(\"(1.414 : \u211d)\", \"(2 : \u211d)\"), (\"(2.23 : \u211d)\", \"(5 : \u211d)\"),\n (\"(3.16 : \u211d)\", \"(10 : \u211d)\"), (\"(4.123 : \u211d)\", \"(17 : \u211d)\")]:\n old = f\"rw [Real.le_sqrt (by norm_num : (0 : \u211d) \u2264 {a})]\"\n new = f\"rw [Real.le_sqrt (by norm_num : (0 : \u211d) \u2264 {b})]\"\n assert old in src, old\n src = src.replace(old, new)\n\n# 1+1 = 2 not rfl\nold = \"\"\" rw [farW, Nat.cast_one, one_pow, show (1 : \u211d) + 1 = 2 from rfl, one_mul]\"\"\"\nnew = \"\"\" rw [farW, Nat.cast_one, one_pow, show (1 : \u211d) + 1 = 2 by norm_num, one_mul]\"\"\"\nassert old in src\nsrc = src.replace(old, new)\n\n# the remaining \u27e8_, tsum_...\u27e9 in farW_tsum_le\nold = \"\"\" apply Summable.tsum_le_tsum _ farW_shift5_summable \u27e8_, tsum_one_div_four_sub_telescope\u27e9\"\"\"\nnew = \"\"\" apply Summable.tsum_le_tsum _ farW_shift5_summable summable_one_div_four_sub_telescope\"\"\"\nassert old in src\nsrc = src.replace(old, new)\n\nopen(p, 'w', encoding='utf-8').write(src)\nprint(\"done\")\n",
"structuredPatch": [],
"originalFile": null
}
raw content_json (database row)
[{"type":"thinking","thinking":"Conventions clear. Now write the NguyenRH1 package. Files:\n\nresearch/lean/NguyenRH1/\n- lakefile.toml\n- lean-toolchain\n- NguyenRH1.lean\n- NguyenRH1/LiSkeleton.lean\n- NguyenRH1/SuzukiSkeleton.lean\n- NguyenRH1/PrintAxioms.lean\n\nLiSkeleton.lean content (careful with Mathlib names):\n```lean\nimport Zeta23.Statement -- brings IsNontrivialZero, zeroMult, zerosIn, RiemannHypothesis (Mathlib)\nimport Mathlib -- heavy; better targeted imports. Mathlib top-level import is fine for skeleton but slow. Use targeted: Mathlib.NumberTheory.LSeries.RiemannZeta, Mathlib.Analysis.SpecialFunctions.Log.Basic etc. For skeleton safety, `import Mathlib` is simplest and guaranteed to have everything; compile time is long but cache covers Mathlib (our file only compiles itself). Importing all of Mathlib in one file is common for scratch. OK.\n\nnamespace NguyenRH1\n\nopen Zeta23 Complex\n\n/-- R-004 finite-height Li theorem — statement skeleton.\n λ_n defined as the zero-sum (convergence content isolated: tsum is 0 if not summable;\n the SUMMABILITY is part of the mathematical content to be formalized later). -/\nnoncomputable def liCoeff (n : ℕ) : ℂ :=\n ∑' ρ : {ρ // IsNontrivialZero ρ}, (zeroMult ρ : ℂ) * (1 - (1 - 1/ρ)^n)\n```\nWait: zeroMult is in Zeta23 namespace. IsNontrivialZero : ℂ → Prop. Subtype {ρ // IsNontrivialZero ρ} — needs ρ : ℂ inference: {ρ : ℂ // IsNontrivialZero ρ}. \n\n1/ρ : ℂ division fine. tsum over a subtype of ℂ: needs TopologicalSpace ℂ ✓, CommMonoidWithZero? tsum needs AddCommMonoid + TopologicalSpace — ℂ ✓. Fintype not needed for ∑' (that's tsum). OK.\n\nBut note: this counts with multiplicity via zeroMult — matches λ_n = Σ' (with multiplicity) ✓.\n\nTheorem statement:\n```lean\n/-- \"RH verified to height T₀\" as a Prop (Platt–Trudgian T₀ = 3×10¹², interval arithmetic). -/\ndef RHUpTo (T₀ : ℝ) : Prop :=\n ∀ ρ : ℂ, IsNontrivialZero ρ → |ρ.im| ≤ T₀ → ρ.re = 1/2\n```\nHmm: zerosIn uses T₁ < im ≤ T₂; height to T₀ should include negative im — |ρ.im| ≤ T₀ fine.\n\n```lean\n/-- Finite Li verification input (computed: E-011/E-015 to 3000; Misguich–Voros to 5×10⁵). -/\ndef LiVerifiedUpTo (N : ℕ) : Prop := ∀ n : ℕ, 1 ≤ n → n ≤ N → 0 < (liCoeff n).re\n```\nActually λ_n is real (zeros come in conjugate pairs); stating 0 < liCoeff n as complex — better take .re or state liCoeff n = conj... For skeleton: `0 < (liCoeff n).re` fine, note in comment.\n\nMain statement:\n```lean\ntheorem lambda_pos_finite_height\n (hRH : RHUpTo (3 * 10^12)) (hfinite : LiVerifiedUpTo (5 * 10^5)) :\n ∀ n : ℕ, 1 ≤ n → (n : ℝ) ≤ ((3 * 10^12 : ℝ) - 1)^2 → 0 < (liCoeff n).re := by\n sorry\n```\n\nS_∞ lower bound skeleton:\n```lean\n/-- Archimedean contribution, exact odd-m identity form (D-037). -/\nnoncomputable def SInfty (n : ℕ) : ℝ :=\n (1 - (Real.log (4 * Real.pi) + Real.eulerMascheroniConstant) / 2) * n - 1 +\n ∑' m : {m : ℕ // Odd m ∧ 3 ≤ m}, ((1 - 1/(m : ℝ))^n - 1 + n/(m : ℝ))\n```\neulerMascheroniConstant exists in Mathlib ✓ (Real.eulerMascheroniConstant).\n\n```lean\ntheorem sInfty_lower_bound (n : ℕ) (hn : 20 ≤ n) :\n (1/2) * n * Real.log n + ((Real.eulerMascheroniConstant - 1 - Real.log (2 * Real.pi))/2 - Real.eulerMascheroniConstant/2) * n - 4 ≤ SInfty n := by sorry\n```\nType coercions: n : ℕ used in ℝ expressions need (n : ℝ). Fine.\n\nMargin convexity: the margin function depends on B(n) with C₀, H, N(T)... too much machinery; honest skeleton: state convexity of the explicit assembled function? I'll define margin with the explicit traced bound using Real.log etc. and N(T) as an abstract nonneg function with the Trudgian bound hypothesis? Convexity of margin as we proved is a specific computation. Skeleton option: state `ConvexOn ℝ (Set.Ici 20) marginFun` where marginFun defined explicitly with C₀ as a parameter satisfying a bound hypothesis... but then convexity doesn't follow. Simplest honest skeleton: define C₀ via its explicit Trudgian majorant (0.433 log(t+2) + 2.5 + log log term — honest form from D-056: C₀(t) = ? I'd need the exact formula). Risk of misstating constants. Alternative: skip margin convexity in v1 skeleton, note as next step. Hmm — Appendix B lists it as target (i). Let me include it with C₀ as an explicit function given by the honest Trudgian form. From D-056: \"honest C₀ incl. log log term\" — I don't have the exact formula in context. To avoid misstatement, I'll state convexity for margin built from a generic C₀ with the hypothesis that C₀ equals the explicit Trudgian majorant... circular.\n\nDecision: v1 skeleton includes: RHUpTo, LiVerifiedUpTo, liCoeff, lambda_pos_finite_height, SInfty + sInfty_lower_bound. Margin convexity: state with margin defined via an abstract bound function B : ℝ → ℝ and hypothesis-driven? No — state it as: `theorem margin_convex (B : ℝ → ℝ) (hB : B = fun n => ...) : ConvexOn ...` — still needs the explicit B. \n\nPragmatic: include a `marginConvex` statement parameterized by the explicit bound as an opaque constant:\n```lean\n/-- The traced finite-part bound B(n) (D-037 (4.1)); the explicit formula is the\n formalization content — for the skeleton it is an opaque function with its\n defining equation as a hypothesis where needed. -/\nopaque Bbound : ℝ → ℝ\n```\nopaque introduces... opaque uses Classical.choice but is axiom-clean (opaque is implemented via axiom? `opaque` in Lean 4 adds an axiom-like opaque constant! It shows in #print axioms? Opaque constants are... they compile to `constant` which IS an axiom. That would violate the audit. Avoid opaque. Use a variable hypothesis instead:\n\n```lean\ntheorem margin_convex_skeleton (B : ℝ → ℝ)\n (hB : ∀ n, B n = <explicit>) : ConvexOn ℝ (Set.Ici 20) (fun n => ...) := sorry\n```\nThe explicit formula is long; I have it from the draft: B(n) = 2N(√n+1) + 4T[⅔C₀(T) + 10.5 log(T+2) + 48] + 40M₀ + 2(e⁴+1)[7H(T)+3.3] + I_I + 1 with N(T), C₀, H needing definitions. N(T) = Riemann–von Mangoldt count — Zeta23 has Ncount! Ncount T₁ T₂ : ℕ. So N(√n+1) := Ncount 0 (√n+1)? zerosIn T₁ T₂ uses T₁ < im ≤ T₂, positive im only; the contour N(T) counts |γ| ≤ T both signs... In the Li context N(T) = # zeros with 0 < γ ≤ T usually. Fine: use Ncount 0 T.\n\nC₀(t): \"explicit unit-interval zero count (honest Trudgian form incl. log log)\". For the skeleton I can DEFINE C₀ as the counting function (Ncount t (t+1)) and H, and state margin convexity. That's actually faithful! C₀(t) := (Ncount t (t+1) : ℝ), M₀ := 1.3352, H(T) := 3 C₀² + 10.5 log(T+2) + 48. I_I : explicit but I don't have its closed form in context — D-037 has it. For skeleton v1, set I_I as a variable with bound hypothesis? Simpler: include I_I as a parameter function with hypothesis 0 ≤ I_I n ≤ (something)? The convexity proof (D-057) handled I_I via direct bound. Statement-level: include I_I as a free nonneg function and the statement would be false in general... \n\nOK — pragmatic v1: state margin convexity for the explicit function WITH I_I + 1 folded as a function I_I : ℝ → ℝ universally quantified with hypothesis `hI : ∀ n, |I_I n| ≤ 1`?? False statement risk: convexity might depend on I_I's oscillation. D-057's majorant chain handled it — meaning they bounded |I_I''| presumably. Without the details in context, I risk stating something false. Better to leave margin convexity out of v1 skeleton and document why (needs I_I explicit form from D-037 §…; scheduled). OR quickly grep D-037/D-057 for the margin function form. D-057 has \"margiñ\" — the majorant chain. Let me grep D-057 for the exact margiñ definition to state it faithfully.\n\nLet me not gold-plate: v1 = Li theorem + S_∞ bound + (if D-057 gives a clean closed form) margin convexity. Grep D-057 quickly.\n\nSuzukiSkeleton.lean:\n- F(z) := z² ξ(½−iz)/ξ'(½−iz). Mathlib: riemannZeta; completed ξ? Mathlib has `completedRiemannZeta` (Λ(s) = π^(−s/2)Γ(s/2)ζ(s)?) and `completedRiemannZeta₀`. ξ(s) = (s−1)/2 ·... hmm. ξ(s) = ½ s(s−1) π^(−s/2) Γ(s/2) ζ(s) = ½ s(s−1) Λ... Mathlib's completedRiemannZeta is π^(−s/2)Γ(s/2)ζ(s) (I think that's `completedRiemannZeta`), and there's `riemannXi`?? Not sure. Safer: define xi via completedRiemannZeta if it exists: ξ(s) = (s*(s−1)/2) * completedRiemannZeta s — if completedRiemannZeta = π^{−s/2}Γ(s/2)ζ(s), then ξ(s) = ½s(s−1)Λ(s)? The standard: Λ(s) := π^(−s/2)Γ(s/2)ζ(s), ξ(s) := ½ s(s−1) Λ(s). Mathlib's completedRiemannZeta documentation: \"completed Riemann zeta function Λ(s)\". I'll define\n```lean\nnoncomputable def xi (s : ℂ) : ℂ := s * (s - 1) / 2 * completedRiemannZeta s\n```\nIf completedRiemannZeta doesn't exist under that name in v4.33, compile will fail and I'll fix. It's in Mathlib.NumberTheory.LSeries.RiemannZeta or ZetaModular... I recall `completedRiemannZeta` exists (differentiability of completedRiemannZeta₀ etc.). OK.\n\n- W as a function family parameter: the factorization theorem:\n```lean\ntheorem factorization (W F : ℂ → ℂ) ... -- vacuous if W is free\n```\nVacuous statements are dishonest skeletons. Better: state the SHAPE: for the W defined from Suzuki's construction — not available. So Suzuki skeleton can only be: given the deficiency vectors (functions v₊ v₋ : ℝ → ℂ), define\n```lean\nnoncomputable def suzukiW (a θ : ℝ) (v₊ v₋ : ℝ → ℂ) (z : ℂ) : ℂ :=\n (z - I) * ∫ x in -a..a, v₊ x * Complex.exp (I*z*x) + Complex.exp (I*θ) * (z + I) * ∫ x in -a..a, v₋ x * Complex.exp (I*z*x)\n```\nand state: suzukiW a θ v₊ v₋ = F * (R0 + Rτ) — but Rτ is defined as W/F − R₀, making it tautological. The factorization's CONTENT is R₀'s closed form asymptotic. Statement: \n```lean\ntheorem R003_factorization (a θ : ℝ) (v₊ v₋ : ℝ → ℂ) :\n suzukiW a θ v₊ v₋ = fun z => F z * (suzukiW a θ v₊ v₋ z / F z) -- trivially true where F ≠ 0\n```\nTrivial = pointless. Honest approach for Suzuki: state the asymptotic skeleton theorem:\n```lean\n/-- R-003 content: W/F − R₀ = o(eᵃ)-controlled tail (statement skeleton; the real statement\n quantifies the o(eᵃ) uniformly on compacts — D-026/D-059). -/\ntheorem tail_cancellation_statement : ... := sorry\n```\nI'll state it as: ∃ R0 Rτ, W = F·(R0 + Rτ) ∧ (R0 explicit) ∧ (Rτ small on compacts). With W a parameter family — acceptable as skeleton since it records the theorem shape. Keep it simple:\n\n```lean\ntheorem R003_exact_factorization\n (a θ : ℝ) (v₊ v₋ : ℝ → ℂ) :\n ∃ R₀ Rτ : ℂ → ℂ,\n (∀ z, suzukiW a θ v₊ v₋ z = Fskeleton z * (R₀ z + Rτ z)) ∧\n (∀ z, R₀ z = 2 * Complex.exp (a + I*θ/2) * Complex.sin (a*z - θ/2) + R₀corr z ...) -- too complex\n```\nSimplify: state existence with R₀ = leading sine + o-term captured as \"Rτ' uniformly small\"? For skeleton, I'll state:\n\n```lean\ntheorem R003_exact_factorization (a θ : ℝ) (v₊ v₋ : ℝ → ℂ) :\n ∃ Rτ : ℂ → ℂ, ∀ z : ℂ,\n suzukiW a θ v₊ v₋ z =\n Fskeleton z * (2 * cexp (a + I*θ/2) * csin (a*z - θ/2) + Rτ z) := sorry\n```\nThis is faithful in shape (R₀ leading term + tail Rτ; the o(eᵃ) folded into Rτ). Good enough for skeleton with a comment noting the o(eᵃ) precision is the D-026 content.\n\nHmm wait — is the factorization right? W = F·(R₀ + R_τ) with R₀ = 2e^{a+iθ/2} sin(az−θ/2) + o(eᵃ). Yes.\n\nAlso the D1 reduction and Cor 1.6 implication could be stated as Prop-level skeleton:\n```lean\n/-- Suzuki Corollary 1.6 (limit formula ⟹ RH), statement skeleton. -/\ndef LimitFormulaHolds : Prop := ∃ θ : ℝ → ℝ, ∃ φ : ℝ → ℂ → ℂ, True -- placeholder shape\n```\nToo vacuous. Skip; document. Actually a cleaner statement-level target: `theorem cor_1_6_skeleton (h : LimitFormula) : RiemannHypothesis := sorry` where LimitFormula is a Prop parameter — that records the logical shape (some limit formula ⟹ RH). It IS nearly vacuous but serves as the formal anchor for the dependency graph. I'll include a minimal version with honest comments.\n\nValley skeleton: needs model-space infra. Statement-level: parameterize K : ℝ → ℝ → ℂ (kernel) and state plateau/floor bounds conditional on RH:\n```lean\ntheorem valley_law_skeleton (K : ℝ → ℂ → ℂ) (hK : K = modelKernel) (hRH : RiemannHypothesis) (a : ℝ) (ha : 1 ≤ a) :\n (∀ z : ℝ, (K a z).re ≤ 2*a) ∧ ... := sorry\n```\nwith modelKernel undefined... needs a def. Define modelKernel via the variational sup over L²(-a,a)? Could do:\n```lean\nnoncomputable def modelKernelDiagonal (a : ℝ) (Q : (ℝ → ℂ) → ℝ) (z : ℝ) : ℝ :=\n ⨆ v : {v : ℝ → ℂ // True}, ... -- sup over functions; conditionally complete lattice issues (ℝ not complete lattice — use sSup with bdd above). Skeleton pain.\n```\nKeep valley skeleton abstract-honest: variable K with hypothesis that it equals the variational supremum (statement of the variational identity as a def via sSup over a set of reals — that's fine: `sSup {x : ℝ | ∃ v : ℝ → ℂ, x = ...}` unbounded sSup = 0 in conditionally complete... sSup of unbounded set is 0 by convention? In Mathlib, sSup of a set not bounded above is 0 (Real). For a skeleton def that's acceptable with a comment.)\n\nOK, I've deliberated enough. Write the three files with honest comments marking SKELETON status. Keep statements simple to maximize compile success; I'll iterate against the compiler once the build is ready.\n\nCheck cache progress + start writing files.","signature":""},{"type":"text","text":"Conventions absorbed. Writing the NguyenRH1 package now — three skeleton files with honest SKELETON markers, plus a PrintAxioms script."},{"type":"tool_use","id":"Write_83","name":"Write","input":{"file_path":"D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\lakefile.toml","content":"name = \"NguyenRH1\"\nversion = \"0.1.0\"\ndefaultTargets = [\"NguyenRH1\"]\n\n[leanOptions]\npp.unicode.fun = true\nrelaxedAutoImplicit = false\n\n# Path overrides reusing the vendored zeta-23-lean checkout (tag v1.0) and its\n# already-fetched Mathlib build, so nothing is downloaded or rebuilt twice.\n[[require]]\nname = \"mathlib\"\npath = \"../../../zeta-23-lean/.lake/packages/mathlib\"\n\n[[require]]\nname = \"Zeta23\"\npath = \"../../../zeta-23-lean\"\n\n[[lean_lib]]\nname = \"NguyenRH1\"\n"},"extra_content":null},{"type":"tool_use","id":"Write_84","name":"Write","input":{"file_path":"D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\lean-toolchain","content":"leanprover/lean4:v4.33.0-rc2\n"},"extra_content":null},{"type":"tool_use","id":"Write_85","name":"Write","input":{"file_path":"D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1.lean","content":"/-\nNguyenRH1.lean — root of the NGUYEN-RH-1 Phase-5 skeleton library.\n\nStatement-level Lean 4 skeletons for the project's new results\n(paper draft.tex §3), built on zeta-23-lean (tag v1.0) conventions.\nEvery proof is `sorry` at this stage BY DESIGN: this is task 5.1's\nfirst pass — get the *statements* machine-checked against Mathlib +\nZeta23 types. `#print axioms` on any declaration here shows `sorryAx`\nuntil the corresponding proof is formalized; that marker is the\nhonesty tag, mirrored by the [SKELETON] comments.\n\nContents:\n NguyenRH1.LiSkeleton — R-004 finite-height Li theorem + the\n archimedean lower bound (draft §3.1)\n NguyenRH1.SuzukiSkeleton — R-003 exact factorization (draft §3.2)\n NguyenRH1.ValleySkeleton — valley law statements (draft §3.3)\n-/\nimport NguyenRH1.LiSkeleton\nimport NguyenRH1.SuzukiSkeleton\nimport NguyenRH1.ValleySkeleton\n"},"extra_content":null}]