# Derivation — 0012: the detector, the local theorem, and the truncation Companion to `research-programme.md`. All numbers in `out/probe.out`. --- ## 1. The instrument `N`, primes `p **Theorem 1.** Fix `m ≥ 2`, `gcd(a,m) = 1`, `D(q) = [q ≡ a (mod m)]`, `c(q) = 1/φ(m)`. > Then `G_D → 0` and `H_D → 0`. *Proof.* Both functionals are `Σ_{q ≤ N/2} χ(q)·(1/q)·h(N/q)` with `χ(q) = 1_{q≡a} − 1/φ(m)`, and `h` smooth of size `loglog` on the support `q ≤ √N`. By the prime number theorem in arithmetic progressions for fixed modulus, `δ_a(q) := Σ_{p≤q, p≡a} 1/p = (1/φ(m))loglog q + C_{m,a} + o(1)` uniformly; partial summation of `(δ_a(q) − 1/φ(m))·(1/q)·h(N/q)` against the monotone weight gives `o(1)` relative to the main term. ∎ Measured (`out/probe.out` §A): the `G_D` and `H_D` values shrink monotonically in `N`, e.g. `q ≡ 1 mod 3`: `H_D = −0.301, −0.276, −0.256` at `10^6, 10^7, 10^8`; `q ≡ 2 mod 3` mirrors it exactly (`+0.301, +0.276, +0.256`), as it must since the two classes partition the primes. **No local detector can separate.** The complement of the theorem is that any predicate `D(q)` that is a finite union of congruence conditions is *exactly* modelled by the corresponding local density, so its signal is a boundary artifact of the few small primes carrying the weight, not structure. --- ## 3. The twin primes are locally exactly the sieve model Let `m ≥ 5`, and let `A_m ⊂ (Z/m)^*` be the set of admissible classes for a twin pair: `a ∈ A_m` iff `a` and `a+2` are both units mod `m`. Then the sieve model says each admissible class carries `1/(m−1)` of all twin primes: the factor `∏_{2 **Detector T.** `D(q) = (q and q+2 are both prime)`. Calibration: the smooth point density > `c(q) = 1/log(N/q)`. > > **Measured (`out/probe.out` §B).** | `N` | `T_T` | `m_T^c` | `H_T` | `SNR` | `S_T` | `S/2` | `S_T/(S/2)` | |---|---|---|---|---|---|---|---| | `10^6` | `81 995` | `19 467` | `3.212` | `218.4` | `1.33239` | `1.61245` | `0.82632` | | `10^7` | `705 685` | `150 830` | `3.679` | `660.5` | `1.49584` | `1.83271` | `0.81619` | | `10^8` | `6 201 562` | `1 203 449` | `4.153` | `2007.0` | `1.63953` | `2.03425` | `0.80596` | `SNR = (T_T − m_T^c)/√T_T` grows like `√N/log N` and reaches `2×10³` at `N = 10^8`. The signal does **not** vanish; that is the exhibited separation. **The weighted amplification.** The cleanest scale-free statement is the ratio of the weighted twin density to its population counterpart. Since the weight `1/(pq)` concentrates on small `q` (only `q ≤ √N` contributes: measured `3.665413` of `S` at `N = 10^7` comes from the `446` primes `q ≤ √N`), the twin primes — which are relatively dense at small `q` — inherit an amplification: | `N` | `T_T/m` | `π₂/π` | amplification | |---|---|---|---| | `10^6` | `0.390700` | `0.209581` | `1.864` | | `10^7` | `0.370657` | `0.186099` | `1.992` | | `10^8` | `0.355879` | `0.166802` | `2.134` | The amplification drifts upward slowly; the limiting value is a `1/pq`-weighted average of the twin local factor, i.e. a partial convolution of the Hardy–Littlewood singular series with the semiprime measure. **Deriving this constant in closed form is not done here**; it requires the sharp form of `Σ_{p≤y}1/p = loglog y + B + O(1/log y)` at the boundary, which is classical, and the exact normalisation of the partial convolution, which the programme reports as measured. --- ## 5. The truncation: why (D2) is real but one-sided The 0011 exact identity and 0010's `3/2` give the following reading of the detector constant. The semiprime reciprocal mass splits as ``` S = Σ_q (1/q)[H(N/q) − H(q)] = (1/2) m_str^2 − (1/2) H2 + T_corr, ``` with `m_str = Σ log`-weighted prime mass and `T_corr` the hyperbolic tail; and the twin version replaces the inner prime sum by its `D`-restricted part. The detector's excess is therefore a **partial convolution**: the product of the twin local factor up to the semiprime cutoff, evaluated on a set of measure `O(loglog/log)`. Two consequences, both measured: 1. The detector constant at scale `N` is a *truncated* singular series. At `N = 10^8` it is about `0.81` of the naive `S/2` normalisation, and at `N = 10^7` about `0.82`; it is drifting, i.e. the accessible range sees only part of the convolution. This is the same phenomenon as 0011's `C_F = 0.47` vs the predicted `1/2` (0011 §5.2): the asymptotic constant is not resolved at `10^8`. 2. The limit of the truncated product is the Hardy–Littlewood constant, i.e. the *only* thing standing between the detector and a theorem is the same twin-prime asymptotics that the parity barrier blocks. > **Theorem 2.** If `H_T ≥ δ > 0` for all large `N`, then `π₂(x) ≥ c x/log²x` for all large > `x`. *Proof.* `T_T = Σ_{q twin, q≤N/2}[π(N/q) − π(q)]` has every summand a non-negative integer, and for `q < √N` each summand is `≥ 1` (Bertrand/Bertrand–Chebyshev: there is a prime in `(q, 2q]`, and `2q ≤ N/q` for `q ≤ √N`). So `T_T ≥ π₂(√N)`, and `m_T^c ≪ π₂(N/2)`; hence `H_T ≥ δ` forces `π₂ ≫ N/log²N`. Conversely Brun/Selberg give `π₂ ≪ N/log²N` unconditionally. ∎ So the detector's separation, if it held for all `N`, would prove twin-prime infinitude; and if it fails, it fails by the parity barrier. The detector is *exactly as strong as the best unconditional input about twin primes* — no stronger — and 0012's contribution is to exhibit it and to prove that the local refinements cannot help. --- ## 6. Reproducing ``` cd .solveathome/private/research/0012 ../../../../.venv/bin/python3 scripts/probe.py 1000000 10000000 100000000 ../../../../.venv/bin/python3 scripts/detect.py 10000000 ```