Indexed text attachment
verify-topology.py
Source for Algebraic and Differential Topology in Higher Categories
View paper · Download original file
Lines 1241–1340 of 1961. Source text is displayed literally.
1241check('L1 Hopf trace formula: the alternating trace on chains equals the alternating trace on homology', okht,1242 '%d affine automorphisms of the 7-vertex torus; Lefschetz numbers occurring: %s' % (len(AUT), Ls))1243 1244 1245def has_fixed_simplex(K, vm):1246 return any(tuple(sorted(vm[v] for v in x)) == x for d in K.S for x in K.S[d])1247 1248 1249okfp = all(has_fixed_simplex(T7, vm) for _, vm in AUT if lefschetz_chain(T7, vm) != 0)1250free = [ab for ab, vm in AUT if not has_fixed_simplex(T7, vm)]1251check('L2 Lefschetz: a simplicial map with non-zero Lefschetz number fixes a simplex setwise, hence a point; the translations have L = 0 and fix nothing',1252 okfp and all(lefschetz_chain(T7, vm) == 0 for ab, vm in AUT if ab in free) and len(free) >= 6, '%d automorphisms without fixed simplex: %s' % (len(free), free[:8]))1253 1254check('L3 the Lefschetz number of the identity is the Euler characteristic',1255 all(lefschetz_chain(K, {x[0]: x[0] for x in K.S[0]}) == K.chi() == lefschetz_hom(K, {x[0]: x[0] for x in K.S[0]}) for _, K in NAMED), 'six model complexes')1256 1257 1258def det2(M):1259 return M[0][0] * M[1][1] - M[0][1] * M[1][0]1260 1261 1262def torus_fixed(A):1263 """number of points x of R^2/Z^2 with Ax = x, by enumeration"""1264 B = [[A[0][0] - 1, A[0][1]], [A[1][0], A[1][1] - 1]]1265 D = abs(det2(B))1266 if D == 0:1267 return None1268 cnt = 01269 for i in range(D):1270 for j in range(D):1271 if (B[0][0] * i + B[0][1] * j) % D == 0 and (B[1][0] * i + B[1][1] * j) % D == 0:1272 cnt += 11273 return cnt1274 1275 1276oktf = True1277for _ in range(40):1278 A = [[random.randint(-3, 3) for _ in range(2)] for _ in range(2)]1279 L = 1 - (A[0][0] + A[1][1]) + det2(A)1280 n = torus_fixed(A)1281 oktf = oktf and (n is None and L == 0 or n == abs(L))1282check('L4 for a linear map of the 2-torus L = 1 - tr A + det A = det(I - A), and the number of fixed points is |L|', oktf, '40 random integer matrices')1283 1284CAT = [[2, 1], [1, 1]]1285P = [[1, 0], [0, 1]]1286per = []1287for n in range(1, 9):1288 P = mat_mul(P, CAT)1289 per.append(torus_fixed(P))1290# zeta function (1-t)^2 / (1 - 3t + t^2): log-derivative gives the counts1291luc = [2, 3]1292while len(luc) < 9:1293 luc.append(3 * luc[-1] - luc[-2])1294check('L5 periodic points of the cat map: N_n = |det(I - A^n)| = tr(A^n) - 2, giving 1, 5, 16, 45, 121, 320, 841, 2205',1295 per == [1, 5, 16, 45, 121, 320, 841, 2205] and per == [luc[n] - 2 for n in range(1, 9)], 'counts %s' % per)1296 1297okanti = True1298info = []1299for n in (1, 2, 3):1300 K = cross_sphere(n)1301 anti = {x[0]: x[0] ^ 1 for x in K.S[0]}1302 Lc = lefschetz_chain(K, anti)1303 deg = homology_trace(K, anti, n)1304 okanti = okanti and Lc == 0 and deg == (-1) ** (n + 1) and not has_fixed_simplex(K, anti)1305 info.append('n=%d: degree %d' % (n, deg))1306check('L6 the antipodal map of the n-sphere has degree (-1)^(n+1), Lefschetz number 1 + (-1)^n deg = 0, and no fixed point', okanti, '; '.join(info))1307 1308 1309def rel_trace(K, A, vm):1310 tot = 01311 for d in range(K.dim + 1):1312 for x in K.S[d]:1313 if d in A.S and x in A.idx[d]:1314 continue1315 y = [vm[v] for v in x]1316 if len(set(y)) == d + 1 and tuple(sorted(y)) == x:1317 tot += (-1) ** d * perm_sign(y)1318 return tot1319 1320 1321okadd = True1322for ab, vm in AUT:1323 if ab[1] == 0:1324 A = Cx([[0]])1325 okadd = okadd and lefschetz_chain(T7, vm) == lefschetz_chain(A, {0: 0}) + rel_trace(T7, A, vm)1326rot = {0: 0, 11: 11}1327rot.update({1 + i: 1 + (i + 1) % 5 for i in range(5)})1328rot.update({6 + i: 6 + (i + 1) % 5 for i in range(5)})1329poles = Cx([[0], [11]])1330okadd = okadd and lefschetz_chain(ICO, rot) == 2 == lefschetz_chain(poles, {0: 0, 11: 11}) + rel_trace(ICO, poles, rot)1331check('L7 traces are additive: L(f) = L(f on A) + L(f on K relative to A) for an invariant subcomplex A', okadd,1332 'torus automorphisms fixing a vertex; the rotation of the icosahedron about an axis has L = 2 = two fixed poles')1333 1334 1335def aut_group(K):1336 verts = [x[0] for x in K.S[0]]1337 top = set(K.S[K.dim])1338 out = []1339 for perm in itertools.permutations(verts):1340 vm = dict(zip(verts, perm))