Indexed text attachment
verify-topology.py
Source for Algebraic and Differential Topology in Higher Categories
View paper · Download original file
Lines 1821–1920 of 1961. Source text is displayed literally.
1821 ones = sum(q.values())1822 okmaj = okmaj and ones == 2 ** (2 * g - 1) + (-1 if arf == 0 else 1) * 2 ** (g - 1)1823 a0 += arf == 01824 a1 += arf == 11825 arf_counts[g] = (a0, a1)1826 c, q = forms[random.randrange(len(forms))]1827 okref = okref and all(q[tuple((a + b) % 2 for a, b in zip(x, y))] == (q[x] + q[y] + omega(x, y, g)) % 2 for x in vecs for y in vecs)1828check('A1 quadratic refinements of the intersection form in genus g: 2^(g-1)(2^g+1) of Arf invariant 0 and 2^(g-1)(2^g-1) of Arf invariant 1',1829 arf_counts == {1: (3, 1), 2: (10, 6), 3: (36, 28)} and okref, 'counts %s' % arf_counts)1830check('A2 the Arf invariant is the majority vote: q takes the value 1 on 2^(2g-1) - 2^(g-1) vectors if Arf = 0 and on 2^(2g-1) + 2^(g-1) if Arf = 1', okmaj, 'all 4 + 16 + 64 forms')1831 1832okadd = True1833_, f1 = quad_forms(1)1834_, f2 = quad_forms(2)1835def arf_vote(q, g):1836 return 0 if sum(q.values()) < 2 ** (2 * g - 1) else 11837for c1, q1 in f1:1838 for c2, q2 in f2:1839 # orthogonal sum on F_2^2 + F_2^41840 tot = sum((q1[x] + q2[y]) % 2 for x in q1 for y in q2)1841 okadd = okadd and (0 if tot < 2 ** 5 else 1) == (arf_vote(q1, 1) + arf_vote(q2, 2)) % 21842check('A3 the Arf invariant is additive under orthogonal sums', okadd, 'all 4 x 16 sums of a genus-1 and a genus-2 form')1843 1844 1845def sp4():1846 J = [[0, 0, 1, 0], [0, 0, 0, 1], [1, 0, 0, 0], [0, 1, 0, 0]]1847 out = []1848 for bits in range(1 << 16):1849 M = [[(bits >> (4 * i + j)) & 1 for j in range(4)] for i in range(4)]1850 ok = True1851 for i in range(4):1852 for j in range(i, 4):1853 v = sum(M[a][i] * J[a][b] * M[b][j] for a in range(4) for b in range(4) if J[a][b]) % 21854 if v != J[i][j]:1855 ok = False1856 break1857 if not ok:1858 break1859 if ok:1860 out.append(M)1861 return out1862 1863 1864SP = sp4()1865vecs2, forms2 = quad_forms(2)1866def act(M, x):1867 return tuple(sum(M[i][j] * x[j] for j in range(4)) % 2 for i in range(4))1868orbit_of = {}1869keys = [tuple(q[x] for x in vecs2) for _, q in forms2]1870seen = set()1871orbits = []1872for k in keys:1873 if k in seen:1874 continue1875 q = dict(zip(vecs2, k))1876 orb = set()1877 for M in SP:1878 orb.add(tuple(q[act(M, x)] for x in vecs2))1879 seen |= orb1880 orbits.append(len(orb))1881check('A4 the symplectic group Sp(4, F_2) has order 720 and exactly two orbits on the 16 quadratic refinements, of sizes 10 and 6', len(SP) == 720 and sorted(orbits) == [6, 10],1882 'orbit sizes %s' % sorted(orbits))1883 1884 1885def surgery_reduce(q, g):1886 """kill classes with q = 0 one at a time; returns the dimension of what cannot be killed"""1887 vecs = list(q.keys())1888 add = lambda x, y: tuple((a + b) % 2 for a, b in zip(x, y))1889 U = set(vecs)1890 R = {tuple([0] * (2 * g))}1891 while True:1892 x = next((y for y in sorted(U) if y not in R and q[y] == 0), None)1893 if x is None:1894 break1895 U = {y for y in U if omega(x, y, g) == 0}1896 R = R | {add(r, x) for r in R}1897 return (len(U).bit_length() - 1) - (len(R).bit_length() - 1)1898 1899 1900okred = True1901for g in (1, 2, 3):1902 vecs, forms = quad_forms(g)1903 for c, q in forms:1904 arf = sum(c[i] * c[g + i] for i in range(g)) % 21905 okred = okred and surgery_reduce(q, g) == 2 * arf1906check('A5 surgery on classes with q = 0 reduces a form of Arf invariant 0 to nothing and one of Arf invariant 1 to a torus on which q is 1 on every non-zero class',1907 okred, 'all forms of genus 1, 2, 3')1908 1909sec('12. Stable stems as the homotopy of the unit')1910 1911 1912def commutator_index(n):1913 els = list(itertools.permutations(range(n)))1914 mul = lambda a, b: tuple(a[b[i]] for i in range(n))1915 inv_ = lambda a: tuple(sorted(range(n), key=lambda i: a[i]))1916 gens = set()1917 for a in els:1918 for b in els:1919 gens.add(mul(mul(a, b), mul(inv_(a), inv_(b))))1920 G = set(gens)