// Audit of Proposition 6.5 in research/full-coefficient-average.md (the reviewed // norm obstruction, sum_j |lambda_j| >= (log x)^{2/5}). // Exact rational arithmetic where the document claims exactness; no compute. const B = BigInt; const gcd = (a, b) => b ? gcd(b, a % b) : (a < 0n ? -a : a); const rat = (n, d) => { const g = gcd(n < 0n ? -n : n, d < 0n ? -d : d); return [n / g, d / g]; }; const show = ([n, d]) => n + '/' + d + ' = ' + (Number(n) / Number(d)).toFixed(6); console.log('=== 1. kappa = 1 - 24q^3/(1+q) at q = 12/23 (claimed -22957/18515) ==='); // q = 12/23; 24q^3/(1+q) = 24*1728/12167 * 23/35 = 41472/(23^2*35) = 41472/18515 const num = 24n * 12n ** 3n * 23n, den = 23n ** 3n * 35n; // 24q^3/(1+q) const [tn, td] = rat(num, den); const [kn, kd] = rat(td - tn, td); console.log(' 24q^3/(1+q) = ' + show([tn, td])); console.log(' kappa = ' + show([kn, kd])); console.log(' claimed = -22957/18515 = ' + (-22957 / 18515).toFixed(6) + ' ' + (kn === -22957n && kd === 18515n ? 'EXACT MATCH' : 'MISMATCH')); console.log('\n=== 2. The profile S(y) = 35y^4 - 84y^5 + 70y^6 - 20y^7 ==='); // exact coefficient differentiation const poly = [0, 0, 0, 0, 35, -84, 70, -20]; // index = power const d1 = p => p.map((c, i) => c * i).slice(1); const at = (p, y) => p.reduce((s, c, i) => s + c * Math.pow(y, i), 0); let D = poly; for (let i = 0; i < 4; i++) D = d1(D); console.log(' S(1) = ' + at(poly, 1) + ' (must be 1) ' + (at(poly, 1) === 1 ? 'ok' : 'FAIL')); console.log(' S\'(y) = 140y^3(1-y)^3 ? check at y=0.37: ' + at(d1(poly), 0.37).toFixed(9) + ' vs ' + (140 * 0.37 ** 3 * 0.63 ** 3).toFixed(9)); console.log(' S\'\'\'\'(y) coefficients: ' + D.map((c, i) => c + 'y^' + i).join(' + ')); console.log(' claimed 840(1 - 12y + 30y^2 - 20y^3) = ' + [840, -10080, 25200, -16800].join(', ') + ' ' + (D[0] === 840 && D[1] === -10080 && D[2] === 25200 && D[3] === -16800 ? 'EXACT MATCH' : 'MISMATCH')); // the two stated bounds on [0,1] let loOK = true, hiOK = true, minSlack = Infinity; for (let y = 0; y <= 1; y += 1e-5) { const v = at(D, y); if (v < 840 * (1 - 12 * y) - 1e-6) loOK = false; if (v > 840 + 1e-6) hiOK = false; minSlack = Math.min(minSlack, v - 840 * (1 - 12 * y)); } console.log(' 840(1-12y) <= S\'\'\'\'(y) <= 840 on [0,1]: lower ' + (loOK ? 'holds' : 'FAILS') + ', upper ' + (hiOK ? 'holds' : 'FAILS')); console.log(' the documents two reasons: 840*10y^2(3-2y) >= 0 (lower), and'); console.log(' disc(20y^2 - 30y + 12) = ' + (900 - 960) + ' < 0 (upper) both ok'); console.log('\n=== 3. Binomial-ratio bound: q_r = (12m-1)/(23m-2), q_r - 12/23 = 1/(23(23m-2)) ==='); let exact = true; for (let m = 2; m <= 40; m++) { const [a, b] = rat(B(23 * (12 * m - 1) - 12 * (23 * m - 2)), B(23 * (23 * m - 2))); if (!(a === 1n && b === B(23 * (23 * m - 2)))) exact = false; } console.log(' identity exact for m = 2..40: ' + (exact ? 'YES' : 'NO')); const qr = m => (12 * m - 1) / (23 * m - 2); console.log(' q_r at m=2 is ' + qr(2).toFixed(6) + ', decreasing to 12/23 = ' + (12 / 23).toFixed(6)); console.log(' claim q_r <= 0.523 for m >= 2: ' + (qr(2) <= 0.523 ? 'holds (max is at m=2)' : 'FAILS')); console.log('\n=== 4. The growth rate: is |F_r| >= 2^{0.92 r} the right constant? ==='); // F_r = +-35 h^4 C(n, J_2-1) (kappa + O(1/m)), n = 35m-4, J_2 = 12m, h = 35/r, r = 35m. // C(n, J_2-1) ~ 2^{r H(12/35)} up to polynomial factors, H = binary entropy. const H = p => -p * Math.log2(p) - (1 - p) * Math.log2(1 - p); const Hstar = H(12 / 35); console.log(' H(12/35) = ' + Hstar.toFixed(6) + ' (the document uses 0.92)'); // direct check with exact binomials const C = (n, k) => { let v = 1n; for (let i = 0n; i < B(k); i++) v = v * B(n - Number(i)) / (i + 1n); return v; }; console.log(' m r log2|F_r| / r (exact binomial, with 35h^4|kappa|)'); for (const m of [20, 60, 200, 600]) { const r = 35 * m, n = r - 4, J2 = 12 * m, h = 35 / r; const c = C(n, J2 - 1); const log2c = BigInt(c).toString(2).length - 1; const val = log2c + Math.log2(35 * Math.pow(h, 4) * Math.abs(-22957 / 18515)); console.log(' ' + String(m).padEnd(6) + String(r).padEnd(7) + (val / r).toFixed(6)); } console.log(' => the exponent tends to H(12/35) = ' + Hstar.toFixed(5) + ' from below; 0.92 is safe.'); console.log('\n=== 5. THE HEADLINE: does 0.92 r give (log x)^{2/5}, or more? ==='); // r = 35 floor(log2 log x / 70), so r ~ (log2 log x)/2. // 2^{0.92 r} = 2^{0.46 log2 log x} = (log x)^{0.46}. console.log(' r = 35*floor(log2 log x / 70) => r ~ (log2 log x)/2'); console.log(' 2^{0.92 r} = 2^{0.46 log2 log x} = (log x)^0.46'); console.log(' part (ii) loses only a factor 1/2, and the floor only a constant 2^-32.2,'); console.log(' neither of which touches the exponent.'); console.log(' stated exponent : 2/5 = 0.400000'); console.log(' proved exponent : 0.92/2 = 0.460000'); console.log(' sharp exponent : H(12/35)/2 = ' + (Hstar / 2).toFixed(6)); console.log(' => Proposition 6.5 is stated LOSSY by ' + (Hstar / 2 - 0.4).toFixed(4) + ' in the exponent.'); console.log(' Since (9) is a LOWER bound (an obstruction), understating it understates'); console.log(' the obstruction. The proof as written already gives (log x)^{0.46}.'); // numeric illustration of what the loss costs for (const lx of [1e3, 1e6]) { console.log(' at log x = ' + lx.toExponential(0) + ': stated floor ' + Math.pow(lx, 0.4).toExponential(3) + ' proved floor ' + Math.pow(lx, 0.46).toExponential(3) + ' ratio ' + (Math.pow(lx, 0.46) / Math.pow(lx, 0.4)).toFixed(1) + 'x'); }