from research import *
from algebra import Matrix
s=begin(1169,'Measure the complete native post-Flood model dimension','How many free numeric coordinates generate all28 source rows under the stated dictionary and Cainan relation?',{},['C1154','C1168'])
d=json.loads((ROOT/'model/postflood_amplitude_dictionary.json').read_text())
def out(p):
 base=p[:18];amp=Matrix(p[18:]);delta=list(Matrix(d['matrix'])*amp)
 sp=[x+y for x,y in zip(base,delta[:18])];lx=[x+y for x,y in zip(base,delta[18:])]
 lx_native=lx[:4]+lx[4:6]+lx[4:]
 return base+sp+lx_native
M=Matrix([out([int(i==j) for i in range(21)]) for j in range(21)]).T
src=json.loads((ROOT/'model/postflood_rows.json').read_text());base=[x for r in src['MT_native_OFF'] for x in [r['b'],r['L']]];values=out(base+[100,60,27]);target=[x for rows in src.values() for r in rows for x in [r['b'],r['L']]]
a=artifact('model/postflood_native_joint_model.json',json.dumps(clean({'matrix':M.tolist(),'input_order':'18 MT b/L values, thenu,t,a','outputs':56,'rank':M.rank(),'source_parameters':base+[100,60,27],'source_values':values,'condition':'source row supports, nativeCainan position and numerical equality toShelah held; baseline equalities not yet imposed'}),indent=2)+'\n')
finish(s,{'native_joint_model':a,'outputs':56,'rank':M.rank()},'The complete28-row native family has56 b/L outputs generated by21 numeric coordinates in the declared model. This includes the18 baseline values; the three-amplitude claim does not erase their input cost.','Assess what the MT equal-remainder relation contributes if it is included in the baseline itself.',{'rank21':M.rank()==21,'56_outputs':M.rows==56,'complete_source_match':values==target})
