Indexed text attachment
verify-topology.py
Source for Algebraic and Differential Topology in Higher Categories
View paper · Download original file
Lines 1761–1860 of 1961. Source text is displayed literally.
1761 for k in range(n + 1):1762 dk = (1 + (-1) ** k) if k >= 1 else None1763 dk1 = (1 + (-1) ** (k + 1)) if k + 1 <= n else None1764 rank_k = 1 if (dk is not None and dk != 0) else 01765 rank_k1 = 1 if (dk1 is not None and dk1 != 0) else 01766 out.append((1 - rank_k - rank_k1, [abs(dk1)] if dk1 not in (None, 0) and abs(dk1) > 1 else []))1767 return out1768 1769 1770check('R4 SO(3) is projective 3-space: its cellular complex Z <-0- Z <-2- Z <-0- Z has homology Z, Z/2, 0, Z',1771 rp_homology(3) == [(1, []), (0, [2]), (0, []), (1, [])] and rp_homology(2) == homology(RP2), 'projective plane from the same recipe: %s' % rp_homology(2))1772 1773 1774def bernoulli(m):1775 B = [Fr(1)]1776 for n in range(1, m + 1):1777 B.append(-sum(Fr(math.comb(n + 1, k)) * B[k] for k in range(n)) / (n + 1))1778 return B1779 1780 1781Bn = bernoulli(16)1782jorders = [(Bn[2 * k] / (4 * k)).denominator for k in range(1, 9)]1783check('R5 the image of the J-homomorphism in the stems 3, 7, 11, 15, ... has order the denominator of B_2k/4k: 24, 240, 504, 480, 264, 65520, 24, 16320',1784 jorders == [24, 240, 504, 480, 264, 65520, 24, 16320], 'computed from Bernoulli numbers: %s' % jorders)1785 1786 1787def framed_circle_class(t, n=3):1788 """class in pi_1(SO(3)) of the normal framing of the unit circle in R^4 that turns t times relative to the product framing"""1789 # frame along the circle: (radial, e_z, e_w) rotated in the (e_z, e_w) plane by t s; as a loop in SO(3) about the radial axis1790 return lift_class(lambda s: axis_rot([1.0, 0.0, 0.0], t * s))1791 1792 1793fc = [framed_circle_class(t) for t in (0, 1, 2, 3)]1794check('R6 in codimension three and more the framings of a circle are counted modulo two: the turning number t gives the class t mod 2',1795 fc == [0, 1, 0, 1], 'classes %s for t = 0, 1, 2, 3; in codimension two (K4) t itself is the invariant' % fc)1796 1797sec('11. The Arf invariant and the second stem')1798 1799 1800def quad_forms(g):1801 """all quadratic refinements of the standard symplectic form on F_2^{2g}, as dictionaries of values"""1802 vecs = list(itertools.product((0, 1), repeat=2 * g))1803 out = []1804 for c in vecs:1805 q = {x: (sum(c[i] * x[i] for i in range(2 * g)) + sum(x[i] * x[g + i] for i in range(g))) % 2 for x in vecs}1806 out.append((c, q))1807 return vecs, out1808 1809 1810def omega(x, y, g):1811 return sum(x[i] * y[g + i] + x[g + i] * y[i] for i in range(g)) % 21812 1813 1814arf_counts = {}1815okmaj = okref = True1816for g in (1, 2, 3):1817 vecs, forms = quad_forms(g)1818 a0 = a1 = 01819 for c, q in forms:1820 arf = sum(c[i] * c[g + i] for i in range(g)) % 21821 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)