from collections import Counter def run(load,read,check): d=load('PREVIOUS_DATA.json');pairs=d['shortest_witnesses'];hits=[] for p in pairs: check(f'parity_{p["input"]}_{p["output"]}',p['gap']%2==0) if p['gap']%529==0:hits.append({**p,'K_multiple':p['gap']//529}) seeds=[3620,3206,3188,3170,2756,2148,2020,1956];locations=[] for x in seeds: cc=next(c for c in d['components'] if x in c['coordinates']);locations.append({'coordinate':x,'component':cc}) check('all pairs counted',len(pairs)==191) return {'step':'C447','all_pair_gaps':[{'input':p['input'],'output':p['output'],'gap':p['gap'],'shortest_length':p['length']} for p in pairs],'K_hits':hits,'seed_locations':locations,'counts':{'pairs':len(pairs),'nonzero_K_hits':len(hits),'odd_gaps':sum(p['gap']%2 for p in pairs)},'invariant':'Every fixed center is even; each reflection preserves coordinate parity, and every even-length word preserves the coordinate modulo4.'}