Skip to content

Commit 2963a3d

Browse files
author
TNFR AI Agent
committed
feat(riemann): P42 - chi-twisted uniform-coercivity certificate
Structural extension of zeta-track P22/P23/P24 (uniform / stratified / adaptive coercivity in coercivity_uniform.py) to primitive real L(s,chi). Adds twisted_coercivity_uniform.py exposing TwistedUniformCoercivityCertificate + verify_twisted_uniform_coercivity_empirical. Lifts the finite-grid pointwise sample of P39 + P40 to a Lipschitz-mesh interval-level certificate by log-spaced sigma sampling, finite-difference Lipschitz envelope, and three interval lower bounds (global / stratified / segment-local) via the canonical P22/P23 helpers reused unchanged from coercivity_uniform.py; optional P24-style adaptive refinement bisects worst-margin segments and re-runs both twisted sweeps. Empirical verification (examples/69, sigma in [1,3], N=5, n_primes=15, k_max=4): chi_3 / chi_4 / chi_5 all give sampled_all_positive=True, admissible_ok=True, nodeaware_ok=True; interval lb_local in {-6.06e-2, -1.30e-1, -6.51e-2} (all NEGATIVE because sampled alpha_min near sigma=1 is 1e-8 to 1e-14, essentially zero margin against any finite Lipschitz proxy). One round of P24 bisection on chi_4 (N: 5 -> 7) reduces lb_local from -1.30e-1 to -3.40e-2 (74 percent margin reduction toward zero), confirming the bisection mechanism transports correctly. Honest scope: diagnostic only. Does NOT prove GRH for any L(s,chi). Does NOT extend to complex characters. Does NOT advance G4 = RH. Mirrors zeta-track P22/P23/P24 behaviour at coarse-mesh / wide-sigma-window initial state. Negative interval lower bounds are a HONEST finding, not a failure. Files: src/tnfr/riemann/twisted_coercivity_uniform.py (new), src/tnfr/riemann/__init__.py (wired exports), examples/69_twisted_coercivity_uniform_demo.py (new), theory/TNFR_RIEMANN_RESEARCH_NOTES.md (section 13vicies-primo + 19.1 P42 row).
1 parent 05da905 commit 2963a3d

4 files changed

Lines changed: 731 additions & 0 deletions

File tree

Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
"""Demo 69: P42 chi-twisted uniform-coercivity certificate for
2+
primitive real Dirichlet L-functions.
3+
4+
Structural extension of the zeta-track P22 / P23 / P24 milestones
5+
(empirical interval-level coercivity certificate with adaptive
6+
refinement) to L(s, chi) via the P34 chi-twisted prime-ladder
7+
Hamiltonian, the P35 chi-twisted Weil-Guinand zero-side enumerator,
8+
and the P37 chi-twisted Weil-TNFR positivity bridge.
9+
10+
Whereas Demos 66 / 67 / 68 (P39 / P40 / P41) verify pointwise
11+
positivity of alpha_chi(sigma; f, g) on a finite (sigma, family,
12+
gauge) grid, Demo 69 (P42) lifts pointwise positivity to *interval*
13+
positivity on a dense log-spaced sigma window by combining:
14+
15+
* a finite-difference Lipschitz proxy L_proxy, and
16+
* three interval lower bounds (global, stratified, segment-local),
17+
* plus optional adaptive bisection of the worst segments.
18+
19+
The demo executes:
20+
21+
1. **Sigma-window certificate for chi_3, chi_4, chi_5** without
22+
refinement (pure P22-style).
23+
24+
2. **Adaptive refinement** for the worst character with two rounds
25+
of bisection on the two worst segments per round (P24-style).
26+
27+
3. **Certificate summaries and honest scope**.
28+
29+
Honest scope
30+
------------
31+
This demo numerically probes alpha_chi > 0 across an interval-level
32+
empirical certificate (sampled minima + Lipschitz envelope + segment
33+
linear envelope) on three primitive real characters. Positive
34+
results strengthen the P37 / P38 / P39 / P40 / P41 numerical
35+
evidence by promoting pointwise positivity to interval-level
36+
positivity with explicit Lipschitz control, but **do not prove**
37+
GRH for any L(s, chi) and do NOT advance G4 = RH. Like P22 / P23
38+
/ P24 on the zeta side, this is an empirical interval-level
39+
diagnostic on a finite grid, not a theorem on family-uniform
40+
positivity over the full admissible Schwartz-even space.
41+
"""
42+
43+
from __future__ import annotations
44+
45+
import sys
46+
47+
try:
48+
sys.stdout.reconfigure(encoding="utf-8") # type: ignore[attr-defined]
49+
except AttributeError:
50+
pass
51+
52+
from tnfr.riemann import (
53+
build_twisted_prime_ladder_hamiltonian,
54+
real_character_mod_3,
55+
real_character_mod_4,
56+
real_character_mod_5,
57+
verify_twisted_uniform_coercivity_empirical,
58+
)
59+
60+
# --------------------------------------------------------------------
61+
# Configuration
62+
# --------------------------------------------------------------------
63+
64+
SIGMA_MIN = 1.0
65+
SIGMA_MAX = 3.0
66+
N_SIGMA = 5
67+
68+
N_PRIMES = 15
69+
MAX_POWER = 4
70+
COUPLING = 0.0
71+
72+
CHARACTERS = (
73+
("chi_3", real_character_mod_3),
74+
("chi_4", real_character_mod_4),
75+
("chi_5", real_character_mod_5),
76+
)
77+
78+
79+
def banner(title: str, char: str = "=") -> None:
80+
print(char * 72)
81+
print(title)
82+
print(char * 72)
83+
84+
85+
def fmt_signed(x: float, width: int = 12, prec: int = 4) -> str:
86+
if x != x: # NaN
87+
return f"{'nan':>{width}}"
88+
if x == float("inf"):
89+
return f"{'+inf':>{width}}"
90+
if x == float("-inf"):
91+
return f"{'-inf':>{width}}"
92+
return f"{x:+{width}.{prec}e}"
93+
94+
95+
# --------------------------------------------------------------------
96+
# Block 1: sigma-window certificate (no refinement)
97+
# --------------------------------------------------------------------
98+
99+
100+
def block_sigma_window() -> list:
101+
banner(
102+
"BLOCK 1: chi-twisted uniform-coercivity certificate "
103+
"(no refinement)"
104+
)
105+
print(
106+
f" sigma window : [{SIGMA_MIN:.3f}, {SIGMA_MAX:.3f}] "
107+
f"n_sigma = {N_SIGMA} (log-spaced)"
108+
)
109+
print()
110+
print(
111+
f" {'chi':<14} {'q':>3} {'a_min':>14} {'a_max':>14} "
112+
f"{'L_proxy':>12} {'lb_global':>14} {'lb_strat':>14} "
113+
f"{'lb_local':>14} {'all+':>6}"
114+
)
115+
print(" " + "-" * 130)
116+
certs = []
117+
for name, factory in CHARACTERS:
118+
chi = factory()
119+
bundle = build_twisted_prime_ladder_hamiltonian(
120+
chi,
121+
n_primes=N_PRIMES,
122+
max_power=MAX_POWER,
123+
coupling=COUPLING,
124+
)
125+
cert = verify_twisted_uniform_coercivity_empirical(
126+
chi,
127+
bundle,
128+
sigma_min=SIGMA_MIN,
129+
sigma_max=SIGMA_MAX,
130+
n_sigma=N_SIGMA,
131+
)
132+
certs.append((name, cert))
133+
all_pos = bool(
134+
cert.sampled_all_positive
135+
and cert.interval_lower_global_positive
136+
and cert.interval_lower_stratified_positive
137+
and cert.interval_lower_local_positive
138+
)
139+
print(
140+
f" {cert.character_name:<14} "
141+
f"{cert.character_modulus:>3} "
142+
f"{fmt_signed(cert.sampled_alpha_min, width=14, prec=4)} "
143+
f"{fmt_signed(cert.sampled_alpha_max, width=14, prec=4)} "
144+
f"{cert.lipschitz_proxy_max:>12.4e} "
145+
f"{fmt_signed(cert.interval_lower_bound_global, 14, 4)} "
146+
f"{fmt_signed(cert.interval_lower_bound_stratified, 14, 4)} "
147+
f"{fmt_signed(cert.interval_lower_bound_local, 14, 4)} "
148+
f"{str(all_pos):>6}"
149+
)
150+
print()
151+
return certs
152+
153+
154+
# --------------------------------------------------------------------
155+
# Block 2: adaptive refinement on the worst character
156+
# --------------------------------------------------------------------
157+
158+
159+
def block_adaptive_refinement(certs: list) -> None:
160+
banner(
161+
"BLOCK 2: adaptive refinement on worst-margin character "
162+
"(P24-style)"
163+
)
164+
name, worst_cert = min(
165+
certs, key=lambda nc: nc[1].interval_lower_bound_local
166+
)
167+
print(
168+
f" worst character : {worst_cert.character_name} "
169+
f"(q={worst_cert.character_modulus})"
170+
)
171+
print(
172+
f" pre-refinement lb : "
173+
f"{worst_cert.interval_lower_bound_local:+.4e}"
174+
)
175+
print(f" pre-refinement n_sigma : {worst_cert.n_sigma}")
176+
print()
177+
178+
factory = dict(CHARACTERS)[name]
179+
chi = factory()
180+
bundle = build_twisted_prime_ladder_hamiltonian(
181+
chi,
182+
n_primes=N_PRIMES,
183+
max_power=MAX_POWER,
184+
coupling=COUPLING,
185+
)
186+
refined = verify_twisted_uniform_coercivity_empirical(
187+
chi,
188+
bundle,
189+
sigma_min=SIGMA_MIN,
190+
sigma_max=SIGMA_MAX,
191+
n_sigma=N_SIGMA,
192+
refinement_rounds=1,
193+
refinement_per_round=2,
194+
)
195+
print(
196+
f" refinement_rounds : {refined.n_refinement_rounds}"
197+
)
198+
print(
199+
f" refined n_sigma : {refined.n_sigma_refined}"
200+
)
201+
print(
202+
f" pre-refinement lb : "
203+
f"{refined.interval_lower_bound_local:+.4e}"
204+
)
205+
print(
206+
f" refined lb (local) : "
207+
f"{refined.interval_lower_bound_local_refined:+.4e}"
208+
)
209+
print(
210+
f" refined lb positive : "
211+
f"{refined.interval_lower_local_refined_positive}"
212+
)
213+
print()
214+
215+
216+
# --------------------------------------------------------------------
217+
# Block 3: summaries + scope
218+
# --------------------------------------------------------------------
219+
220+
221+
def block_summaries(certs: list) -> None:
222+
banner("BLOCK 3: certificate summaries")
223+
for _, cert in certs:
224+
print(" " + cert.summary())
225+
print()
226+
banner("HONEST SCOPE", char="-")
227+
print(
228+
" P42 numerically verifies alpha_chi > 0 at the interval\n"
229+
" level via a sampled minimum plus a finite-difference\n"
230+
" Lipschitz envelope on a finite log-spaced Gaussian-width\n"
231+
" window for three primitive real Dirichlet characters\n"
232+
" (chi_3, chi_4, chi_5). Positive lower bounds strengthen\n"
233+
" the P37 / P38 / P39 / P40 / P41 numerical evidence by\n"
234+
" promoting pointwise positivity to interval-level\n"
235+
" positivity with explicit Lipschitz control, but do NOT\n"
236+
" prove GRH for any L(s, chi) and do NOT advance G4 = RH.\n"
237+
" Like P22 / P23 / P24 on the zeta side, this is an\n"
238+
" empirical interval-level diagnostic on a finite grid,\n"
239+
" not a theorem on family-uniform positivity over the full\n"
240+
" admissible Schwartz-even space."
241+
)
242+
243+
244+
def main() -> None:
245+
certs = block_sigma_window()
246+
block_adaptive_refinement(certs)
247+
block_summaries(certs)
248+
249+
250+
if __name__ == "__main__":
251+
main()

‎src/tnfr/riemann/__init__.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,17 @@
295295
Implemented for primitive real characters (chi_3, chi_4, chi_5).
296296
Diagnostic only; does NOT prove GRH for any L(s, chi) and does
297297
NOT advance G4 = RH.
298+
twisted_coercivity_uniform
299+
P42 empirical interval-level chi-twisted uniform-coercivity
300+
certificate. Structural analogue of P22 / P23 / P24 on the
301+
chi-twisted bundle: samples alpha_chi(sigma; f, g) on a dense
302+
log-spaced sigma grid via P39 (scalar gauges) and P40 (node-aware
303+
gauges), computes a finite-difference Lipschitz proxy, and lifts
304+
pointwise positivity to three interval lower bounds (global,
305+
stratified, segment-local) with optional adaptive bisection of
306+
the worst segments. Implemented for primitive real characters
307+
(chi_3, chi_4, chi_5). Diagnostic only; does NOT prove GRH for
308+
any L(s, chi) and does NOT advance G4 = RH.
298309
oscillatory_correction
299310
P31 Branch B1 retry: prime-ladder oscillatory correction of the
300311
P28 / P30 smooth targets. Reconstructs S(T) = pi^{-1} arg zeta(1/2
@@ -808,6 +819,11 @@
808819
TwistedHermite2EtaSweepCertificate,
809820
sweep_twisted_hermite2_eta,
810821
)
822+
from .twisted_coercivity_uniform import (
823+
# P42: chi-twisted uniform-coercivity certificate (diagnostic)
824+
TwistedUniformCoercivityCertificate,
825+
verify_twisted_uniform_coercivity_empirical,
826+
)
811827
from .spectral_emergence import (
812828
# P29: Spectral universality emergence under canonical UM+RA coupling
813829
CANONICAL_COUPLING_LAWS,
@@ -1194,6 +1210,9 @@
11941210
"DEFAULT_HERMITE2_ETAS",
11951211
"TwistedHermite2EtaSweepCertificate",
11961212
"sweep_twisted_hermite2_eta",
1213+
# P42: chi-twisted uniform-coercivity certificate (diagnostic)
1214+
"TwistedUniformCoercivityCertificate",
1215+
"verify_twisted_uniform_coercivity_empirical",
11971216
# P29: Spectral universality emergence under canonical UM+RA coupling
11981217
"CANONICAL_COUPLING_LAWS",
11991218
"InterPrimeCoupling",

0 commit comments

Comments
 (0)