Real projective spaces

In this notebook we illustrate steenroder using filtrations of simplicial complex models of \(\mathbb R\mathrm P^n\) for \(n \in \{2,3,4\}\), as well as of models of their cones and their suspensions.

[1]:
from steenroder import barcodes, cone, suspension
from examples import rp2, rp3, rp4
import numpy as np

def print_rel_barcodes(k, filtrations, names):
    for filtration, name in zip(filtrations, names):
        print(f'\n**) {name} ({len(filtration)} simplices):')
        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, filtrations, names, length=1):
    for filtration, name in zip(filtrations, names):
        print(f'\n**) {name} ({len(filtration)} simplices):')
        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 focus on \(Sq^k\) with

[2]:
k = 1

\(\mathbb R \mathrm P^n\)

[3]:
filtrations = [rp2, rp3, rp4]
names = ['RP2', 'RP3', 'RP4']

print('Persistent relative cohomology:')
print_rel_barcodes(k, filtrations, names)
Persistent relative cohomology:

**) RP2 (31 simplices):
*) Regular (infinite only):
0 [[-1  0]]
1 [[-1  5]]
2 [[-1 30]]
*) Sq^1 (non-zero only):
2 [[-1  5]]

**) RP3 (284 simplices):
*) Regular (infinite only):
0 [[-1  0]]
1 [[-1 73]]
2 [[ -1 191]]
3 [[ -1 283]]
*) Sq^1 (non-zero only):
2 [[-1 73]]

**) RP4 (991 simplices):
*) Regular (infinite only):
0 [[-1  0]]
1 [[-1  5]]
2 [[-1 66]]
3 [[ -1 473]]
4 [[ -1 990]]
*) Sq^1 (non-zero only):
2 [[-1  5]]
4 [[ -1 473]]

Cones

[4]:
cone_filtrations = [cone(rp2), cone(rp3), cone(rp4)]
cone_names = ['cone_RP2', 'cone_RP3', 'cone_RP4$']
print('Persistent absolute cohomology:')
min_bar_length = 200
print_abs_barcodes(k, cone_filtrations, cone_names, min_bar_length)
Persistent absolute cohomology:

**) cone_RP2 (63 simplices):
*) Regular (length > 200 only):
0 []
1 []
2 []
3 []
*) Sq^1 (non-zero only):
2 [[30 37]]

**) cone_RP3 (569 simplices):
*) Regular (length > 200 only):
0 []
1 [[ 73 358]]
2 [[191 476]]
3 [[283 568]]
4 []
*) Sq^1 (non-zero only):
2 [[191 358]]

**) cone_RP4$ (1983 simplices):
*) Regular (length > 200 only):
0 []
1 [[  5 997]]
2 [[  66 1058]
 [ 120  382]
 [  44  366]]
3 [[ 473 1465]
 [1112 1374]
 [1036 1358]]
4 [[ 990 1982]]
5 []
*) Sq^1 (non-zero only):
2 [[ 66 997]]
4 [[ 990 1465]]

Suspensions

[5]:
sus_filtrations = [suspension(rp2), suspension(rp3), suspension(rp4)]
sus_names = ['suspension_RP2', 'suspension_RP3', 'suspension_RP4']
print('Persistent absolute cohomology:')
print_rel_barcodes(k, sus_filtrations, sus_names)
Persistent absolute cohomology:

**) suspension_RP2 (95 simplices):
*) Regular (infinite only):
0 [[-1  0]]
1 []
2 [[-1 69]]
3 [[-1 94]]
*) Sq^1 (non-zero only):
3 [[30 37]
 [-1 69]]

**) suspension_RP3 (854 simplices):
*) Regular (infinite only):
0 [[-1  0]]
1 []
2 [[ -1 643]]
3 [[ -1 761]]
4 [[ -1 853]]
*) Sq^1 (non-zero only):
3 [[191 358]
 [ -1 643]]

**) suspension_RP4 (2975 simplices):
*) Regular (infinite only):
0 [[-1  0]]
1 []
2 [[  -1 1989]]
3 [[  -1 2050]]
4 [[  -1 2457]]
5 [[  -1 2974]]
*) Sq^1 (non-zero only):
3 [[  66  997]
 [  -1 1989]]
5 [[ 990 1465]
 [  -1 2457]]

Cone on suspensions

[6]:
cone_sus_filtrations = [cone(suspension(rp2)), cone(suspension(rp3)), cone(suspension(rp4))]
cone_sus_names = ['cone_sus_RP2', 'cone_sus_RP3', 'cone_sus_RP4$']
print('Persistent absolute cohomology:')
min_bar_length = 500
print_abs_barcodes(k, cone_sus_filtrations, cone_sus_names, min_bar_length)
Persistent absolute cohomology:

**) cone_sus_RP2 (191 simplices):
*) Regular (length > 500 only):
0 []
1 []
2 []
3 []
4 []
*) Sq^1 (non-zero only):
2 [[30 37]]
3 [[126 133]
 [ 94 165]]

**) cone_sus_RP3 (1709 simplices):
*) Regular (length > 500 only):
0 []
1 []
2 [[ 643 1498]]
3 [[ 761 1616]]
4 [[ 853 1708]]
5 []
*) Sq^1 (non-zero only):
2 [[191 358]]
3 [[1046 1213]
 [ 761 1498]]

**) cone_sus_RP4$ (5951 simplices):
*) Regular (length > 500 only):
0 []
1 [[  5 997]]
2 [[1989 4965]
 [2981 3973]
 [  66 1058]]
3 [[2050 5026]
 [3042 4034]
 [ 473 1465]]
4 [[2457 5433]
 [3449 4441]
 [ 990 1982]]
5 [[2974 5950]
 [3966 4958]]
6 []
*) Sq^1 (non-zero only):
2 [[ 66 997]]
3 [[3042 3973]
 [2050 4965]]
4 [[ 990 1465]]
5 [[3966 4441]
 [2974 5433]]