Research source · python
verify-local-collar.py
site/public/evidence/dehn-filled-quantum-trace/six-root-peripheral-attack/verify-local-collar.py
135 lines. Source is displayed for inspection; it is not executed by this page.
File fingerprint
SHA-256: fd9de55476f3eaf12c746f60cc3bdb5f107657a6fae37aff6f0422cee7300329
#!/usr/bin/env python3
"""Exact local tensor/collar audit. Python 3.10+, standard library only.
Arithmetic is in Z[i,t^+-1,r^+-1]/(i^2+1), A=t^2.
No sampling, floating point, manifold, slope or triangulation census.
These checks certify displayed algebra identities, not geometric identifications.
"""
from dataclasses import dataclass
@dataclass(frozen=True)
class L:
terms: tuple = ()
@staticmethod
def m(t=0, r=0, i=0, c=1):
i %= 4
if i > 1:
c, i = -c, i - 2
return L((((t, r, i), c),)) if c else L()
def __add__(self, b):
d = dict(self.terms)
for a, c in b.terms:
d[a] = d.get(a, 0) + c
return L(tuple(sorted((a, c) for a, c in d.items() if c)))
def __neg__(self):
return L(tuple((a, -c) for a, c in self.terms))
def __sub__(self, b):
return self + -b
def __mul__(self, b):
d = L()
for (t, r, i), c in self.terms:
for (u, s, j), e in b.terms:
d += L.m(t+u, r+s, i+j, c*e)
return d
Z, O = L(), L.m()
def mt(a):
return list(map(list, zip(*a)))
def mm(a, b):
return [[sum((x*y for x, y in zip(row, col)), Z)
for col in mt(b)] for row in a]
def sm(c, a):
return [[c*x for x in row] for row in a]
def check(name, truth):
if not truth:
raise AssertionError(name)
print("PASS:", name)
def imul(a, b):
return [[sum(x*y for x, y in zip(row, col)) for col in zip(*b)]
for row in a]
def main():
print("Local collar audit; exact Laurent/tensor identities")
print("Coefficient ring: Z[i,t^+-1,r^+-1]/(i^2+1), A=t^2")
v, vi = L.m(t=2, i=1), L.m(t=-2, i=3)
h, hi = L.m(t=3, i=1), L.m(t=-3, i=3)
I, F = [[O,Z],[Z,O]], [[Z,O],[O,Z]]
EG = [[Z,L.m(t=-1)],[-L.m(t=-5),Z]]
CG = [[Z,-L.m(t=5)],[L.m(t=1),Z]]
EC = [[Z,v],[vi,Z]]
CC = EC
check("distinguished vertex and half-twist units have their exact inverses",
v*vi == O and h*hi == O)
check("half-twist squares to the full framing scalar", h*h == -L.m(t=6))
check("ordinary cup is h^-1 times symmetric cup", EG == sm(hi,EC))
check("ordinary cap is h times symmetric cap", CG == sm(h,CC))
check("both ordinary snake identities", mm(EG,CG)==I and mm(CG,EG)==I)
check("both symmetric snake identities", mm(EC,CC)==I and mm(CC,EC)==I)
check("unweighted state flip is involutive", mm(F,F)==I)
ER, CR = mm(F,mm(EC,F)), mm(F,mm(CC,F))
check("evaluation square including both mixed states after marking reversal",
mm(F,mm(ER,F)) == EC)
check("coevaluation square including both mixed states after marking reversal",
mm(F,mm(CR,F)) == CC)
check("same-state cut tensor is preserved, F I F^t=I", mm(F,mt(F))==I)
check("annular matrix-element counit is preserved for arbitrary states",
all((int(a==b) == int((1-a)==(1-b))) for a in range(2) for b in range(2)))
# PP1 Proposition 3.10 on unrescaled generators: d(L_s)=v^-sum(s)L_-s.
D = [[Z,v],[vi,Z]]
defect = mm(D,mt(D))
check("weighted self-duality has nontrivial same-state splitting defect",
defect == [[v*v,Z],[Z,vi*vi]] and defect != I)
check("weighted self-duality fails the unmodified standard annular counit",
vi*vi != O and v*v != O)
Di = [[Z,vi],[v,Z]]
check("opposite endpoint weights cancel across a paired cut", mm(D,mt(Di))==I)
r, ri = L.m(r=1), L.m(r=-1)
U, Ui = [[Z,ri],[r,Z]], [[Z,r],[ri,Z]]
check("arbitrary reciprocal endpoint gauge cancels without specializing it",
mm(U,mt(Ui))==I)
check("the same nontrivial gauge on both cut sides does not cancel",
mm(U,mt(U)) == [[ri*ri,Z],[Z,r*r]] and mm(U,mt(U))!=I)
# GY corner diagonal values, read in its source order; CK in reversed marking.
gy_mm, gy_pp, ck_pp, ck_mm = vi,v,vi,v
check("unweighted flip sends both fixed corner characters exactly",
gy_mm==ck_pp and gy_pp==ck_mm)
check("the weighted map does not send the same fixed corner character",
(v*v)*ck_pp != gy_mm)
omega = [[0,1,-1],[-1,0,1],[1,-1,0]]
T = [[0,0,1],[0,1,0],[1,0,0]]
check("reversing cyclic triangle order reverses the cocycle form universally",
imul(mt(T),imul(omega,T)) == [[-a for a in row] for row in omega])
B = [[omega[a%3][b%3] for b in range(6)] for a in range(6)]
P = [[int(j==k) for j in range(6)] for k in (2,1,0,5,4,3)]
check("anchored bare-edge dictionary is anti-symplectic on the full lattice",
imul(mt(P),imul(B,P)) == [[-a for a in row] for row in B])
print("All local tensor checks passed.")
print("The written proof must separately identify actual collars, ribbon framings,")
print("corner ideals, and the underlying closed link. Matrices do not certify those.")
print("No manifold, triangulation, slope, or skein-configuration enumeration.")
if __name__ == "__main__":
main()