diff --git a/reviews/lm006_quantified_regression_20261005/NOTE.md b/reviews/lm006_quantified_regression_20261005/NOTE.md new file mode 100644 index 000000000..a58948d25 --- /dev/null +++ b/reviews/lm006_quantified_regression_20261005/NOTE.md @@ -0,0 +1,302 @@ +# LM006: an explicit linear coupling rate from the pin-frame derivatives + +Dylan Roy — delegated AI mathematical work. Actual author OpenAI / GPT-6 +Astra Pro, `round17-quantified-regression-audit-20261005`. Scientific effect NONE. +This is a new analytic companion with finite exact checks, not a Lean theorem, +scientific-status change, or independent reclassification of an older proof. + +## 1. What is new, and which hypotheses are stronger + +Math-#301's endpoint note at `e31b6ad8356e0760c8a7fb6e816ff640c45176c9`, +`reviews/lm006_endpoint_extension_20261005/NOTE.md`, blob +`551aa563562bc88a19e33d146259c03aa2d318f6`, proves qualitative convergence +using mean-square F C3, H_y C2 and Q continuous. Here +F(x)=f(x,0), H_y(x)=f_y(x,0), Q(x)=f_yy(x,0). Its explicit frame and adjusted +endpoint formulas, not an unspecified historical frame, are our inputs. + +We assume instead F C4, H_y C3 and Q C1 as maps into the common Gaussian +Hilbert space H=L2 of the UNCONDITIONED field. This extra regularity yields +quantified row errors. A finite eighth spectral moment is sufficient; the +older sixth-moment assumption alone is not silently upgraded. Section 6 +gives a well-posed Gaussian counterexample to such an upgrade. + +Our contribution is an explicit regression-residual coupling and its constant +K, with e_r <= K r despite a singular limiting endpoint covariance. We do not +assume a Lipschitz estimate for the principal covariance square-root map. +Pathwise Gaussian conditioning is established prior methodology; see Wilson, +Borovitskiy, Terenin, Mostowsky and Deisenroth, JMLR 22(105):1–47 (2021), +*Pathwise Conditioning of Gaussian Processes*, arXiv:2011.04026. Only its +abstract/publication record was consulted; no theorem is imported from it. +The Gaussian argument below is complete. Repository remote-window work also +already uses regression couplings; no general coupling novelty is claimed. + +## 2. A quantitative finite-target conditioning lemma + +Let P_r in H^p and V_r in H^q be centered jointly Gaussian random vectors on +ONE probability space, for 0<=r<=Rbar, where 0= lambda I_p, lambda>0. + +All constants are fixed, not r-dependent. Let prescribed pin values d_r +satisfy ||d_0||<=d0 and ||d_r-d_0||<=Ld r. Define + + U=p0+Lp Rbar, V=v0+Lv Rbar, + Lg=2 U Lp, Lk=U Lv+V Lp, + B=2 V U/lambda, + Lb=2 Lk/lambda + 2 V U Lg/lambda^2, + Cm=Lb d0+B Ld, Cz=Lv+Lb p0+B Lp, + K=sqrt(Cm^2+Cz^2). (2) + +Set R=min(Rbar,lambda/(2 Lg)) when Lg>0, and R=Rbar if Lg=0. +For every r in [0,R], G_r is positive definite and the canonical conditional +law of V_r given P_r=d_r admits a joint Gaussian coupling X_r,X_0 with + + e_r^2=E||X_r-X_0||^2 <= K^2 r^2. (3) + +This is a statement for every prescribed d_r, not conditioning on a +positive-probability event. No lower eigenvalue bound on the TARGET's +conditional covariance is needed. A singular target law is permitted. + +### Proof with constants + +For Hilbert-valued vector rows, Cauchy–Schwarz entrywise gives +||Cov(A,B)||_F <= ||A||_H ||B||_H. Thus, writing +G_r=Cov(P_r), J_r=Cov(V_r,P_r), + + ||G_r-G_0||_op <= Lg r, + ||J_r-J_0||_F <= Lk r, ||J_r||_F <= V U. (4) + +The first bound uses (||P_r||_H+||P_0||_H)||P_r-P_0||_H. +The second uses Cov(V_r-V_0,P_r)+Cov(V_0,P_r-P_0). The radius ensures +G_r >= lambda I/2 and ||G_r^-1||_op<=2/lambda. The resolvent identity gives + + ||G_r^-1-G_0^-1||_op <= 2 Lg r/lambda^2. + +Let B_r=J_r G_r^-1. Then ||B_r||_F<=B and +||B_r-B_0||_F<=Lb r. These estimates use the PIN Gram inverse only. +Now set + + Z_r=V_r-B_r P_r, m_r=B_r d_r, + X_r=m_r+Z_r. (5) + +The residual Z_r is Gaussian and Cov(Z_r,P_r)=0. The joint Gaussian +characteristic function therefore factors, even when Cov(Z_r) is singular; +Z_r is independent of P_r. Consequently X_r has precisely the canonical +conditional law of V_r given P_r=d_r. + +All Z_r are on the original unconditioned probability space. Algebra gives + + ||m_r-m_0|| <= ||B_r-B_0||_F ||d_0||+||B_r||_F||d_r-d_0|| + <= Cm r, + ||Z_r-Z_0||_H + <= ||V_r-V_0||_H+||(B_r-B_0)P_0||_H+||B_r(P_r-P_0)||_H + <= Cz r. + +The residual difference is centered, so its cross term with the deterministic +mean difference is zero. Squaring gives (3). This does not assert that the +coupling is optimal or a common conditional realization of every full-field +event. For each fixed pair r,0, the joint residual vector in R^(2q) has a +positive-semidefinite covariance and a standard finite Gaussian +representation. Its two factor blocks A_r,A_0 have a common width at most +2q, and + + ||m_r-m_0||^2+||A_r-A_0||_F^2=e_r^2. (6) + +Thus the factor-error premise used in #315/#318 is satisfied by THESE +coupling factors. It is not a rate for separately selected principal roots. +The unweighted endpoint laws also satisfy W2<=e_r by the definition as an +infimum over couplings; no W2 claim for their tilted laws is inferred. + +## 3. Row rates for exactly the LM006 pin-adjusted coordinates + +Use I=[-1/2,1/2], and the exact #301 frame + + P0=(F(-r/2)+F(r/2))/2, + P1=(F'(-r/2)+F'(r/2))/2, + P2=(H_y(-r/2)+H_y(r/2))/2, + P3=int_I F''(ru)du, P4=int_I H_y'(ru)du, + P5=6 int_I (1/4-u^2)F'''(ru)du. (7) + +The last three integral identities are the divided differences in #301; +its inverse frame loses no raw pin. At zero, P equals +(f,f_x,f_y,f_xx,f_xy,f_xxx)(0). For b=6/5, heights b and b-r^3/6 and zero +endpoint gradients give exactly + + d_r=(b-r^3/12,0,0,0,0,2), ||d_r-d_0||=r^3/12. + +We can take Ld=Rbar^2/12 and d0=sqrt(b^2+4). This is the exact target, +not an unproved inference from the endpoint types. + +Let F_j, H_j and Q_1 be uniform Hilbert-norm upper bounds on the indicated +mean-square derivatives over [-Rbar/2,Rbar/2]. The fundamental theorem gives +||U(ru)-U(0)||_H<=|ru| sup||U'||_H. Applying it to (7) yields component +rate bounds + + (F1/2, F2/2, H1/2, F3/4, H2/4, 3 F4/16). + +Here int_I |u| du=1/4 and 6 int_I |u|(1/4-u^2)du=3/16. Therefore + + Lp^2=F1^2/4+F2^2/4+H1^2/4+F3^2/16+H2^2/16+9F4^2/256. (8) + +For the adjusted target vector V_r=(A_-,A_+,B_-,B_+,C_-,C_+), use exactly + + A_-=-int_I(1/2-u)F'''(ru)du, A_+=int_I(1/2+u)F'''(ru)du, + B_-=-int_I(1/2-u)H_y''(ru)du, B_+=int_I(1/2+u)H_y''(ru)du, + C_-=Q(-r/2), C_+=Q(r/2). (9) + +Since int_I |u|(1/2±u)du=1/8, the six component bounds are +(F4/8,F4/8,H3/8,H3/8,Q1/2,Q1/2), so + + Lv^2=F4^2/32+H3^2/32+Q1^2/2. (10) + +The subtraction of P3/P4 is performed BEFORE conditioning. On the actual +pin subspace these rows become the physical Hessian entries divided by r. +Using raw unconditioned F''/r instead would not satisfy (1). + +Equations (8)–(10), positive pin Gram, and the exact target now discharge +(1) and give (3) on the explicit sufficient radius. The limiting conditioned +vector is the #301 section (-1,1,-a/2,a/2,Q_L,Q_L). In particular its first +two entries are deterministic and its last two coincide; nothing in the +proof requires their six-dimensional covariance to be invertible. + +## 4. A sufficient spectral class; no numerical field certificate + +Suppose an actual centered stationary real Gaussian field has covariance + + C(z)=sum_{k in Z^2} p_k exp(i nu k.z), nu=2pi/L, + p_k=p_-k>=0, S8=sum_k p_k(1+|nu k|^8)0. The canonical conditional Q_L +is then a nondegenerate real Gaussian; its negative half-line has positive +probability, so z0=E(Q_L)_-^2>0. + +This proves a conditional spectral-class corollary, not an assertion that an +unread named field or finite approximation has (11) with all weights positive. +The all-positive hypothesis can be weakened to independence on the actual +support; merely having a finite S8 is not nondegeneracy. Choose Rbar0, either as an explicit premise or via §4's +strictly-positive spectral hypothesis. From (5), uniformly in [0,R], + + ||m_r|| <= B(d0+Ld Rbar)=:M, + ||Cov(X_r)||_op <= E||V_r||^2 <= V^2=:Lambda. + +The covariance bound is the usual subtraction of a positive-semidefinite +regression term. It does not bound the mean, which was handled separately. +Use #315's pointwise estimate and integrate its ABSOLUTE value, as #318 did. +With the exact physical endpoint function T_r and z_r=E T_r=Z_r^phys/r^2, + + Delta_r=E|T_r(X_r)-T_0(X_0)| <= Cw r, + Cw=Bs K+Ds, + Bs=sqrt(2048(M^6+480 Lambda^3)), Ds=8(M^4+48 Lambda^2). (13) + +For r<=Rz=min(R,z0/(2Cw)) when Cw>0 (omit the second term when Cw=0), +z_r>=z0/2. This is a symbolic sufficient radius, not a computed enclosure. +#318 gives d_BL(nu_r,nu_0)=O(r) with its displayed constant and metric +convention. It still does not give total-variation convergence of the two +endpoint pushforwards; their singular-support obstruction is unaffected. + +The separately reviewed #325 NOTE, at1dfe801eb61a8335a2e42b886fca9b000fb3598c, +`reviews/lm006_typed_sign_suppression_20261005/NOTE.md`, blob +`9015971fa03f44ae99d410facc6f3d8c26cdc945`, (8), gives for E={c_+>=0} + + E[T_r(X_r)1_E] <= sqrt(2 C6) K r^2 + sqrt(105 C2) K^4 r^4/8, + C2=M^2+6Lambda, C6=32(M^6+480Lambda^3). + +Therefore, for 0=order: row[index]=c*F(math.factorial(degree),math.factorial(degree-order))*x**(degree-order) + return row + zero=F(0); h=r/2 + if not r: + p=[derivative(f,zero,0),derivative(f,zero,1),derivative(hy,zero,0),derivative(f,zero,2),derivative(hy,zero,1),derivative(f,zero,3)] + f3=derivative(f,zero,3); h2=derivative(hy,zero,2) + v=[[-x/2 for x in f3],[x/2 for x in f3],[-x/2 for x in h2],[x/2 for x in h2],derivative(q,zero,0),derivative(q,zero,0)] + else: + raw=[derivative(f,-h,0),derivative(f,-h,1),derivative(hy,-h,0),derivative(f,h,0),derivative(f,h,1),derivative(hy,h,0)] + p=transpose([frame(col,r) for col in zip(*raw)]) + v=[[(x-y)/r for x,y in zip(derivative(f,-h,2),p[3])],[(x-y)/r for x,y in zip(derivative(f,h,2),p[3])],[(x-y)/r for x,y in zip(derivative(hy,-h,1),p[4])],[(x-y)/r for x,y in zip(derivative(hy,h,1),p[4])],derivative(q,-h,0),derivative(q,h,0)] + d=[F(6,5)-r**3/12,F(0),F(0),F(0),F(0),F(1) if mutant=='M3' else F(2)] + return p,v,d + + +def rough_model(n): + """C3-not-C4 example: replace Z8*x^4/24 by Z8*|x|^(7/2).""" + if type(n) is not int or n<2: raise ValueError('integer n>=2 required') + p,v,d=model(F(2,n*n)) + p[0][8]=F(1,n**7); p[1][8]=F(0); p[3][8]=F(7,2*n**3); p[5][8]=F(0) + v[0][8]=v[1][8]=F(21,8*n) + return p,v,d + + +def require(ok,reason): + if not ok: raise ValueError(reason) + + +def controls(mutant=None): + count=0 + m,res=condition(eye(2),eye(2),[F(1),F(2)],mutant) + require(m==[F(1),F(2)],'CONDITIONAL_MEAN'); count+=1 + require(res==[[F(0)]*2 for _ in range(2)],'RESIDUAL_ORTHOGONALITY'); count+=1 + mean,_=condition(*model(F(0),mutant)) + require(mean[:2]==[F(-1),F(1)],'CUBIC_PIN_TARGET'); count+=1 + k=F(3,32) if mutant=='M4' else kernel_constants()[0] + require(k==F(3,16),'KERNEL_LIPSCHITZ_MASS'); count+=1 + for n in (2,4,8,16,32): + r=F(1,n) + require(r<= (r*r if mutant=='M5' else r),'NO_SQRT_LIPSCHITZ'); count+=1 + ratio=F(21*n,16) + require(ratio<=(F(25) if mutant=='M6' else F(21*n,16)),'EXTRA_REGULARITY_REQUIRED'); count+=1 + for r in (F(1),F(1,2),F(1,8)): + for j in range(12): + raw=tuple(F((j+3*i)%11-5,3) for i in range(6)) + require(inverse_frame(frame(raw,r),r)==raw,'FRAME_INVERSE'); count+=1 + p0,v0,d0=model(F(0)); y=condition(p0,v0,d0) + for j in range(1,15): + r=F(1,2**j); p,v,d=model(r); x=condition(p,v,d) + require(mul(x[1],transpose(p))==[[F(0)]*6 for _ in range(6)],'RESIDUAL_ORTHOGONALITY'); count+=1 + require(frob2(sub(p,p0))<=4*r*r and frob2(sub(v,v0))<=4*r*r,'ROW_RATES'); count+=1 + if r<=F(1,40): + e2=coupling_error_sq(x,y) + require(F(1,2)*r*r<=e2<=(F(10042,3)**2+2590**2)*r*r,'QUANTIFIED_RATE'); count+=1 + return {'controls':count,'scientific_effect':'NONE','meaning':'finite exact regression and countermodels; not Lean or an infinite-field realization'} + + +def main(): + parser=argparse.ArgumentParser(description=__doc__) + parser.add_argument('--mutant',choices=['M'+str(i) for i in range(1,7)]) + args=parser.parse_args() + try: result=controls(args.mutant) + except (ValueError,TypeError) as exc: + print('REGRESSION_FAIL: '+str(exc),file=sys.stderr); return 1 + print(json.dumps(result,sort_keys=True)); return 0 +if __name__=='__main__': sys.exit(main()) diff --git a/reviews/lm006_quantified_regression_20261005/test_regression.py b/reviews/lm006_quantified_regression_20261005/test_regression.py new file mode 100644 index 000000000..c0affa36d --- /dev/null +++ b/reviews/lm006_quantified_regression_20261005/test_regression.py @@ -0,0 +1,89 @@ +"""Exact rational controls; these tests do not execute Lean or an infinite field.""" +from fractions import Fraction as F +from pathlib import Path +import importlib.util, itertools, json, subprocess, sys, unittest +P=Path(__file__).with_name('regression_check.py') +class RegressionTests(unittest.TestCase): + def setUp(self): + self.assertTrue(P.is_file(), 'quantified-regression implementation not supplied') + spec=importlib.util.spec_from_file_location('regression_check', P) + self.m=importlib.util.module_from_spec(spec); spec.loader.exec_module(self.m) + def test_kernel_constants(self): + self.assertEqual(self.m.kernel_constants(), (F(3,16),F(1,8),F(1,4))) + def test_frame_inverse(self): + for r in (F(1),F(1,2),F(1,8)): + for j in range(12): + raw=tuple(F((j+3*i)%11-5,3) for i in range(6)) + self.assertEqual(self.m.inverse_frame(self.m.frame(raw,r),r),raw) + def test_contact_rows(self): + p,v,d=self.m.model(F(0)) + self.assertEqual(self.m.mul(p,self.m.transpose(p)),self.m.eye(6)) + m,res=self.m.condition(p,v,d) + self.assertEqual(m[:2], [F(-1),F(1)]) + self.assertEqual(res[0], [F(0)]*11) + self.assertEqual(res[1], [F(0)]*11) + self.assertEqual(res[4],res[5]) + def test_residual_orthogonality(self): + for k in range(1,9): + p,v,d=self.m.model(F(1,2**k)); m,res=self.m.condition(p,v,d) + self.assertEqual(self.m.mul(res,self.m.transpose(p)), [[F(0)]*6 for _ in range(6)]) + def test_conditional_mean(self): + p=[[1,0],[0,1]]; v=[[2,1],[-1,3]]; d=[F(1,3),F(-2)] + mean,res=self.m.condition(p,v,d) + self.assertEqual(mean,[F(-4,3),F(-19,3)]) + self.assertEqual(res,[[F(0),F(0)],[F(0),F(0)]]) + def test_common_coupling_second_moment(self): + m=[F(1,2),F(-1)]; n=[F(0),F(2)] + a=[[F(1),F(2)],[F(-1),F(1)]]; b=[[F(2),F(1)],[F(0),F(-2)]] + total=F(0) + for z in itertools.product((-1,1),repeat=2): + diff=[m[i]-n[i]+sum((a[i][j]-b[i][j])*z[j] for j in range(2)) for i in range(2)] + total+=sum(x*x for x in diff)/4 + self.assertEqual(total,self.m.coupling_error_sq((m,a),(n,b))) + def test_quantified_rate_and_nontrivial_error(self): + y=self.m.condition(*self.m.model(F(0))) + K2=F(10042,3)**2+F(2590)**2 + for k in range(6,15): + r=F(1,2**k); p,v,d=self.m.model(r) + e2=self.m.coupling_error_sq(self.m.condition(p,v,d),y) + self.assertLessEqual(e2,K2*r*r) + self.assertGreaterEqual(e2,F(1,2)*r*r) + def test_pin_and_target_row_rates(self): + p0,v0,_=self.m.model(F(0)) + for k in range(1,10): + r=F(1,2**k); p,v,_=self.m.model(r) + self.assertLessEqual(self.m.frob2(self.m.sub(p,p0)),4*r*r) + self.assertLessEqual(self.m.frob2(self.m.sub(v,v0)),4*r*r) + def test_singular_square_root_and_weaker_regularities(self): + for n in (2,4,8,16,32): + r=F(1,n) + self.assertGreater(r,r*r) + # F(x)=|x|^(7/2), h=1/n^2: adjusted A=21/(8n), r=2/n^2. + self.assertEqual(F(21,8*n)/F(2,n*n),F(21*n,16)) + pins,targets,d=self.m.rough_model(n) + mean,res=self.m.condition(pins,targets,d) + h=F(1,n*n) + expected=F(441,64)*h/(1+F(49,4)*h**3+F(9,16)*h**7) + self.assertEqual(sum(x*x for x in res[0]),expected) + def test_input_rejections(self): + for r in (F(-1),F(2),True,0.1): + with self.assertRaises((ValueError,TypeError)): self.m.model(r) + with self.assertRaises(ValueError): self.m.inverse([[1,1],[1,1]]) + with self.assertRaises(ValueError): self.m.condition([[1,0]], [[1]], [1]) + def test_cli_controls_and_faults(self): + names=['CONDITIONAL_MEAN','RESIDUAL_ORTHOGONALITY','CUBIC_PIN_TARGET','KERNEL_LIPSCHITZ_MASS','NO_SQRT_LIPSCHITZ','EXTRA_REGULARITY_REQUIRED'] + outputs=[] + for flags in (['-B','-S'],['-B','-O','-S']): + run=subprocess.run([sys.executable,*flags,str(P)],capture_output=True,text=True,timeout=20) + self.assertEqual(run.returncode,0,run.stderr); self.assertEqual(run.stderr,'') + self.assertGreater(json.loads(run.stdout)['controls'],0); outputs.append(run.stdout) + for i,name in enumerate(names,1): + bad=subprocess.run([sys.executable,*flags,str(P),'--mutant','M'+str(i)],capture_output=True,text=True,timeout=20) + self.assertEqual((bad.returncode,bad.stdout,bad.stderr),(1,'','REGRESSION_FAIL: '+name+'\n')) + self.assertEqual(outputs[0],outputs[1]) + def test_cli_invalid(self): + for flags in (['-B','-S'],['-B','-O','-S']): + for args in (['--mutant','M9'],['--bogus'],['--mutant']): + run=subprocess.run([sys.executable,*flags,str(P),*args],capture_output=True,text=True,timeout=10) + self.assertEqual(run.returncode,2) +if __name__=='__main__': unittest.main()