from research import *
from algebra import Matrix
s=begin(1183,'Expose the extra premise in the four-amplitude model','What is lost when Eber40 and Nahor60 are tied to the century100?',{'relation':'e+n=u'},['C1182','C1154'])
d=json.loads((ROOT/'model/whole_genealogy_five_model.json').read_text());M=Matrix(d['matrix']);T=Matrix([[1,0,0,0],[0,1,0,0],[0,0,1,0],[1,0,0,-1],[0,0,0,1]]);N=M*T
a=artifact('model/whole_genealogy_four_model.json',json.dumps(clean({'parameters':['u','lambda','a','t'],'values':[100,-24,27,60],'substitution':T.tolist(),'matrix':N.tolist(),'labels':d['labels'],'rank':N.rank(),'extra_source_value_relation':'Eber lifespan change + Nahor lifespan change = repeated century change'}),indent=2)+'\n')
finish(s,{'model':a,'rank5_to_rank4':[M.rank(),N.rank()]},'The four-amplitude form is exact only after adding the fitted relation40+60=100. It is a useful compression, but not an independent derivation of these source numerals.','Find a small transparent observation set that recovers the five coefficients without totals.',{'rank4':N.rank()==4,'same_outputs':list(N*Matrix([100,-24,27,60]))==d['outputs'],'substitution_injective':T.rank()==4})
