// Audit of research/prime-band-transfer.md sections 3, 4 and 6: // the exponent chain c -> c_* = c/2 -> d = c/4, the stability inequality, and // exactly how much (7) constrains an individual dyadic scale. // No compute, no network, no randomness. const f = (x, n) => x.toFixed(n); console.log('=== 1. Section 3: is delta = (log X)^{-c/2} the optimal mesh, giving c_* = c/2? ==='); // The bound to minimise is g(delta) = delta^{-1} L^{-c} + delta (+ 1/L, negligible). // Stationary: -delta^{-2} L^{-c} + 1 = 0 => delta = L^{-c/2}, and then both terms are L^{-c/2}. function best(c, L) { let bd = 0, bv = Infinity; for (let k = 0; k <= 4000; k++) { const d = Math.pow(L, -k / 4000 * 2); const v = 1 / d * Math.pow(L, -c) + d; if (v < bv) { bv = v; bd = d; } } return { bd, bv }; } console.log(' c log X argmin delta L^{-c/2} min value 2*L^{-c/2}'); for (const [c, L] of [[0.3, 1e6], [0.1, 1e10], [0.7, 1e4]]) { const { bd, bv } = best(c, Math.log(L)); const LL = Math.log(L); console.log(' ' + f(c, 2) + ' ' + L.toExponential(0).padEnd(9) + f(bd, 8).padStart(14) + f(Math.pow(LL, -c / 2), 8).padStart(15) + f(bv, 8).padStart(14) + f(2 * Math.pow(LL, -c / 2), 8).padStart(14)); } console.log(' => the stated choice delta = (log X)^{-c/2} IS the balance point, both terms'); console.log(' equal, and the resulting exponent is c/2. So c_* = c/2 is exact, not a'); console.log(' convenient rounding. VERIFIED.'); console.log('\n=== 2. Section 6: the stability inequality O(h + 1/N) ==='); // Moving (N,2N] to (t,2t] with N <= t <= (1+h)N: the symmetric difference is // (N,t] union (2N,2t], of size (t-N)+(2t-2N) = 3(t-N) <= 3hN, plus at most 2 endpoints. // For a 1-bounded sequence the normalised sums differ by at most that over N. let worstRel = 0; for (const h of [0.5, 0.1, 0.01, 0.001]) for (const N of [100, 10000, 1000000]) { const t = (1 + h) * N; const sym = (t - N) + (2 * t - 2 * N) + 2; // worst case, every element contributing 1 worstRel = Math.max(worstRel, (sym / N) / (h + 1 / N)); } console.log(' symmetric difference of (N,2N] and (t,2t] is (N,t] u (2N,2t], size 3(t-N)+O(1)'); console.log(' so the normalised sums differ by at most 3h + O(1/N) = O(h + 1/N) as stated'); console.log(' worst ratio of the true bound to (h + 1/N) over a grid of h, N: ' + f(worstRel, 4) + ' (a bounded constant, so the O() is right) VERIFIED'); console.log('\n=== 3. Section 6: does the sampling argument really give c/2, then d = c/4? ==='); // Around each dyadic point put a neighbourhood of log-length h. Stability gives // T_j <= (1/h) * integral over that neighbourhood + O(h), // and summing over the ~ (1/2) log_2 X points and dividing by log X turns the // continuous bound (6) into (1/h) L^{-c} + O(h). Balance: h = L^{-c/2}. function bal(expo, L) { // min over h of h^{-1} L^{-expo} + h let bh = 0, bv = Infinity; for (let k = 0; k <= 4000; k++) { const hh = Math.pow(L, -k / 4000 * 2); const v = Math.pow(L, -expo) / hh + hh; if (v < bv) { bv = v; bh = hh; } } return { bh, bv }; } for (const [c, L] of [[0.3, 1e6], [0.1, 1e10]]) { const LL = Math.log(L); const s1 = bal(c, LL); // continuous -> dyadic: saving c/2 at h = L^{-c/2} const s2 = bal(c / 2, LL); // then the moving-band mesh on saving c/2 console.log(' c = ' + c + ', log X = ' + f(LL, 3)); console.log(' step 1 (sampling): argmin h = ' + f(s1.bh, 8) + ' vs L^{-c/2} = ' + f(Math.pow(LL, -c / 2), 8) + ' value exponent ~ ' + f(-Math.log(s1.bv / 2) / Math.log(LL), 4) + ' vs c/2 = ' + f(c / 2, 4)); console.log(' step 2 (mesh) : argmin delta = ' + f(s2.bh, 8) + ' vs L^{-c/4} = ' + f(Math.pow(LL, -c / 4), 8) + ' value exponent ~ ' + f(-Math.log(s2.bv / 2) / Math.log(LL), 4) + ' vs c/4 = ' + f(c / 4, 4)); } console.log(' => each step is the balance point of its own two terms, so the chain'); console.log(' c -> c_* = c/2 -> d = c/4 = c_*/2 is exact at every step. VERIFIED.'); console.log('\n=== 4. How much does (7) constrain ONE dyadic scale? ==='); // (7): (1/log X) * sum_j T_j << L^{-d}, T_j = |A_w(2^j)| / (2^j (log X)^2). // There are ~ (1/2) log_2 X = log X / (2 log 2) terms. // So sum_j T_j << L^{1-d}, and a single T_j is bounded only by that. console.log(' log X #dyadic j in [sqrt X, X] sum_j T_j allowed single T_j allowed by (7)'); for (const L of [1e2, 1e4, 1e6, 1e12]) { const LL = Math.log(L), n = LL / (2 * Math.log(2)), d = 0.05; console.log(' ' + L.toExponential(0).padEnd(9) + f(n, 2).padStart(12) + Math.pow(LL, 1 - d).toExponential(3).padStart(22) + Math.pow(LL, 1 - d).toExponential(3).padStart(26)); } console.log(' The trivial bound on each T_j is O(1) (|A_w(N)|/N is at most of order log^2 X).'); console.log(' Since L^{1-d} >> 1 for every d < 1, (7) permits a single dyadic scale to sit at'); console.log(' its TRIVIAL size with no saving at all, while the average still obeys (7).'); console.log(' => (7) is not merely "not an every-dyadic bound": it imposes NO constraint'); console.log(' whatsoever on any individual prescribed dyadic scale. The notes sentence'); console.log(' "an average over dyadic scales, not a bound at every such scale" is exact,'); console.log(' and its strongest form is this one. VERIFIED, elementary.'); console.log(' This is consistent with return #88 (job #232), which argued the same for the'); console.log(' CONTINUOUS theorem by a measure argument. The two are the same gap in two'); console.log(' currencies; neither is contradicted by section 6.');