ml-intern
riemann-vmix / problem_solvers /lindeloef_hypothesis.py
swayam1111's picture
Upload problem_solvers/lindeloef_hypothesis.py
49f569e verified
"""
PROBLEM 6: Lindelöf Hypothesis — Numerical Evidence
=====================================================
Lindelöf Hypothesis: ζ(1/2 + it) = O(t^ε) for all ε > 0
Best known: O(t^{13/84}) ≈ O(t^{0.155}) [Bourgain 2017]
Method:
1. Compute |ζ(1/2 + it)| at the 100k zero ordinates t = γ_n
2. Plot log|ζ(1/2+iγ_n)|/log(γ_n)
3. If Lindelöf is true, this ratio → 0
4. Estimate empirical exponent: |ζ(1/2+it)| ~ t^θ
"""
import numpy as np
from mpmath import zeta, mp, sqrt, log, exp
from typing import Dict
class LindeloefAnalyzer:
def __init__(self, zeros: list):
self.zeros = np.array(zeros)
self.results = {}
def analyze(self, n_samples: int = 2000) -> Dict:
mp.dps = 15
# Sample at logarithmically spaced zero indices
indices = np.unique(np.logspace(0, np.log10(len(self.zeros)), n_samples).astype(int))
indices = [i for i in indices if i > 0 and i <= len(self.zeros)]
ratios = []
zeta_abs = []
gamma_vals = []
for idx in indices:
gamma = self.zeros[idx - 1]
t = float(gamma)
if t < 100:
continue
# Compute |ζ(1/2 + it)| — skip mpmath for speed, use approximation
# Actually compute with lower precision for speed
val = abs(zeta(0.5 + 1j * t))
ratio = float(log(val) / log(t)) if val > 0 else 0
ratios.append(ratio)
zeta_abs.append(float(val))
gamma_vals.append(t)
ratios = np.array(ratios)
gamma_vals = np.array(gamma_vals)
# Fit θ in |ζ| ~ t^θ via log-log regression
log_g = np.log(gamma_vals)
log_z = np.log(zeta_abs)
theta = float(np.polyfit(log_g, log_z, 1)[0])
self.results = {
'n_samples': len(ratios),
'gamma_values': gamma_vals.tolist(),
'zeta_abs': zeta_abs,
'ratios': ratios.tolist(),
'max_ratio': float(np.max(ratios)),
'mean_ratio': float(np.mean(ratios)),
'theta_estimate': theta,
'bourgain_bound': 13.0 / 84.0, # ≈ 0.155
'lindeloef_satisfied': bool(theta < 0.3), # heuristic
}
return self.results
def summary(self) -> str:
r = self.results
s = f"Lindelöf Hypothesis Analysis\n{'='*50}\n"
s += f"Samples: {r['n_samples']}\n"
s += f"Estimated θ: {r['theta_estimate']:.4f} (|ζ| ~ t^θ)\n"
s += f"Bourgain bound: {r['bourgain_bound']:.4f}\n"
s += f"Lindelöf threshold (<0.3 heuristic): {r['lindeloef_satisfied']}\n"
s += f"Max log|ζ|/log(t): {r['max_ratio']:.4f}\n"
return s