#!/usr/bin/env python3 """Build outputs/job4472/attack0830_dband.js from attack0830_level23.js. Job #4472. PART G of the served producer splits the dominant mix2a cell (n0 | h, e | h-+2, n = n0 e <= 2L) only at the balance threshold L^(2/5). The two magnitude statements in the record's own open-step discussion are stricter than that split: * DFI97 Theorem 1 (as the record reads it, via Shen 2607.06575 Lemma 5) saves `D^(-1/2) + sqrt(D/E)` only for a fixed-power short factor `L^delta <= D <= L^(2/5)`, i.e. it reaches no d below every fixed power; * Harper arXiv:2412.19644v1 Theorem 1 needs `sqrt(2N) < Q <= N` with N the length of the sum, so for the cell's `d`, `N = L/d` and the theorem is silent unless `d > (2L)^(1/3)`. So the cell is re-binned here on d = min(n0, e) at `L^0.1`, `L^(1/3)`, `L^(2/5)`. Nothing else changes: same levels (x = 7..23), same weights, same identity COUNT - MAIN = REM. """ import os import sys HERE = os.path.dirname(os.path.abspath(__file__)) SRC = os.path.join(HERE, "attack0830_level23.js") DST = os.path.join(HERE, "attack0830_dband.js") START = """// --------------------------------------------------------------------------- console.log('\\n=== PART G: the mix2a cell below 2L, split by balance of the two parts ===');""" END = """// ============================================================================ // OUTPUT — EMBEDDED, do not hand-edit. Regenerate:""" NEW = r"""// --------------------------------------------------------------------------- // PART G' : ADDED by job #4472. The same mix2a cell below 2L, binned on the // SMALL part d = min(n0, e) at L^0.1, L^(1/3) and L^(2/5), because the two // printed bounds the record prices the cell against are range-restricted: // DFI97 Thm 1 needs d >= L^delta (fixed delta), Harper Thm 1 needs // d > (2L)^(1/3). Nothing else about the cell changes. console.log('\n=== PART G\': the mix2a cell below 2L binned on the small part d = min(n0, e) ==='); console.log(' d-bins: d<=L^0.1 | L^0.1L^(2/5)'); console.log(' (Harper Thm 1 covers only d > (2L)^(1/3); DFI97 Thm 1 only d >= L^delta, any fixed delta > 0)'); console.log(' x | bin | COUNT | MAIN | REM | del*REM | share | d-hi'); const DB=[]; for(const lv of LV){ const {x,L}=lv; const K=L/6; const R=RES.find(r=>r.x===x); const D=R.D, delta=R.delta; const ps=primesUpTo(R.y).filter(p=>p>=7), np=ps.length; const T=[Math.pow(L,0.1),Math.pow(L,1/3),Math.pow(L,0.4)]; const bnames=['d<=L^0.1','L^0.1L^(2/5)']; const binOf=v=>{let i=0; while(iT[i]) i++; return i;}; const lam0=ps.map(p=>2/(p-4)), lam1=ps.map(p=>1/(p-4)); const cnt=[new Int32Array(K),new Int32Array(K),new Int32Array(K)]; const starts=(p)=>{const i6=inv6(p);return [p,(2*i6)%p||p,((p-2)*i6)%p||p];}; for(let i=0;i{const a=off[j][k],b=off[j][k+1]; const out=[[1,1]]; for(let q=a;qnew Kah()); for(let k=1;ks[0]>1); for(const j of [1,2]){ const SE=subs(j,k).filter(s=>s[0]>1); for(const [a0,w0] of S0) for(const [ae,we] of SE){ const n=a0*ae; if(n>2*L) continue; CU[binOf(Math.min(a0,ae))].add(base*w0*we); } } } const MU=[0,1,2,3].map(()=>new Kah()); (function desc(i,n0,e,w){ if(n0>1&&e>1){ MU[binOf(Math.min(n0,e))].add(2*L*D*w/(n0*e)); } for(let j=i;j2*L) break; desc(j+1,n0*p,e,w*lam0[j]); desc(j+1,n0,e*p,w*lam1[j]);} })(0,1,1,1); const cell=R.COUNT[3][0]-R.MAIN[3][0]; let tot=0; const rows=[]; for(let b=0;b<4;b++){const c=CU[b].get(),m=MU[b].get(); rows.push([c,m,c-m]); tot+=c-m;} const sumc=rows.reduce((s,r)=>s+r[0],0), summ=rows.reduce((s,r)=>s+r[1],0); assert(Math.abs(sumc-R.COUNT[3][0])<1e-6*Math.max(1,R.COUNT[3][0])&&Math.abs(summ-R.MAIN[3][0])<1e-6*Math.max(1,R.MAIN[3][0]),'d-bin split re-sums to the mix2a n<=2L cell at x='+x); console.log(' --- x = '+x+' L = '+L+' L^0.1 = '+f3(T[0])+' (2L)^(1/3) = '+f3(Math.pow(2*L,1/3))+' L^(1/3) = '+f3(T[1])+' L^(2/5) = '+f3(T[2])); for(let b=0;b<4;b++) console.log(' '+pad(x,4)+' | '+pad(bnames[b],14)+' | '+pad(f6(rows[b][0]),14)+' | '+pad(f6(rows[b][1]),14)+' | '+pad(f6(rows[b][2]),14)+' | '+pad(f6(delta*rows[b][2]),7)+' | '+pad(f4(rows[b][2]/tot),7)+' | '+pad(f3(b<3?T[b]:0),6)); DB.push({x,L,T,bnames,rows,tot,delta}); } console.log('\n share of the cell REM by d-bin, and the DFI-covered / Harper-covered sub-shares:'); for(const r of DB){ const sh=r.rows.map(v=>v[2]/r.tot); const d0=Math.pow(r.L,0.1), dH=Math.pow(2*r.L,1/3), d40=Math.pow(r.L,0.4); console.log(' x = '+pad(r.x,2)+' '+r.bnames.map((n,i)=>n+': '+f4(sh[i])).join(' ')); // Harper: d > (2L)^(1/3) only. DFI: L^delta <= d (fixed delta, no lower reach). console.log(' d <= (2L)^(1/3) carries '+f4(sh[0]+sh[1])+' of the cell REM; beyond it (Harper range) carries '+f4(sh[2]+sh[3])); } console.log(' => the cell is dominated by d at or below the small scale, so the printed bounds that need a'); console.log(' fixed-power or sqrt(2N) lower reach do not see the mass of the obstruction.'); """ def main(): src = open(SRC, encoding="utf-8").read() i = src.index(START) j = src.index(END) out = src[:i] + NEW + src[j:] open(DST, "w", encoding="utf-8", newline="\n").write(out) print("wrote %s (%d bytes)" % (DST, len(out))) return 0 if __name__ == "__main__": sys.exit(main())