from fractions import Fraction as F def run(load,read,check): reg=load('C286_DATA.json')['target_register'];by={} for i,r in enumerate(reg):by.setdefault(r['center'],[]).append(i) E=lambda h,x:F(25*x-2*h,23) rat=lambda x:[x.numerator,x.denominator] centers=[z['points']['center'] for z in load('C437_DATA.json')['cases'] if z['record_indices']['center']] alltrials=[];complete=[];paired=[];families=[] for c in centers: p,q,H,M=c+432,c-432,c+18,c-18;local=[] for x in sorted(by): R=lambda x:2*c-x mid=E(q,x);out=E(p,mid);old=E(q,E(p,x)) check(f'conjugacy and order {c}/{x}',R(E(p,R(x)))==E(q,x) and R(E(q,E(p,R(x))))==out and old-out==-F(3456,529)) check(f'529-integrality {c}/{x}',(out.denominator==1)==((x-M)%529==0)) row={'center':c,'p':p,'q':q,'reverse_effective_pivot':M,'input':x,'intermediate':rat(mid),'output':rat(out), 'input_indices':by[x],'intermediate_indices':by.get(mid,[]),'output_indices':by.get(out,[]),'complete':mid in by and out in by} local.append(row);alltrials.append(row) if row['complete']:complete.append(row) ep=E(p,x) if ep in by and R(x) in by and R(ep) in by: paired.append({'center':c,'first_leg':[x,int(ep)],'reflected_leg':[int(R(x)),int(R(ep))],'zero_gap':x==p}) families.append({'center':c,'trials':len(local),'integer_outputs':sum(r['output'][1]==1 for r in local),'sourced_outputs':sum(bool(r['output_indices']) for r in local),'complete_paths':sum(r['complete'] for r in local)}) check('1492 reversed trials complete',len(alltrials)==1492) check('only reversed zero-net loop survives',[(r['center'],r['input'],r['intermediate'][0],r['output'][0]) for r in complete]==[(3188,3170,3206,3170)]) check('five reflected primitive pairs are four zero-gap and one loop leg',len(paired)==5 and sum(z['zero_gap'] for z in paired)==4) reflected=[] for z in load('C435_DATA.json')['complete_paths']: c=z['H']-18;points=[z['input'],z['intermediate']['numerator'],z['output']['numerator']];image=[2*c-x for x in points] check('reflected full word arithmetic '+str(points),E(c-432,image[0])==image[1] and E(c+432,image[1])==image[2]) reflected.append({'original':points,'center':c,'reflected':image,'record_indices':[by.get(x,[]) for x in image],'fully_sourced':all(x in by for x in image)}) check('nonzero2K reflected path is outside source range',reflected[0]['reflected']==[4228,4356,4420] and not any(reflected[0]['record_indices']) and min(reflected[0]['reflected'])>max(by)) check('loop reflection reverses its order',reflected[1]['reflected']==[3170,3206,3170] and reflected[1]['fully_sourced']) return {'step':'C442','families':families,'all_reverse_trials':alltrials,'complete_reverse_paths':complete,'paired_primitive_arrows':paired,'reflected_forward_paths':reflected, 'identities':{'primitive':'R_c E_p R_c = E_q','word':'R_c (E_q E_p) R_c = E_p E_q','forward_fixed_point':'c+18','reverse_fixed_point':'c-18','forward_minus_reverse':'-3456/529','integer_output':'x congruent to c-18 modulo529'}, 'counts':{'reverse_trials':1492,'complete_reverse_paths':1,'paired_primitive_arrows':5,'nonzero_paired_primitive_arrows':1}, 'limits':'Affine conjugacy is exact, but source membership is partial. No reversed2K source path or global reflection/E action is established; prior phase/component restrictions remain.'}