TFPT scientific source excerpt Original repository path: experiments/theory-contracts/tfpt-unified-source-derivation-20261029/aps_source_review/check_b1_whole_source_reduction.py Original file SHA-256: d7230cf739c0f0d327c9b8eec369cf42d9b13909cbf06f3c7c0f9d5ef5a7cc65 Inclusive original lines: 1-132 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 | """B1 continuation: exact reducing images and a whole-source counterexample. 000002 | 000003 | Uses the existing exact intertwiner solver. Finite statements do not identify 000004 | the physical P_F or replace the circle domain by a finite Hilbert space. 000005 | """ 000006 | from pathlib import Path 000007 | import json 000008 | import sys 000009 | import sympy as s 000010 | 000011 | ROOT = Path(__file__).resolve().parents[4] 000012 | sys.path.insert(0, str(ROOT / 'experiments/theory-contracts/seam-constructive-search-20261015/operator_synthesis')) 000013 | from intertwiner_search import equation, restrict 000014 | 000015 | checks = {} 000016 | records = [] 000017 | Z = s.diag(1, -1) 000018 | S = s.Matrix([[0, 1], [1, 0]]) 000019 | N = s.Matrix([[0, -1], [1, 0]]) 000020 | checks['normal_sign_NZ_S'] = N*Z == S 000021 | checks['normal_sign_NS_minus_Z'] = N*S == -Z 000022 | 000023 | for r, t in [(1, 1), (1, 2), (2, 2)]: 000024 | n = r+t 000025 | g = s.diag(*([1]*r+[-1]*t)) 000026 | generators = [] 000027 | for i in range(n): 000028 | a = s.zeros(n); a[i, i] = 1 000029 | generators.append(s.kronecker_product(Z, a)) 000030 | for i in range(n): 000031 | for j in range(i+1, n): 000032 | x = s.zeros(n); x[i,j] = x[j,i] = 1 000033 | y = s.zeros(n); y[i,j] = s.I; y[j,i] = -s.I 000034 | normal = Z if g[i,i] == g[j,j] else -S 000035 | generators.extend([s.kronecker_product(normal,x), s.kronecker_product(normal,y)]) 000036 | dim = 2*n 000037 | basis = s.eye(dim*dim) 000038 | dimensions = [] 000039 | for b in generators: 000040 | basis = restrict(basis, [equation(b,b,False)]) 000041 | dimensions.append(basis.cols) 000042 | Gamma = s.kronecker_product(Z,g) 000043 | candidate = s.Matrix.hstack(s.Matrix(s.eye(dim)).reshape(dim*dim,1),Gamma.reshape(dim*dim,1)) 000044 | checks[f'commutant_{r}_{t}_exact_span_I_Gamma'] = basis.cols == 2 and candidate.row_join(basis).rank() == 2 000045 | checks[f'projector_{r}_{t}_rank_n'] = ((s.eye(dim)+Gamma)/2).rank() == n 000046 | records.append({'grading_ranks':[r,t], 'normal_dimension':dim, 000047 | 'generator_count':len(generators),'successive_commutant_dimensions':dimensions, 000048 | 'final_complex_dimension':basis.cols}) 000049 | 000050 | theta = s.symbols('theta',real=True) 000051 | a,d,x,y = s.symbols('a d x y',real=True) 000052 | g = Z 000053 | pp,pm = (s.eye(2)+g)/2,(s.eye(2)-g)/2 000054 | A = s.diag(a,d) 000055 | phi = s.Matrix([[0,x+s.I*y],[x-s.I*y,0]]) 000056 | B = s.kronecker_product(Z,A)-s.kronecker_product(S,phi) 000057 | E = pp.col_join(s.exp(s.I*theta)*pm) 000058 | P = (s.eye(4)+s.kronecker_product(Z,g))/2 000059 | def zero(m): 000060 | return m.applyfunc(lambda z:s.simplify(s.expand_complex(z))) == s.zeros(*m.shape) 000061 | h = A*g-s.cos(theta)*phi-s.I*s.sin(theta)*g*phi 000062 | checks['all_phase_isometry'] = zero(E.H*E-s.eye(2)) 000063 | checks['all_phase_same_image'] = zero(E*E.H-P) 000064 | checks['all_phase_reducing'] = zero(B*E-E*h) 000065 | checks['all_phase_pullback'] = zero(E.H*B*E-h) 000066 | checks['intrinsic_odd_reader'] = zero((B-s.kronecker_product(Z,s.eye(2))*B*s.kronecker_product(Z,s.eye(2)))/2+s.kronecker_product(S,phi)) 000067 | 000068 | # H = diag(log(2),-log(2)), ell=1: f=(1/5,4/5), X=(2/5)I. 000069 | H = s.diag(s.log(2),-s.log(2)) 000070 | v = s.Matrix([1,1])/s.sqrt(2) 000071 | p = v*v.H 000072 | f = s.diag(s.Rational(1,5),s.Rational(4,5)) 000073 | cross = s.eye(2)*s.Rational(2,5) 000074 | G = (s.eye(2)-f).row_join(cross).col_join(cross.row_join(f)) 000075 | W = s.diag(v,v) 000076 | K = W.H*G*W 000077 | G_compressed_H = s.ones(2)/2 000078 | leak = (s.eye(4)-W*W.H)*G*W 000079 | defect = K-K*K 000080 | checks['original_whole_graph_is_projection'] = G*G == G 000081 | checks['one_face_reader_matches_H_compression'] = (v.H*f*v)[0] == s.Rational(1,2) and (v.H*H*v)[0] == 0 000082 | checks['one_face_does_not_reduce_H'] = H*p != p*H 000083 | checks['whole_cross_detects_loss'] = K != G_compressed_H 000084 | checks['exact_defect_factorization'] = defect == leak.H*leak 000085 | checks['nonzero_whole_defect'] = defect == s.eye(2)*s.Rational(9,100) 000086 | 000087 | # Inspect the actual v252 field slots: quark/lepton separation survives all 000088 | # supplied Yukawa and Majorana coefficients, not the larger arbitrary-even class. 000089 | sys.path.insert(0,str(ROOT/'verification')) 000090 | import numpy as np 000091 | import v252_full_finite_triple as finite 000092 | ys = [np.array([[1,2,0],[0,3,1],[1,0,4]],complex)+j*np.eye(3) for j in range(4)] 000093 | mr = np.array([[2,1,0],[1,3,1],[0,1,4]],complex) 000094 | phi96 = finite.full_D(*ys,mr) 000095 | gamma96 = finite.grading() 000096 | q48 = [1 if name in ('u','d') else 0 for name,chirality,colour,family in finite.P] 000097 | q = np.diag(q48+q48) 000098 | omega = 2*q-np.eye(96) 000099 | checks['actual_96_quark_lepton_no_mixing'] = np.array_equal(q@phi96,phi96@q) 000100 | checks['actual_96_alternative_grading_odd'] = np.array_equal((gamma96@omega)@phi96+phi96@(gamma96@omega),np.zeros((96,96))) 000101 | checks['actual_96_alternative_distinct'] = not np.array_equal(gamma96@omega,gamma96) and not np.array_equal(gamma96@omega,-gamma96) 000102 | real_swap = finite.Kswap() 000103 | checks['actual_96_alternative_internal_KO6'] = np.array_equal(real_swap@(gamma96@omega).conjugate(),-(gamma96@omega)@real_swap) 000104 | algebra_generators = [] 000105 | for lam in (1,1j): 000106 | algebra_generators.append(finite.rep(lam,np.zeros((2,2)),np.zeros((3,3)))) 000107 | for aa,bb in ((1,0),(1j,0),(0,1),(0,1j)): 000108 | algebra_generators.append(finite.rep(0,finite.quaternion(aa,bb),np.zeros((3,3)))) 000109 | for i in range(3): 000110 | for j in range(3): 000111 | for phase in (1,1j): 000112 | m = np.zeros((3,3),complex); m[i,j] = phase 000113 | algebra_generators.append(finite.rep(0,np.zeros((2,2)),m)) 000114 | checks['actual_96_q_commutes_entire_SM_algebra_basis'] = all(np.array_equal(q@a,a@q) for a in algebra_generators) 000115 | checks['actual_96_alternative_grading_even_entire_SM_basis'] = all(np.array_equal((gamma96@omega)@a,a@(gamma96@omega)) for a in algebra_generators) 000116 | 000117 | out = {'contract':'B1-WHOLE-SOURCE-REDUCTION-20261030', 000118 | 'scope':'Exact finite algebra; actual96 coefficient countertest; no physical P_F selection or new Lean proof.', 000119 | 'commutant_runs':records,'checks':{k:bool(v) for k,v in checks.items()}, 000120 | 'actual_96':{'quark_rank':int(np.trace(q)), 'lepton_rank':int(96-np.trace(q)), 000121 | 'SM_algebra_real_basis_size':len(algebra_generators), 000122 | 'full_normal_J_tested':False, 000123 | 'coefficient_scope':'v252 full_D and SM rep; not every even96 matrix'}, 000124 | 'counterexample':{'compressed_whole_graph':str(K),'canonical_graph_of_compressed_H':str(G_compressed_H), 000125 | 'defect':str(defect),'eigenvalues':['1/10','9/10'], 000126 | 'single_face_equality':'For every ell>0 by f(x)+f(-x)=1; proof in B1-WHOLE-SOURCE-REDUCTION.txt'}, 000127 | 'all_passed':all(checks.values())} 000128 | path = Path(__file__).with_name('B1-WHOLE-SOURCE-REDUCTION.json') 000129 | path.write_text(json.dumps(out,indent=2,ensure_ascii=False)+'\n') 000130 | print(json.dumps(out,indent=2,ensure_ascii=False)) 000131 | if not out['all_passed']: 000132 | raise SystemExit(1)