Script: h12_full_ambient_torsion_verify.py
Hilbert 12: contracting ambient torsion
h12_full_ambient_torsion_verify.py
This is the original source text. Reading it does not run or verify the program.
1 #!/usr/bin/env python3
2 """Full 343-point ambient cubic torsion and triptic distribution audit.
3 Author: Komorebi P.
4 Exact integer/rational identities, optional numerical checks of a classical
5 multiplication formula. Does NOT prove elliptic gamma algebraicity or Hilbert 12.
6 """
7 import argparse
8 from collections import Counter
9 import sympy as sp
10
11 b=sp.symbols('b')
12 poly=b**3-7
13 rho=b*b+2*b+4
14 epsilon=2-b
15 tau=(b*b+2*b)/15
16 s=-(b+2)/15
17 delta=(tau+2*s+4)/7
18 eta=(s+2)/7
19 xi=sp.Rational(1,7)
20 z0=sp.Rational(1,3)
21 R=sp.Matrix([[8,-4,15],[1,0,0],[2,-1,4]])
22 M=R.inv()
23 u=sp.Matrix([1,2,4]);v=sp.Matrix([0,1,2]);w=sp.Matrix([0,0,1])
24 V=sp.Matrix.hstack(u,v,w)
25 H=sp.Matrix([[4,-4,15],[-4,1,0],[15,0,0]])
26
27 def rem(e):
28 return sp.rem(sp.expand(sp.together(e)),poly,b)
29
30 def assert_zero(e,label):
31 out=rem(e)
32 assert out==0,(label,out)
33
34 def action(k,l,j):
35 return ((4*k+5*l+j)%7,(4*l+5*j)%7,(4*j)%7)
36
37 def carry(k,l,j):
38 U=4*k+5*l+j;V_=4*l+5*j;W=4*j
39 qu,kp=divmod(U,7);qv,lp=divmod(V_,7);qw,jp=divmod(W,7)
40 A=5+8*k+3*l+2*j+qu
41 B=-k-2*l-j+2*qu+qv
42 C=1-3*l-2*j+4*qu+2*qv+qw
43 return (kp,lp,jp,A,B,C)
44
45 def exact_audit():
46 assert V.det()==1
47 assert all(int(a)%7==0 for a in R**21-sp.eye(3))
48 assert any(int(a)%7!=0 for a in R**3-sp.eye(3))
49 assert all(int(a)%7==0 for a in R**7-4*sp.eye(3))
50 print('PASS complete lattice basis and order 21 mod seven')
51 Nr=M-2*sp.eye(3)
52 assert all(int(a)%7==0 for a in Nr*u)
53 assert all(int(a)%7==0 for a in Nr*v-u)
54 assert all(int(a)%7==0 for a in Nr*w-v)
55 assert int((u.T*H*w)[0])%7==1
56 assert int((u.T*H*v)[0])%7==0
57 print('PASS full length-three eigenchain and nonzero socle-to-top pairing')
58 assert_zero(rho*eta-(5*delta+4*eta+3*tau-2*s-3),'rho eta')
59 assert_zero(rho*xi-(delta+5*eta+4*xi+2*tau-s-2),'rho one seventh')
60 assert_zero(rho*delta-(4*delta+8*tau-s),'rho delta')
61 print('PASS exact images of three generators')
62
63 points=[(k,l,j) for k in range(7) for l in range(7) for j in range(7)]
64 assert len({action(*p) for p in points})==343
65 for p in points:
66 k,l,j=p
67 kp,lp,jp,A,B,C=carry(*p)
68 assert (kp,lp,jp)==action(*p)
69 lhs=rho*(z0+k*delta+l*eta+j*xi)
70 rhs=z0+kp*delta+lp*eta+jp*xi+A*tau+B*s+C
71 assert_zero(lhs-rhs,f'343 carry {p}')
72 print('PASS 343 exact arithmetic unit carries')
73
74 known=set();sizes=[];representatives=[]
75 for p in points:
76 if p in known:continue
77 x=p;orbit=[]
78 while x not in known:
79 known.add(x);orbit.append(x);x=action(*x)
80 assert x==p
81 sizes.append(len(orbit));representatives.append((p,len(orbit)))
82 assert Counter(sizes)==Counter({1:1,3:2,21:16})
83 print('PASS full 343-point orbit decomposition', dict(Counter(sizes)))
84 assert Counter(length for p,length in representatives if p[2]==0 and p[1]==0)==Counter({1:1,3:2})
85 print('PASS embedded seven-point socle packet')
86
87 # Characteristic 7 reduction: R is 4I+5N+N^2 with N=(M-2I).
88 assert all(int(q)%7==0 for q in R-4*sp.eye(3)-5*Nr-Nr**2)
89 assert all(int(q)%7==0 for q in R**3-sp.eye(3)-2*Nr-5*Nr**2)
90 print('PASS semisimple order three and nontrivial order-seven shear')
91 TT=sp.Matrix([[4,5,1],[0,4,5],[0,0,4]])
92 dual=TT.inv_mod(7).T
93 a=sp.Matrix([1,0,0]); seen=[]
94 for m in range(1,22):
95 a=(dual*a).applyfunc(lambda y:int(y)%7)
96 seen.append(tuple(a))
97 assert len(set(seen))==21 and seen[-1]==(1,0,0)
98 print('PASS complementary dual character has a full 21-step orbit')
99
100 # All points avoid the zero/pole lattice Lambda5: integer tau, sigma
101 # coefficients force k=l=0, and then (1/3+j/7) is not an integer fifth.
102 for k,l,j in points:
103 if k==0 and l==0:
104 assert (5*(sp.Rational(1,3)+sp.Rational(j,7))).q != 1
105 print('PASS lattice-avoidance arithmetic for conductor-three packet')
106 print('Exact audit passed, with no Gamma algebraicity claim.')
107
108
109 def gamma_log(z,t,s,N,mp):
110 twopi=2j*mp.pi
111 P=mp.exp(twopi*t);Q=mp.exp(twopi*s);E=mp.exp(twopi*z)
112 pn=qn=en=ei=mp.mpc(1);acc=mp.mpc(0)
113 for n in range(1,N+1):
114 pn*=P;qn*=Q;en*=E;ei/=E
115 if n%5:acc+=(pn*en-qn*ei)/(n*(1-pn)*(1-qn))
116 return -5*acc
117
118
119 def numeric_distribution():
120 import mpmath as mp
121 mp.mp.dps=38
122 t=mp.mpc('0.19','0.52');s=mp.mpc('-0.13','0.66');z=mp.mpf(1)/3
123 N=210
124 for n in (2,3,5,7):
125 val=mp.mpc(0)
126 for u in range(1-n,1):
127 for v in range(n):
128 zz=z+(u*t+v*s)/n
129 for j in range(n):
130 val+=gamma_log(zz+mp.mpf(j)/n,t,s,N,mp)
131 target=gamma_log(n*z,t,s,N,mp) if n%5 else mp.mpc(0)
132 err=abs(val-target)
133 print('NUMERIC distribution n=',n,'n^3=',n**3,
134 'log residual',mp.nstr(err,12),'expected', 'F(nz)' if n%5 else '1')
135 print('Numerics are not an interval certificate; the proof is geometric-series Fourier filtering.')
136
137 if __name__=='__main__':
138 p=argparse.ArgumentParser();p.add_argument('--numeric',action='store_true')
139 a=p.parse_args()
140 exact_audit()
141 if a.numeric:numeric_distribution()
Original file and source record
This copy matches the recorded source file. Its publication here does not change the work’s review status.
SHA-256: aae4e94d320745f9be22e37e95cf77c41fcaf6d9432ed28b86c6a53df952d576