The spotlight kernel and the window masses

The spotlight kernel and the window masses#

The window criterion (6 · The window criterion) samples the prime sum through the moments \(A_k(z)=\int g(u)\,\frac{u^ke^{-\sigma u}}{k!}e^{-itu}\,du\) of its Laplace transform. This notebook computes how sharply the kernel \(u^ke^{-\sigma u}/k!\) concentrates on one logarithmic window \([U,(1+\delta)U]\) when \(k=\lceil(1+\delta/2)\sigma U\rceil\), checks the numbers shown in the atlas, and quantifies the two exponential effects the argument plays against each other.

Mass inside the window, two ways#

Normalized by \(\sigma^{k+1}\) the kernel is the density of a Gamma\((k+1,\sigma)\) variable, so the mass inside \([a,b]\) has the closed form \(\sum_{j=0}^{k}\big(e^{-\sigma a}(\sigma a)^j-e^{-\sigma b}(\sigma b)^j\big)/j!\) (Poisson sums). We compare it with the trapezoidal quadrature used for the atlas figure (rhlib.spotlight_mass_in).

def pois(x, j):
    """e^{-x} x^j / j!, computed in logarithms."""
    return math.exp(-x + j * math.log(x) - math.lgamma(j + 1))

def mass_exact(U, delta, k, sigma):
    a, b = sigma * U, sigma * (1 + delta) * U
    return math.fsum(pois(a, j) - pois(b, j) for j in range(k + 1))

sigma, delta = sp['sigma'], sp['delta']
rows = []
for U_str, w in sp['windows'].items():
    U = float(U_str)
    k = math.ceil((1 + delta / 2) * sigma * U)
    quad = rhlib.spotlight_mass_in(U, delta, k, sigma)
    exact = mass_exact(U, delta, k, sigma)
    rows.append((int(U), k, quad, exact))
    assert k == w['k'] and round(quad, 4) == w['mass_inside'] and abs(quad - exact) < 1e-6
for U, k, quad, exact in rows:
    print(f"U = {U:4d}, k = {k:4d}:  quadrature {quad:.6f}   closed form {exact:.6f}")
U =   20, k =   25:  quadrature 0.679458   closed form 0.679458
U =   40, k =   50:  quadrature 0.839694   closed form 0.839694
U =   80, k =  100:  quadrature 0.952163   closed form 0.952163
U =  160, k =  200:  quadrature 0.994529   closed form 0.994529

For \(\sigma=1\), \(\delta=\tfrac12\) and \(U=\)20, 40, 80, 160, the fractions of mass inside the window are 67.95%, 83.97%, 95.22%, 99.45%.

_images/4b9370e2972c2c69c82a7d426bc9cf6748328aa02a56d718c72dab9b07414482.svg

The tails are exponentially small#

Outside the window, the mass splits into a lower tail \(P(\text{Gamma}<U)\) and an upper tail \(P(\text{Gamma}>(1+\delta)U)\), both computed below as sums of positive Poisson terms (so no cancellation occurs). Large deviations predict decay like \(e^{-cU}\) with \(c=(1+\delta/2)\sigma\min\big(I(t_-),I(t_+)\big)\), \(I(t)=t-1-\log t\), \(t_-=\frac{1}{1+\delta/2}\), \(t_+=\frac{1+\delta}{1+\delta/2}\); the polynomial prefactor makes the convergence of \(-\log(\text{outside})/U\) to \(c\) slow.

def outside(U, delta, k, sigma):
    a, b = sigma * U, sigma * (1 + delta) * U
    lower = math.fsum(pois(a, j) for j in range(k + 1, k + 60 * int(math.sqrt(k)) + 200))  # P(Poisson(a) > k)
    upper = math.fsum(pois(b, j) for j in range(k + 1))                                    # P(Poisson(b) <= k)
    return lower + upper

I = lambda t: t - 1 - math.log(t)
c = (1 + delta / 2) * sigma * min(I(1 / (1 + delta / 2)), I((1 + delta) / (1 + delta / 2)))
prev = None
tail_rows = []
for U in (20, 40, 80, 160, 320, 640, 1280):
    k = math.ceil((1 + delta / 2) * sigma * U)
    out = outside(U, delta, k, sigma)
    tail_rows.append((U, k, out, -math.log(out) / U))
    if prev is not None:
        assert out < prev
    prev = out
for U, k, out, rate in tail_rows:
    print(f"U = {U:5d}, k = {k:5d}:  mass outside = {out:.3e},  −log(outside)/U = {rate:.4f}")
print(f"large-deviation rate c = {c:.4f}")
assert all(r2[3] < r1[3] for r1, r2 in zip(tail_rows, tail_rows[1:])) and all(r[3] > c for r in tail_rows)
U =    20, k =    25:  mass outside = 3.205e-01,  −log(outside)/U = 0.0569
U =    40, k =    50:  mass outside = 1.603e-01,  −log(outside)/U = 0.0458
U =    80, k =   100:  mass outside = 4.784e-02,  −log(outside)/U = 0.0380
U =   160, k =   200:  mass outside = 5.471e-03,  −log(outside)/U = 0.0326
U =   320, k =   400:  mass outside = 1.035e-04,  −log(outside)/U = 0.0287
U =   640, k =   800:  mass outside = 5.977e-08,  −log(outside)/U = 0.0260
U =  1280, k =  1600:  mass outside = 3.064e-14,  −log(outside)/U = 0.0243
large-deviation rate c = 0.0221

At \(U=\)1,280 the mass outside the window is 3.1e-14, and the observed rate decreases towards \(c=\)0.0221 from above (the prefactor is smaller than one). Computing \(1-(\text{mass inside})\) instead would lose most significant digits at this size. In the proof the tails are not estimated through these exact values but through a crude global bound \(|g(u)|\le C_0e^{2u}\) and a large \(\sigma\); the computation only shows how fast the spotlight focuses.

Pole against window#

A pole at distance \(d\) from the point \(z\) contributes about \(d^{-k}\) to \(A_k(z)\), while the window bound only allows \(e^{\eta U}r^{-k}\) with \(r>d\). With \(k\ge U\) the ratio is at least \(e^{U(\log(r/d)-\eta)}\). For example, with \(d/r=0.9\) and \(\eta=0.05\):

d_over_r, eta = 0.9, 0.05
for U in (20, 80, 320, 1280):
    k = math.ceil((1 + delta / 2) * sigma * U)
    log10_ratio = (k * math.log(1 / d_over_r) - eta * U) / math.log(10)
    print(f"U = {U:5d}, k = {k:5d}:  pole term / window bound ≥ 10^{log10_ratio:.1f}")
    assert log10_ratio > 0
U =    20, k =    25:  pole term / window bound ≥ 10^0.7
U =    80, k =   100:  pole term / window bound ≥ 10^2.8
U =   320, k =   400:  pole term / window bound ≥ 10^11.4
U =  1280, k =  1600:  pole term / window bound ≥ 10^45.4

Since \(\eta>0\) is arbitrary in the source’s estimate, any \(\eta<\log(r/d)\) gives a contradiction for large \(U\); only arbitrarily late windows are needed, which is why sparse windows suffice.