Evidence

whole genealogy extension.py

Download source fileOpen in research workspace
"""Independent preparation: complete MT/LXX five-versus-four model.
No root journal or numbered-action writes. Standard-library exact arithmetic.
"""
from pathlib import Path
from fractions import Fraction as F
import json,hashlib
BASE=Path(__file__).resolve().parents[2]
PREP=Path(__file__).resolve().parent
SOURCE=BASE/'c1132_c1431/model/complete_source_row_packet.json'
QUESTION=BASE/'c1132_c1431/model/whole_genealogy_extension_question.json'
PRIOR=BASE/'c732_c831/model/tradition_displacement_profiles.json'
raw=json.loads(SOURCE.read_text())
MT={r['name']:r for r in raw['MT']}; LX={r['name']:r for r in raw['LXX']}
names=list(MT)
assert len(names)==19 and set(LX)-set(MT)=={'Cainan2'}
checks=[]
def clean(x):
 if isinstance(x,F):return x.numerator if x.denominator==1 else str(x)
 if isinstance(x,dict):return {str(k):clean(v) for k,v in x.items()}
 if isinstance(x,(list,tuple)):return [clean(v) for v in x]
 return x

def check(label,actual,expected=True):
 a,b=clean(actual),clean(expected)
 checks.append({'check':label,'pass':a==b,'actual':a,'expected':b})
 if a!=b:raise AssertionError((label,a,b))

def matmul(A,B):
 return [[sum((F(a)*F(b) for a,b in zip(row,col)),F(0)) for col in zip(*B)] for row in A]
def mv(A,v):return [sum((F(a)*F(b) for a,b in zip(row,v)),F(0)) for row in A]
def rank(A):
 a=[[F(x) for x in row] for row in A];r=0
 for c in range(len(a[0])):
  j=next((j for j in range(r,len(a)) if a[j][c]),None)
  if j is None:continue
  a[j],a[r]=a[r],a[j];p=a[r][c];a[r]=[v/p for v in a[r]]
  for j in range(len(a)):
   if j!=r:
    p=a[j][c];a[j]=[u-p*v for u,v in zip(a[j],a[r])]
  r+=1
  if r==len(a):break
 return r

def determinant(A):
 a=[[F(x) for x in row] for row in A];d=F(1)
 for c in range(len(a)):
  j=next((j for j in range(c,len(a)) if a[j][c]),None)
  if j is None:return F(0)
  if j!=c:a[j],a[c]=a[c],a[j];d=-d
  pivot=a[c][c];d*=pivot
  for j in range(c+1,len(a)):
   m=a[j][c]/pivot
   a[j]=[x-m*y for x,y in zip(a[j],a[c])]
 return d

masks={
'b_u':['Adam','Seth','Enosh','Kenan','Mahalalel','Enoch','Arphaxad','Shelah','Eber','Peleg','Reu','Serug'],
'b_u_half':['Nahor'],
'L_u':['Peleg','Reu','Serug'],
'L_lambda':['Lamech'],
'L_a':['Arphaxad','Shelah'],
'L_e':['Eber'],
'L_n':['Nahor']}
params5=['u','lambda','a','e','n'];theta5=[100,-24,27,40,60]
params4=['u','lambda','a','n'];theta4=[100,-24,27,60]
B=[];L=[]
for name in names:
 B.append([F(1) if name in masks['b_u'] else F(1,2) if name in masks['b_u_half'] else F(0),0,0,0,0])
 L.append([int(name in masks['L_u']),int(name in masks['L_lambda']),int(name in masks['L_a']),int(name in masks['L_e']),int(name in masks['L_n'])])
R=[[F(l)-F(b) for b,l in zip(br,lr)] for br,lr in zip(B,L)]
M5=[v for pair in zip(B,L) for v in pair]
# theta5 = P theta4, exactly imposing e+n=u.
P=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[1,0,0,-1],[0,0,0,1]]
M4=matmul(M5,P);B4=matmul(B,P);L4=matmul(L,P);R4=matmul(R,P)
U=[[int(j>=i) for j in range(19)] for i in range(19)]
constraint=[-1,0,0,1,1]
check('five model rank',rank(M5),5)
check('four model rank',rank(M4),4)
check('restriction embedding rank',rank(P),4)
check('restriction equation annihilates embedding',matmul([constraint],P),[[0,0,0,0]])
check('source restriction',sum(F(a)*F(b) for a,b in zip(constraint,theta5)),0)
check('source parameter embedding',mv(P,theta4),theta5)
rows=[]
for i,name in enumerate(names):
 expected=[LX[name]['b_ledger']-MT[name]['b_ledger'],LX[name]['L_ledger']-MT[name]['L_ledger']]
 pred5=mv([B[i],L[i]],theta5);pred4=mv([B4[i],L4[i]],theta4)
 dr=LX[name]['r_calculated']-MT[name]['r_calculated']
 check('five source row '+name,pred5,expected)
 check('four source row '+name,pred4,expected)
 check('remaining identity '+name,mv([R[i]],theta5)[0],dr)
 check('binding unchanged '+name,LX[name]['following_Shem_binding'],MT[name]['following_Shem_binding'])
 rows.append({'name':name,'MT':{'b':MT[name]['b_ledger'],'r':MT[name]['r_calculated'],'L':MT[name]['L_ledger']},'LXX':{'b':LX[name]['b_ledger'],'r':LX[name]['r_calculated'],'L':LX[name]['L_ledger']},'delta_b_r_L':[expected[0],dr,expected[1]],'coeff_b_5':B[i],'coeff_L_5':L[i],'R_A_normal_form':[expected[0],expected[1]],'R_S_optional_coordinates':[expected[0]-expected[1],expected[1]],'remainder_status':MT[name]['r_status']})
projection_ranks={}
for label,A,A4 in [('regular_local',B,B4),('life_local',L,L4),('remaining_local',R,R4),('regular_full',matmul(U,B),matmul(U,B4)),('cumulative_full',matmul(U,L),matmul(U,L4)),('bridge_full',matmul(U,R),matmul(U,R4))]:
 projection_ranks[label]={'five':rank(A),'four':rank(A4)}
 check('projection rank '+label,[rank(A),rank(A4)],[1,1] if label.startswith('regular') else [5,4])
# Full compatible triples do not add an independent remaining measurement.
T5=[v for triple in zip(B,R,L) for v in triple];T4=matmul(T5,P)
check('triple observation ranks',[rank(T5),rank(T4)],[5,4])
# Local bases recover each parameter directly.
labels=[(name,part) for name in names for part in ['b','L']]
obs5=[('Adam','b'),('Lamech','L'),('Arphaxad','L'),('Eber','L'),('Nahor','L')]
obs4=[('Adam','b'),('Lamech','L'),('Arphaxad','L'),('Nahor','L')]
O5=[M5[labels.index(x)] for x in obs5];O4=[M4[labels.index(x)] for x in obs4]
check('five local observation determinant',determinant(O5),1)
check('four local observation determinant',determinant(O4),1)
check('five source recovery',mv(O5,theta5),theta5)
check('four source recovery',mv(O4,theta4),theta4)
check('four observations leave e unobserved in five model',rank([M5[labels.index(x)] for x in obs4]),4)
for i,obs in enumerate(obs5):check('five basis deletion '+str(obs),rank(O5[:i]+O5[i+1:]),4)
for i,obs in enumerate(obs4):check('four basis deletion '+str(obs),rank(O4[:i]+O4[i+1:]),3)
# Local life-only basis also observes all parameters; regular ages observe only u.
life_obs5=['Peleg','Lamech','Arphaxad','Eber','Nahor']
life_obs4=['Peleg','Lamech','Arphaxad','Nahor']
check('five life-only determinant',determinant([L[names.index(n)] for n in life_obs5]),1)
check('four life-only determinant',determinant([L4[names.index(n)] for n in life_obs4]),1)
# Totals and fixed native insertion.
total_b=[sum(F(r[c]) for r in B) for c in range(5)]
total_L=[sum(F(r[c]) for r in L) for c in range(5)]
total4=matmul([total_b,total_L],P)
check('five total coefficients',[total_b,total_L],[[F(25,2),0,0,0,0],[3,1,2,1,1]])
check('four total coefficients',total4,[[F(25,2),0,0,0],[4,1,2,0]])
check('two-total ranks',[rank([total_b,total_L]),rank(total4)],[2,2])
check('leveled heads',mv([total_b,total_L],theta5),[1250,430])
cainan=LX['Cainan2'];check('native Cainan source triple',[cainan['b_ledger'],cainan['r_calculated'],cainan['L_ledger']],[130,330,460])
prefix=[int(i<=names.index('Arphaxad')) for i in range(19)]
level_R=mv(matmul(U,B),theta5);level_C=mv(matmul(U,L),theta5)
native_R=[r+130*p for r,p in zip(level_R,prefix)];native_C=[c+460*p for c,p in zip(level_C,prefix)]
expected_prior=json.loads(PRIOR.read_text())
# The source artifact stores profiles directly under LXX, or under profiles.
prof=expected_prior.get('profiles',expected_prior)['LXX']
check('native complete regular field',native_R+[0],prof['R'])
check('native complete cumulative field',native_C+[0],prof['C_lower'])
check('native complete bridge field',[c-r for c,r in zip(native_C,native_R)]+[0],prof['G'])
# Restriction effect and two predeclared algebraic controls.
e_unit=[0,0,0,1,0];coupled=[0,0,0,-1,1]
break_rows=mv(M5,e_unit);interval_rows=mv(L,coupled);interval_profile=mv(U,interval_rows)
check('free e control breaks restriction',sum(F(a)*F(b) for a,b in zip(constraint,e_unit)),1)
check('coupled e/n control preserves restriction',sum(F(a)*F(b) for a,b in zip(constraint,coupled)),0)
check('coupled control preserves both totals',mv([total_b,total_L],coupled),[0,0])
check('coupled control cumulative support',[n for n,v in zip(names,interval_profile) if v],['Peleg','Reu','Serug','Nahor'])
check('coupled control cumulative values',[v for v in interval_profile if v],[1,1,1,1])
check('free e control local support',[labels[i] for i,v in enumerate(break_rows) if v],[('Eber','L')])
# Quantify unchanged and actual-changed output support without treating counts as evidence.
unchanged=[r['name'] for r in rows if r['delta_b_r_L']==[0,0,0]]
changed_b=[n for n,v in zip(names,mv(B,theta5)) if v]
changed_L=[n for n,v in zip(names,mv(L,theta5)) if v]
check('unchanged full rows',unchanged,['Jared','Methuselah','Noah','Shem','Terah'])
check('changed b count',len(changed_b),13)
check('changed L count',len(changed_L),8)
full_columns={p:{'b_local':dict(zip(names,[row[i] for row in B])),'L_local':dict(zip(names,[row[i] for row in L])),'regular_suffix':dict(zip(names,[row[i] for row in matmul(U,B)])),'cumulative_suffix':dict(zip(names,[row[i] for row in matmul(U,L)]))} for i,p in enumerate(params5)}
full4_columns={p:{'b_local':dict(zip(names,[row[i] for row in B4])),'L_local':dict(zip(names,[row[i] for row in L4])),'regular_suffix':dict(zip(names,[row[i] for row in matmul(U,B4)])),'cumulative_suffix':dict(zip(names,[row[i] for row in matmul(U,L4)]))} for i,p in enumerate(params4)}
bindings={n:{'path':str(p),'sha256':hashlib.sha256(p.read_bytes()).hexdigest()} for n,p in [('current_source_packet',SOURCE),('root_frozen_question',QUESTION),('inherited_displacement_target',PRIOR),('source_File18',BASE/'project_sources/38-File_18.Chronological_Data_Tables-20260919-141048-.md'),('script',Path(__file__))]}
overlap=[
{'prior':'C733–C748','already_proved':'U suffix accumulation, exact local recovery and complete MT/LXX/SP mode/displacement fields.','extension':'Reuse these maps; compare which named parameter columns survive each projection.'},
{'prior':'C739–C740','already_proved':'Full received MT/LXX difference support, including the collapsed Arphaxad/Cainan split.','extension':'Rank-five/four model comparison is compression of explored inputs, not a new source discovery.'},
{'prior':'C1152–C1159','already_proved':'R/A normal form, post-Flood three-amplitude dictionary and source-support cost.','extension':'The earlier u,t,a dictionary already imposed Eber e=u-t and Nahor n=t. The five-parameter comparison makes e+n=u visible as one additional fitted relation.'},
{'prior':'C1168–C1172','already_proved':'Native Cainan, baseline-value costs and the failure of rank alone as an explanation score.','extension':'Carry these source costs and fixed insertion labels into the complete pre/post-Flood model.'},
{'prior':'C1177–C1181','already_proved':'Full58-row source packet, six lifespan-preserving pre-Flood century changes, post-Flood remainder preservation, and the frozen whole-genealogy question.','extension':'Execute the complete19-shared-row five-versus-four comparison and identify the restriction’s finite internal-boundary support.'}]
result={
'status':'INDEPENDENT PREPARATION — exact whole-genealogy calculation; no root journal edits or numbered actions',
'source_bindings':bindings,'question_before_execution':str(QUESTION),'row_order':names,'output_order':labels,
'parameter_definition':{'five':params5,'source_five':theta5,'four':params4,'source_four':theta4,'restriction':'e+n=u','embedding_five_from_four':P},
'exact_named_masks':masks,'design_matrix_five':M5,'design_matrix_four':M4,'all_source_row_results':rows,
'projection_ranks':projection_ranks,'local_recovery':{'five_observations':obs5,'five_matrix':O5,'four_observations':obs4,'four_matrix':O4,'life_only_five':life_obs5,'life_only_four':life_obs4,'unobserved_five_parameter_from_four_basis':'e'},
'parameter_output_support':full_columns,'restricted_parameter_output_support':full4_columns,
'whole_totals':{'five_coefficients':[total_b,total_L],'four_coefficients':total4,'leveled_values':[1250,430],'native_values':[1380,890],'joint_total_rank':2,'unseen_dimensions':{'five':3,'four':2}},
'complete_boundary_field':{'names':names+['Abraham'],'leveled_R':level_R+[0],'leveled_C':level_C+[0],'native_R':native_R+[0],'native_C':native_C+[0],'native_gap':[c-r for c,r in zip(native_C,native_R)]+[0]},
'Cainan':{'status':'native LXX source row, separately inserted relative to the shared-node comparison; no MT/SP zero-life surrogate','position':['Arphaxad','Cainan2','Shelah'],'source_triple':[130,330,460],'shared_upstream_mask':prefix,'Delta_R':130,'Delta_C':460,'remaining_difference':330,'authority':'File18 §1.6 and native §4.2; theoretical removal is a declared comparison, not the native baseline','parameter_limit':'The fixed source payload adds no variable rank here, but its values, name, slot and admission remain input costs. Equality to the supplied LXX Shelah row is not a universal identity under all free parameter changes.'},
'restriction_interpretation':{'linear_condition_on_outputs':'Delta L(Eber)+Delta L(Nahor)-Delta b(Adam)=0','equivalent_remaining_condition':'Delta r(Eber)+Delta L(Nahor)=0','five_model_condition_rank':1,'four_model_consequence':'The n column is -1 at Eber life and +1 at Nahor life, producing a cumulative +1 plateau only at Peleg,Reu,Serug,Nahor.','head_consequence':'n cancels from the four-parameter cumulative head; its value remains visible internally.'},
'negative_controls':{'break_four_only':{'theta_delta':e_unit,'source_status':'unadmitted algebraic diagnostic','local_changed_output':'Eber lifespan and calculated remainder +1','restriction_residual':1,'cumulative_boundary_support':names[:names.index('Eber')+1]},'preserve_restriction_and_heads':{'theta_delta':coupled,'source_status':'unadmitted algebraic diagnostic','regular_changes':[0]*19,'cumulative_changes':interval_profile,'proof_burden':'Same complete regular field and both heads do not identify n; internal cumulative boundaries do.'}},
'domain_and_source_limits':['Ranks are over Q on the declared fixed-support affine family. Integer row values require u even and lambda,a,e,n integer; actual source u=100 satisfies this.', 'Nonnegative row components further restrict formal parameters; source permission is an additional constraint, not implied by integrality or nonnegativity.', 'Calculated remainders carry no independent source rank. Noah’s equal +2 binding cancels in this MT/LXX difference, while retained count tags remain part of the input.', 'The four-parameter relation e+n=u is source-fitted and additional to biography compatibility; it is not forced by the shared masks alone.', 'No historical direction, unseen holdout, probability, unique smallest grammar or universal affine chronology is claimed. No SP inclusive row is placed into this ordinary MT/LXX model.'],
'prior_overlap_audit':overlap,'check_count':len(checks),'checks':checks}
jsonpath=PREP/'whole_genealogy_extension.json'
mdpath=PREP/'whole_genealogy_extension.md'
with jsonpath.open('x') as f:json.dump(clean(result),f,ensure_ascii=False,indent=2);f.write('\n')
lines=['# Complete MT/LXX five-versus-four parameter model','',
'Independent preparation only. The question was frozen in `model/whole_genealogy_extension_question.json` before this calculation. No root journal or numbered-action file is edited. All '+str(len(checks))+' exact checks pass.','',
'## Main result','',
'The complete19-shared-row MT→LXX comparison is reproduced by five parameters (u,λ,a,e,n)=(100,−24,27,40,60). Its38 local begetting/lifespan outputs have rank5. Imposing the additional source-value relation e+n=u gives a rank4 family with parameters (u,λ,a,n). Both fit the received full field exactly. The four-parameter restriction is genuine extra content of this fitted model; it does not follow from lifespan compatibility or from the five named masks.','',
'The useful consequence is internal: under the restriction, increasing n while decreasing e by the same amount changes the Cumulative boundaries at Peleg, Reu, Serug and Nahor equally, while all Regular boundaries and both whole-span heads stay fixed. The complete Cumulative field retains information that the heads lose.','',
'## Exact supported model','',
'Write all differences as LXX minus MT. The shared source order is Adam through Terah, with native Cainan retained separately between Arphaxad and Shelah.','',
'| Measurement | Named support | Coefficient |','|---|---|---|',
'| Δb | Adam, Seth, Enosh, Kenan, Mahalalel, Enoch; Arphaxad, Shelah, Eber, Peleg, Reu, Serug | u |',
'| Δb | Nahor | u/2 |',
'| ΔL | Peleg, Reu, Serug | u |',
'| ΔL | Lamech | λ |',
'| ΔL | Arphaxad, Shelah | a |',
'| ΔL | Eber | e |',
'| ΔL | Nahor | n |',
'', 'Every unlisted measurement change is zero. The calculated remainder change is Δr=ΔL−Δb. In the root’s R/A normal form the row coefficients are exactly(Δb,ΔL); no new operation basis is needed.','',
'| Shared row | Δb | Δr | ΔL |','|---|---:|---:|---:|']
for r in rows:lines.append('| '+r['name']+' | '+' | '.join(str(v) for v in r['delta_b_r_L'])+' |')
lines+=['','Jared, Methuselah, Noah, Shem and Terah are unchanged as full rows. Thirteen begetting values and eight lifespans change; these support counts are descriptive, not independent evidence. Main LXX Lamech uses182/753 and calculated571. Noah’s equal +2 binding cancels in the comparison.','',
'## Ranks and exact local recovery','',
'| Observed projection | Five parameters | Four parameters |','|---|---:|---:|']
for k,v in projection_ranks.items():lines.append('| '+k.replace('_',' ')+' | '+str(v['five'])+' | '+str(v['four'])+' |')
lines+=['','Adding calculated remainders to the38 outputs leaves ranks5 and4. Since U is invertible, ordered suffix accumulation preserves the ranks of each local projection; no new U proof is needed.','',
'The five observation rows Δb(Adam), ΔL(Lamech), ΔL(Arphaxad), ΔL(Eber), ΔL(Nahor) form an identity matrix on(u,λ,a,e,n). Under the restriction, omit Eber and recover(u,λ,a,n); e=u−n follows. The omitted Eber row is an additional test of the four-parameter restriction. The same four rows leave e wholly free in the unrestricted model. Dropping any row from either stated basis loses one rank.','',
'A life-only basis can use Peleg for u, together with Lamech, Arphaxad, Eber and Nahor. Thus Regular changes see only the century parameter, while the complete Cumulative life field sees every parameter.','',
'## Totals, native insertion and complete boundaries','',
'\[\nT_R=\\frac{25}{2}u,\\qquad T_C=3u+\\lambda+2a+e+n.\n\]','',
'With e+n=u, T_C=4u+λ+2a and n disappears from this total. The two totals together have rank2 in either model: three parameter directions remain invisible in the five-parameter family and two in the four-parameter family. Source substitution gives1250 and430 before the separate Cainan contribution.','',
'Native Cainan contributes the tagged biography130|330|460. Its regular130 and cumulative460 additions act on the shared-node prefix Adam through Arphaxad; the named inserted node remains explicit. The native heads become1380 and890. This fixed insertion changes affine offsets, not parameter rank, while its name, slot, values and source permission remain input costs. The source equality of Cainan and Shelah130/330/460 is not automatically preserved under arbitrary changes to the five formal parameters.','',
'| Boundary | Leveled ΔR | Leveled ΔC | Native ΔR | Native ΔC |','|---|---:|---:|---:|---:|']
for n,r,c,nr,nc in zip(names+['Abraham'],level_R+[0],level_C+[0],native_R+[0],native_C+[0]):lines.append('| '+n+' | '+' | '.join(str(v) for v in [r,c,nr,nc])+' |')
lines+=['','Every native value agrees with the inherited full displacement artifact, including the gap field ΔC−ΔR. Zero terminal differences are retained; no absolute anchor was fitted.','',
'## What the four-parameter restriction adds','',
'The restriction is the single output relation ΔL(Eber)+ΔL(Nahor)=Δb(Adam), equivalently Δr(Eber)+ΔL(Nahor)=0. In the four-parameter model, the n direction has life changes−1 at Eber and+1 at Nahor. Accumulation cancels it from Adam through Eber, leaves+1 at Peleg/Reu/Serug/Nahor, and returns to0 at Terah. This gives a finite internal plateau rather than an upstream translation.','',
'Two bounded algebraic controls expose its status. First, e→e+1 with all other parameters held remains in the five-parameter family but violates the four-parameter condition by1. It changes only Eber’s local life/remainder and all cumulative boundaries upstream through Eber. Second, (e,n)→(e−1,n+1) preserves the restriction and both outer totals while moving precisely the four internal boundaries above. Neither control is an admitted new chronology.','',
'## Source and model domain','',
'Ranks are over rational parameters on a fixed named support. Integer outputs require even u and integer λ,a,e,n; the received values satisfy this. Nonnegative source components place further inequalities on formal parameters. These mathematical domains do not confer source authorization. The model applies to the ordinary MT/LXX rows and does not absorb SP inclusive counts or replace nominal/counting distinctions.','',
'All remaining years in the packet retain their calculated L−b provenance. Five or four change amplitudes do not erase the38 baseline MT b/L values, the named masks, the insertion packet, or frame choices. Lower rank alone is not an explanation score. No historical priority, statistical independence or whole-system minimum is claimed.','',
'## Prior overlap audit','',
'| Earlier work | Reused result | Added burden here |','|---|---|---|']
for o in overlap:lines.append('| '+o['prior']+' | '+o['already_proved']+' | '+o['extension']+' |')
lines+=['','The whole-genealogy block should therefore remain bounded: adopt the complete support comparison, explain the single extra four-parameter relation and its internal plateau, then move to Rounded inverse fibres as planned. Further determinant variations would add little.','',
'## Reproduction and bindings','',
'Run `python c1132_c1431/prep/whole_genealogy_extension.py` in a fresh copy after removing only its own generated .json/.md outputs, or direct those outputs to a fresh path. The script uses only Fraction and standard-library matrix elimination, and imports no root model helper.','']
for k,v in bindings.items():lines.append('- '+k+': `'+v['path']+'`; SHA256 `'+v['sha256']+'`.')
with mdpath.open('x') as f:f.write('\n'.join(lines)+'\n')
print(json.dumps({'checks':len(checks),'passed':sum(c['pass'] for c in checks),'ranks':[rank(M5),rank(M4)],'json':str(jsonpath),'markdown':str(mdpath)}))

Linked sources and evidence

Edition and provenance

whole_genealogy_extension.py

SHA-256 0f73cd3c5bda902e671bdadc1dec9c6f76529a138b0cb8278448123aff734f63

C480–C1634/Research_Cycles/C1132_C1431_Recovered/prep/whole_genealogy_extension.py