from fractions import Fraction def run(load,check): reg=load('C286_DATA.json')['target_register'];rows=[] base=[t for t in reg if (t['Cainan'],t['Terah60'],t['full430'])==(0,0,1)] for i in range(8): q=-5290+i;N=q+8993;B=-q-2832;P=B+650 mt=[t for t in base if t['tradition']=='MT' and t['role'] in ['Flood start','Flood close'] and t['center']==B] noah=[t for t in base if t['tradition']=='SP' and t['role']=='Noah birth' and t['center']==N] sp=[t for t in base if t['tradition']=='SP' and t['role'] in ['Flood start','Flood close'] and t['center']==P and any(t['gear']==m['gear'] and t['role']==m['role'] for m in mt)] rows.append({'i':i,'q':q,'SP_Noah_required':N,'MT_Flood_required':B,'SP_Flood_required':P,'MT_matches':mt,'SP_Noah_matches':noah,'same_Gear_SP_Flood_matches':sp,'all_bound':bool(mt and noah and sp),'Noah_minus_Flood':N-P,'affine_expression':595+2*i}) bound=[r for r in rows if r['all_bound']] formal=Fraction(600-595,2) check('MT domain indices0to3',[r['i'] for r in rows if r['MT_matches']]==[0,1,2,3]) check('SP Noah domain indices2to7',[r['i'] for r in rows if r['SP_Noah_matches']]==list(range(2,8))) check('joint support only2and3',[r['i'] for r in bound]==[2,3]) check('joint widths599and601',[r['Noah_minus_Flood'] for r in bound]==[599,601]) check('algebra holds on all annual rows',all(r['Noah_minus_Flood']==r['affine_expression'] for r in rows)) check('all annual widths odd',all(r['Noah_minus_Flood']%2==1 for r in rows)) check('formal600 requiresnoninteger5over2',formal==Fraction(5,2) and formal.denominator!=1) check('joint endpoints retain same Gear1',all(r['SP_Noah_matches'][0]['gear']==r['same_Gear_SP_Flood_matches'][0]['gear']==1 for r in bound)) check('opposite selectors',[(r['SP_Noah_matches'][0]['rail'],r['same_Gear_SP_Flood_matches'][0]['role']) for r in bound]==[('companion','Flood start'),('primary','Flood close')]) check('C303 joint source coordinate binding',sorted(-r['q'] for r in bound)==sorted(r['cumulative_BC'] for r in load('C303_DATA.json')['joint_8395_17K_rows'])) return {'annual_domain':rows,'jointly_bound_rows':bound,'width_formula':'595+2i','formal600_index':str(formal),'exact600_admitted':False,'interpretation':'Valid off-diagonal selectors give599/601; they cannot simultaneously be renamed as the matched-selector600 comparison.'}