Research source · python
verify-generic-boundary-reconstruction.py
site/public/evidence/dehn-filled-quantum-trace/verify-generic-boundary-reconstruction.py
168 lines. Source is displayed for inspection; it is not executed by this page.
File fingerprint
SHA-256: 0e58cdd564e0735d0cb2c989092903477096dffaa43a63e4ca42f3d12409c6fb
#!/usr/bin/env python3
"""Exact algebra audit; no numerical sampling or external dependencies.
All coefficients are integer Laurent polynomials. Quantum-torus monomials
are normalized as A^a m^i l^j with ml=A^2 lm. The script audits the local
identities and explicit quotient maps in the companion research note.
It does not prove category generation, source trace matching, or nonvanishing.
"""
from dataclasses import dataclass
@dataclass(frozen=True)
class P:
terms: dict
def __post_init__(self):
object.__setattr__(self, "terms", {k: v for k, v in self.terms.items() if v})
def __add__(self, other):
if isinstance(other, int):
other = mon(c=other)
d = dict(self.terms)
for k, v in other.terms.items():
d[k] = d.get(k, 0) + v
return P(d)
__radd__ = __add__
def __neg__(self):
return P({k: -v for k, v in self.terms.items()})
def __sub__(self, other):
return self + (-other)
def __rsub__(self, other):
return -self + other
def __mul__(self, other):
if isinstance(other, int):
other = mon(c=other)
d = {}
for (a, i, j), c in self.terms.items():
for (b, k, n), e in other.terms.items():
key = (a + b - 2*j*k, i+k, j+n)
d[key] = d.get(key, 0) + c*e
return P(d)
__rmul__ = __mul__
def mon(a=0, i=0, j=0, c=1):
return P({(a, i, j): c})
Z, O = mon(c=0), mon()
def mm(x, y):
assert len(x[0]) == len(y)
return [[sum((x[i][k]*y[k][j] for k in range(len(y))), Z)
for j in range(len(y[0]))] for i in range(len(x))]
def ma(x, y):
return [[u+v for u, v in zip(a, b)] for a, b in zip(x, y)]
def ms(c, x):
return [[c*v for v in row] for row in x]
def eye(n):
return [[O if i == j else Z for j in range(n)] for i in range(n)]
def kron(x, y):
return [[a*b for a in xr for b in yr] for xr in x for yr in y]
checks = []
def check(name, lhs, rhs):
assert lhs == rhs, name
checks.append(name)
print("PASS:", name)
A, Ai = mon(1), mon(-1)
delta = -mon(2)-mon(-2)
C = [[Z, A], [-Ai, Z]]
E = [[Z, -A], [Ai, Z]]
cup = [[Z], [A], [-Ai], [Z]]
cap = [[Z, -A, Ai, Z]]
U = mm(cup, cap)
R = ma(ms(A, eye(4)), ms(Ai, U))
Ri = ma(ms(Ai, eye(4)), ms(A, U))
check("left snake", mm(C, E), eye(2))
check("right snake", mm(E, C), eye(2))
check("loop value", mm(cap, cup), [[delta]])
check("Temperley-Lieb square", mm(U, U), ms(delta, U))
U12, U23 = kron(U, eye(2)), kron(eye(2), U)
check("three-strand contraction 121", mm(mm(U12, U23), U12), U12)
check("three-strand contraction 232", mm(mm(U23, U12), U23), U23)
check("crossing inverse, right", mm(R, Ri), eye(4))
check("crossing inverse, left", mm(Ri, R), eye(4))
R12, R23 = kron(R, eye(2)), kron(eye(2), R)
check("braid relation", mm(mm(R12, R23), R12), mm(mm(R23, R12), R23))
check("curl eigenvalue", mm(R, cup), ms(-mon(-3), cup))
t, ti, r = mon(2), mon(-2), mon(i=1)
D = t-ti
first = -t+ti*r
conjugate_second = -ti+t*mon(-4)*r
check("reduced GJV two-point identity", first-conjugate_second, -D)
check("two-point denominator vanishes at A=-1",
sum(c*((-1)**a) for (a, i, j), c in D.terms.items()), 0)
omega3 = [[0, 1, -1], [-1, 0, 1], [1, -1, 0]]
omega6 = [[omega3[i % 3][j % 3] for j in range(6)] for i in range(6)]
projection = [[int(j % 3 == i) for j in range(6)] for i in range(3)]
pullback = [[sum(projection[a][i]*omega3[a][b]*projection[b][j]
for a in range(3) for b in range(3))
for j in range(6)] for i in range(6)]
check("CK six-edge skew form is P-transpose Omega P", omega6, pullback)
for j in range(3):
v = [int(i == j)-int(i == j+3) for i in range(6)]
check("opposite-edge radical vector " + str(j+1),
[sum(omega6[i][k]*v[k] for k in range(6)) for i in range(6)], [0]*6)
# The new quotient isomorphism, with denominators cleared.
m, mi, l, li = mon(i=1), mon(i=-1), mon(j=1), mon(j=-1)
r1, r2 = -mon(2), -mon(-2)
d = r1-r2
X = m+mi-r1-r2
Y = Ai*m*l+Ai*mi*li+mon(-3)*(l+li)
F, H = O-l*l, m-r2 # Phi=F, Psi=H/d.
check("peripheral quantum-torus convention", m*l, mon(2)*l*m)
check("inverse-map representatives: H(m-r1)=Xm", H*(m-r1), X*m)
check("Psi Phi minus identity is a filling relation", H*F-d, X-A*Y*l)
check("Phi Psi difference factors through meridian",
F*H-d, (m-r1)*(O-mon(-4)*l*l))
check("Phi X explicit right-ideal factorization", F*X,
(m-r1)*(mi*(m-r2)-mon(-4)*mi*(m+mon(6))*l*l))
check("Phi Y explicit right-ideal factorization", F*Y,
(m-r1)*(-mon(-5)*l*l*l+Ai*mi*(m-mon(2))*l+mon(-3)*mi*li))
def reduce_at_r1(p):
"""Remainder modulo (m-r1)T on the RIGHT of the generator.
The right ideal (m-r1)T admits normal remainders in A,l because m
is ordered before l. Since r1=-A^2, this substitution is exact even
for negative m powers. It is a linear remainder map, not an algebra map.
"""
dct = {}
for (a, i, j), c in p.terms.items():
key = (a+2*i, 0, j)
dct[key] = dct.get(key, 0) + c*(-1 if i % 2 else 1)
return P(dct)
check("Phi kills first filling generator", reduce_at_r1(F*X), Z)
check("Phi kills second filling generator", reduce_at_r1(F*Y), Z)
check("Phi Psi is identity modulo meridian relation", reduce_at_r1(F*H-d), Z)
print(f"\nAll {len(checks)} exact checks passed.")
print("No numerical approximation, manifold census, or nonvanishing claim.")