File: chap1.html

package info (click to toggle)
gap-hap 1.70%2Bds-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 56,612 kB
  • sloc: xml: 16,139; sh: 216; javascript: 155; makefile: 126; ansic: 47; perl: 36
file content (1264 lines) | stat: -rw-r--r-- 95,625 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>GAP (HAP commands) - Chapter 1: Simplicial complexes &amp; CW complexes</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
<script src="manual.js" type="text/javascript"></script>
<script type="text/javascript">overwriteStyle();</script>
</head>
<body class="chap1"  onload="jscontent()">


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chap11.html">11</a>  <a href="chap12.html">12</a>  <a href="chap13.html">13</a>  <a href="chap14.html">14</a>  <a href="chap15.html">15</a>  <a href="chap16.html">16</a>  <a href="chapBib.html">Bib</a>  <a href="chapInd.html">Ind</a>  </div>

<div class="chlinkprevnexttop">&nbsp;<a href="chap0.html">[Top of Book]</a>&nbsp;  <a href="chap0.html#contents">[Contents]</a>&nbsp;  &nbsp;<a href="chap0.html">[Previous Chapter]</a>&nbsp;  &nbsp;<a href="chap2.html">[Next Chapter]</a>&nbsp;  </div>

<p id="mathjaxlink" class="pcenter"><a href="chap1_mj.html">[MathJax on]</a></p>
<p><a id="X7E5EA9587D4BCFB4" name="X7E5EA9587D4BCFB4"></a></p>
<div class="ChapSects"><a href="chap1.html#X7E5EA9587D4BCFB4">1 <span class="Heading">Simplicial complexes &amp; CW complexes</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X85691C6980034524">1.1 <span class="Heading">The Klein bottle as a simplicial complex</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X7B8F88487B1B766C">1.2 <span class="Heading">Other simplicial surfaces</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X80A72C347D99A58E">1.3 <span class="Heading">The Quillen complex</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X7C4A2B8B79950232">1.4 <span class="Heading">The Quillen complex as a reduced CW-complex</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X782AAB84799E3C44">1.5 <span class="Heading">Simple homotopy equivalences</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X80474C7885AC1578">1.6 <span class="Heading">Cellular simplifications preserving homeomorphism type</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X7A15484C7E680AC9">1.7 <span class="Heading">Constructing a CW-structure on a knot complement</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X829793717FB6DDCE">1.8 <span class="Heading">Constructing a regular CW-complex by attaching cells</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X7B7354E68025FC92">1.9 <span class="Heading">Constructing a regular CW-complex from its face lattice</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X823FA6A9828FF473">1.10 <span class="Heading">Cup products</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X7F9B01CF7EE1D2FC">1.11 <span class="Heading">Intersection forms of <span class="SimpleMath">4</span>-manifolds</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X80B6849C835B7F19">1.12 <span class="Heading">Cohomology Rings</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X83035DEC7C9659C6">1.13 <span class="Heading">Bockstein homomorphism</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X87135D067B6CDEEC">1.14 <span class="Heading">Diagonal maps on associahedra and other polytopes</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X8771FF2885105154">1.15 <span class="Heading">CW maps and induced homomorphisms</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X853D6B247D0E18DB">1.16 <span class="Heading">Constructing a simplicial complex from a regular CW-complex</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X7900FD197F175551">1.17 <span class="Heading">Some limitations to representing spaces as regular CW complexes</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X85A579217DCB6CC8">1.18 <span class="Heading">Equivariant CW complexes</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1.html#X86881717878ADCD6">1.19 <span class="Heading">Orbifolds and classifying spaces</span></a>
</span>
</div>
</div>

<h3>1 <span class="Heading">Simplicial complexes &amp; CW complexes</span></h3>

<p><a id="X85691C6980034524" name="X85691C6980034524"></a></p>

<h4>1.1 <span class="Heading">The Klein bottle as a simplicial complex</span></h4>

<p><img src="images/klein.jpg" align="center" width="250" alt="Klein bottle"/> <img src="images/kleingrid.jpg" align="center" width="250"/ alt="simplicial Klein bottle"/></p>

<p>The following example constructs the Klein bottle as a simplicial complex <span class="SimpleMath">K</span> on <span class="SimpleMath">9</span> vertices, and then constructs the cellular chain complex <span class="SimpleMath">C_∗=C_∗(K)</span> from which the integral homology groups <span class="SimpleMath">H_1(K, Z)= Z_2⊕ Z</span>, <span class="SimpleMath">H_2(K, Z)=0</span> are computed. The chain complex <span class="SimpleMath">D_∗=C_∗ ⊗_ Z Z_2</span> is also constructed and used to compute the mod-<span class="SimpleMath">2</span> homology vector spaces <span class="SimpleMath">H_1(K, Z_2)= Z_2⊕ Z_2</span>, <span class="SimpleMath">H_2(K, Z)= Z_2</span>. Finally, a presentation <span class="SimpleMath">π_1(K) = ⟨ x,y : yxy^-1x⟩</span> is computed for the fundamental group of <span class="SimpleMath">K</span>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">2simplices:=</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">[[1,2,5], [2,5,8], [2,3,8], [3,8,9], [1,3,9], [1,4,9],</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput"> [4,5,8], [4,6,8], [6,8,9], [6,7,9], [4,7,9], [4,5,7],</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput"> [1,4,6], [1,2,6], [2,6,7], [2,3,7], [3,5,7], [1,3,5]];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">K:=SimplicialComplex(2simplices);</span>
Simplicial complex of dimension 2.

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">C:=ChainComplex(K);</span>
Chain complex of length 2 in characteristic 0 .

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(C,1);</span>
[ 2, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(C,2);</span>
[  ]

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">D:=TensorWithIntegersModP(C,2);</span>
Chain complex of length 2 in characteristic 2 .

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(D,1);</span>
2
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(D,2);</span>
1

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">G:=FundamentalGroup(K);</span>
&lt;fp group of size infinity on the generators [ f1, f2 ]&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">RelatorsOfFpGroup(G);</span>
[ f2*f1*f2^-1*f1 ]

</pre></div>

<p><a id="X7B8F88487B1B766C" name="X7B8F88487B1B766C"></a></p>

<h4>1.2 <span class="Heading">Other simplicial surfaces</span></h4>

<p>The following example constructs the real projective plane <span class="SimpleMath">P</span>, the Klein bottle <span class="SimpleMath">K</span> and the torus <span class="SimpleMath">T</span> as simplicial complexes, using the surface genus <span class="SimpleMath">g</span> as input in the oriented case and <span class="SimpleMath">-g</span> as input in the unoriented cases. It then confirms that the connected sums <span class="SimpleMath">M=K#P</span> and <span class="SimpleMath">N=T#P</span> have the same integral homology.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">P:=ClosedSurface(-1);</span>
Simplicial complex of dimension 2.

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">K:=ClosedSurface(-2);</span>
Simplicial complex of dimension 2.

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:=ClosedSurface(1);</span>
Simplicial complex of dimension 2.

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">M:=ConnectedSum(K,P);</span>
Simplicial complex of dimension 2.

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">N:=ConnectedSum(T,P);</span>
Simplicial complex of dimension 2.

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(M,0);</span>
[ 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(N,0);</span>
[ 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(M,1);</span>
[ 2, 0, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(N,1);</span>
[ 2, 0, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(M,2);</span>
[  ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(N,2);</span>
[  ]

</pre></div>

<p><a id="X80A72C347D99A58E" name="X80A72C347D99A58E"></a></p>

<h4>1.3 <span class="Heading">The Quillen complex</span></h4>

<p>Given a group <span class="SimpleMath">G</span> one can consider the partially ordered set <span class="SimpleMath">cal A_p(G)</span> of all non-trivial elementary abelian <span class="SimpleMath">p</span>-subgroups of <span class="SimpleMath">G</span>, the partial order being set inclusion. The order complex <span class="SimpleMath">∆cal A_p(G)</span> is a simplicial complex which is called the <em>Quillen complex </em>.</p>

<p>The following example constructs the Quillen complex <span class="SimpleMath">∆cal A_2(S_7)</span> for the symmetric group of degree <span class="SimpleMath">7</span> and <span class="SimpleMath">p=2</span>. This simplicial complex involves <span class="SimpleMath">11291</span> simplices, of which <span class="SimpleMath">4410</span> are <span class="SimpleMath">2</span>-simplices..</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">K:=QuillenComplex(SymmetricGroup(7),2);</span>
Simplicial complex of dimension 2.

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size(K);</span>
11291

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">K!.nrSimplices(2);</span>
4410

</pre></div>

<p><a id="X7C4A2B8B79950232" name="X7C4A2B8B79950232"></a></p>

<h4>1.4 <span class="Heading">The Quillen complex as a reduced CW-complex</span></h4>

<p>Any simplicial complex <span class="SimpleMath">K</span> can be regarded as a regular CW complex. Different datatypes are used in <strong class="button">HAP</strong> for these two notions. The following continuation of the above Quillen complex example constructs a regular CW complex <span class="SimpleMath">Y</span> isomorphic to (i.e. with the same face lattice as) <span class="SimpleMath">K=∆cal A_2(S_7)</span>. An advantage to working in the category of CW complexes is that it may be possible to find a CW complex <span class="SimpleMath">X</span> homotopy equivalent to <span class="SimpleMath">Y</span> but with fewer cells than <span class="SimpleMath">Y</span>. The cellular chain complex <span class="SimpleMath">C_∗(X)</span> of such a CW complex <span class="SimpleMath">X</span> is computed by the following commands. From the number of free generators of <span class="SimpleMath">C_∗(X)</span>, which correspond to the cells of <span class="SimpleMath">X</span>, we see that there is a single <span class="SimpleMath">0</span>-cell and <span class="SimpleMath">160</span> <span class="SimpleMath">2</span>-cells. Thus the Quillen complex $$\Delta{\cal A}_2(S_7) \simeq \bigvee_{1\le i\le 160} S^2$$ has the homotopy type of a wedge of <span class="SimpleMath">160</span> <span class="SimpleMath">2</span>-spheres. This homotopy equivalence is given in <a href="chapBib.html#biBksontini">[Kso00, (15.1)]</a> where it was obtained by purely theoretical methods.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y:=RegularCWComplex(K);</span>
Regular CW-complex of dimension 2

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">C:=ChainComplex(Y);</span>
Chain complex of length 2 in characteristic 0 . 

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">C!.dimension(0);</span>
1
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">C!.dimension(1);</span>
0
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">C!.dimension(2);</span>
160

</pre></div>

<p><a id="X782AAB84799E3C44" name="X782AAB84799E3C44"></a></p>

<h4>1.5 <span class="Heading">Simple homotopy equivalences</span></h4>

<p>For any regular CW complex <span class="SimpleMath">Y</span> one can look for a sequence of simple homotopy collapses <span class="SimpleMath">Y↘ Y_1 ↘ Y_2 ↘ ... ↘ Y_N=X</span> with <span class="SimpleMath">X</span> a smaller, and typically non-regular, CW complex. Such a sequence of collapses can be recorded using what is now known as a <em>discrete vector field</em> on <span class="SimpleMath">Y</span>. The sequence can, for example, be used to produce a chain homotopy equivalence <span class="SimpleMath">f: C_∗ Y → C_∗ X</span> and its chain homotopy inverse <span class="SimpleMath">g: C_∗ X → C_∗ Y</span>. The function <code class="code">ChainComplex(Y)</code> returns the cellular chain complex <span class="SimpleMath">C_∗(X)</span>, wheras the function <code class="code">ChainComplexOfRegularCWComplex(Y)</code> returns the chain complex <span class="SimpleMath">C_∗(Y)</span>.</p>

<p>For the above Quillen complex <span class="SimpleMath">Y=∆cal A_2(S_7)</span> the following commands produce the chain homotopy equivalence <span class="SimpleMath">f: C_∗ Y → C_∗ X</span> and <span class="SimpleMath">g: C_∗ X → C_∗ Y</span>. The number of generators of <span class="SimpleMath">C_∗ Y</span> equals the number of cells of <span class="SimpleMath">Y</span> in each degree, and this number is listed for each degree.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">K:=QuillenComplex(SymmetricGroup(7),2);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y:=RegularCWComplex(K);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CY:=ChainComplexOfRegularCWComplex(Y);</span>
Chain complex of length 2 in characteristic 0 . 

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CX:=ChainComplex(Y);</span>
Chain complex of length 2 in characteristic 0 . 

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">equiv:=ChainComplexEquivalenceOfRegularCWComplex(Y);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=equiv[1];</span>
Chain Map between complexes of length 2 . 

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g:=equiv[2];</span>
Chain Map between complexes of length 2 .


<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CY!.dimension(0);</span>
1316
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CY!.dimension(1);</span>
5565
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CY!.dimension(2);</span>
4410

</pre></div>

<p><a id="X80474C7885AC1578" name="X80474C7885AC1578"></a></p>

<h4>1.6 <span class="Heading">Cellular simplifications preserving homeomorphism type</span></h4>

<p>For some purposes one might need to simplify the cell structure on a regular CW-complex <span class="SimpleMath">Y</span> so as to obtained a homeomorphic CW-complex <span class="SimpleMath">W</span> with fewer cells.</p>

<p>The following commands load a <span class="SimpleMath">4</span>-dimensional simplicial complex <span class="SimpleMath">Y</span> representing the K3 complex surface. Its simplicial structure is taken from <a href="chapBib.html#biBspreerkhuenel">[SK11]</a> and involves <span class="SimpleMath">1704</span> cells of various dimensions. The commands then convert the cell structure into that of a homeomorphic regular CW-complex <span class="SimpleMath">W</span> involving <span class="SimpleMath">774</span> cells.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y:=RegularCWComplex(SimplicialK3Surface());</span>
Regular CW-complex of dimension 4

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size(Y);</span>
1704
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:=SimplifiedComplex(Y);</span>
Regular CW-complex of dimension 4

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size(W);</span>
774

</pre></div>

<p><a id="X7A15484C7E680AC9" name="X7A15484C7E680AC9"></a></p>

<h4>1.7 <span class="Heading">Constructing a CW-structure on a knot complement</span></h4>

<p>The following commands construct the complement <span class="SimpleMath">M=S^3∖ K</span> of the trefoil knot <span class="SimpleMath">K</span>. This complement is returned as a <span class="SimpleMath">3</span>-manifold <span class="SimpleMath">M</span> with regular CW-structure involving four <span class="SimpleMath">3</span>-cells.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">arc:=ArcPresentation(PureCubicalKnot(3,1));</span>
[ [ 2, 5 ], [ 1, 3 ], [ 2, 4 ], [ 3, 5 ], [ 1, 4 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S:=SphericalKnotComplement(arc);</span>
Regular CW-complex of dimension 3

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S!.nrCells(3);</span>
4

</pre></div>

<p>The following additional commands then show that <span class="SimpleMath">M</span> is homotopy equivalent to a reduced CW-complex <span class="SimpleMath">Y</span> of dimension <span class="SimpleMath">2</span> involving one <span class="SimpleMath">0</span>-cell, two <span class="SimpleMath">1</span>-cells and one <span class="SimpleMath">2</span>-cell. The fundamental group of <span class="SimpleMath">Y</span> is computed and used to calculate the Alexander polynomial of the trefoil knot.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y:=ContractedComplex(S);</span>
Regular CW-complex of dimension 2

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CriticalCells(Y);</span>
[ [ 2, 1 ], [ 1, 9 ], [ 1, 11 ], [ 0, 22 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">G:=FundamentalGroup(Y);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AlexanderPolynomial(G);</span>
x_1^2-x_1+1

</pre></div>

<p><a id="X829793717FB6DDCE" name="X829793717FB6DDCE"></a></p>

<h4>1.8 <span class="Heading">Constructing a regular CW-complex by attaching cells</span></h4>

<p><img src="images/cwspace2.jpg" align="center" width="250" alt="CW space"/></p>

<p>The following example creates the projective plane <span class="SimpleMath">Y</span> as a regular CW-complex, and tests that it has the correct integral homology <span class="SimpleMath">H_0(Y, Z)= Z</span>, <span class="SimpleMath">H_1(Y, Z)= Z_2</span>, <span class="SimpleMath">H_2(Y, Z)=0</span>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">attch:=RegularCWComplex_AttachCellDestructive;; #Function for attaching cells</span>

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y:=RegularCWDiscreteSpace(3); #Discrete CW-complex consisting of points {1,2,3}</span>
Regular CW-complex of dimension 0

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">e1:=attch(Y,1,[1,2]);; #Attach 1-cell</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">e2:=attch(Y,1,[1,2]);; #Attach 1-cell</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">e3:=attch(Y,1,[1,3]);; #Attach 1-cell</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">e4:=attch(Y,1,[1,3]);; #Attach 1-cell</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">e5:=attch(Y,1,[2,3]);; #Attach 1-cell</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">e6:=attch(Y,1,[2,3]);; #Attach 1-cell</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f1:=attch(Y,2,[e1,e3,e5]);; #Attach 2-cell</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f2:=attch(Y,2,[e2,e4,e5]);; #Attach 2-cell</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f3:=attch(Y,2,[e2,e3,e6]);; #Attach 2-cell</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f4:=attch(Y,2,[e1,e4,e6]);; #Attach 2-cell</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(Y,0);</span>
[ 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(Y,1);</span>
[ 2 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(Y,2);</span>
[  ]`

</pre></div>

<p>The following example creates a 2-complex <span class="SimpleMath">K</span> corresponding to the group presentation</p>

<p><span class="SimpleMath">G=⟨ x,y,z : xyx^-1y^-1=1, yzy^-1z^-1=1, zxz^-1x^-1=1⟩</span>.</p>

<p>The complex is shown to have the correct fundamental group and homology (since it is the 2-skeleton of the 3-torus <span class="SimpleMath">S^1× S^1× S^1</span>).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S1:=RegularCWSphere(1);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:=WedgeSum(S1,S1,S1);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">F:=FundamentalGroupWithPathReps(W);; x:=F.1;;y:=F.2;;z:=F.3;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">K:=RegularCWComplexWithAttachedRelatorCells(W,F,Comm(x,y),Comm(y,z),Comm(x,z));</span>
Regular CW-complex of dimension 2

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">G:=FundamentalGroup(K);</span>
&lt;fp group on the generators [ f1, f2, f3 ]&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">RelatorsOfFpGroup(G);</span>
[ f2^-1*f1*f2*f1^-1, f1^-1*f3*f1*f3^-1, f2^-1*f3*f2*f3^-1 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(K,1);</span>
[ 0, 0, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(K,2);</span>
[ 0, 0, 0 ]

</pre></div>

<p><a id="X7B7354E68025FC92" name="X7B7354E68025FC92"></a></p>

<h4>1.9 <span class="Heading">Constructing a regular CW-complex from its face lattice</span></h4>

<p><img src="images/cwspace.jpg" align="center" width="250" alt="CW space"/></p>

<p>The following example creats a <span class="SimpleMath">2</span>-dimensional annulus <span class="SimpleMath">A</span> as a regular CW-complex, and testing that it has the correct integral homology <span class="SimpleMath">H_0(A, Z)= Z</span>, <span class="SimpleMath">H_1(A, Z)= Z</span>, <span class="SimpleMath">H_2(A, Z)=0</span>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FL:=[];; #The face lattice</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FL[1]:=[[1,0],[1,0],[1,0],[1,0]];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FL[2]:=[[2,1,2],[2,3,4],[2,1,4],[2,2,3],[2,1,4],[2,2,3]];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FL[3]:=[[4,1,2,3,4],[4,1,2,5,6]];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FL[4]:=[];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:=RegularCWComplex(FL);</span>
Regular CW-complex of dimension 2

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(A,0);</span>
[ 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(A,1);</span>
[ 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(A,2);</span>
[  ]


</pre></div>

<p>Next we construct the direct product <span class="SimpleMath">Y=A× A× A× A× A</span> of five copies of the annulus. This is a <span class="SimpleMath">10</span>-dimensional CW complex involving <span class="SimpleMath">248832</span> cells. It will be homotopy equivalent <span class="SimpleMath">Y≃ X</span> to a CW complex <span class="SimpleMath">X</span> involving fewer cells. The CW complex <span class="SimpleMath">X</span> may be non-regular. We compute the cochain complex <span class="SimpleMath">D_∗ = Hom_ Z(C_∗(X), Z)</span> from which the cohomology groups <br /> <span class="SimpleMath">H^0(Y, Z)= Z</span>, <br /> <span class="SimpleMath">H^1(Y, Z)= Z^5</span>, <br /> <span class="SimpleMath">H^2(Y, Z)= Z^10</span>, <br /> <span class="SimpleMath">H^3(Y, Z)= Z^10</span>, <br /> <span class="SimpleMath">H^4(Y, Z)= Z^5</span>, <br /> <span class="SimpleMath">H^5(Y, Z)= Z</span>, <br /> <span class="SimpleMath">H^6(Y, Z)=0</span><br /> are obtained.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y:=DirectProduct(A,A,A,A,A);</span>
Regular CW-complex of dimension 10

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size(Y);</span>
248832
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">C:=ChainComplex(Y);</span>
Chain complex of length 10 in characteristic 0 . 

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">D:=HomToIntegers(C);</span>
Cochain complex of length 10 in characteristic 0 . 

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(D,0);</span>
[ 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(D,1);</span>
[ 0, 0, 0, 0, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(D,2);</span>
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(D,3);</span>
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(D,4);</span>
[ 0, 0, 0, 0, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(D,5);</span>
[ 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(D,6);</span>
[  ]


</pre></div>

<p><a id="X823FA6A9828FF473" name="X823FA6A9828FF473"></a></p>

<h4>1.10 <span class="Heading">Cup products</span></h4>

<p><strong class="button">Strategy 1: Use geometric group theory in low dimensions.</strong></p>

<p>Continuing with the previous example, we consider the first and fifth generators <span class="SimpleMath">g_1^1, g_5^1∈ H^1(Y, Z) = Z^5</span> and establish that their cup product <span class="SimpleMath">g_1^1 ∪ g_5^1 = - g_7^2 ∈ H^2(Y, Z) = Z^10</span> is equal to minus the seventh generator of <span class="SimpleMath">H^2(Y, Z)</span>. We also verify that <span class="SimpleMath">g_5^1∪ g_1^1 = - g_1^1 ∪ g_5^1</span>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">cup11:=CupProduct(FundamentalGroup(Y));</span>
function( a, b ) ... end

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">cup11([1,0,0,0,0],[0,0,0,0,1]);</span>
[ 0, 0, 0, 0, 0, 0, -1, 0, 0, 0 ]

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">cup11([0,0,0,0,1],[1,0,0,0,0]);</span>
[ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 ]


</pre></div>

<p>This computation of low-dimensional cup products is achieved using group-theoretic methods to approximate the diagonal map <span class="SimpleMath">∆ : Y → Y× Y</span> in dimensions <span class="SimpleMath">≤ 2</span>. In order to construct cup products in higher degrees <strong class="button">HAP</strong> invokes three further strategies.</p>

<p><strong class="button">Strategy 2: implement the Alexander-Whitney map for simplicial complexes.</strong></p>

<p>For simplicial complexes the cup product is implemented using the standard formula for the Alexander-Whitney chain map, together with homotopy equivalences to improve efficiency.</p>

<p>As a first example, the following commands construct simplicial complexes <span class="SimpleMath">K=( S^1 × S^1) # ( S^1 × S^1)</span> and <span class="SimpleMath">L=( S^1 × S^1) ∨ S^1 ∨ S^1</span> and establish that they have the same cohomology groups. It is then shown that the cup products <span class="SimpleMath">∪_K: H^2(K, Z)× H^2(K, Z) → H^4(K, Z)</span> and <span class="SimpleMath">∪_L: H^2(L, Z)× H^2(L, Z) → H^4(L, Z)</span> are antisymmetric bilinear forms of different ranks; hence <span class="SimpleMath">K</span> and <span class="SimpleMath">L</span> have different homotopy types.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">K:=ClosedSurface(2);</span>
Simplicial complex of dimension 2.

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">L:=WedgeSum(WedgeSum(ClosedSurface(1),Sphere(1)),Sphere(1));</span>
Simplicial complex of dimension 2.

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(K,0);Cohomology(L,0);</span>
[ 0 ]
[ 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(K,1);Cohomology(L,1);</span>
[ 0, 0, 0, 0 ]
[ 0, 0, 0, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(K,2);Cohomology(L,2);</span>
[ 0 ]
[ 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">gens:=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">cupK:=CupProduct(K);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">cupL:=CupProduct(L);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:=NullMat(4,4);;B:=NullMat(4,4);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">for i in [1..4] do</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">for j in [1..4] do</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">A[i][j]:=cupK(1,1,gens[i],gens[j])[1];</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">B[i][j]:=cupL(1,1,gens[i],gens[j])[1];</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">od;od;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Display(A);</span>
[ [   0,   0,   0,   1 ],
  [   0,   0,   1,   0 ],
  [   0,  -1,   0,   0 ],
  [  -1,   0,   0,   0 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Display(B);</span>
[ [   0,   1,   0,   0 ],
  [  -1,   0,   0,   0 ],
  [   0,   0,   0,   0 ],
  [   0,   0,   0,   0 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Rank(A);</span>
4
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Rank(B);</span>
2

</pre></div>

<p>As a second example of the computation of cups products, the following commands construct the connected sums <span class="SimpleMath">V=M# M</span> and <span class="SimpleMath">W=M# overline M</span> where <span class="SimpleMath">M</span> is the <span class="SimpleMath">K3</span> complex surface which is stored as a pure simplicial complex of dimension 4 and where <span class="SimpleMath">overline M</span> denotes the opposite orientation on <span class="SimpleMath">M</span>. The simplicial structure on the <span class="SimpleMath">K3</span> surface is taken from <a href="chapBib.html#biBspreerkhuenel">[SK11]</a>. The commands then show that <span class="SimpleMath">H^2(V, Z)=H^2(W, Z)= Z^44</span> and <span class="SimpleMath">H^4(V, Z)=H^4(W, Z)= Z</span>. The final commands compute the matrix <span class="SimpleMath">AV=(x∪ y)</span> as <span class="SimpleMath">x,y</span> range over a generating set for <span class="SimpleMath">H^2(V, Z)</span> and the corresponding matrix <span class="SimpleMath">AW</span> for <span class="SimpleMath">W</span>. These two matrices are seen to have a different number of positive eigenvalues from which we can conclude that <span class="SimpleMath">V</span> is not homotopy equivalent to <span class="SimpleMath">W</span>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">M:=SimplicialK3Surface();;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:=ConnectedSum(M,M,+1);</span>
Simplicial complex of dimension 4.

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:=ConnectedSum(M,M,-1);</span>
Simplicial complex of dimension 4.

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(V,2);</span>
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(W,2);</span>
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(V,4);</span>
[ 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(W,4);</span>
[ 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">cupV:=CupProduct(V);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">cupW:=CupProduct(W);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AV:=NullMat(44,44);;      </span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AW:=NullMat(44,44);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">gens:=IdentityMat(44);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">for i in [1..44] do</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">for j in [1..44] do</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">AV[i][j]:=cupV(2,2,gens[i],gens[j])[1];                               </span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">AW[i][j]:=cupW(2,2,gens[i],gens[j])[1];</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">od;od;                                 </span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SignatureOfSymmetricMatrix(AV);</span>
rec( determinant := 1, negative_eigenvalues := 22, positive_eigenvalues := 22,
  zero_eigenvalues := 0 )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SignatureOfSymmetricMatrix(AW);</span>
rec( determinant := 1, negative_eigenvalues := 6, positive_eigenvalues := 38, 
  zero_eigenvalues := 0 )

</pre></div>

<p>A cubical cubical version of the Alexander-Whitney formula, due to J.-P. Serre, could be used for computing the cohomology ring of a regular CW-complex whose cells all have a cubical combinatorial face lattice. This has not been implemented in HAP. However, the following more general approach has been implemented.</p>

<p><strong class="button">Strategy 3: Implement a cellular approximation to the diagonal map on an arbitrary finite regular CW-complex.</strong></p>

<p>The following example calculates the cup product <span class="SimpleMath">H^2(W, Z)× H^2(W, Z) → H^4(W, Z)</span> for the <span class="SimpleMath">4</span>-dimensional orientable manifold <span class="SimpleMath">W=M× M</span> where <span class="SimpleMath">M</span> is the closed surface of genus <span class="SimpleMath">2</span>. The manifold <span class="SimpleMath">W</span> is stored as a regular CW-complex.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">M:=RegularCWComplex(ClosedSurface(2));;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:=DirectProduct(M,M);</span>
Regular CW-complex of dimension 4

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size(W);</span>
5776
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:=SimplifiedComplex(W);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size(W);                                </span>
1024

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(W,2);           </span>
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(W,4);</span>
[ 0 ]

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">cup:=CupProduct(W);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SecondCohomologtGens:=IdentityMat(18);;   </span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:=NullMat(18,18);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">for i in [1..18] do</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">for j in [1..18] do</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">A[i][j]:=cup(2,2,SecondCohomologtGens[i],SecondCohomologtGens[j])[1];</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">od;od;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Display(A);</span>
[ [    0,   -1,    0,    0,    0,    0,    3,   -2,    0,    0,    0,    1,   -1,    0,    0,    1,    0,    0 ],
  [   -1,  -10,    1,    2,   -2,    1,    6,   -1,    0,   -3,    4,   -1,   -1,   -1,    4,   -2,   -2,    0 ],
  [    0,    1,   -2,    1,    0,   -1,    0,    0,    1,    0,   -1,    1,    0,    0,    1,   -1,    0,    0 ],
  [    0,    2,    1,   -2,    1,    0,    0,   -1,    0,    1,    0,    0,    0,    0,   -1,    2,    0,    0 ],
  [    0,   -2,    0,    1,    0,    0,    1,   -1,    0,    0,   -1,    0,    0,    0,    0,   -1,    0,    0 ],
  [    0,    1,   -1,    0,    0,    0,    0,    1,   -1,    1,    0,    0,    0,    0,    1,   -1,    0,    0 ],
  [    3,    6,    0,    0,    1,    0,   -4,    0,   -1,    2,    4,   -5,    2,   -1,    1,    0,    3,    0 ],
  [   -2,   -1,    0,   -1,   -1,    1,    0,    4,   -2,    0,    0,    3,   -1,    1,   -1,    0,   -2,    0 ],
  [    0,    0,    1,    0,    0,   -1,   -1,   -2,    4,   -3,  -10,    1,    0,    0,   -3,    3,    0,    0 ],
  [    0,   -3,    0,    1,    0,    1,    2,    0,   -3,    2,    3,    0,    0,    0,    1,   -3,    0,    0 ],
  [    0,    4,   -1,    0,   -1,    0,    4,    0,  -10,    3,   18,    1,    0,    0,    0,    4,    0,    1 ],
  [    1,   -1,    1,    0,    0,    0,   -5,    3,    1,    0,    1,    0,    0,    0,   -2,   -1,   -1,    0 ],
  [   -1,   -1,    0,    0,    0,    0,    2,   -1,    0,    0,    0,    0,    0,    0,    1,    0,    0,    0 ],
  [    0,   -1,    0,    0,    0,    0,   -1,    1,    0,    0,    0,    0,    0,    0,    0,   -1,   -1,    0 ],
  [    0,    4,    1,   -1,    0,    1,    1,   -1,   -3,    1,    0,   -2,    1,    0,    0,    2,    2,    0 ],
  [    1,   -2,   -1,    2,   -1,   -1,    0,    0,    3,   -3,    4,   -1,    0,   -1,    2,    0,    0,    0 ],
  [    0,   -2,    0,    0,    0,    0,    3,   -2,    0,    0,    0,   -1,    0,   -1,    2,    0,    0,    0 ],
  [    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    1,    0,    0,    0,    0,    0,    0,    0 ] ]

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SignatureOfSymmetricMatrix(A);</span>
rec( determinant := -1, negative_eigenvalues := 9, positive_eigenvalues := 9,
  zero_eigenvalues := 0 )


</pre></div>

<p>The matrix <span class="SimpleMath">A</span> representing the cup product <span class="SimpleMath">H^2(W, Z)× H^2(W, Z) → H^4(W, Z)</span> is shown to have <span class="SimpleMath">9</span> positive eigenvalues, <span class="SimpleMath">9</span> negative eigenvalues, and no zero eigenvalue.</p>

<p><strong class="button">Strategy 4: Guess and verify a cellular approximation to the diagonal map.</strong></p>

<p>Many naturally occuring cell structures are neither simplicial nor cubical. For a general regular CW-complex we can attempt to construct a cellular inclusion <span class="SimpleMath">overline Y ↪ Y× Y</span> with <span class="SimpleMath">{(y,y) : y∈ Y}⊂ overline Y</span> and with projection <span class="SimpleMath">p: overline Y ↠ Y</span> that induces isomorphisms on integral homology. The function <code class="code">DiagonalApproximation(Y)</code> constructs a candidate inclusion, but the projection <span class="SimpleMath">p: overline Y ↠ Y</span> needs to be tested for homology equivalence. If the candidate inclusion passes this test then the function <code class="code">CupProductOfRegularCWComplex_alt(Y)</code>, involving the candidate space, can be used for cup products. (I think the test is passed for all regular CW-complexes that are subcomplexes of some Euclidean space with all cells convex polytopes -- but a proof needs to be written down!)</p>

<p>The following example calculates <span class="SimpleMath">g_1^2 ∪ g_2^2 ne 0</span> where <span class="SimpleMath">Y=T× T</span> is the direct product of two copies of a simplicial torus <span class="SimpleMath">T</span>, and where <span class="SimpleMath">g_k^n</span> denotes the <span class="SimpleMath">k</span>-th generator in some basis of <span class="SimpleMath">H^n(Y, Z)</span>. The direct product <span class="SimpleMath">Y</span> is a CW-complex which is not a simplicial complex.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">K:=RegularCWComplex(ClosedSurface(1));;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y:=DirectProduct(K,K);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">cup:=CupProductOfRegularCWComplex_alt(Y);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">cup(2,2,[1,0,0,0,0,0],[0,1,0,0,0,0]);</span>
[ 5 ]

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">D:=DiagonalApproximation(Y);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">p:=D!.projection;</span>
Map of regular CW-complexes

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">P:=ChainMap(p);</span>
Chain Map between complexes of length 4 . 

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsIsomorphismOfAbelianFpGroups(Homology(P,0));</span>
true
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsIsomorphismOfAbelianFpGroups(Homology(P,2));</span>
true
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsIsomorphismOfAbelianFpGroups(Homology(P,3));</span>
true
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsIsomorphismOfAbelianFpGroups(Homology(P,4));</span>
true

</pre></div>

<p>Of course, either of Strategies 2 or 3 could also be used for this example. To use the Alexander-Whitney formula of Strategy 2 we would need to give the direct product <span class="SimpleMath">Y=T× T</span> a simplicial structure. This could be obtained using the function <code class="code">DirectProduct(T,T)</code>. The details are as follows. (The result is consistent with the preceding computation since the choice of a basis for cohomology groups is far from unique.)</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">K:=ClosedSurface(1);;                </span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">KK:=DirectProduct(K,K);</span>
Simplicial complex of dimension 4.

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">cup:=CupProduct(KK);;                </span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">cup(2,2,[1,0,0,0,0,0],[0,1,0,0,0,0]);</span>
[ 0 ]

</pre></div>

<p><a id="X7F9B01CF7EE1D2FC" name="X7F9B01CF7EE1D2FC"></a></p>

<h4>1.11 <span class="Heading">Intersection forms of <span class="SimpleMath">4</span>-manifolds</span></h4>

<p>The cup product gives rise to the intersection form of a connected, closed, orientable <span class="SimpleMath">4</span>-manifold <span class="SimpleMath">Y</span> is a symmetric bilinear form</p>

<p><span class="SimpleMath">qY: H^2(Y, Z)/Torsion × H^2(Y, Z)/Torsion ⟶ Z</span></p>

<p>which we represent as a symmetric matrix.</p>

<p>The following example constructs the direct product <span class="SimpleMath">L=S^2× S^2</span> of two <span class="SimpleMath">2</span>-spheres, the connected sum <span class="SimpleMath">M= CP^2 # overline CP^2</span> of the complex projective plane <span class="SimpleMath">CP^2</span> and its oppositely oriented version <span class="SimpleMath">overline CP^2</span>, and the connected sum <span class="SimpleMath">N= CP^2 # CP^2</span>. The manifolds <span class="SimpleMath">L</span>, <span class="SimpleMath">M</span> and <span class="SimpleMath">N</span> are each shown to have a CW-structure involving one <span class="SimpleMath">0</span>-cell, two <span class="SimpleMath">1</span>-cells and one <span class="SimpleMath">2</span>-cell. They are thus simply connected and have identical cohomology.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S:=Sphere(2);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S:=RegularCWComplex(S);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">L:=DirectProduct(S,S);</span>
Regular CW-complex of dimension 4

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">M:=ConnectedSum(ComplexProjectiveSpace(2),ComplexProjectiveSpace(2),-1);</span>
Simplicial complex of dimension 4.

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">N:=ConnectedSum(ComplexProjectiveSpace(2),ComplexProjectiveSpace(2),+1);</span>
Simplicial complex of dimension 4.

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CriticalCells(L);</span>
[ [ 4, 1 ], [ 2, 13 ], [ 2, 56 ], [ 0, 16 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CriticalCells(RegularCWComplex(M));</span>
[ [ 4, 1 ], [ 2, 109 ], [ 2, 119 ], [ 0, 8 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CriticalCells(RegularCWComplex(N));</span>
[ [ 4, 1 ], [ 2, 119 ], [ 2, 149 ], [ 0, 12 ] ]

</pre></div>

<p>John Milnor showed (as a corollary to a theorem of J. H. C. Whitehead) that the homotopy type of a simply connected 4-manifold is determined by its quadratic form. More precisely, a form is said to be of <em>type I (properly primitive)</em> if some diagonal entry of its matrix is odd. If every diagonal entry is even, then the form is of <em>type II (improperly primitive)</em>. The <em>index</em> of a form is defined as the number of positive diagonal entries minus the number of negative ones, after the matrix has been diagonalized over the real numbers.</p>

<p><strong class="button">Theorem.</strong> (Milnor <a href="chapBib.html#biBmilnor">[Mil58]</a>) The oriented homotopy type of a simply connected, closed, orientable 4-manifold is determined by its second Betti number and the index and type of its intersetion form; except possibly in the case of a manifold with definite quadratic form of rank r &gt; 9.</p>

<p>The following commands compute matrices representing the intersection forms <span class="SimpleMath">qL</span>, <span class="SimpleMath">qM</span>, <span class="SimpleMath">qN</span>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">qL:=IntersectionForm(L);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">qM:=IntersectionForm(M);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">qN:=IntersectionForm(N);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Display(qL);</span>
[ [  -2,   1 ],
  [   1,   0 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Display(qM);</span>
[ [  1,  0 ],
  [  0,  1 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Display(qN);</span>
[ [   1,   0 ],
  [   0,  -1 ] ]

</pre></div>

<p>Since <span class="SimpleMath">qL</span> is of type II, whereas <span class="SimpleMath">qM</span> and <span class="SimpleMath">qN</span> are of type I we see that the oriented homotopy type of <span class="SimpleMath">L</span> is distinct to that of <span class="SimpleMath">M</span> and that of <span class="SimpleMath">N</span>. Since <span class="SimpleMath">qM</span> has index <span class="SimpleMath">2</span> and <span class="SimpleMath">qN</span> has index <span class="SimpleMath">0</span> we see that that <span class="SimpleMath">M</span> and <span class="SimpleMath">N</span> also have distinct oriented homotopy types.</p>

<p><a id="X80B6849C835B7F19" name="X80B6849C835B7F19"></a></p>

<h4>1.12 <span class="Heading">Cohomology Rings</span></h4>

<p>The cup product gives the cohomology <span class="SimpleMath">H^∗(X,R)</span> of a space <span class="SimpleMath">X</span> with coefficients in a ring <span class="SimpleMath">R</span> the structure of a graded commutitive ring. The function <code class="code">CohomologyRing(Y,p)</code> returns the cohomology as an algebra for <span class="SimpleMath">Y</span> a simplicial complex and <span class="SimpleMath">R= Z_p</span> the field of <span class="SimpleMath">p</span> elements. For more general regular CW-complexes or <span class="SimpleMath">R= Z</span> the cohomology ring structure can be determined using the function <code class="code">CupProduct(Y)</code>.</p>

<p>The folowing commands compute the mod <span class="SimpleMath">2</span> cohomology ring <span class="SimpleMath">H^∗(W, Z_2)</span> of the above wedge sum <span class="SimpleMath">W=M∨ N</span> of a <span class="SimpleMath">2</span>-dimensional orientable simplicial surface of genus 2 and the <span class="SimpleMath">K3</span> complex simplicial surface (of real dimension 4).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">M:=ClosedSurface(2);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">N:=SimplicialK3Surface();;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:=WedgeSum(M,N);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:=CohomologyRing(W,2);</span>
&lt;algebra of dimension 29 over GF(2)&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x:=Basis(A)[25];</span>
v.25
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">y:=Basis(A)[27];</span>
v.27
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x*y;</span>
v.29

</pre></div>

<p>The functions <code class="code">CupProduct</code> and <code class="code">IntersectionForm</code> can be used to determine integral cohomology rings. For example, the integral cohomology ring of an arbitrary closed surface was calculated in <a href="chapBib.html#biBgoncalves">[GM15, Theorem 3.5]</a>. For any given surface <span class="SimpleMath">M</span> this result can be recalculated using the intersection form. For instance, for an orientable surface of genus <span class="SimpleMath">g</span> it is well-known that <span class="SimpleMath">H^1(M, Z)= Z^2g</span>, <span class="SimpleMath">H^2(M, Z)= Z</span>. The ring structure multiplication is thus given by the matrix of the intersection form. For say <span class="SimpleMath">g=3</span> the ring multiplication is given, with respect to some cohomology basis, in the following.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">M:=ClosedSurface(3);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Display(IntersectionForm(M));</span>
[ [   0,   0,   1,  -1,  -1,   0 ],
  [   0,   0,   0,   1,   1,   0 ],
  [  -1,   0,   0,   1,   1,  -1 ],
  [   1,  -1,  -1,   0,   0,   1 ],
  [   1,  -1,  -1,   0,   0,   0 ],
  [   0,   0,   1,  -1,   0,   0 ] ]

</pre></div>

<p>By changing the basis <span class="SimpleMath">B</span> for <span class="SimpleMath">H^1(M, Z)</span> we obtain the following simpler matrix representing multiplication in <span class="SimpleMath">H^∗(M, Z)</span>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:=[ [ 0, 1, -1, -1, 1, 0 ],</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">        [ 1, 0, 1, 1, 0, 0 ],</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">        [ 0, 0, 1, 0, 0, 0 ],</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">        [ 0, 0, 0, 1, -1, 0 ],</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">        [ 0, 0, 1, 1, 0, 0 ],</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">        [ 0, 0, 1, 1, 0, 1 ] ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Display(IntersectionForm(M,B));</span>
[ [   0,   1,   0,   0,   0,   0 ],
  [  -1,   0,   0,   0,   0,   0 ],
  [   0,   0,   0,   0,   1,   0 ],
  [   0,   0,   0,   0,   0,   1 ],
  [   0,   0,  -1,   0,   0,   0 ],
  [   0,   0,   0,  -1,   0,   0 ] ]

</pre></div>

<p><a id="X83035DEC7C9659C6" name="X83035DEC7C9659C6"></a></p>

<h4>1.13 <span class="Heading">Bockstein homomorphism</span></h4>

<p>The following example evaluates the Bockstein homomorphism <span class="SimpleMath">β_2: H^∗(X, Z_2) → H^∗ +1(X, Z_2)</span> on an additive basis for <span class="SimpleMath">X=Σ^100( RP^2 × RP^2)</span> the <span class="SimpleMath">100</span>-fold suspension of the direct product of two projective planes.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">P:=SimplifiedComplex(RegularCWComplex(ClosedSurface(-1)));</span>
Regular CW-complex of dimension 2
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PP:=DirectProduct(P,P);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SPP:=Suspension(PP,100); </span>
Regular CW-complex of dimension 104
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:=CohomologyRing(SPP,2); </span>
&lt;algebra of dimension 9 over GF(2)&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">List(Basis(A),x-&gt;Bockstein(A,x));</span>
[ 0*v.1, v.4, v.6, 0*v.1, v.7+v.8, 0*v.1, v.9, v.9, 0*v.1 ]


</pre></div>

<p>If only the Bockstein homomorphism is required, and not the cohomology ring structure, then the Bockstein could also be computedirectly from a chain complex. The following computes the Bockstein <span class="SimpleMath">β_2: H^2(Y, Z_2) → H^3(Y, Z_2)</span> for the direct product <span class="SimpleMath">Y=K × K × K × K</span> of four copies of the Klein bottle represented as a regular CW-complex with <span class="SimpleMath">331776</span> cells. The order of the kernel and image of <span class="SimpleMath">β_2</span> are computed.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">K:=ClosedSurface(-2);;                </span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">K:=SimplifiedComplex(RegularCWComplex(K));;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">KKKK:=DirectProduct(K,K,K,K); </span>
Regular CW-complex of dimension 8
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size(KKKK);</span>
331776
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">C:=ChainComplex(KKKK);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">bk:=Bockstein(C,2,2);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Order(Kernel(bk));</span>
1024
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Order(Image(bk)); </span>
262144

</pre></div>

<p><a id="X87135D067B6CDEEC" name="X87135D067B6CDEEC"></a></p>

<h4>1.14 <span class="Heading">Diagonal maps on associahedra and other polytopes</span></h4>

<p>By a <em>diagonal approximation</em> on a regular CW-complex <span class="SimpleMath">X</span> we mean any cellular map <span class="SimpleMath">∆: X→ X× X</span> that is homotopic to the diagonal map <span class="SimpleMath">X→ X× X, x↦ (x,x)</span> and equal to the diagonal map when restricted to the <span class="SimpleMath">0</span>-skeleton. Theoretical formulae for diagonal maps on a polytope <span class="SimpleMath">X</span> can have interesting combinatorial aspects. To illustrate this let us consider, for <span class="SimpleMath">n=3</span>, the <span class="SimpleMath">n</span>-dimensional polytope <span class="SimpleMath">cal K^n+2</span> known as the associahedron. The following commands display the <span class="SimpleMath">1</span>-skeleton of <span class="SimpleMath">cal K^5</span>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">n:=3;;Y:=RegularCWAssociahedron(n+2);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Display(GraphOfRegularCWComplex(Y));</span>

				</pre></div>

<p><img src="images/assoc.png" align="center" width="250" alt="Associahedron"/></p>

<p>The induced chain map <span class="SimpleMath">C_∗(cal K^n+2) → C_∗(cal K^n+2× cal K^n+2)</span> sends the unique free generator <span class="SimpleMath">e^n_1</span> of <span class="SimpleMath">C_n(cal K^n+2)</span> to a sum <span class="SimpleMath">∆(e^n_1)</span> of a number of distinct free generators of <span class="SimpleMath">C_n(cal K^n+2× cal K^n+2)</span>. Let <span class="SimpleMath">|∆(e^n_1)|</span> denote the number of free generators. For <span class="SimpleMath">n=3</span> the following commands show that <span class="SimpleMath">|∆(e^3_1)|=22</span> with each free generator occurring with coefficient <span class="SimpleMath">± 1</span>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">n:=3;;Y:=RegularCWAssociahedron(n+2);;    </span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">D:=DiagonalChainMap(Y);;Filtered(D!.mapping([1],n),x-&gt;x&lt;&gt;0);</span>
[ 1, 1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, 1 ]

                                </pre></div>

<p>Repeating this example for <span class="SimpleMath">0≤ n≤ 6</span> yields the sequence <span class="SimpleMath">|∆(e^n_1)|: 1, 2, 6, 22, 91, 408, 1938, ⋯</span>. The <span class="URL"><a href="https://oeis.org/A000139">On-line Encyclopedia of Integer Sequences</a></span> explains that this is the beginning of the sequence given by the number of canopy intervals in the Tamari lattices.</p>

<p>Repeating the same experiment for the permutahedron, using the command <code class="code">RegularCWPermutahedron(n)</code>, yields the sequence <span class="SimpleMath">|∆(e^n_1)|: 1, 2, 8, 50, 432, 4802,⋯</span>. The <span class="URL"><a href="https://oeis.org/A007334">On-line Encyclopedia of Integer Sequences</a></span> explains that this is the beginning of the sequence given by the number of spanning trees in the graph <span class="SimpleMath">K_n/e</span>, which results from contracting an edge <span class="SimpleMath">e</span> in the complete graph <span class="SimpleMath">K_n</span> on <span class="SimpleMath">n</span> vertices.</p>

<p>Repeating the experiment for the cube, using the command <code class="code">RegularCWCube(n)</code>, yields the sequence <span class="SimpleMath">|∆(e^n_1)|: 1, 2, 4, 8, 16, 32,⋯</span>.</p>

<p>Repeating the experiment for the simplex, using the command <code class="code">RegularCWSimplex(n)</code>, yields the sequence <span class="SimpleMath">|∆(e^n_1)|: 1, 2, 3, 4, 5, 6,⋯</span>.</p>

<p><a id="X8771FF2885105154" name="X8771FF2885105154"></a></p>

<h4>1.15 <span class="Heading">CW maps and induced homomorphisms</span></h4>

<p>A <em>strictly cellular</em> map <span class="SimpleMath">f: X→ Y</span> of regular CW-complexes is a cellular map for which the image of any cell is a cell (of possibly lower dimension). Inclusions of CW-subcomplexes, and projections from a direct product to a factor, are examples of such maps. Strictly cellular maps can be represented in <strong class="button">HAP</strong>, and their induced homomorphisms on (co)homology and on fundamental groups can be computed.</p>

<p>The following example begins by visualizing the trefoil knot <span class="SimpleMath">κ ∈ R^3</span>. It then constructs a regular CW structure on the complement <span class="SimpleMath">Y= D^3∖ Nbhd(κ)</span> of a small tubular open neighbourhood of the knot lying inside a large closed ball <span class="SimpleMath">D^3</span>. The boundary of this tubular neighbourhood is a <span class="SimpleMath">2</span>-dimensional CW-complex <span class="SimpleMath">B</span> homeomorphic to a torus <span class="SimpleMath">S^1× S^1</span> with fundamental group <span class="SimpleMath">π_1(B)=&lt;a,b : aba^-1b^-1=1&gt;</span>. The inclusion map <span class="SimpleMath">f: B↪ Y</span> is constructed. Then a presentation <span class="SimpleMath">π_1(Y)= &lt;x,y | xy^-1x^-1yx^-1y^-1&gt;</span> and the induced homomorphism $$\pi_1(B)\rightarrow \pi_1(Y), a\mapsto y^{-1}xy^2xy^{-1}, b\mapsto y $$ are computed. This induced homomorphism is an example of a <em>peripheral system</em> and is known to contain sufficient information to characterize the knot up to ambient isotopy.</p>

<p>Finally, it is verified that the induced homology homomorphism <span class="SimpleMath">H_2(B, Z) → H_2(Y, Z)</span> is an isomomorphism.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">K:=PureCubicalKnot(3,1);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ViewPureCubicalKnot(K);;</span>

</pre></div>

<p><img src="images/trefoil.png" align="center" width="150" alt="trefoil knot"/></p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">K:=PureCubicalKnot(3,1);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=KnotComplementWithBoundary(ArcPresentation(K));</span>
Map of regular CW-complexes

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">G:=FundamentalGroup(Target(f));</span>
&lt;fp group of size infinity on the generators [ f1, f2 ]&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">RelatorsOfFpGroup(G);</span>
[ f1*f2^-1*f1^-1*f2*f1^-1*f2^-1 ]

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">F:=FundamentalGroup(f);</span>
[ f1, f2 ] -&gt; [ f2^-1*f1*f2^2*f1*f2^-1, f1 ]


<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">phi:=ChainMap(f);</span>
Chain Map between complexes of length 2 . 

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">H:=Homology(phi,2);</span>
[ g1 ] -&gt; [ g1 ]


</pre></div>

<p><a id="X853D6B247D0E18DB" name="X853D6B247D0E18DB"></a></p>

<h4>1.16 <span class="Heading">Constructing a simplicial complex from a regular CW-complex</span></h4>

<p>The following example constructs a <span class="SimpleMath">3</span>-dimensional pure regular CW-complex <span class="SimpleMath">K</span> whose <span class="SimpleMath">3</span>-cells are permutahedra. It then constructs the simplicial complex <span class="SimpleMath">B</span> by taking barycentric subdivision. It then constructes a smaller, homotopy equivalent, simplicial complex <span class="SimpleMath">N</span> by taking the nerve of the cover of <span class="SimpleMath">K</span> by the closures of its <span class="SimpleMath">3</span>-cells.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">K:=RegularCWComplex(PureComplexComplement(PurePermutahedralKnot(3,1)));</span>
Regular CW-complex of dimension 3

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size(K);</span>
77923
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:=BarycentricSubdivision(K);</span>
Simplicial complex of dimension 3.

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size(B);</span>
1622517
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">N:=Nerve(K);</span>
Simplicial complex of dimension 3.

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size(N);</span>
48745

</pre></div>

<p><a id="X7900FD197F175551" name="X7900FD197F175551"></a></p>

<h4>1.17 <span class="Heading">Some limitations to representing spaces as regular CW complexes</span></h4>

<p>By a <em>classifying space</em> for a group <span class="SimpleMath">G</span> we mean a path-connected space <span class="SimpleMath">BG</span> with fundamental group <span class="SimpleMath">π_1(BG)≅ G</span> isomorphic to <span class="SimpleMath">G</span> and with higher homotopy groups <span class="SimpleMath">π_n(BG)=0</span> trivial for all <span class="SimpleMath">n≥ 2</span>. The homology of the group <span class="SimpleMath">G</span> can be defined to be the homology of <span class="SimpleMath">BG</span>: <span class="SimpleMath">H_n(G, Z) = H_n(BG, Z)</span>.</p>

<p>In principle <span class="SimpleMath">BG</span> can always be constructed as a regular CW-complex. For instance, the following extremely slow commands construct the <span class="SimpleMath">5</span>-skeleton <span class="SimpleMath">Y^5</span> of a regular CW-classifying space <span class="SimpleMath">Y=BG</span> for the dihedral group of order <span class="SimpleMath">16</span> and use it to calculate <span class="SimpleMath">H_1(G, Z)= Z_2⊕ Z_2</span>, <span class="SimpleMath">H_2(G, Z)= Z_2</span>, <span class="SimpleMath">H_3(G, Z)= Z_2⊕ Z_2 ⊕ Z_8</span>, <span class="SimpleMath">H_4(G, Z)= Z_2 ⊕ Z_2</span>. The final command shows that the constructed space <span class="SimpleMath">Y^5</span> in this example is a <span class="SimpleMath">5</span>-dimensional regular CW-complex with a total of <span class="SimpleMath">15289</span> cells.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y:=ClassifyingSpaceFiniteGroup(DihedralGroup(16),5);</span>
Regular CW-complex of dimension 5
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(Y,1);</span>
[ 2, 2 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(Y,2);</span>
[ 2 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(Y,3);</span>
[ 2, 2, 8 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(Y,4);</span>
[ 2, 2 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size(Y);</span>
15289


</pre></div>

<p>The <span class="SimpleMath">n</span>-skeleton of a regular CW-classifying space of a finite group necessarily involves a large number of cells. For the group <span class="SimpleMath">G=C_2</span> of order two a classifying space can be take to be real projective space <span class="SimpleMath">BG= RP^∞</span> with <span class="SimpleMath">n</span>-skeleton <span class="SimpleMath">BG^n= RP^n</span>. To realize <span class="SimpleMath">BG^n= RP^n</span> as a simplicial complex it is known that one needs at least 6 vertices for <span class="SimpleMath">n=2</span>, at least 11 vertices for <span class="SimpleMath">n=3</span> and at least 16 vertices for <span class="SimpleMath">n=4</span>. One can do a bit better by allowing <span class="SimpleMath">BG</span> to be a regular CW-complex. For instance, the following creates <span class="SimpleMath">RP^4</span> as a regular CW-complex with 5 vertices. This construction of <span class="SimpleMath">RP^4</span> involves a total of 121 cells. A minimal triangulation of <span class="SimpleMath">RP^4</span> would require 991 simplices.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y:=ClassifyingSpaceFiniteGroup(CyclicGroup(2),4);</span>
Regular CW-complex of dimension 4
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y!.nrCells(0);                                   </span>
5
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y!.nrCells(1);</span>
20
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y!.nrCells(2);</span>
40
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y!.nrCells(3);                                   </span>
40
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y!.nrCells(4);</span>
16

</pre></div>

<p>The space <span class="SimpleMath">RP^n</span> can be given the structure of a regular CW-complex with <span class="SimpleMath">n+1</span> vertices. Kuehnel has described a triangulation of <span class="SimpleMath">RP^n</span> with <span class="SimpleMath">2^n+1-1</span> vertices.</p>

<p>The above examples suggest that it is inefficient/impractical to attempt to compute the <span class="SimpleMath">n</span>-th homology of a group <span class="SimpleMath">G</span> by first constructing a regular CW-complex corresponding for the <span class="SimpleMath">n+1</span> of a classifying space <span class="SimpleMath">BG</span>, even for quite small groups <span class="SimpleMath">G</span>, since such spaces seem to require a large number of cells in each dimension. On the other hand, by dropping the requirement that <span class="SimpleMath">BG</span> must be regular we can obtain much smaller CW-complexes. The following example constructs <span class="SimpleMath">RP^9</span> as a regular CW-complex and then shows that it can be given a non-regular CW-structure with just one cell in each dimension.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y:=ClassifyingSpaceFiniteGroup(CyclicGroup(2),9);</span>
Regular CW-complex of dimension 9
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size(Y);</span>
29524
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CriticalCells(Y);</span>
[ [ 9, 1 ], [ 8, 124 ], [ 7, 1215 ], [ 6, 1246 ], [ 5, 487 ], [ 4, 254 ], 
  [ 3, 117 ], [ 2, 54 ], [ 1, 9 ], [ 0, 10 ] ]

</pre></div>

<p>It is of course well-known that <span class="SimpleMath">RP^∞</span> admits a theoretically described CW-structure with just one cell in each dimension. The question is: how best to represent this on a computer?</p>

<p><a id="X85A579217DCB6CC8" name="X85A579217DCB6CC8"></a></p>

<h4>1.18 <span class="Heading">Equivariant CW complexes</span></h4>

<p>As just explained, the representations of spaces as simplicial complexes and regular CW complexes have their limitations. One limitation is that the number of cells needed to describe a space can be unnecessarily large. A minimal simplicial complex structure for the torus has <span class="SimpleMath">7</span> vertices, <span class="SimpleMath">21</span> edges and <span class="SimpleMath">14</span> triangles. A minimal regular CW-complex structure for the torus has <span class="SimpleMath">4</span> vertices, <span class="SimpleMath">8</span> edges and <span class="SimpleMath">4</span> cells of dimension <span class="SimpleMath">2</span>. By using simplicial sets (which are like simplicial complexes except that they allow the freedom to attach simplicial cells by gluing their boundary non-homeomorphically) one obtains a minimal triangulation of the torus involving <span class="SimpleMath">1</span> vertex, <span class="SimpleMath">3</span> edges and <span class="SimpleMath">2</span> cells of dimension <span class="SimpleMath">2</span>. By using non-regular CW-complexes one obtains a minimal cell structure involving <span class="SimpleMath">1</span> vertex, <span class="SimpleMath">2</span> edges and <span class="SimpleMath">1</span> cell of dimension <span class="SimpleMath">2</span>. Minimal cell structures (in the four different categories) for the torus are illustrated as follows.</p>

<p><img src="images/mstorus.png" align="center" width="300" alt="minimal simplicial torus"/> <img src="images/mrtorus.png" align="center" width="300" alt="minimal regular CW torus"/></p>

<p><img src="images/mdtorus.png" align="center" width="300" alt="minimal delta complex torus"/> <img src="images/mctorus.png" align="center" width="300" alt="minimal delta complex torus"/></p>

<p>A second limitation to our representations of simplicial and regular CW-complexes is that they apply only to structures with finitely many cells. They do no apply, for instance, to the simplicial complex structure on the real line <span class="SimpleMath">R</span> in which each each integer <span class="SimpleMath">n</span> is a vertex and each interval <span class="SimpleMath">[n,n+1]</span> is an edge.</p>

<p>Simplicial sets provide one approach to the efficient combinatorial representation of certain spaces. So too do cubical sets (the analogues of simplicial sets in which each cell has the combinatorics of an <span class="SimpleMath">n</span>-cube rather than an <span class="SimpleMath">n</span>-simplex). Neither of these two approaches has been implemented in <strong class="button">HAP</strong>.</p>

<p>Simplicial sets endowed with the action of a (possibly infinite) group <span class="SimpleMath">G</span> provide for an efficient representation of (possibly infinite) cell structures on a wider class of spaces. Such a structure can be made precise and is known as a <em>simplicial group</em>. Some functionality for simplicial groups is implemented in <strong class="button">HAP</strong> and described in Chapter <a href="chap12.html#X7D818E5F80F4CF63"><span class="RefLink">12</span></a>.</p>

<p>A regular CW-complex endowed with the action of a (possibly infinite) group <span class="SimpleMath">G</span> is an alternative approach to the efficient combinatorial representation of (possibly infinite) cell structures on spaces. Much of <strong class="button">HAP</strong> is focused on this approach. As a first example of the idea, the following commands construct the infinite regular CW-complex <span class="SimpleMath">Y=widetilde T</span> arising as the universal cover of the torus <span class="SimpleMath">T= S^1× S^1</span> where <span class="SimpleMath">T</span> is given the above minimal non-regular CW structure involving <span class="SimpleMath">1</span> vertex, <span class="SimpleMath">2</span> edges, and <span class="SimpleMath">1</span> cell of dimension <span class="SimpleMath">2</span>. The homology <span class="SimpleMath">H_n(T, Z)</span> is computed and the fundamental group of the torus <span class="SimpleMath">T</span> is recovered.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">F:=FreeGroup(2);;x:=F.1;;y:=F.2;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">G:=F/[ x*y*x^-1*y^-1 ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y:=EquivariantTwoComplex(G);</span>
Equivariant CW-complex of dimension 2

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">C:=ChainComplexOfQuotient(Y);</span>
Chain complex of length 2 in characteristic 0 . 

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(C,0);</span>
[ 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(C,1);</span>
[ 0, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(C,2);</span>
[ 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FundamentalGroupOfQuotient(Y);</span>
&lt;fp group of size infinity on the generators [ f1, f2 ]&gt;

</pre></div>

<p>As a second example, the following comands load group number <span class="SimpleMath">9</span> in the library of <span class="SimpleMath">3</span>-dimensional crystallographic groups. They verify that <span class="SimpleMath">G</span> acts freely on <span class="SimpleMath">R^3</span> (i.e. <span class="SimpleMath">G</span> is a <em>Bieberbach group</em>) and then construct a <span class="SimpleMath">G</span>-equivariant CW-complex <span class="SimpleMath">Y= R^3</span> corresponding to the tessellation of <span class="SimpleMath">R^3</span> by a fundamental domain for <span class="SimpleMath">G</span>. Finally, the cohomology <span class="SimpleMath">H_n(M, Z)</span> of the <span class="SimpleMath">3</span>-dimensional closed manifold <span class="SimpleMath">M= R^3/G</span> is computed. The manifold <span class="SimpleMath">M</span> is seen to be non-orientable (since it's top-dimensional homology is trivial) and has a non-regular CW structure with <span class="SimpleMath">1</span> vertex, <span class="SimpleMath">3</span> edges, <span class="SimpleMath">3</span> cells of dimension <span class="SimpleMath">2</span>, and <span class="SimpleMath">1</span> cell of dimension <span class="SimpleMath">3</span>. (This example uses Polymake software.)</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">G:=SpaceGroup(3,9);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsAlmostBieberbachGroup(Image(IsomorphismPcpGroup(G)));</span>
true
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y:=EquivariantEuclideanSpace(G,[0,0,0]);</span>
Equivariant CW-complex of dimension 3

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y!.dimension(0);</span>
1
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y!.dimension(1);</span>
3
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y!.dimension(2);</span>
3
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Y!.dimension(3);</span>
1
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">C:=ChainComplexOfQuotient(Y);</span>
Chain complex of length 3 in characteristic 0 . 

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(C,0);</span>
[ 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(C,1);</span>
[ 0, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(C,2);</span>
[ 2, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(C,3);</span>
[  ]

</pre></div>

<p>The fundamental domain for the action of <span class="SimpleMath">G</span> in the above example is constructed to be the Dirichlet-Voronoi region in <span class="SimpleMath">R^3</span> whose points are closer to the origin <span class="SimpleMath">v=(0,0,0)</span> than to any other point <span class="SimpleMath">v^g</span> in the orbit of the origin under the action of <span class="SimpleMath">G</span>. This fundamental domain can be visualized as follows.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">F:=FundamentalDomainStandardSpaceGroup([0,0,0],G);</span>
&lt;polymake object&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Polymake(F,"VISUAL");</span>

</pre></div>

<p><img src="images/fdspace9.png" align="center" width="300" alt="fundamental domain"/></p>

<p>Other fundamental domains for the same group action can be obtained by choosing some other starting vector <span class="SimpleMath">v</span>. For example:</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">F:=FundamentalDomainStandardSpaceGroup([1/2,1/3,1/5],G);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Polymake(F,"VISUAL");</span>

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">F:=FundamentalDomainStandardSpaceGroup([1/7,1/2,1/2],G);</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Polymake(F,"VISUAL");</span>

</pre></div>

<p><img src="images/fdspace9-2.png" align="center" width="300" alt="fundamental domain"/> <img src="images/fdspace9-3.png" align="center" width="300" alt="fundamental domain"/></p>

<p><a id="X86881717878ADCD6" name="X86881717878ADCD6"></a></p>

<h4>1.19 <span class="Heading">Orbifolds and classifying spaces</span></h4>

<p>If a discrete group <span class="SimpleMath">G</span> acts on Euclidean space or hyperbolic space with finite stabilizer groups then we say that the quotient space obtained by killing the action of <span class="SimpleMath">G</span> an an <em>orbifold</em>. If the stabilizer groups are all trivial then the quotient is of course a manifold.</p>

<p>An orbifold is represented as a <span class="SimpleMath">G</span>-equivariant regular CW-complex together with the stabilizer group for a representative of each orbit of cells and its subgroup consisting of those group elements that preserve the cell orientation. <strong class="button">HAP</strong> stores orbifolds using the data type of <em>non-free resolution</em> and uses them mainly as a first step in constructing free <span class="SimpleMath">ZG</span>-resolutions of <span class="SimpleMath">Z</span>.</p>

<p>The following commands use an <span class="SimpleMath">8</span>-dimensional equivariant deformation retract of a <span class="SimpleMath">GL_3( Z[ i])</span>-orbifold structure on hyperbolic space to compute <span class="SimpleMath">H_5(GL_3( Z[ i], Z) = Z_2^5⊕ Z_4^2</span>. (The deformation retract is stored in a library and was supplied by Mathieu Dutour Sikiric.)</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Orbifold:=ContractibleGcomplex("PGL(3,Z[i])");</span>
Non-free resolution in characteristic 0 for matrix group . 
No contracting homotopy available. 

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">R:=FreeGResolution(Orbifold,6);</span>
Resolution of length 5 in characteristic 0 for matrix group . 
No contracting homotopy available. 

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Homology(TensorWithIntegers(R),5);</span>
[ 2, 2, 2, 2, 2, 4, 4 ]

</pre></div>

<p>The next example computes an orbifold structure on <span class="SimpleMath">R^4</span>, and then the first <span class="SimpleMath">12</span> degrees of a free resolution/classifying space, for the second <span class="SimpleMath">4</span>-dimensional crystallographic group <span class="SimpleMath">G</span> in the library of crystallographic groups. The resolution is shown to be periodic of period <span class="SimpleMath">2</span> in degrees <span class="SimpleMath">≥ 5</span>. The cohomology is seen to have <span class="SimpleMath">11</span> ring generators in degree <span class="SimpleMath">2</span> and no further ring generators. The cohomology groups are: $$H^n(G,\mathbb Z) =\left( \begin{array}{ll} 0, &amp; {\rm odd~} n\ge 1\\ \mathbb Z_2^5 \oplus \mathbb Z^6, &amp; n=2\\ \mathbb Z_2^{15}\oplus \mathbb Z, &amp; n=4\\ \mathbb Z_2^{16}, &amp; {\rm even~} n \ge 6 .\\ \end{array}\right.$$</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">G:=SpaceGroup(4,2);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">R:=ResolutionCubicalCrystGroup(G,12);</span>
Resolution of length 12 in characteristic 0 for &lt;matrix group with 
5 generators&gt; . 

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">R!.dimension(5);</span>
16
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">R!.dimension(7);</span>
16
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">List([1..16],k-&gt;R!.boundary(5,k)=R!.boundary(7,k));</span>
[ true, true, true, true, true, true, true, true, true, true, true, true, 
  true, true, true, true ]

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">C:=HomToIntegers(R);</span>
Cochain complex of length 12 in characteristic 0 . 

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(C,0);</span>
[ 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(C,1);</span>
[  ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(C,2);</span>
[ 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(C,3);</span>
[  ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(C,4);</span>
[ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(C,5);</span>
[  ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(C,6);</span>
[ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Cohomology(C,7);</span>
[  ]

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IntegralRingGenerators(R,1);</span>
[  ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IntegralRingGenerators(R,2);</span>
[ [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], 
  [ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 ], 
  [ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 ], 
  [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 ], 
  [ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ], 
  [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IntegralRingGenerators(R,3);</span>
[  ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IntegralRingGenerators(R,4);</span>
[  ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IntegralRingGenerators(R,5);</span>
[  ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IntegralRingGenerators(R,6);</span>
[  ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IntegralRingGenerators(R,7);</span>
[  ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IntegralRingGenerators(R,8);</span>
[  ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IntegralRingGenerators(R,9);</span>
[  ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IntegralRingGenerators(R,10);</span>
[  ]


</pre></div>

<p>A group <span class="SimpleMath">G</span> with a finite index torsion free nilpotent subgroup admits a resolution which is periodic in sufficiently high degrees if and only if all of its finite index subgroups admit periodic resolutions. The following commands identify the <span class="SimpleMath">99</span> <span class="SimpleMath">3</span>-dimensional space groups (respectively, the <span class="SimpleMath">1191</span> <span class="SimpleMath">4</span>-dimensional space groups) that admit a resolution which is periodic in degrees <span class="SimpleMath">&gt; 3</span> (respectively, in degrees <span class="SimpleMath">&gt; 4</span>).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">L3:=Filtered([1..219],k-&gt;IsPeriodicSpaceGroup(SpaceGroup(3,k)));</span>
[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 15, 17, 18, 19, 21, 24, 26, 27, 28, 
  29, 30, 31, 32, 33, 34, 36, 37, 39, 40, 41, 43, 45, 46, 52, 54, 55, 56, 58, 
  61, 62, 74, 75, 76, 77, 78, 79, 80, 81, 84, 85, 87, 89, 92, 98, 101, 102, 
  107, 111, 119, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 
  152, 153, 154, 155, 157, 159, 161, 162, 163, 164, 165, 166, 168, 171, 172, 
  174, 175, 176, 178, 180, 186, 189, 192, 196, 198, 209 ] 

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">L4:=Filtered([1..4783],k-&gt;IsPeriodicSpaceGroup(SpaceGroup(4,k)));</span>
[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 15, 16, 17, 18, 19, 20, 22, 23, 25,
  26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 43, 44, 46, 47, 48,
  49, 50, 51, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 65, 66, 68, 69, 70,
  71, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 89, 90, 91,
  93, 94, 95, 96, 97, 98, 99, 101, 102, 103, 104, 105, 107, 108, 109, 110,
  111, 113, 115, 116, 118, 119, 120, 121, 122, 124, 126, 127, 128, 130, 131,
  134, 141, 144, 145, 149, 151, 153, 154, 155, 156, 157, 158, 159, 160, 162,
  163, 165, 167, 168, 169, 170, 171, 172, 173, 174, 176, 178, 179, 180, 187,
  188, 197, 198, 202, 204, 205, 206, 211, 212, 219, 220, 222, 226, 233, 237,
  238, 239, 240, 241, 242, 243, 244, 245, 247, 248, 249, 250, 251, 253, 254,
  255, 256, 257, 259, 260, 261, 263, 264, 265, 266, 267, 269, 270, 271, 273,
  275, 277, 278, 279, 281, 283, 285, 290, 292, 296, 297, 298, 299, 300, 301,
  303, 304, 305, 314, 316, 317, 319, 327, 328, 329, 333, 335, 342, 355, 357,
  358, 359, 361, 362, 363, 365, 366, 367, 368, 369, 370, 372, 374, 376, 378,
  381, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397,
  398, 399, 400, 401, 402, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413,
  414, 415, 416, 417, 418, 419, 421, 422, 423, 424, 425, 426, 427, 428, 429,
  430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 442, 443, 444, 445,
  446, 447, 448, 450, 451, 458, 459, 462, 464, 465, 466, 467, 469, 470, 473,
  477, 478, 479, 482, 483, 484, 485, 486, 493, 495, 497, 501, 502, 503, 504,
  505, 507, 508, 512, 514, 515, 516, 517, 522, 524, 525, 526, 527, 533, 537,
  539, 540, 541, 542, 543, 544, 546, 548, 553, 555, 558, 562, 564, 565, 566,
  567, 568, 571, 572, 573, 574, 576, 577, 580, 581, 582, 589, 590, 591, 593,
  596, 598, 599, 612, 613, 622, 623, 624, 626, 632, 641, 647, 649, 651, 652,
  654, 656, 657, 658, 659, 661, 662, 663, 665, 666, 667, 668, 669, 670, 671,
  672, 674, 676, 677, 678, 679, 680, 682, 683, 684, 686, 688, 689, 690, 691,
  692, 694, 696, 697, 698, 699, 700, 702, 708, 710, 712, 714, 716, 720, 722,
  728, 734, 738, 739, 741, 742, 744, 745, 752, 754, 756, 757, 758, 762, 763,
  769, 770, 778, 779, 784, 788, 790, 800, 801, 843, 845, 854, 855, 856, 857,
  865, 874, 900, 904, 909, 911, 913, 915, 916, 917, 919, 920, 921, 922, 923,
  924, 925, 926, 927, 929, 931, 932, 933, 934, 936, 938, 940, 941, 943, 945,
  946, 953, 955, 956, 958, 963, 966, 972, 973, 978, 979, 981, 982, 983, 985,
  987, 988, 989, 991, 992, 993, 995, 996, 998, 999, 1000, 1003, 1011, 1022,
  1024, 1025, 1026, 1162, 1167, 1236, 1237, 1238, 1239, 1240, 1241, 1242,
  1243, 1244, 1246, 1248, 1250, 1255, 1264, 1267, 1270, 1273, 1279, 1280,
  1281, 1283, 1284, 1289, 1291, 1293, 1294, 1324, 1325, 1326, 1327, 1328,
  1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340,
  1341, 1343, 1345, 1347, 1348, 1349, 1350, 1351, 1352, 1354, 1356, 1357,
  1358, 1359, 1361, 1363, 1365, 1367, 1372, 1373, 1374, 1375, 1376, 1377,
  1378, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389,
  1390, 1393, 1395, 1397, 1399, 1400, 1401, 1404, 1405, 1408, 1410, 1419,
  1420, 1421, 1422, 1424, 1425, 1426, 1428, 1429, 1438, 1440, 1441, 1442,
  1443, 1444, 1445, 1449, 1450, 1451, 1456, 1457, 1460, 1461, 1462, 1464,
  1465, 1470, 1472, 1473, 1477, 1480, 1481, 1487, 1488, 1489, 1493, 1494,
  1495, 1501, 1503, 1506, 1509, 1512, 1515, 1518, 1521, 1524, 1527, 1530,
  1532, 1533, 1534, 1537, 1538, 1541, 1542, 1544, 1547, 1550, 1552, 1553,
  1554, 1558, 1565, 1566, 1568, 1573, 1644, 1648, 1673, 1674, 1700, 1702,
  1705, 1713, 1714, 1735, 1738, 1740, 1741, 1742, 1743, 1744, 1745, 1746,
  1747, 1748, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 1756, 1757, 1759,
  1761, 1762, 1763, 1765, 1767, 1768, 1769, 1770, 1771, 1772, 1773, 1774,
  1775, 1778, 1779, 1782, 1783, 1785, 1787, 1788, 1789, 1791, 1793, 1795,
  1797, 1798, 1799, 1800, 1801, 1803, 1806, 1807, 1809, 1810, 1811, 1813,
  1815, 1821, 1822, 1823, 1828, 1829, 1833, 1837, 1839, 1842, 1845, 1848,
  1850, 1851, 1852, 1854, 1856, 1857, 1858, 1859, 1860, 1861, 1863, 1866,
  1870, 1873, 1874, 1877, 1880, 1883, 1885, 1886, 1887, 1889, 1892, 1895,
  1915, 1918, 1920, 1923, 1925, 1927, 1928, 1930, 1952, 1953, 1954, 1955,
  2045, 2047, 2049, 2051, 2053, 2054, 2055, 2056, 2057, 2059, 2067, 2068,
  2072, 2075, 2076, 2079, 2084, 2087, 2088, 2092, 2133, 2135, 2136, 2137,
  2139, 2140, 2170, 2171, 2196, 2224, 2234, 2236, 2238, 2254, 2355, 2356,
  2386, 2387, 2442, 2445, 2448, 2451, 2478, 2484, 2487, 2490, 2493, 2496,
  2499, 2502, 2508, 2511, 2514, 2517, 2520, 2523, 2550, 2553, 2559, 2621,
  2624, 2648, 2650, 3046, 3047, 3048, 3049, 3050, 3051, 3052, 3053, 3054,
  3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 3065, 3066,
  3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 3077, 3078,
  3079, 3080, 3081, 3082, 3083, 3084, 3085, 3086, 3087, 3089, 3090, 3091,
  3094, 3095, 3096, 3099, 3100, 3101, 3104, 3105, 3106, 3109, 3110, 3111,
  3112, 3113, 3114, 3115, 3117, 3119, 3120, 3121, 3122, 3123, 3124, 3125,
  3127, 3128, 3129, 3130, 3131, 3132, 3133, 3135, 3137, 3139, 3141, 3142,
  3143, 3144, 3145, 3149, 3151, 3152, 3153, 3154, 3155, 3157, 3159, 3160,
  3161, 3162, 3163, 3169, 3170, 3171, 3172, 3173, 3174, 3175, 3177, 3179,
  3180, 3181, 3182, 3183, 3184, 3185, 3187, 3188, 3189, 3190, 3191, 3192,
  3193, 3195, 3197, 3199, 3200, 3201, 3204, 3206, 3207, 3208, 3209, 3210,
  3212, 3214, 3215, 3216, 3217, 3218, 3226, 3234, 3235, 3236, 3244, 3252,
  3253, 3254, 3260, 3268, 3269, 3270, 3278, 3280, 3281, 3282, 3283, 3284,
  3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3295, 3296, 3298, 3299,
  3302, 3303, 3306, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316,
  3317, 3318, 3319, 3320, 3322, 3324, 3326, 3327, 3329, 3330, 3338, 3345,
  3346, 3347, 3348, 3350, 3351, 3352, 3354, 3355, 3356, 3359, 3360, 3361,
  3362, 3374, 3375, 3383, 3385, 3398, 3399, 3417, 3418, 3419, 3420, 3422,
  3424, 3426, 3428, 3446, 3447, 3455, 3457, 3469, 3471, 3521, 3523, 3524,
  3525, 3530, 3531, 3534, 3539, 3542, 3545, 3548, 3550, 3551, 3554, 3557,
  3579, 3580, 3830, 3831, 3832, 3833, 3835, 3837, 3839, 3849, 3851, 3877,
  3938, 3939, 3949, 3951, 3952, 3958, 3960, 3962, 3963, 3964, 3966, 3968,
  3972, 3973, 3975, 4006, 4029, 4030, 4033, 4034, 4037, 4038, 4046, 4048,
  4050, 4062, 4064, 4067, 4078, 4081, 4089, 4090, 4114, 4138, 4139, 4140,
  4141, 4146, 4147, 4148, 4149, 4154, 4155, 4169, 4171, 4175, 4180, 4183,
  4188, 4190, 4204, 4205, 4223, 4224, 4225, 4254, 4286, 4289, 4391, 4397,
  4496, 4499, 4500, 4501, 4502, 4504, 4508, 4510, 4521, 4525, 4544, 4559,
  4560, 4561, 4562, 4579, 4580, 4581, 4583, 4587, 4597, 4598, 4599, 4600,
  4651, 4759, 4760, 4761, 4762, 4766 ]


</pre></div>


<div class="chlinkprevnextbot">&nbsp;<a href="chap0.html">[Top of Book]</a>&nbsp;  <a href="chap0.html#contents">[Contents]</a>&nbsp;  &nbsp;<a href="chap0.html">[Previous Chapter]</a>&nbsp;  &nbsp;<a href="chap2.html">[Next Chapter]</a>&nbsp;  </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chap11.html">11</a>  <a href="chap12.html">12</a>  <a href="chap13.html">13</a>  <a href="chap14.html">14</a>  <a href="chap15.html">15</a>  <a href="chap16.html">16</a>  <a href="chapBib.html">Bib</a>  <a href="chapInd.html">Ind</a>  </div>

<hr />
<p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>