Independent scholarship · Open accessThe monthly digest

Indexed text attachment

verify-topology.py

Source for Algebraic and Differential Topology in Higher Categories

View paper · Download original file

Lines 1201–1300 of 1961. Source text is displayed literally.

1201 1202okcont = True1203found = 01204for K in (T7, RP2, MB, ICO):1205    SK, num = sd(K)1206    for _ in range(3):1207        f, g = choice_map(K, num), choice_map(K, num)1208        contig = all(tuple(sorted(set(f[a] for a in x) | set(g[a] for a in x))) in K.idx.get(len(set(f[a] for a in x) | set(g[a] for a in x)) - 1, {}) for d in SK.S for x in SK.S[d])1209        found += contig1210        for d in range(1, K.dim + 1):1211            Bd = K.bd(d + 1) if d < K.dim else []1212            Bbasis = independent_extend([], [[Fr(v) for v in c] for c in zip(*Bd)]) if Bd and Bd[0] else []1213            F, G = chain_map(SK, K, f, d), chain_map(SK, K, g, d)1214            for z in nullspace(SK.bd(d), SK.n(d)):1215                diff = [sum((F[i][k] - G[i][k]) * z[k] for k in range(SK.n(d))) for i in range(K.n(d))]1216                okcont = okcont and not independent_extend(Bbasis, [diff])1217check('P3 contiguous simplicial maps induce the same map on homology: any two vertex-choice maps from the subdivision to the complex', okcont and found == 12,1218      '%d pairs, all contiguous, on the torus, the projective plane, the Moebius band and the icosahedron' % found)1219 1220disc, _ = cone(circle(8))1221check('P4 homotopy equivalent polyhedra have the same homology: Moebius band and circle (1,1); disc and point',1222      bettis(MB) == [1, 1, 0] and bettis(circle(5)) == [1, 1] and bettis(disc) == [1, 0, 0], 'the band has the Euler characteristic 0 of its core circle')1223 1224sec('6. Traces and fixed points')1225 1226 1227def automorphisms_affine7():1228    out = []1229    tri = set(T7.S[2])1230    for a in range(1, 7):1231        for b in range(7):1232            vm = {x: (a * x + b) % 7 for x in range(7)}1233            if all(tuple(sorted(vm[v] for v in t)) in tri for t in tri):1234                out.append(((a, b), vm))1235    return out1236 1237 1238AUT = automorphisms_affine7()1239okht = all(lefschetz_chain(T7, vm) == lefschetz_hom(T7, vm) for _, vm in AUT)1240Ls = sorted(set(lefschetz_chain(T7, vm) for _, vm in AUT))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)