TFPT scientific source excerpt Original repository path: experiments/theory-contracts/tfpt-unified-source-derivation-20261029/aps_source_review/check_full_source_regulator.py Original file SHA-256: 694718775b75428ce173a281c688881d9e39176c37b217bcfa52a868ae3e2dae Inclusive original lines: 1-85 Line numbers below refer to the original source. This bounded excerpt is source evidence; it is not a new proof/checker run. Conversation metadata and personal execution details are omitted where indicated. 000001 | """Exact controls of full-source preservation; no new physical source model. 000002 | 000003 | Reuse the existing original finite exterior algebra. Generic even densities 000004 | span every two-mode Grassmann functional, including its quartic interaction. 000005 | Bosonic Gaussian matrices test a universal regulator implication only. 000006 | """ 000007 | from pathlib import Path 000008 | import sys,json 000009 | import sympy as s 000010 | ROOT=Path(__file__).resolve().parents[4] 000011 | sys.path.insert(0,str(ROOT/'experiments/theory-contracts/seam-collar-multifield-20261016')) 000012 | from joint_source import add,clean,exponential,multiply,scale,variable 000013 | checks={} 000014 | def equal(p,q):return not clean({m:s.simplify(p.get(m,0)-q.get(m,0)) for m in set(p)|set(q)}) 000015 | def derivative(p,j): 000016 | return clean({m^(1<0 000063 | checks['counterexample_regulator_PSD']=Rbad.is_positive_semidefinite 000064 | checks['counterexample_structural_commutation']=Rbad*P_adm==P_adm*Rbad 000065 | checks['counterexample_reflection_covariance']=theta*Rbad*theta==Rbad 000066 | checks['counterexample_RP_cross_minus_one_over16']=Cbad[0,1]==-s.Rational(1,16) 000067 | checks['good_negative_cross_regulator_preserves_RP']=Cgood[0,1]>0 000068 | # Noncommuting same-side/cross matrices: necessity needs no joint diagonalization. 000069 | A=s.Matrix([[3,1],[1,2]]);B=s.diag(1,s.Rational(1,2));R=A.row_join(-B).col_join((-B).row_join(A)) 000070 | cov=(s.eye(4)+R).inv() 000071 | checks['noncommuting_block_case']=A*B!=B*A 000072 | checks['good_full_block_PSD']=R.is_positive_semidefinite 000073 | checks['good_reflected_cross_covariance_PSD']=cov[:2,2:].is_positive_semidefinite 000074 | def mat(M):return [[str(x) for x in row] for row in M.tolist()] 000075 | checks={k:bool(v) for k,v in checks.items()} 000076 | out={'contract':'ORIGINAL-FULL-SOURCE-REGULATOR-20261030','all_passed':all(checks.values()),'checks':checks, 000077 | 'Grassmann_even_density_dimension':8,'Grassmann_quadratic_regulator_parameters':6, 000078 | 'generic_Z0_coefficients':{str(m):str(v) for m,v in z0.items()}, 000079 | 'generic_regulated_scalar':str(zr.get(0,0)), 000080 | 'counterexample':{'C':mat(C0),'R':mat(Rbad),'P_adm':mat(P_adm),'regulated_C':mat(Cbad)}, 000081 | 'good_regulator':{'R':mat(Rgood),'regulated_C':mat(Cgood)}, 000082 | 'scope':'Generic finite exterior-algebra identities and finite tests of the analytic regulator cone. No original TFPT measure chosen; native68 states are not configuration fields. Whole RP/continuum/source origin not claimed.'} 000083 | Path(__file__).with_name('FULL-SOURCE-REGULATOR.json').write_text(json.dumps(out,indent=2)+'\n') 000084 | print(json.dumps(out,indent=2)) 000085 | if not out['all_passed']:raise RuntimeError('Full-source preservation check failed')