from research import *
s=begin(1134,'Parametrize the unresolved age family','What does every age sequence satisfying the six retained constraints look like?',{},['C1133'])
from algebra import Matrix
d=json.loads((ROOT/'model/SP_age_constraints.json').read_text());A=Matrix(d['matrix'])
base=[0,0,460,0,0,127,0,67,52]
directions=[[2,0,-3,0,1,-1,1,0,0],[0,1,-1,0,0,0,0,0,0],[0,0,-1,1,0,0,0,0,0]]
v=[base[i]+65*directions[0][i]+105*directions[1][i]+70*directions[2][i] for i in range(9)]
formula=['2m','s','460-3m-s-k','k','m','127-m','m','67','52']
a=artifact('model/SP_age_parametrization.json',json.dumps({'parameters':['m=Mahalalel=Enoch','s=Seth','k=Kenan'],'formula':formula,'affine_base':base,'directions':directions,'source_parameters':[65,105,70]},indent=2)+'\n')
finish(s,{'parametrization':a,'source_parameters':[65,105,70]},'All solutions are controlled by the shared65 scale and two interior ages. Adam and Jared follow from that scale; Enosh follows from the460 total and the two retained interior ages. This is conditional reconstruction, not proof of historical choice.','Identify how the same three freedoms appear in birth positions and the Flood-cap output.',{'source_recovered':v==d['source_ages'],'base_satisfies':list(A*Matrix(base))==list(Matrix(d['rhs'])),'directions_in_kernel':all(all(x==0 for x in A*Matrix(w)) for w in directions)})
