from research import *
s=begin(834,'Reconstruct a complete Sukkot species-by-day matrix','Can the seven day totals be generated by one declining component and three constant components?',{'uniform_daily_rams_lambs_goats':[2,14,1],'status':'declared allocation reconstruction; marginal totals alone do not imply uniformity'},['File58 §§3.1–3.2,7.1'])
p=json.loads((ROOT/'model/list_inputs.json').read_text());totals=p['orders']['feast'][:7]
matrix=[[t-17,2,14,1] for t in totals];cols=[sum(r[j] for r in matrix) for j in range(4)]
out={'species':['bulls','rams','lambs','goats'],'day_rows':matrix,'day_totals':totals,'column_totals':cols,'rank':2,'generator':'row_d=(14−d,2,14,1), d=1…7'}
a=artifact('model/Sukkot_matrix.json',json.dumps(out,indent=2)+'\n')
finish(s,{'matrix':a,**out},'The declared daily allocation has a rank-two generator: only the bull component changes. It recovers all seven totals and the complete189 species ledger. The uniform component allocation remains an input, not a deduction from margins alone.','Recover the whole Tishri category/species table as a linear measurement object.',{'cols':cols==[70,14,98,7],'row_totals':all(sum(r)==t for r,t in zip(matrix,totals)),'rank2':all(matrix[i]==[13-i,2,14,1] for i in range(7)) and matrix[0][0]*matrix[1][1]-matrix[1][0]*matrix[0][1]!=0})
