from research import *
s=begin(1149,'Derive adjacent-cap remainder relations','When does a clipped ancestor’s remaining count equal the next capacity or next lifespan?',{},['C1148','File18 §3.1.3'])
b=[130,105,90,70,65,62,65,67,52];c=[601+sum(b[i:]) for i in range(9)];L=[930,912,905,910,895,847,365,720,653]
rows=[{'row':i,'remaining':L[i]-b[i],'next_capacity':c[i+1] if i<8 else 601,'next_lifespan':L[i+1] if i<8 else None} for i in [5,7,8]]
a=artifact('model/SP_cap_remainder_relations.json',json.dumps({'rows':rows,'theorem':'If L_i=c_i and c_i=b_i+c_next, then L_i-b_i=c_next. This equals L_next precisely when that next life also meets capacity.','source_example':'Methuselah remainder653 equals Lamech653; Jared remainder785 is Enoch capacity, not Enoch365'},indent=2)+'\n')
finish(s,{'adjacent_cap_relations':a},'A clipped row’s algebraic remainder equals the next capacity. Adjacent clipped rows therefore share a remainder/life equality; across uncapped Enoch the equality is with capacity785, leaving the actual365 distinct.','Use this source-local distinction to formulate a compact connection from the SP mechanism to the wider row grammar.',{'all_capacity_equalities':all(r['remaining']==r['next_capacity'] for r in rows),'Methuselah_Lamech':rows[1]['remaining']==L[8],'Enoch_capacity_not_life':rows[0]['remaining']==785 and L[6]==365})
