#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Build `artifacts/rev-grouped-divisor-moment.md`: the OWNING note of the (D1) moment, one inserted block. Carrier choice. `research/grouped-divisor-moment.md` is the note that OWNS equation (4) -- the pair kernel whose coefficient price is the object of this return -- and its section 6 is exactly the (D1) box. It is also the only carrier that can take a revision: the served copies of `OUTCOMES.md` (#812), `fixed-endpoint-discrepancy.md` (#864), `structured-dispersion-estimate.md` (#814), `TODO.md` (#815), `RESEARCH-HANDOFF.md` (this lane's #899) and `RESEARCH-EXECUTION.md` (this lane's b-grid return) are still at their OLD base shas, i.e. every revision against them is pending and a second one would collide. Verified this turn by GET: HANDOFF 21193 bytes b3f33f44, OUTCOMES 207017 bytes 78c5ea9f, EXECUTION 16700 bytes 43e7c897 -- all unchanged. """ import hashlib import os RUN = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SRC = os.path.join(RUN, "work", "served", "research__grouped-divisor-moment.md") DST = os.path.join(RUN, "artifacts", "rev-grouped-divisor-moment.md") BASE_SHA = "b0be809da29800d2a9e37520ce6487a1beb0a2550d40ab847c30cc80c9e1f14f" ANCHOR = "## 7. Validation and conditions for revision\n" BLOCK = """ ### 6.1 The exact nuclear-norm price of the (4) coefficient (audit 2026-09-17, return #900) Equation (4)'s pair kernel is what an operator-norm/Hilbert-Schmidt interface prices, and its price is not its Frobenius norm. Two exact reductions and one measurement settle it -- scripts `work/r2-nuc-exact.py`, `work/r2-nuc-controls.py`; outputs `artifacts/r2-nuc-exact.out`, `artifacts/r2-nuc-controls.out`: * the completion is a DFT and `Omega Omega* = c I`, so `||gamma||_nuc/||gamma||_F = ||A||_nuc/||A||_F` **exactly** (`c` cancels), `A` being the pair-profile matrix; * `Phi_{jl,h}(m) = e(beta h/(lm)) - e(beta' h/(lm))` with `beta = z0'/(gj)`, `beta' = z'/(gj)` depends on `(l,h)` **only through the ratio** `w = h/l`. In one `(M,N,A)` box the ratio is confined to a factor-4 window, so the family is governed by ONE number: the typical phase `v = A*x/(M*N)` -- this note's own `v`, the one whose `f = min(1,v)` already appears in (2). Measured: `R(v) := ||A||_nuc/||A||_F = 1 + C*v + O(v^2)`, with `C = 0.34 ... 0.53` across `rho = z'/z0'` in `[1,2]`. `C` is independent of the frequency window `M` to three digits (`M = 128, 512, 2048, 8192`) and of the box to four (`#distinct w = 53 ... 343`). It is unchanged by an arbitrary rank-one reweighting `coeff(pair) = alpha_p * conj(alpha_q)` -- which is exactly the `|b_u| <= B` that (2) permits -- because such a product remains a product of a `p`-factor and a `q`-factor, so the leading term stays rank one whatever `b_u` is. The `sqrt(rank)` bound `||gamma||_nuc <= sqrt(rank) ||gamma||_F` is attained only for `v >> 1` (`R/sqrt(rank) = 0.97-0.99` at `v = 100, 1000`), while at `v = 1/100` the exact price is `R = 1.0045`. The **exact** rank is `#{distinct h/l}` at every `v` (numerically `53` at `v = 1000`, `3-6` at `v <= 1/10`): what collapses is the nuclear norm, not the rank. Consequence for this section's box, in this note's own exponents. `v = A*x/(M*N)` with `A <= T` and `T = x^{2*tau}*max(1, M*N/x)`, hence ```text every band with A <= M*N/x has v <= 1 and the interface costs o(1) in exponent (FREE); the top band A ~ T has v = x^{2*tau} and costs exactly 2*tau. ``` At this section's box `M*N/x = x^{3/50}`, so the bands the minimal truncation already admits are priced at `o(1)`, and only the truncation slack `x^{2*tau}` is charged `2*tau`. **So a bound that treats (4)'s coefficient by its Frobenius norm is NOT short by a power of `x` in this regime.** The figure `x^{0.255}` recorded earlier (return #899, "14.6x the deficit") was measured at `v >> 1`, i.e. with phases far outside the regime `f = min(1,v) < 1` where (2) is sharp; it is an upper bound on the exact nuclear norm, not the exact norm, and it is not attained here. This changes no exponent of (21). The deficit of (21) is on the moment/Kloosterman side and remains exactly as stated in this section; what is corrected is only the price of the coefficient that the interface would multiply it by. """ def main(): raw = open(SRC, "rb").read() sha = hashlib.sha256(raw).hexdigest() if sha != BASE_SHA: raise SystemExit("base is not the served copy: %s != %s" % (sha, BASE_SHA)) text = raw.decode("utf-8") if text.count(ANCHOR) != 1: raise SystemExit("anchor occurs %d times, not once" % text.count(ANCHOR)) if "6.1 The exact nuclear-norm price" in text: raise SystemExit("the block is already present") out = text.replace(ANCHOR, BLOCK + "\n" + ANCHOR) with open(DST, "w", encoding="utf-8", newline="\n") as fh: fh.write(out) print("base %s %d bytes %d lines" % (sha[:12], len(raw), len(text.splitlines()))) print("rev %s %d bytes %d lines (+%d / -0)" % (hashlib.sha256(out.encode()).hexdigest()[:12], len(out.encode()), len(out.splitlines()), len(out.splitlines()) - len(text.splitlines()))) print("wrote %s" % DST) return 0 if __name__ == "__main__": raise SystemExit(main())