#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Build `artifacts/rev-small-divisor-kernel.md`: one block before section 5. Carrier: `research/small-divisor-kernel.md` (sha f27435bf, 20892 B) is the note that owns the two prices this audit is about -- section 3 item 2 ("the only cost is the truncation height (1+v)x^epsilon") and section 4(b) ("removing it costs ... (number of pairs)*(coefficient mass)*(M/x) = x^(14/25)"). It carries no pending revision (RESEARCH-HANDOFF #899, grouped-divisor-moment #902, structural-literature-audit #905 and OUTCOMES are all occupied). The audit found no line here that flips a verdict; both prices are upper bounds and both err in the safe direction. What was missing is the exact value, which the closed-form constant of 2026-09-17 supplies. Recording it is the point: a consumer who reads `(1+v)` or `x^(14/25)` as the price over-counts, and the note's own verdicts (`far below every budget`) do not need the over-count. """ import hashlib import os RUN = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SRC = os.path.join(RUN, "evidence", "docs", "research__small-divisor-kernel.md") DST = os.path.join(RUN, "artifacts", "rev-small-divisor-kernel.md") BASE_SHA = "f27435bf29dd19e4ff2428fd75e48c8d36a735a57e45058ed37ef00b4ff3bd04" ANCHOR = "## 5. Pricing the interfaces\n" BLOCK = """ ## 4bis. The two prices in closed form: `(1+v)` and `x^(14/25)` are upper bounds, and now exact-valued Audit of 2026-09-17, norm-as-price sweep of the prescriptive layer (return #907). This section is the one place in the corpus where an interface price is quoted as a norm/count product, so the exact values belong here. Nothing below changes a verdict: both recorded prices are **upper** bounds, and both are larger than the exact value, i.e. both err toward over-counting the cost. **(a) Section 3 item 2 -- `(1+v)x^epsilon`.** The object priced there is the endpoint/Mellin separation of `Phi`, and its exact first-order law is the nuclear-norm ratio of the coefficient family, which is now proved in closed form (`artifacts/report-audit-nucC.md`, verified in `work/r2-nuc-C-analytic.py`): ```text R(v) := ||A||_nuc / ||A||_F = 1 + C v + O(v^2), C = pi(1+rho) sqrt((U_2U_4-U_3^2)(V_2V_4-V_3^2)) / (U_2 V_2) = 0.1515 (1+rho) on these boxes, U_j = over the distinct ratios w = h/l, V_j = over the frequency window. ``` So the shape `1+v` recorded here is **correct** (linear in `v`, coefficient an absolute constant) and the coefficient is `C = 0.1515(1+rho)`, not `1`: the recorded price over-counts by `1/C = 6.6/(1+rho)`, i.e. by `2.2x` at `rho = 2` and `3.3x` at `rho = 1/2`. Since `v = A x/(M N) <= 1` on every retained band here, both forms are `x^{O(1)}` and no power of `x` separates them; the note's conclusion ("the cost is `x^epsilon`") is unaffected. The same correction applies to `grouped-divisor-moment`'s `(6)` bookkeeping, to `structured-dispersion-estimate`'s "endpoint variation costs `f^2(1+A x/(M N))`" and to the OUTCOMES entry that repeats it. **(b) Section 4(b) -- `(number of pairs)(coefficient mass)(M/x) = x^(14/25)`.** The removed object is the reciprocity correction, i.e. the factor `e(theta R/(m c))` of (9). Its exact size is per-pair: `|theta R/(m c)| << A/(M N) = v/x`, hence `|1 - e(theta R/(m c))| <= 2 pi v/x`, hence ```text exact removal cost <= 2 pi (A/(M N)) (coefficient mass) = 2 pi v (coefficient mass) / x. ``` The recorded form multiplies a **pair count** and a factor `M` into a quantity the preceding sentence already bounds per unit ("its total variation across `I_m` is also `O(x^(-1))`"). The quoted value therefore exceeds the exact supremum-based price by a factor `>= M/(2 pi v) = M/(2 pi)` at this box (`v = 1`): a power of `x`, not a constant. Because the line is an upper bound used only to assert "far below every budget in section 1" (the smallest budget there is a block of size `x^(53/50)`), the over-count is harmless and the transfer claim of (5) and (12) is strengthened, not weakened. **What the sweep found elsewhere.** In the freshly fetched served documents the other norm-as-price lines are OUTCOMES's `f^2(1+A x/(M N))` (same object as (a)) and OUTCOMES's repetition of `x^(14/25)` (same object as (b)); both are the same two prices. The only line in the whole prescriptive layer whose **verdict** rested on a norm bound read as an exact price is the Hilbert-Schmidt clause ("an arbitrary both-index coefficient is admissible at the price of its Frobenius norm", return #759 R2 row, echoed in route 49's register): there the price is the nuclear norm, whose exact law is `1 + C v + O(v^2)` above, and the `sqrt(rank)` reading of 2026-09-17 is retracted in `research/RESEARCH-HANDOFF.md` (return #899), `research/grouped-divisor-moment.md` section 6.1 (return #902) and `research/structural-literature-audit.md` (return #905) -- all three revisions were still pending when this audit was written. """ 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 "The two prices in closed form" 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())