Complex projective space and a wedge of spheres

[1]:
from steenroder import barcodes, wedge, sphere, suspension, cone
from examples import cp2
import numpy as np

def print_rel_barcodes(k, filtration):
    '''Auxiliary function to print outputs in the
    persistent relative cohomology context'''
    barcode, steenrod_barcode = barcodes(k, filtration)
    print(f'*) Regular (infinite only):')
    for d, bars in enumerate(barcode):
        print(d, bars[np.where(bars == -1)[0],:])
    print(f'*) Sq^{k} (non-zero only):')
    for d, bars in enumerate(steenrod_barcode):
        if bars.size > 0:
            print(d, bars)

def print_abs_barcodes(k, filtration, length=1):
    '''Auxiliary function to print outputs in the
    persistent absolute cohomology context'''
    barcode, steenrod_barcode = barcodes(k, filtration, absolute=True)
    print(f'*) Regular (length > {length} only):')
    for d, bars in enumerate(barcode):
        print(d, bars[np.where(bars[:,1]-bars[:,0] > length)])
    print(f'*) Sq^{k} (non-zero only):')
    for d, bars in enumerate(steenrod_barcode):
        if bars.size > 0:
            print(d, bars)

We will be mostly interested in \(Sq^k\) when \(k = 2\).

[2]:
k = 2

\(\mathbb CP^2\) and \(S^2 \vee S^4\)

[3]:
print('Persistent relative cohomology:')
print('\n**) CP^2:')
print_rel_barcodes(k, cp2)
print('\n**) S^2 v S^4:')
s2_s4 = wedge(sphere(2), sphere(4))
print_rel_barcodes(k, s2_s4)
Persistent relative cohomology:

**) CP^2:
*) Regular (infinite only):
0 [[-1  0]]
1 []
2 [[-1 13]]
3 []
4 [[ -1 254]]
*) Sq^2 (non-zero only):
4 [[-1 13]]

**) S^2 v S^4:
*) Regular (infinite only):
0 [[-1  0]]
1 []
2 [[-1 13]]
3 []
4 [[-1 74]]
*) Sq^2 (non-zero only):

\(\Sigma\mathbb CP^2\) and \(\Sigma(S^2 \vee S^4)\)

[4]:
print('Persistent relative cohomology:')
print('**) Suspension of CP^2:')
sus_cp2 = suspension(cp2)
print_rel_barcodes(2, sus_cp2)

print('\n**) Suspension of S^2 v S^4:')
sus_s2_s4 = suspension(s2_s4)
print_rel_barcodes(2, sus_s2_s4)
Persistent relative cohomology:
**) Suspension of CP^2:
*) Regular (infinite only):
0 [[-1  0]]
1 []
2 []
3 [[ -1 525]]
4 []
5 [[ -1 766]]
*) Sq^2 (non-zero only):
5 [[254 269]
 [ -1 525]]

**) Suspension of S^2 v S^4:
*) Regular (infinite only):
0 [[-1  0]]
1 []
2 []
3 [[ -1 165]]
4 []
5 [[ -1 226]]
*) Sq^2 (non-zero only):

\(\mathrm{C}\,\Sigma\,\mathbb CP^2\) and \(\mathrm{C}\,\Sigma(S^2 \vee S^4)\)

[5]:
print('Persistent absolute cohomology')
min_length_bars = 30

print('**) Cone on the suspension of CP^2:')
cone_sus_cp2 = cone(sus_cp2)
print_abs_barcodes(k, cone_sus_cp2, min_length_bars)

print('\n**) Cone on the suspension of S^2 v S^4:')
cone_sus_s2_s4 = cone(sus_s2_s4)
print_abs_barcodes(k, cone_sus_s2_s4, min_length_bars)
Persistent absolute cohomology
**) Cone on the suspension of CP^2:
*) Regular (length > 30 only):
0 []
1 []
2 [[ 13 269]]
3 [[ 525 1293]
 [ 781 1037]]
4 [[254 510]]
5 [[ 766 1534]
 [1022 1278]]
6 []
*) Sq^2 (non-zero only):
4 [[254 269]]
5 [[1022 1037]
 [ 766 1293]]

**) Cone on the suspension of S^2 v S^4:
*) Regular (length > 30 only):
0 []
1 []
2 [[13 89]]
3 [[165 393]
 [241 317]]
4 [[ 74 150]]
5 [[226 454]
 [302 378]]
6 []
*) Sq^2 (non-zero only):