Evidence

Independent rational elimination and fraction-free determinant; no project matrix helper.

Download source fileOpen in research workspace
from pathlib import Path
from fractions import Fraction as F
import json,hashlib,datetime,re
R=Path('/workspace/scratch/1b40da62dcbd/c932_c1131');S=R/'evidence/sources';M=R/'model'
j={x['step']:x for x in json.loads((R/'journal.json').read_text())};checks={}
def read(n):return json.loads((M/n).read_text())
def table(path,head):
 a=path.read_text().splitlines();st=a.index(head);q=st+2;rows=[]
 while q<len(a) and a[q].startswith('|'):
  rows.append([x.strip().strip('`*') for x in a[q].strip('|').split('|')]);q+=1
 return rows,st+1,q
f58=S/'19-File_58.Numbers_28_29_Tishri_Sacrificial_Ledger-2-.md';f43=S/'06-File_43.Genealogical_Bridge-2-.md';f54=S/'07-File_54.Luke_70_Year_Genealogical_Lattice-5-.md';f70=S/'24-File_70.Genesis_Toledot_Atonement_Weave-10-1-.md';fs=S/'14-file_70-supplement-a-key-of-23-fine-resolution-720-30-rail-2-.md'
prep=json.loads((R/'prep/structural_transfer/inputs.json').read_text());manifest=json.loads((R/'evidence/SOURCE_MANIFEST.json').read_text())
for p in [f58,f43,f54,f70,fs]:checks['source_snapshot_'+p.name]=hashlib.sha256(p.read_bytes()).hexdigest()==manifest[p.name]
for k,v in prep['sources'].items():checks['prep_binding_'+k]=hashlib.sha256((S/Path(v['path']).name).read_bytes()).hexdigest()==v['sha256']
# Independent rational elimination and fraction-free determinant; no project matrix helper.
def rref(a):
 a=[[F(v) for v in row] for row in a];k=0;piv=[]
 for c in range(len(a[0])):
  p=next((p for p in range(k,len(a)) if a[p][c]),None)
  if p is None:continue
  a[k],a[p]=a[p],a[k];den=a[k][c];a[k]=[v/den for v in a[k]]
  for p in range(len(a)):
   if p==k:continue
   z=a[p][c];a[p]=[x-z*y for x,y in zip(a[p],a[k])]
  piv.append(c);k+=1
  if k==len(a):break
 return a,piv
rank=lambda a:len(rref(a)[1])
def mm(a,b):return [[sum(F(x)*F(y) for x,y in zip(row,col)) for col in zip(*b)] for row in a]
def mv(a,v):return [sum(F(x)*F(y) for x,y in zip(row,v)) for row in a]
def bareiss(a):
 a=[[F(x) for x in row] for row in a];old=F(1);sign=1;n=len(a)
 for k in range(n-1):
  if a[k][k]==0:
   p=next((i for i in range(k+1,n) if a[i][k]),None)
   if p is None:return F(0)
   a[k],a[p]=a[p],a[k];sign=-sign
  pivot=a[k][k]
  for i in range(k+1,n):
   for h in range(k+1,n):a[i][h]=(a[i][h]*pivot-a[i][k]*a[k][h])/old
  for i in range(k+1,n):a[i][k]=0
  old=pivot
 return sign*a[-1][-1]
def pref(order,n=9):
 cur=[0]*n;out=[]
 for i in order:cur[i]=1;out.append(cur.copy())
 return out
es,eslo,eshi=table(f58,'| Species | Clean state | Sex | Printed numeral |');counts=[int(x[3]) for x in es]
p=read('structural_transfer_inputs.json');C=pref([1,3,5,0,2,4]);FM=pref([0,2,6,4,7]);U=pref([7,6,8]);A=C+FM+[[1]*9]
checks['C1008_nine_counts_from_literal']=counts==p['Esau_counts'] and len(counts)==9 and sum(counts)==550
joint=read('esau_joint_measurements.json');checks['C1009_complete_matrix']=joint['matrix']==A
checks['C1009_complete_measurements']=mv(A,counts)==joint['measurements']
checks['C1009_full_rank_and_recovery']=rank(A)==9 and joint['recovered']==counts
checks['C1010_rank_eight']=rank(C+FM)==8
expectedkernel=[0]*8+[1];checks['C1010_only_male_donkey_missing']=all(v==0 for v in mv(C+FM,expectedkernel)) and j[1010]['results']['kernel']==[expectedkernel]
bas=read('esau_unimodular_basis.json');B=[A[i] for i in [0,1,2,3,4,5,8,10,11]];I=[[int(i==k) for k in range(9)] for i in range(9)]
checks['C1011_basis_equals_selected_source_measurements']=B==bas['matrix'] and mv(B,counts)==bas['measurements']
checks['C1011_bareiss_determinant1']=bareiss(B)==1==bas['determinant']
checks['C1011_inverse_both_sides']=mm(B,bas['inverse'])==I and mm(bas['inverse'],B)==I
checks['C1011_integral_inverse_and_reconstruction']=all(F(x).denominator==1 for row in bas['inverse'] for x in row) and mv(bas['inverse'],bas['measurements'])==counts
checks['C1012_second_basis']=bareiss(C+U)==-1 and mv(C+U,counts)==j[1012]['results']['measurements'] and j[1012]['results']['recovered']==counts
D=read('esau_register_dependencies.json');ALL=C+FM+U;trans=[list(x) for x in zip(*ALL)]
checks['C1013_whole14register_matrix']=ALL==D['matrix'] and rank(ALL)==9
checks['C1013_all_five_independent_relations']=len(D['left_relations'])==5 and rank(D['left_relations'])==5 and all(all(q==0 for q in mv(trans,v)) for v in D['left_relations'])
checks['C1013_source_equalities_not_incidence_identities']=mv(C,counts)[0]==mv(U,counts)[0]==20 and mv(C,counts)[2]==mv(U,counts)[1]==50 and C[0]!=U[0] and C[2]!=U[1]
# Reconstruct templates directly from frozen literal source cell ratios.
t,tl,th=table(f58,'| Category | Bulls | Rams | Lambs | Goats | Total |');cells=[[int(v) for v in row[1:5]] for row in t[:7]];tt=[int(v) for v in t[-1][1:5]]
rowtemplates=[[0,0,1,0],[0,0,1,0]]+cells[2:];base=[list(x) for x in zip(*rowtemplates)];extras=[[0,0,0,1,-1,0,0],[0,0,0,0,1,0,-1],[1,0,0,0,0,0,0]];TA=base+extras;rhs=tt+[0,0,44];TC=read('tishri_template_constraints.json')
checks['C1014_templates_equal_frozen_source']=TC['base']==base and TC['rhs']==rhs and p['Tishri_species_totals']==tt
checks['C1014_rank4_to7']=rank(base)==4 and rank(TA)==7
checks['C1014_whole_ledger_solution']=mv(TA,TC['solution'])==rhs and TC['solution']==[44,6,1,1,1,1,1] and [[int(v*a) for v in row] for row,a in zip(rowtemplates,TC['solution'])]==cells
checks['C1015_predicate_removal_ranks']=rank(base+extras[:2])==6 and rank(base+[extras[2]])==5
for key,mat in [('without_daily_kernel',base+extras[:2]),('without_equal_festivals_kernel',base+[extras[2]])]:
 ks=j[1015]['results'][key];checks['C1015_'+key]=all(all(q==0 for q in mv(mat,v)) for v in ks) and rank(ks)==7-rank(mat)
fest,fl,fh=table(f58,'| Step | Day | Day total | `×7` | Cumulative | Landing |');weights=[int(row[2]) for row in fest];landings=[int(re.search(r'\d+',row[-1])[0]) for row in fest]
first=F(189+21,7);days=[first-i for i in range(7)];bulls=[v-17 for v in days]
checks['C1016_literal_day_sequence_and_bulls']=days==weights[:7]==j[1016]['results']['day_totals'] and bulls==j[1016]['results']['bulls_given_nonbull17'] and sum(bulls)==70
checks['C1016_three_positive_constant_decrement_alternatives']=j[1016]['results']['diagnostic_positive_bull_alternatives']==[[10+3*d-i*d for i in range(7)] for d in range(1,4)]
def sums(v):
 r=[0]
 for x in v:r.append(r[-1]+x)
 return r
pr=sums(weights);a=F(1446-536,pr[7]-pr[2]);head=1446+a*pr[2]
checks['C1017_identifies_declared_parameters']=a==7 and head==1859
checks['C1017_every_literal_boundary']=[head-a*x for x in pr]==[1859]+landings==j[1017]['results']['all_landings']
rp=sums(list(reversed(weights)));ra=F(910,rp[7]-rp[2]);rh=1446+ra*rp[2]
checks['C1018_diagnostic_order_fit']=ra==F(182,27) and rh==F(45230,27) and rh-ra*rp[-1]==F(3004,9) and (rh!=1859 and rh-ra*rp[-1]!=466)
K=[[F(70,69)-1,-1],[F(25,23)-1,-6]];NK=read('nt_knot_constraints.json')
checks['C1019_complete_knot_rank']=rank(K)==1 and all(F(x)==y for row,krow in zip(NK['matrix'],K) for x,y in zip(row,krow)) and K[1]==[6*x for x in K[0]]
checks['C1020_one_free_metric']=mv(K,[69,1])==[0,0] and j[1020]['results']['kernel']==[[69,1]]
checks['C1021_metric_recovered']=rank(K+[[0,35]])==2 and mv(K+[[0,35]],[4830,70])==[0,0,2450] and j[1021]['results']['Enoch_radius_and_slot']==[4830,70]
P=[[1,55],[1,20]];checks['C1022_placement_basis']=bareiss(P)==-35 and mv(P,[6,70])==[3856,1406]
nt,nl,nh=table(f43,"| Primary 70-year generation | Matthew's genealogy | Luke's genealogy |");lookup={76-i:row for i,row in enumerate(nt)}
checks['C1019_source_marked_index_roles']=lookup[69][2]=='Enoch' and lookup[70][2]=='Jared' and lookup[75][2]=='Creation of Adam'
checks['C1022_source_coincident_slots']=lookup[55][0].startswith('3856') and lookup[20][0].startswith('1406')
tol,ol,oh=table(f70,'| Occurrence | Major section | Reference | File_70 function |');names=[r[1] for r in tol];unique=[];q=[]
for n in names:
 if n not in unique:unique.append(n)
 q.append(unique.index(n)+1)
blocks=[[i+1 for i,x in enumerate(q) if x==k] for k in range(1,len(unique)+1)];Q=read('toledot_quotient.json')
checks['C1023_complete_literal_quotient']=q==Q['occurrence_to_section'] and blocks==Q['blocks'] and len(q)==11 and len(blocks)==10
checks['C1024_two_measures']=names.index('Terah')+1==6 and unique.index('Terah')+1==6 and [5,11-6]==[5,5] and [5,10-6]==[5,4]
obs=[B for B in blocks if len({q[(12-i)-1] for i in B})>1]
checks['C1025_unique_descent_obstruction']=obs==[[9,10]] and {q[2],q[1]}=={2,3}
w=[len(B) for B in blocks];checks['C1026_count_restored_reflection_not_restored']=w==j[1026]['results']['section_weights'] and sum(w[:5])==sum(w[6:])==5 and sum(w)==11 and bool(obs)
closure=j[1027]['results']['formal_blocks'];checks['C1027_closure_and_required_merge']=all(sorted(12-i for i in B) in closure for B in closure) and [2,3] in closure and [9,10] in closure and len(closure)==9
checks['C1028_representative_criterion_correct']=not all(len({q[12-i-1] for i in B})==1 for B in blocks)
B=[set(range(7*i,7*i+7)) for i in range(11)];images=[{76-i for i in b} for b in B];maps=[B.index(v) for v in images];boundaries=list(range(0,78,7))
checks['C1029_complete_coarsening']=maps==list(reversed(range(11)))==j[1029]['results']['block_map'] and set(77-i for i in boundaries)==set(boundaries)
info=read('cross_family_information_table.json');checks['C1030_retains_information_limits']=len(info)==5 and any('section-level reflection remains obstructed' in x['loss'] for x in info) and any('scale free' in x['loss'] for x in info)
sub=fs.read_text().split('### 10.3 Cumulative calendar-body matrix')[1].split('### 10.4')[0]
checks['C1031_correct_macro_source_locator']=all(x in sub for x in ['9660+2940 = 12600','9660×70/69 = 9800','9660×25/23 = 10500'])
checks['C1031_first100_record_numbers']=list(range(932,1032))==[n for n in j if n<=1031] and j[1031]['results']['completed']==100
refs=[]
def walk(v):
 if isinstance(v,dict):
  if 'path'in v and 'sha256'in v:refs.append(v)
  for x in v.values():walk(x)
 elif isinstance(v,list):
  for x in v:walk(x)
for n in range(1008,1032):walk(j[n]['results'])
checks['all_reviewed_artifact_hashes']=all(hashlib.sha256((R/x['path']).read_bytes()).hexdigest()==x['sha256'] for x in refs)
result={'reviewer':'nt_family','scope':'C1008–C1031','status':'PASS' if all(checks.values()) else 'FAIL','utc':datetime.datetime.now(datetime.timezone.utc).isoformat(),'method':'Fresh literal-source parsing, independent rational row reduction and Bareiss determinants. No root or preparation algebra module imported; no numbered script replay or journal write.','checks':checks,'counts':{'checks':len(checks),'Esau_counts':9,'combined_measurements':12,'all_register_measurements':14,'Tishri_source_rows':7,'NT_marked_equation_rows':2,'Toledot_occurrences':11,'Toledot_sections':10,'NT_coarse_blocks':11,'records_reviewed':24,'artifact_hashes':len(refs)},'source_locators':{'Esau':[eslo,eshi],'Tishri':[tl,th],'festival':[fl,fh],'NT_display':[nl,nh],'Toledot':[ol,oh],'macro_source':'SupplementA §10.3'},'journal_record_hashes':{str(n):j[n]['sha256'] for n in range(1008,1032)},'required_numerical_corrections':[],'scope_findings':['C1026 correctly restores occurrence measure but explicitly does not restore a single-valued section reflection.','Unimodular recovery is a bijection of integer coordinate lattices; arbitrary measurement vectors need not produce nonnegative source counts. No historical input reduction follows merely from changing basis.','Tishri row templates retain numeric source content; four margins alone never carry the reconstruction.','NT unit/anchor recovery uses already fitted display co-registrations and remains conditional consistency.','C1018 does not reject the legitimate reverse-order source path, whose roles differ.'],'minor_locator_refinement':'C1021 cites File54 §6 for the Key fork. The retained2450/35-slot metric premise is located more precisely in File54 §§8.6 and13.2; include those in synthesis citation.','integration_scope':'C1030 inherited SP-cap row and C1031 earlier-cycle claims were checked for consistency with their recorded scope; their full prior numerical proofs were not re-audited in this block.'}
(R/'evidence/INDEPENDENT_C1008_C1031.json').write_text(json.dumps(result,indent=2,ensure_ascii=False)+'\n')
print(json.dumps({'status':result['status'],'checks':len(checks),'failed':[k for k,v in checks.items() if not v]},indent=2))

Linked sources and evidence

Edition and provenance

review_block.py

SHA-256 216714e0261ac93bbc23ec428c3c3fcb2bb1edba87ac45ae700ad9d87fce2ff9

C480–C1634/Research_Cycles/C0932_C1131/prep/structural_transfer/review_block.py