from research import *
p=json.loads((ROOT/'model/tradition_displacement_profiles.json').read_text()); names=p['names']; lx=p['profiles']['LXX']
s=begin(740,'Recover LXX local changes from its boundary profile','Can adjacent differences identify the contributing rows and distinguish aninsertedrowfromalifespanchange?',{'shared_edge':'Arphaxad→Shelah spansLXXCainan2','profile':'LXXminusMT'},['C739; File18 §§2,4,6D'])
d={k:{names[i]:v[i]-v[i+1] for i in range(len(names)-1) if v[i]!=v[i+1]} for k,v in lx.items()}
finish(s,{'nonzero_edge_changes':d,'collapsed_Arphaxad_components':{'regular':[100,130],'cumulative':[27,460],'bridge':[-73,330]}},'Finite differences recover the entireLXX change support. At the sharedArphaxad→Shelah edge, regular230 splits into100+130 and cumulative487 into27+460. KeepingCainan as a native row distinguishes insertion from the adjacent biography change; collapsing them would lose that explanation.','Recover theSP support with its separateLamech completed-year correction.',{'regular_edge':d['R']['Arphaxad']==100+130==230,'cumulative_edge':d['C_lower']['Arphaxad']==27+460==487,'bridge_edge':d['G']['Arphaxad']==-73+330==257,'Lamech':d['C_lower']['Lamech']==-24})
