from research import *
from algebra import Matrix
s=begin(1152,'Define the row-operation basis','Can every compatible change in begetting, remainder and lifespan be written with two explicit operations?',{},['Strategy §§3.2,5B','C1151'])
basis=Matrix([[1,0],[-1,1],[0,1]])
data={'R_d':'(b,r,L)->(b+d,r-d,L)','A_e':'(b,r,L)->(b,r+e,L+e)','normal_form':'A_deltaL R_deltab; Delta r=Delta L-Delta b','R_invariant':'lifespan','A_invariant':'begetting','diagonal_Rd_Ad':'(b+d,r,L+d), preserving remainder','claim':'unique integer coordinate description of compatible row changes; source masks and admissible domains remain extra premises'}
a=artifact('model/row_operation_basis.json',json.dumps(data,indent=2)+'\n')
finish(s,{'row_basis':a,'basis_matrix':basis.tolist(),'rank':basis.rank()},'Two row operations describe every compatible source change uniquely: transfer between begetting and remainder while preserving life, then change remainder and life together while preserving begetting. Their equal-amplitude combination preserves remainder.','Place the complete post-Flood inter-tradition changes in this basis.',{'rank2':basis.rank()==2,'compatibility':all(b+r==L for b,r,L in zip(basis.tolist()[0],basis.tolist()[1],basis.tolist()[2])),'integer_recovery':'Delta L-Delta b' in data['normal_form']})
