forked from homalg-project/alexander
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path(RP^2,S^1).g
211 lines (194 loc) · 6.06 KB
/
(RP^2,S^1).g
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
## <#GAPDoc Label="(RP^2,S^1)">
## <Section Label="(RP^2,S^1)">
## <Heading>(RP^2,S^1)</Heading>
## In this example we compute the relative homology and cohomology
## with coefficients in &ZZ; of the pair <M>(&RR;P^2,S^1)</M>,
## where <M>&RR;P^2</M> is the real projective plane and <M>S^1</M> is
## a nontrivial homology cycle.
## <Example><![CDATA[
## gap> R := HomalgRingOfIntegers( );
## Z
## gap> RP2 := [ [ 1, 2, 3 ], [ 1, 3, 6 ], [ 2, 5, 6 ], [ 1, 2, 5 ], [ 1, 4, 6 ],
## > [ 2, 4, 6 ], [ 3, 5, 6 ], [ 1, 4, 5 ], [ 2, 3, 4 ], [ 3, 4, 5 ] ];;
## gap> RP2 := SimplicialComplexConstructor( RP2 );
## <A simplicial 2-complex>
## gap> cyc := SimplicialCycle( RP2, 1, 1 );
## [ [ 4, 5 ], [ 4, 6 ], [ 5, 6 ] ]
## gap> S1 := SimplicialComplexConstructor( cyc, Dimension( RP2 ) );
## <A simplicial 1-complex>
## gap> d := SimplicialData( RP2, S1, R );
## <A short exact sequence containing 2 morphisms of left complexes at degrees
## [ 0 .. 2 ]>
## gap> T := ExactTriangle( d );
## <An exact triangle containing 3 morphisms of left complexes at degrees
## [ 1, 2, 3, 1 ]>
## gap> lehs := LongSequence( T );
## <A sequence containing 8 morphisms of left modules at degrees [ 0 .. 8 ]>
## gap> ByASmallerPresentation( lehs );
## <A non-zero sequence containing 8 morphisms of left modules at degrees
## [ 0 .. 8 ]>
## gap> IsExactSequence( lehs );
## true
## gap> lehs;
## <A non-zero exact sequence containing 8 morphisms of left modules at degrees
## [ 0 .. 8 ]>
## gap> Display( lehs );
## -------------------------
## at homology degree: 8
## 0
## -------------------------
## (an empty 0 x 0 matrix)
##
## the map is currently represented by the above 0 x 0 matrix
## ------------v------------
## at homology degree: 7
## 0
## -------------------------
## (an empty 0 x 1 matrix)
##
## the map is currently represented by the above 0 x 1 matrix
## ------------v------------
## at homology degree: 6
## Z^(1 x 1)
## -------------------------
## [ [ 2 ] ]
##
## the map is currently represented by the above 1 x 1 matrix
## ------------v------------
## at homology degree: 5
## Z^(1 x 1)
## -------------------------
## [ [ 1 ] ]
##
## the map is currently represented by the above 1 x 1 matrix
## ------------v------------
## at homology degree: 4
## Z/< 2 >
## -------------------------
## (an empty 1 x 0 matrix)
##
## the map is currently represented by the above 1 x 0 matrix
## ------------v------------
## at homology degree: 3
## 0
## -------------------------
## (an empty 0 x 1 matrix)
##
## the map is currently represented by the above 0 x 1 matrix
## ------------v------------
## at homology degree: 2
## Z^(1 x 1)
## -------------------------
## [ [ 1 ] ]
##
## the map is currently represented by the above 1 x 1 matrix
## ------------v------------
## at homology degree: 1
## Z^(1 x 1)
## -------------------------
## (an empty 1 x 0 matrix)
##
## the map is currently represented by the above 1 x 0 matrix
## ------------v------------
## at homology degree: 0
## 0
## -------------------------
## gap> dd := Hom( d );
## <A cocomplex containing 2 morphisms of right cocomplexes at degrees
## [ 0 .. 2 ]>
## gap> SetIsShortExactSequence( dd, true );
## gap> t := ExactTriangle ( dd );
## <An exact cotriangle containing 3 morphisms of right cocomplexes at degrees
## [ 0, 1, 2, 0 ]>
## gap> lecs := LongSequence( t );
## <A cosequence containing 8 morphisms of right modules at degrees [ 0 .. 8 ]>
## gap> ByASmallerPresentation( lecs );
## <A non-zero cosequence containing 8 morphisms of right modules at degrees
## [ 0 .. 8 ]>
## gap> IsExactSequence( lecs );
## true
## gap> lecs;
## <A non-zero exact cosequence containing
## 8 morphisms of right modules at degrees [ 0 .. 8 ]>
## gap> Display( lecs );
## -------------------------
## at cohomology degree: 8
## 0
## ------------^------------
## (an empty 0 x 1 matrix)
##
## the map is currently represented by the above 0 x 1 matrix
## -------------------------
## at cohomology degree: 7
## Z/< 2 >
## ------------^------------
## [ [ 1 ] ]
##
## the map is currently represented by the above 1 x 1 matrix
## -------------------------
## at cohomology degree: 6
## Z^(1 x 1)
## ------------^------------
## [ [ 2 ] ]
##
## the map is currently represented by the above 1 x 1 matrix
## -------------------------
## at cohomology degree: 5
## Z^(1 x 1)
## ------------^------------
## (an empty 1 x 0 matrix)
##
## the map is currently represented by the above 1 x 0 matrix
## -------------------------
## at cohomology degree: 4
## 0
## ------------^------------
## (an empty 0 x 0 matrix)
##
## the map is currently represented by the above 0 x 0 matrix
## -------------------------
## at cohomology degree: 3
## 0
## ------------^------------
## (an empty 0 x 1 matrix)
##
## the map is currently represented by the above 0 x 1 matrix
## -------------------------
## at cohomology degree: 2
## Z^(1 x 1)
## ------------^------------
## [ [ 1 ] ]
##
## the map is currently represented by the above 1 x 1 matrix
## -------------------------
## at cohomology degree: 1
## Z^(1 x 1)
## ------------^------------
## (an empty 1 x 0 matrix)
##
## the map is currently represented by the above 1 x 0 matrix
## -------------------------
## at cohomology degree: 0
## 0
## -------------------------
## ]]></Example>
## </Section>
## <#/GAPDoc>
LoadPackage( "alexander" );
R := HomalgRingOfIntegers( );
RP2 := [[1, 2, 3], [1, 3, 6], [2, 5, 6], [1, 2, 5], [1, 4, 6], [2, 4, 6], [3, 5, 6], [1, 4, 5], [2, 3, 4], [3, 4, 5]];
RP2 := SimplicialComplexConstructor( RP2 );
cyc := SimplicialCycle( RP2, 1, 1 );
S1 := SimplicialComplexConstructor( cyc, Dimension( RP2 ) );
d := SimplicialData( RP2, S1, R );
T := ExactTriangle( d );
lehs := LongSequence( T );
ByASmallerPresentation( lehs );
IsExactSequence( lehs );
dd := Hom( d );
## FIXME: make the following line obsolete
SetIsShortExactSequence( dd, true );
t := ExactTriangle ( dd );
lecs := LongSequence( t );
ByASmallerPresentation( lecs );
IsExactSequence( lecs );