from fractions import Fraction as F from itertools import product def run(load,check): E=F(25,23);eps=[F(-1,4),F(1,4)];rows=[];trials=[];maps=[] for x in load('C340_DATA.json')['rows']: tag=f'i{x["i"]}/{x["binding"]}';v={k:F(r['center']) for k,r in x['records'].items()};full=x['rail']=='primary' and x['Shem_mode_sigma']==0 for es in product(eps,repeat=4): n,r,h,f=[v[k]+e for k,e in zip(['N','R','H','F'],es)];one=E*(n-r)==n-h;two=E*(n-h)==n-f;double=E*E*(n-r)==n-f check(tag+str(es)+' ladder phases',(one and two)==(full and len(set(es))==1)) check(tag+str(es)+' doubleE phases',double==(es[0]==es[1]==es[3])) trials.append({'path':tag,'phases':list(map(str,es)),'firstE':one,'secondE':two,'doubleE':double,'full_ladder':one and two}) if full: for e in eps: n,r,h,f,d=(v[k]+e for k in ['N','R','H','F','D']);image=lambda t:n+E*(t-n) check(tag+str(e)+' componentwise map',image(r)==h and image(h)==f and image(n)==n) di=image(d);check(tag+str(e)+' lifespan changes',n-di==E*950 and n-di!=950 and (di*4).denominator!=1) centered=v['N']+E*((v['R']+e)-v['N']);check(tag+str(e)+' common center phase residual',centered-(v['H']+e)==(E-1)*e) maps.append({'path':tag,'phase':str(e),'fixed_existing_Noah_component':str(n),'source_Noah_lifespan':950,'expanded_lifespan':str(n-di),'Noah_death_diagnostic_image':str(di),'diagnostic_image_adopted':False,'center_map_minus_retained_target_phase':str((E-1)*e)}) rows.append({'path':tag,'full_ladder':full,'same_phase_needed':True}) check('80 phase controls',len(trials)==80) check('four full component ladders',sum(x['full_ladder'] for x in trials)==4) check('twenty doubleE controls with H free',sum(x['doubleE'] for x in trials)==20) check('no single E map preserves half-year spacing',E*F(1,2)!=F(1,2) and E*F(1,2)-F(1,2)==F(1,23)) return {'step':'C341','phase_trials':trials,'component_map_checks':maps,'counts':{'phase_assignments':80,'complete_ladders':4,'doubleE_with_unconstrained_H_phase':20},'single_physical_affine_phase_gap':'1/23','center_fixed_map_component_errors':['-1/46','1/46'],'Noah_lifespan_E_image':'23750/23','map_classification':'Component-preserving duration/center calculation can be written as separate fixed-Noah-component affine expressions. It is not a single affine dilation of physical time preserving both seasonal components or the950 lifespan.','no_new_phase_values':True,'no_diagnostic_images_adopted':True}