"""Independent exact arithmetic audit of the attached September 28 spine study. This accepts the six declared source coordinate pairs and checks their consequences. It is not a re-derivation of the underlying source-table lifespan totals. No source or completed C1431 research artifact is changed. """ from fractions import Fraction as Q from hashlib import sha256 from pathlib import Path import json ROOT = Path(__file__).resolve().parent SOURCE = ROOT.parent / '490d_LXX_Reversed_Spines_and_Accepted_SP_Solution_20260928.md' def reverse_placeholders(n): if not isinstance(n, int) or n <= 0: raise ValueError('A positive integer duration is required') scale = 1 while n % 10 == 0: n //= 10 scale *= 10 return int(str(n)[::-1]) * scale checks = [] def eq(group, label, actual, expected): checks.append(dict(group=group, label=label, actual=actual, expected=expected, passed=actual == expected)) assert actual == expected, (label, actual, expected) declared = { 'MT_regular': (4106, 2456, [1406,6416,12026], [6,4106,9116,14726]), 'MT_cumulative': (14006,4836,[1406,4836,12026],[6,4106,7536,14726]), 'LXX_regular': (5486,3236,[1406,5216,10436],[6,4106,7916,13136]), 'LXX_cumulative': (14896,5746,[1406,5746,10936],[6,4106,8446,13636]), 'SP_regular_accepted_Fall': (4406,3106,[1406,8506,11606],[6,4106,11206,14306]), 'SP_cumulative_accepted_Fall': (13396,4716,[1406,2736,11416],[6,4106,5436,14116]), } computed = {} for name, (c,f,expected2,expected3) in declared.items(): legs = [f-1406,c-f] reversed_legs = [reverse_placeholders(s) for s in legs] path2 = [1406] for duration in reversed_legs: path2.append(path2[-1]+duration) path3 = [6,6+reverse_placeholders(1400)] for duration in reversed_legs: path3.append(path3[-1]+duration) eq('six_spines',name+' two-stage path',path2,expected2) eq('six_spines',name+' three-stage path',path3,expected3) eq('stage_translation',name+' common shift',path3[-1]-path2[-1],2700) computed[name] = dict(source_head=c,flood=f,original_legs=legs,reversed_legs=reversed_legs, path2=path2,path3=path3,two_stage_gain=path2[-1]-c) for label,prefix,gap in [('MT','MT',0),('LXX','LXX',500),('SP','SP',-190)]: r = computed[prefix+'_regular'+('_accepted_Fall' if prefix=='SP' else '')] c = computed[prefix+'_cumulative'+('_accepted_Fall' if prefix=='SP' else '')] for field in ['path2','path3']: eq('regular_cumulative_difference',label+' '+field,c[field][-1]-r[field][-1],gap) eq('gain_balance',label+' gap decomposition', c['source_head']-r['source_head']+c['two_stage_gain']-r['two_stage_gain'],gap) for label,actual,expected in [ ('LXX inter-leg cancellation',(4340-3810)+(5190-5220),500), ('MT cumulative fixed leg',reverse_placeholders(3430),3430), ('LXX cumulative fixed leg',reverse_placeholders(4340),4340), ('SP cumulative fixed leg',reverse_placeholders(8680),8680), ('SP fixed leg twice LXX',8680,2*4340), ('SP regular Fall adjustment',4411-5,4406), ('SP cumulative Fall adjustment',13401-5,13396), ('SP regular source segment',4406-3106,1300), ('SP cumulative source segment',13396-4716,8680), ]: eq('source_and_fixed_segments',label,actual,expected) for label,actual,expected in [ ('Flood translation',5746-4836,910),('Shem translation',6346-5436,910), ('Target translation',1446-536,910),('MT Shem restoration',5436-536,4900), ('LXX Shem Exodus',6346-1446,4900),('MT Flood restoration',4836-536,4300), ('LXX Flood Exodus',5746-1446,4300),('9030 two-stage',10436-1406,9030), ('9030 shifted',13136-4106,9030),('9030 factor',9030,21*430), ('12600 LXX',13136-536,12600),('12600 MT',14006-1406,12600), ('870 heads',14006-13136,870),('870 targets',1406-536,870), ]: eq('LXX_MT_translations',label,actual,expected) for label,actual,expected in [ ('cumulative span',13636-1446,12190),('regular span',13136-1406,11730), ('cumulative endpoint',13636-Q(25,23)*(13636-1446),386), ('regular endpoint',13136-Q(25,23)*(13136-1406),386), ('difference expansion',Q(25,23)*(500-40),500), ]: eq('LXX_common_expanded_endpoint',label,actual,expected) for label,actual,expected in [ ('MT 344',Q(12026-4114,23),344),('LXX 354',Q(13636-5494,23),354), ('LXX 364',Q(13636-5264,23),364),('anchor gap',13636-12026,23*70), ('source gap',5494-4114,1380),('first 230 increment',1610-1380,230), ('second 230 increment',5494-5264,230),('LXX to MT square',13636-4114,18*23**2), ('square priestly',Q(25,23)*9522,10350),('square prophetic',Q(70,69)*9522,9660), ('apparent LXX',14894+30,14924),('apparent partition left',14924-14004,920), ('apparent partition right',14004-13636,368),('apparent total expansion',Q(25,23)*1288,1400), ('apparent other boundary',14896+30-13636,1290), ]: eq('actual_node_and_apparent_comparisons',label,actual,expected) for label,actual,expected in [ ('SP two-stage displacement',11606-4406,7200), ('SP reversal gain',7100-1700+3100-1300,7200), ('MT original span reversal',reverse_placeholders(4106-1406),7200), ('corrected MT endpoint subtraction',11606-4106,7500), ('SP 9900',14306-4406,9900),('SP 9890',14306-4416,9890), ('MT 9900',14006-4106,9900),('MT 9890',14006-4116,9890), ('MT actual completion 9890',14004-4114,9890),('9890 factor',9890,23*430), ('head translation',14306-14006,300),('lower translation',4406-4106,300), ('upper translation',4416-4116,300),('9900 generation',7200+2700,9900), ('2736 Exodus',2736-1446,1290),('SP cumulative 7000',11416-4416,7000), ('SP cumulative 10000',14116-4116,10000),('7000 to10000 accounting',10000-7000,2700+300), ]: eq('SP_MT_bridges',label,actual,expected) expanded_lxx = 1406+Q(70,69)*(13136-1406) eq('LXX_SP_return','held-Conquest LXX expansion',expanded_lxx,13306) for label,actual,expected in [ ('LXX expansion gain',expanded_lxx-13136,170), ('SP upper to LXX Creation',14306-5486,180*49), ('expanded LXX to LXX Creation',expanded_lxx-5486,170*46), ('SP lower to LXX Creation',11606-5486,17*360), ('source1700 returns',expanded_lxx-11606,3106-1406), ('upper1000',14306-expanded_lxx,1000), ('8820 decomposition',14306-5486,1000+7820), ('8820 stage decomposition',14306-5486,2700+6120), ('1700 factor difference',7820-6120,17*(460-360)), ]: eq('LXX_SP_return',label,actual,expected) for label,actual,expected in [ ('BC toAD30',10436+30-1,10465),('legacy factor',10465,7*1495), ('Enochian factor',10465,35*299),('legacy expansion',Q(1496,1495)*10465,10472), ('legacy AD endpoint',Q(1496,1495)*10465-10436+1,37), ('Enochian expansion',Q(300,299)*10465,10500), ('Enochian AD endpoint',Q(300,299)*10465-10436+1,65), ('Conquest toAD65',1406+65-1,3*490), ]: eq('civil_cross_era',label,actual,expected) for source,targets in [(4836,[-6,30,65]),(4829,[2,37,72])]: for years,target in zip([4830,4865,4900],targets): # Negative targets denote BC here solely for this expected-value check. actual = -(source-years) if years < source else years-source+1 eq('civil_cross_era',str(source)+' duration'+str(years),actual,target) def jsonable(obj): if isinstance(obj,Q): return obj.numerator if obj.denominator==1 else str(obj) if isinstance(obj,dict): return {k:jsonable(v) for k,v in obj.items()} if isinstance(obj,list): return [jsonable(v) for v in obj] return obj result = dict(status='PASS',scope='Exact arithmetic using declared source coordinates; source-total reconstruction not rerun', source=str(SOURCE),source_sha256=sha256(SOURCE.read_bytes()).hexdigest(), checks=len(checks),groups=sorted(set(x['group'] for x in checks)), computed_spines=computed,results=checks,inverse_of_inverse_performed=False) (ROOT/'spine_arithmetic_verification.json').write_text(json.dumps(jsonable(result),indent=2)+'\n') print(json.dumps(dict(status=result['status'],checks=result['checks'],groups=len(result['groups']),source_sha256=result['source_sha256'])))