from fractions import Fraction from collections import defaultdict,Counter def run(load,read,check): C=load('C365_DATA.json')['cumulative_register'];ix=defaultdict(list) for i,r in enumerate(C):ix[r['coordinate']].append(i) arrows=load('C451_DATA.json')['arrows'];trials=[] for A in [-2639,-2635]: for a in arrows: x,y,h=A-a['input'],A-a['output'],A-a['anchor'];op=a['operator'];formal=Fraction(2*h-x) if op=='R' else Fraction(25*x-2*h,23) check('conjugate_'+str(A)+'_'+str(a),formal==y) endpoints=x in ix and y in ix;anchor=h in ix trials.append({'exchange_constant':A,'original_arrow':a,'image_input':x,'image_output':y,'image_anchor':h,'endpoints_sourced':endpoints,'anchor_sourced':anchor,'fully_sourced':endpoints and anchor,'cumulative_indices':[ix.get(z,[]) for z in [x,y,h]]}) summaries=[] for op in ['R','E']: rows=[t for t in trials if t['original_arrow']['operator']==op];summaries.append({'operator':op,'trials':len(rows),'endpoints_sourced':sum(t['endpoints_sourced'] for t in rows),'fully_sourced':sum(t['fully_sourced'] for t in rows),'nonzero_fully_sourced':sum(t['fully_sourced'] and t['image_input']!=t['image_output'] for t in rows)}) return {'step':'C463','trials':trials,'endpoint_images':[t for t in trials if t['endpoints_sourced']],'fully_sourced_images':[t for t in trials if t['fully_sourced']],'operator_summary':summaries,'counts':{'trials':len(trials),'endpoints_sourced':sum(t['endpoints_sourced'] for t in trials),'fully_sourced':sum(t['fully_sourced'] for t in trials)},'limits':'Conjugacy is a formal comparison; source-qualified cumulative images do not establish a new cumulative Gear or calendar protocol.'}