Skip to content

Commit 96329e8

Browse files
author
TNFR AI Agent
committed
feat(riemann): P43 - chi-twisted Paley-gap consistency diagnostic
L-track analogue of zeta-track P25 (paley_gap_coercivity.py). Transports the Paley-gap philosophy of Martinez Gamo (Zenodo 10.5281/zenodo.17665853 v2, Nov 2025) onto the chi-twisted side for every primitive real Dirichlet character chi_3, chi_4, chi_5. Compares three representations of -L'(s,chi)/L(s,chi): P32 closed-form weighted spectrum (tnfr_log_l_derivative), P34 chi-twisted weighted spectral trace (twisted_weighted_spectral_trace), and classical truncated Dirichlet sum (classical_log_l_derivative). Forms three absolute Paley-gap quantities g_P32, g_P34, g_cross = |Z_P34 - Z_P32|. Empirical results on (n_primes, k_max, N_max_cls) = (18, 5, 50000), sigma in [1.5, 4.0] with N=11: at J_0 = 0 the decoupled cross gap collapses to machine precision (chi_3 5.55e-17, chi_4 4.16e-17, chi_5 1.11e-16) -- Paley-style algebraic identity between P32 and P34 on the L-track, regression test. At J_0 = 1e-2 the coupling-induced cross gap jumps to O(1e-5) (chi_3 1.01e-5, chi_4 8.25e-6, chi_5 1.51e-5), twelve orders of magnitude above noise; clean structural-deformation signal free of classical-truncation noise which contaminates g_P32 at 1e-3 to 1e-2 level. Roadmap consolidation: original P43/P44 entries (stratified, adaptive coercivity) were absorbed into P42 (twisted_coercivity_uniform.py) since the zeta-track precedent puts P22+P23+P24 in one module. P43 is now reassigned to the P25 Paley-gap analogue. Honest scope: P43 is a consistency diagnostic at coupling zero and a deformation magnitude at coupling positive. Vanishing of g_cross at J_0 = 0 is necessary but not sufficient for any structural positivity claim and not connected to GRH localisation; it is a regression test selecting consistent realisations, not a coercivity certificate. Does NOT prove GRH for any L(s, chi), does NOT extend to complex characters, does NOT advance the P42 interval-coercivity certificate, does NOT advance G4 = RH. Files: src/tnfr/riemann/twisted_paley_gap_coercivity.py (new), src/tnfr/riemann/__init__.py (5 exports wired), examples/70_twisted_paley_gap_coercivity_demo.py (new), theory/TNFR_RIEMANN_RESEARCH_NOTES.md (sec 13vicies-secundo + 19.1 P43 row).
1 parent 2963a3d commit 96329e8

4 files changed

Lines changed: 697 additions & 0 deletions

File tree

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
"""P43 chi-twisted Paley-gap coercivity demo.
2+
3+
L-track analogue of the zeta-track P25 demo
4+
(examples/52_paley_gap_coercivity_demo.py). Transports the
5+
Paley-gap philosophy of Mart\u00ednez Gamo, *Spectral note: Paley
6+
gap via lambda_2 (residue circulants)*, Zenodo
7+
10.5281/zenodo.17665853 v2 (November 2025), to the chi-twisted
8+
TNFR-Riemann program for primitive real Dirichlet characters
9+
chi_3, chi_4, chi_5.
10+
11+
Computes three chi-twisted Paley-gap quantities over a real
12+
sigma-grid:
13+
14+
g_P32(sigma) = |Z_P32(sigma, chi) - Z_classical(sigma, chi)|
15+
g_P34(sigma) = |Z_P34(sigma, chi) - Z_classical(sigma, chi)|
16+
g_cross(sigma) = |Z_P34(sigma, chi) - Z_P32(sigma, chi)|
17+
18+
Two bundles per character are exercised:
19+
20+
[A] Decoupled (coupling = 0) -- Paley-style identity expected:
21+
g_cross collapses to machine precision for every sigma and
22+
every chi. This is a regression test, not a discovery.
23+
24+
[B] Weakly coupled (coupling = 1e-2) -- coupling-induced cross
25+
gap appears. This is the diagnostic signal: it quantifies
26+
how strongly inter-ladder coupling deforms the chi-twisted
27+
prime-ladder identity, free of classical-truncation noise.
28+
29+
HONEST SCOPE: this is a consistency diagnostic, not a proof of
30+
uniform coercivity and not a proof of the Generalised Riemann
31+
Hypothesis for L(s, chi). The Zenodo source note itself disclaims
32+
primality proof status; P43 inherits the same scope at the L-track
33+
coercivity level. Gap G4-chi (GRH localisation on Re(s) = 1/2 for
34+
L(s, chi)) is NOT addressed by P43.
35+
"""
36+
37+
from __future__ import annotations
38+
39+
import sys
40+
41+
import numpy as np
42+
43+
from tnfr.riemann.dirichlet_l import (
44+
real_character_mod_3,
45+
real_character_mod_4,
46+
real_character_mod_5,
47+
)
48+
from tnfr.riemann.twisted_paley_gap_coercivity import sweep_twisted_paley_gap
49+
from tnfr.riemann.twisted_prime_ladder_hamiltonian import (
50+
build_twisted_prime_ladder_hamiltonian,
51+
)
52+
53+
54+
def _ensure_utf8_stdout() -> None:
55+
try:
56+
sys.stdout.reconfigure(encoding="utf-8") # type: ignore[attr-defined]
57+
except Exception:
58+
pass
59+
60+
61+
def _print_sweep_table(sweep) -> None:
62+
print(
63+
f" {'sigma':>8s} {'g_P32':>14s} "
64+
f"{'g_P34':>14s} {'g_cross':>14s}"
65+
)
66+
for s, g32, g34, gc in zip(
67+
sweep.sigmas, sweep.g_p32, sweep.g_p34, sweep.g_cross,
68+
):
69+
print(f" {s:>8.3f} {g32:>14.6e} {g34:>14.6e} {gc:>14.6e}")
70+
71+
72+
def main() -> int:
73+
_ensure_utf8_stdout()
74+
75+
n_primes = 18
76+
max_power = 5
77+
sigmas = np.linspace(1.5, 4.0, 11)
78+
n_max_classical = 50_000
79+
coupling_b = 1.0e-2
80+
81+
characters = [
82+
("chi_3", real_character_mod_3()),
83+
("chi_4", real_character_mod_4()),
84+
("chi_5", real_character_mod_5()),
85+
]
86+
87+
print("=" * 78)
88+
print("P43 CHI-TWISTED PALEY-GAP COERCIVITY DEMO")
89+
print("(L-track analogue of P25; after Mart\u00ednez Gamo, "
90+
"Zenodo 17665853 v2, 2025)")
91+
print("=" * 78)
92+
print(f"n_primes = {n_primes}")
93+
print(f"max_power = {max_power}")
94+
print(
95+
f"sigma grid = [{sigmas[0]:.3f}, {sigmas[-1]:.3f}],"
96+
f" {sigmas.size} points"
97+
)
98+
print(f"n_max_classical = {n_max_classical}")
99+
print(f"coupling (B) = {coupling_b:.1e}")
100+
print()
101+
print(
102+
"HONEST SCOPE: consistency diagnostic only. Does NOT prove\n"
103+
"GRH for any L(s, chi); does NOT advance G4 = RH."
104+
)
105+
print()
106+
107+
summary_rows = []
108+
109+
for name, chi in characters:
110+
print("=" * 78)
111+
print(f"CHARACTER {name} (modulus q = {chi.modulus})")
112+
print("=" * 78)
113+
114+
# --------------------------------------------------------------
115+
# [A] Decoupled bundle: Paley-style identity expected
116+
# --------------------------------------------------------------
117+
bundle_a = build_twisted_prime_ladder_hamiltonian(
118+
chi=chi,
119+
n_primes=n_primes,
120+
max_power=max_power,
121+
coupling=0.0,
122+
)
123+
sweep_a = sweep_twisted_paley_gap(
124+
bundle_a, chi, sigmas, n_max_classical=n_max_classical,
125+
)
126+
print(f"[A] {name} decoupled bundle (coupling = 0)")
127+
print(" " + sweep_a.summary())
128+
print()
129+
_print_sweep_table(sweep_a)
130+
print()
131+
132+
# --------------------------------------------------------------
133+
# [B] Weakly coupled bundle: cross gap should appear
134+
# --------------------------------------------------------------
135+
bundle_b = build_twisted_prime_ladder_hamiltonian(
136+
chi=chi,
137+
n_primes=n_primes,
138+
max_power=max_power,
139+
coupling=coupling_b,
140+
)
141+
sweep_b = sweep_twisted_paley_gap(
142+
bundle_b, chi, sigmas, n_max_classical=n_max_classical,
143+
)
144+
print(f"[B] {name} weakly coupled bundle (coupling = {coupling_b:.1e})")
145+
print(" " + sweep_b.summary())
146+
print()
147+
_print_sweep_table(sweep_b)
148+
print()
149+
150+
summary_rows.append(
151+
(
152+
name,
153+
chi.modulus,
154+
sweep_a.max_g_cross,
155+
sweep_b.max_g_cross,
156+
sweep_a.max_g_p32,
157+
sweep_b.max_g_p32,
158+
)
159+
)
160+
161+
# ------------------------------------------------------------------
162+
# Cross-character summary
163+
# ------------------------------------------------------------------
164+
print("=" * 78)
165+
print("CROSS-CHARACTER SUMMARY (worst-case Paley-gaps)")
166+
print("=" * 78)
167+
print(
168+
f" {'chi':>6s} {'q':>3s} "
169+
f"{'max g_cross [A]':>18s} {'max g_cross [B]':>18s} "
170+
f"{'max g_P32 [A]':>14s} {'max g_P32 [B]':>14s}"
171+
)
172+
for name, q, gxa, gxb, gpa, gpb in summary_rows:
173+
print(
174+
f" {name:>6s} {q:>3d} "
175+
f"{gxa:>18.3e} {gxb:>18.3e} "
176+
f"{gpa:>14.3e} {gpb:>14.3e}"
177+
)
178+
print()
179+
180+
# ------------------------------------------------------------------
181+
# Interpretation
182+
# ------------------------------------------------------------------
183+
print("-" * 78)
184+
print("INTERPRETATION (chi-twisted Paley-gap philosophy)")
185+
print("-" * 78)
186+
print(
187+
" - g_P32 is the truncation gap of the P32 chi-twisted\n"
188+
" prime-ladder closed form vs the classical chi-twisted sum;\n"
189+
" it shrinks as (n_primes, max_power, n_max_classical) grow.\n"
190+
" - g_P34 is the same fidelity check applied to the P34\n"
191+
" chi-twisted spectral trace.\n"
192+
" - g_cross = |Z_P34 - Z_P32| is the structural Paley-gap on\n"
193+
" the L-track: at coupling = 0 it must vanish to machine\n"
194+
" precision (Paley-style algebraic identity between P32 and\n"
195+
" P34), and at coupling > 0 it measures pure coupling-induced\n"
196+
" deformation, free of classical-truncation noise.\n"
197+
" - Honest scope: consistency diagnostic only. Does NOT prove\n"
198+
" GRH for any L(s, chi); does NOT advance G4 = RH. The\n"
199+
" Zenodo source disclaims primality proof status; P43\n"
200+
" inherits the same scope at the L-track coercivity level."
201+
)
202+
return 0
203+
204+
205+
if __name__ == "__main__":
206+
raise SystemExit(main())

‎src/tnfr/riemann/__init__.py‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,19 @@
306306
the worst segments. Implemented for primitive real characters
307307
(chi_3, chi_4, chi_5). Diagnostic only; does NOT prove GRH for
308308
any L(s, chi) and does NOT advance G4 = RH.
309+
twisted_paley_gap_coercivity
310+
P43 chi-twisted Paley-gap consistency diagnostic. Structural
311+
analogue of P25 on the chi-twisted bundle: compares three
312+
representations of -L'(s,chi)/L(s,chi) -- the P32 closed-form
313+
weighted spectrum, the P34 chi-twisted spectral trace, and the
314+
classical truncated Dirichlet series sum chi(n) Lambda(n)/n^s --
315+
via three absolute Paley-gap quantities g_P32, g_P34, g_cross.
316+
The cross gap vanishes identically at coupling = 0 (Paley-style
317+
identity between closed-form and self-adjoint realisations);
318+
non-zero coupling exposes the deformation magnitude. Implemented
319+
for primitive real characters (chi_3, chi_4, chi_5). Diagnostic
320+
only; does NOT prove GRH for any L(s, chi) and does NOT advance
321+
G4 = RH.
309322
oscillatory_correction
310323
P31 Branch B1 retry: prime-ladder oscillatory correction of the
311324
P28 / P30 smooth targets. Reconstructs S(T) = pi^{-1} arg zeta(1/2
@@ -824,6 +837,14 @@
824837
TwistedUniformCoercivityCertificate,
825838
verify_twisted_uniform_coercivity_empirical,
826839
)
840+
from .twisted_paley_gap_coercivity import (
841+
# P43: chi-twisted Paley-gap consistency diagnostic
842+
TwistedPaleyGapSweep,
843+
sweep_twisted_paley_gap,
844+
twisted_paley_gap_cross,
845+
twisted_paley_gap_p32,
846+
twisted_paley_gap_p34,
847+
)
827848
from .spectral_emergence import (
828849
# P29: Spectral universality emergence under canonical UM+RA coupling
829850
CANONICAL_COUPLING_LAWS,
@@ -1213,6 +1234,12 @@
12131234
# P42: chi-twisted uniform-coercivity certificate (diagnostic)
12141235
"TwistedUniformCoercivityCertificate",
12151236
"verify_twisted_uniform_coercivity_empirical",
1237+
# P43: chi-twisted Paley-gap consistency diagnostic
1238+
"TwistedPaleyGapSweep",
1239+
"sweep_twisted_paley_gap",
1240+
"twisted_paley_gap_cross",
1241+
"twisted_paley_gap_p32",
1242+
"twisted_paley_gap_p34",
12161243
# P29: Spectral universality emergence under canonical UM+RA coupling
12171244
"CANONICAL_COUPLING_LAWS",
12181245
"InterPrimeCoupling",

0 commit comments

Comments
 (0)