Demo 66: P39 chi-twisted admissible-family + gauge sweep for primitive real Dirichlet L-functions.
Structural analogue of Demo 48 (P19 admissible-family sweep for zeta) extended to L(s, chi) via the P34 chi-twisted prime-ladder Hamiltonian, the P35 chi-twisted Weil-Guinand zero-side enumerator, and the P37 chi-twisted Weil-TNFR positivity bridge.
P39 is the joint robustness audit of the P37 bridge under (i) test-profile ambiguity (admissible-family sweep, inherited from P19: gaussian, gaussian_mixture, hermite2_gaussian) and (ii) canonical-mapping ambiguity (gauge sweep, inherited from P18: the six canonical structural gauges DEFAULT_GAUGES).
The demo executes:
Detailed (family, gauge) chart for chi_3 at sigma=2.0 -- the smallest non-trivial primitive real character, evaluated at the conventional Gaussian width. Prints the W_chi[sigma; f] column (gauge-independent) and the alpha_chi(sigma; f, g) table across the three admissible families and six canonical gauges.
Aggregate sweep across chi_3, chi_4, chi_5 -- reports aggregate positivity flags (W_chi >= 0, alpha_chi > 0) and the range [alpha_min, alpha_max] for each character together with the coordinates of the minimum (most demanding) entry.
Certificate summaries and honest scope -- prints the frozen summaries and reiterates the honesty disclaimer.
This demo numerically probes alpha_chi(sigma; f, g) > 0 across three admissible Schwartz-even test families, six canonical structural gauges, and a finite Gaussian-width grid for three primitive real characters. Positive results strengthen the P37 / P38 numerical evidence under joint test-profile + canonical-mapping ambiguity but do not prove GRH for any L(s, chi). This demo also does NOT advance G4 = RH or the arithmetic obstruction of GRH. Negative entries would falsify the bridge as parameterised by the given (family, gauge) grid; they would not disprove GRH_chi, which depends only on the gauge-independent quantities W_chi[sigma; f].
"""Demo 66: P39 chi-twisted admissible-family + gauge sweep for
primitive real Dirichlet L-functions.
Structural analogue of Demo 48 (P19 admissible-family sweep for zeta)
extended to L(s, chi) via the P34 chi-twisted prime-ladder Hamiltonian,
the P35 chi-twisted Weil-Guinand zero-side enumerator, and the P37
chi-twisted Weil-TNFR positivity bridge.
P39 is the joint robustness audit of the P37 bridge under
(i) test-profile ambiguity (admissible-family sweep, inherited from
P19: gaussian, gaussian_mixture, hermite2_gaussian) and
(ii) canonical-mapping ambiguity (gauge sweep, inherited from P18:
the six canonical structural gauges DEFAULT_GAUGES).
The demo executes:
1. **Detailed (family, gauge) chart for chi_3 at sigma=2.0** -- the
smallest non-trivial primitive real character, evaluated at the
conventional Gaussian width. Prints the W_chi[sigma; f] column
(gauge-independent) and the alpha_chi(sigma; f, g) table across
the three admissible families and six canonical gauges.
2. **Aggregate sweep across chi_3, chi_4, chi_5** -- reports
aggregate positivity flags (W_chi >= 0, alpha_chi > 0) and the
range [alpha_min, alpha_max] for each character together with the
coordinates of the minimum (most demanding) entry.
3. **Certificate summaries and honest scope** -- prints the frozen
summaries and reiterates the honesty disclaimer.
Honest scope
------------
This demo numerically probes alpha_chi(sigma; f, g) > 0 across three
admissible Schwartz-even test families, six canonical structural
gauges, and a finite Gaussian-width grid for three primitive real
characters. Positive results strengthen the P37 / P38 numerical
evidence under joint test-profile + canonical-mapping ambiguity but
**do not prove** GRH for any L(s, chi). This demo also does NOT
advance G4 = RH or the arithmetic obstruction of GRH. Negative
entries would falsify the bridge *as parameterised by the given
(family, gauge) grid*; they would not disprove GRH_chi, which depends
only on the gauge-independent quantities W_chi[sigma; f].
"""
from __future__ import annotations
import sys
# Ensure UTF-8 on Windows cp1252 consoles (chi, gamma, sigma...).
try:
sys.stdout.reconfigure(encoding="utf-8") # type: ignore[attr-defined]
except AttributeError:
pass
from tnfr.riemann import (
build_twisted_prime_ladder_hamiltonian,
real_character_mod_3,
real_character_mod_4,
real_character_mod_5,
sweep_twisted_admissible_family,
)
# --------------------------------------------------------------------
# Configuration
# --------------------------------------------------------------------
SIGMAS = (1.0, 1.5, 2.0, 2.5, 3.0)
# Bundle configuration (matches Demo 65)
N_PRIMES = 25
MAX_POWER = 6
COUPLING = 0.0 # decoupled spectrum is exact
# Primitive real characters (small conductor)
CHARACTERS = (
("chi_3", real_character_mod_3),
("chi_4", real_character_mod_4),
("chi_5", real_character_mod_5),
)
def banner(title: str, char: str = "=") -> None:
print(char * 72)
print(title)
print(char * 72)
def fmt_signed(x: float, width: int = 12, prec: int = 4) -> str:
if x != x: # NaN
return f"{'nan':>{width}}"
if x == float("inf"):
return f"{'+inf':>{width}}"
if x == float("-inf"):
return f"{'-inf':>{width}}"
return f"{x:+{width}.{prec}e}"
# --------------------------------------------------------------------
# Block 1: detailed (family, gauge) chart for chi_3 at sigma=2.0
# --------------------------------------------------------------------
def block_detailed_chi3() -> None:
banner("BLOCK 1: detailed (family, gauge) chart for chi_3 " "across sigma grid")
chi = real_character_mod_3()
bundle = build_twisted_prime_ladder_hamiltonian(
chi,
n_primes=N_PRIMES,
max_power=MAX_POWER,
coupling=COUPLING,
)
cert = sweep_twisted_admissible_family(chi, bundle, SIGMAS)
print(f" character : {cert.character_name} " f"(q={cert.character_modulus})")
print(f" n_sigma : {len(cert.sigmas)}")
print(f" families : {cert.families}")
print(f" gauges : {cert.gauges}")
print()
# W_chi[family, sigma] table (gauge-independent)
print(" W_chi[sigma; family] (gauge-independent):")
header = (
" " + f"{'family':<22}" + " ".join(f"sigma={s:>5.2f}" for s in cert.sigmas)
)
print(header)
for i, fname in enumerate(cert.families):
row = (
" "
+ f"{fname:<22}"
+ " ".join(
fmt_signed(float(cert.weil_table[i, j]), width=11, prec=3)
for j in range(len(cert.sigmas))
)
)
print(row)
print()
# alpha_chi(sigma; family, gauge) at sigma=2.0 (middle index)
j_target = len(cert.sigmas) // 2
sigma_target = float(cert.sigmas[j_target])
print(f" alpha_chi(sigma={sigma_target:.3f}; family, gauge):")
header = (
" "
+ f"{'family\\gauge':<22}"
+ " ".join(f"{gn[:11]:>12}" for gn in cert.gauges)
)
print(header)
for i, fname in enumerate(cert.families):
row = (
" "
+ f"{fname:<22}"
+ " ".join(
fmt_signed(float(cert.alpha_table[i, k, j_target]), width=12, prec=3)
for k in range(len(cert.gauges))
)
)
print(row)
print()
# --------------------------------------------------------------------
# Block 2: aggregate sweep across chi_3, chi_4, chi_5
# --------------------------------------------------------------------
def block_aggregate_sweep() -> list:
banner("BLOCK 2: aggregate sweep across chi_3, chi_4, chi_5")
certs = []
print(
f" {'character':<12} {'q':>3} {'W>=0':>6} {'a>0':>6} "
f"{'alpha_min':>14} {'@(sigma,fam,gauge)':<42} "
f"{'alpha_max':>14}"
)
print(" " + "-" * 110)
for name, factory in CHARACTERS:
chi = factory()
bundle = build_twisted_prime_ladder_hamiltonian(
chi,
n_primes=N_PRIMES,
max_power=MAX_POWER,
coupling=COUPLING,
)
cert = sweep_twisted_admissible_family(chi, bundle, SIGMAS)
certs.append(cert)
loc = (
f"({cert.alpha_min_sigma:.3f}, "
f"{cert.alpha_min_family}, "
f"{cert.alpha_min_gauge})"
)
print(
f" {cert.character_name:<12} "
f"{cert.character_modulus:>3} "
f"{str(cert.weil_all_positive):>6} "
f"{str(cert.alpha_all_positive):>6} "
f"{fmt_signed(cert.alpha_min, width=14, prec=4)} "
f"{loc:<42} "
f"{fmt_signed(cert.alpha_max, width=14, prec=4)}"
)
print()
return certs
# --------------------------------------------------------------------
# Block 3: certificate summaries + honest scope
# --------------------------------------------------------------------
def block_summaries(certs: list) -> None:
banner("BLOCK 3: certificate summaries")
for cert in certs:
print(" " + cert.summary())
print()
banner("HONEST SCOPE", char="-")
print(
" P39 numerically verifies alpha_chi(sigma; f, g) > 0\n"
" across a finite Gaussian-width grid, three admissible\n"
" Schwartz-even test families (gaussian, gaussian_mixture,\n"
" hermite2_gaussian inherited from P19), and the six canonical\n"
" structural gauges DEFAULT_GAUGES (inherited from P18) for\n"
" three primitive real Dirichlet characters (chi_3, chi_4,\n"
" chi_5). Positive results strengthen the P37 / P38 numerical\n"
" evidence under joint test-profile + canonical-mapping\n"
" ambiguity but do NOT prove GRH for any L(s, chi) and do NOT\n"
" advance G4 = RH. Like P19 / P38, this is an RH-equivalent\n"
" robustness audit on a finite grid, not a theorem on family\n"
" completeness."
)
# --------------------------------------------------------------------
# Main
# --------------------------------------------------------------------
def main() -> None:
block_detailed_chi3()
certs = block_aggregate_sweep()
block_summaries(certs)
n_pass = sum(1 for c in certs if c.weil_all_positive and c.alpha_all_positive)
print()
print(f" P39 sweep PASS rate: {n_pass}/{len(certs)} characters")
if __name__ == "__main__":
main()