from research import *
s=begin(987,'Four relations contain three constraints','What is the exact dependence certificate for calibration and allocation?',{'matrix':[[336,-360,0],[336,0,-364],[1,-6,0],[1,0,-26]],'rhs':[0,0,-5,-25]},['C985','C986'])
from algebra import Matrix
M=Matrix(s['inputs']['matrix']);b=Matrix(s['inputs']['rhs']);dep=Matrix([[7,-6,-420,84]]);aug=Matrix([r+[y] for r,y in zip(s['inputs']['matrix'],s['inputs']['rhs'])])
a=artifact('model/key_calibration_basis.json',json.dumps(clean({'matrix':M.tolist(),'rhs':list(b),'rank':M.rank(),'dependence':[7,-6,-420,84],'solution':[E,P,J]}),indent=2)+'\n')
finish(s,{'basis':a,'rank':M.rank(),'augmented_rank':aug.rank(),'dependency_products':list(dep*M)+list(dep*b)},'The four equations have rank three, with7A−6B−420C+84D=0 including constants. One relation is dependent.','Identify the freedom left by calendar calibration alone.',{'rank_three':M.rank()==aug.rank()==3,'certificate':list(dep*M)+list(dep*b)==[0,0,0,0]})
