CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
2
5 Examples
3
4
5
5.1 An Easy Polynomial Example
6
7
The ground ring used in this example is F_3[x,y]. We want to see, how the
8
different rings in this package can be used to localize at different points
9
and how the results differ.
10
11
 Example 
12
gap> LoadPackage("RingsForHomalg");;
13
gap> F3xy := HomalgRingOfIntegersInSingular(3) * "x,y";;
14
gap> x1 := HomalgRingElement( "x+2", F3xy );;
15
gap> y0 := HomalgRingElement( "y", F3xy );;
16
gap> LoadPackage("LocalizeRingForHomalg");;
17
gap> R00 := LocalizeAtZero( F3xy );;
18
gap> R10 := LocalizeAt( F3xy, [ x1, y0 ] );;
19
gap> RMora := LocalizePolynomialRingAtZeroWithMora( F3xy );;
20
gap> M := HomalgMatrix( "[\
21
>  y^3+2*y^2+x+x^2+2*x*y+y^4+x*y^2, \
22
>  x*y^3+2*x^2*y+y^3+y^2+x+2*y+x^2, \
23
>  x^2*y^2+2*x^3+x^2*y+y^3+2*x^2+2*x*y+y^2+2*y\
24
>  ]", 1, 3, F3xy );;
25
gap> LoadPackage( "Modules" );;
26
gap> I := RightPresentation( M );;
27
gap> M00 := HomalgLocalMatrix( M, R00 );;
28
gap> M10 := HomalgLocalMatrix( M, R10 );;
29
gap> MMora := HomalgLocalMatrix( M, RMora );;
30
gap> I00 := RightPresentation( M00 );;
31
gap> I10 := RightPresentation( M10 );;
32
gap> IMora := RightPresentation( MMora );;
33

34
35
This ring is able to compute a standard basis of the module.
36
37
 Example 
38
gap> Display( IMora );
39
GF(3)[x,y]_< x, y >/< (x+x^2-x*y-y^2+x*y^2+y^3+y^4)/1, (x-y+x^2+y^2-x^2*y+y^3+\
40
x*y^3)/1, (-y-x^2-x*y+y^2-x^3+x^2*y+y^3+x^2*y^2)/1 >
41
gap> ByASmallerPresentation( IMora );
42
<A cyclic torsion right module on a cyclic generator satisfying 2 relations>
43
gap> Display( IMora );
44
GF(3)[x,y]_< x, y >/< x/1, y/1 >
45

46
47
This ring recognizes, that the module is not zero, but is not able to find
48
better generators.
49
50
 Example 
51
gap> Display( I00 );
52
GF(3)[x,y]_< x, y >/< (y^4+x*y^2+y^3+x^2-x*y-y^2+x)/1, (x*y^3-x^2*y+y^3+x^2+y^\
53
2+x-y)/1, (x^2*y^2-x^3+x^2*y+y^3-x^2-x*y+y^2-y)/1 >
54
gap> ByASmallerPresentation( I00 );
55
<A cyclic right module on a cyclic generator satisfying 3 relations>
56
gap> Display( I00 );
57
GF(3)[x,y]_< x, y >/< (y^4+x*y^2+y^3+x^2-x*y-y^2+x)/1, (x*y^3-x^2*y+y^3+x^2+y^\
58
2+x-y)/1, (x^2*y^2-x^3+x^2*y+y^3-x^2-x*y+y^2-y)/1 >
59

60
61
We are able to change the ring, to compute a nicer basis.
62
63
 Example 
64
gap> I00ToMora := RMora * I00;
65
<A cyclic right module on a cyclic generator satisfying 3 relations>
66
gap> Display( I00ToMora );
67
GF(3)[x,y]_< x, y >/< (x+x^2-x*y-y^2+x*y^2+y^3+y^4)/1, (x-y+x^2+y^2-x^2*y+y^3+\
68
x*y^3)/1, (-y-x^2-x*y+y^2-x^3+x^2*y+y^3+x^2*y^2)/1 >
69
gap> ByASmallerPresentation( I00ToMora );
70
<A cyclic torsion right module on a cyclic generator satisfying 2 relations>
71
gap> Display( I00ToMora );
72
GF(3)[x,y]_< x, y >/< x/1, y/1 >
73

74
75
We are able to find out, that this module is actually zero.
76
77
 Example 
78
gap> Display( I10 );
79
GF(3)[x,y]_< x-1, y >/< (y^4+x*y^2+y^3+x^2-x*y-y^2+x)/1, (x*y^3-x^2*y+y^3+x^2+\
80
y^2+x-y)/1, (x^2*y^2-x^3+x^2*y+y^3-x^2-x*y+y^2-y)/1 >
81
gap> ByASmallerPresentation( I10 );
82
<A zero right module>
83
gap> Display( I10 );
84
0
85

86
87
88
5.2 Hom(Hom(-,Z128),Z16)
89
90
The following example is taken from Section 2 of [BR06].
91
The computation takes place over the local ring R=ℤ_⟨ 2⟩ (i.e. ℤ localized
92
at the maximal ideal generated by 2).
93
94
Here we compute the (infinite) long exact homology sequence of the covariant
95
functor Hom(Hom(-,R/2^7R),R/2^4R) (and its left derived functors) applied to
96
the short exact sequence
97
0 -> M_=R/2^2R --alpha_1--> M=R/2^5R --alpha_2--> _M=R/2^3R -> 0.
98
99
 Example 
100
gap> LoadPackage( "LocalizeRingForHomalg" );;
101
gap> GlobalR := HomalgRingOfIntegersInExternalGAP( );
102
Z
103
gap> Display( GlobalR );
104
<An external ring residing in the CAS GAP>
105
gap> LoadPackage( "RingsForHomalg" );;
106
gap> R := LocalizeAt( GlobalR , [ 2 ] );
107
Z_< 2 >
108
gap> Display( R );
109
<A local ring>
110
gap> M := LeftPresentation( HomalgMatrix( [ 2^5 ], R ) );
111
<A cyclic left module presented by 1 relation for a cyclic generator>
112
gap> _M := LeftPresentation( HomalgMatrix( [ 2^3 ], R ) );
113
<A cyclic left module presented by 1 relation for a cyclic generator>
114
gap> alpha2 := HomalgMap( HomalgMatrix( [ 1 ], R ), M, _M );
115
<A "homomorphism" of left modules>
116
gap> M_ := Kernel( alpha2 );
117
<A cyclic left module presented by yet unknown relations for a cyclic generato\
118
r>
119
gap> alpha1 := KernelEmb( alpha2 );
120
<A monomorphism of left modules>
121
gap> seq := HomalgComplex( alpha2 );
122
<A "complex" containing a single morphism of left modules at degrees
123
[ 0 .. 1 ]>
124
gap> Add( seq, alpha1 );
125
gap> IsShortExactSequence( seq );
126
true
127
gap> K := LeftPresentation( HomalgMatrix( [ 2^7 ], R ) );
128
<A cyclic left module presented by 1 relation for a cyclic generator>
129
gap> L := RightPresentation( HomalgMatrix( [ 2^4 ], R ) );
130
<A cyclic right module on a cyclic generator satisfying 1 relation>
131
gap> triangle := LHomHom( 4, seq, K, L, "t" );
132
<An exact triangle containing 3 morphisms of left complexes at degrees
133
[ 1, 2, 3, 1 ]>
134
gap> lehs := LongSequence( triangle );
135
<A sequence containing 14 morphisms of left modules at degrees [ 0 .. 14 ]>
136
gap> ByASmallerPresentation( lehs );
137
<A non-zero sequence containing 14 morphisms of left modules at degrees
138
[ 0 .. 14 ]>
139
gap> IsExactSequence( lehs );
140
true
141

142
143
144
5.3 ResidueClass
145
146
We want to show, how localization can work together with residue class
147
rings.
148
149
 Example 
150
gap> LoadPackage( "RingsForHomalg" );;
151
gap> Qxy := HomalgFieldOfRationalsInDefaultCAS( ) * "x,y";
152
Q[x,y]
153
gap> wmat := HomalgMatrix(
154
>  "[ y^3-y^2 , x^3-x^2 , y^3+y^2 , x^3+x^2 ]",
155
>  2, 2, Qxy );
156
<A 2 x 2 matrix over an external ring>
157
gap> ec := HomalgRingElement( "-x^3-x^2+2*y^2", Qxy );
158
-x^3-x^2+2*y^2
159

160
161
Compute globally:
162
163
 Example 
164
gap> LoadPackage( "Modules" );;
165
gap> W := LeftPresentation( wmat );
166
<A left module presented by 2 relations for 2 generators>
167
gap> Res := Resolution( 2 , W );
168
<A right acyclic complex containing 2 morphisms of left modules at degrees
169
[ 0 .. 2 ]>
170
gap> Display( Res );
171
-------------------------
172
at homology degree: 2
173
0
174
-------------------------
175
(an empty 0 x 2 matrix)
176

177
the map is currently represented by the above 0 x 2 matrix
178
------------v------------
179
at homology degree: 1
180
Q[x,y]^(1 x 2)
181
-------------------------
182
y^2, x^2,
183
x*y^2-y^3,0
184

185
the map is currently represented by the above 2 x 2 matrix
186
------------v------------
187
at homology degree: 0
188
Q[x,y]^(1 x 2)
189
-------------------------
190

191
192
Try a localization of a residue class ring:
193
194
 Example 
195
gap> R1 := Qxy / ec;
196
Q[x,y]/( -x^3-x^2+2*y^2 )
197
gap> Display( R1 );
198
<A residue class ring>
199
gap> wmat1 := R1 * wmat;
200
<A 2 x 2 matrix over a residue class ring>
201
gap> LoadPackage( "LocalizeRingForHomalg" );;
202
gap> R10 := LocalizeAt( R1 ,
203
>  [ HomalgRingElement( "x", R1 ),
204
>  HomalgRingElement( "y", R1 ) ]
205
>  );
206
Q[x,y]/( x^3+x^2-2*y^2 )_< |[ x ]|, |[ y ]| >
207
gap> Display( R10 );
208
<A local ring>
209
gap> wmat10 := HomalgLocalMatrix( wmat, R10 );
210
<A 2 x 2 matrix over a local ring>
211
gap> W10 := LeftPresentation( wmat10 );
212
<A left module presented by 2 relations for 2 generators>
213
gap> Res10 := Resolution( 2 , W10 );
214
<A right acyclic complex containing 2 morphisms of left modules at degrees
215
[ 0 .. 2 ]>
216
gap> Display( Res10 );
217
-------------------------
218
at homology degree: 2
219
0
220
-------------------------
221
(an empty 0 x 2 matrix)
222

223
the map is currently represented by the above 0 x 2 matrix
224
------------v------------
225
at homology degree: 1
226
Q[x,y]/( x^3+x^2-2*y^2 )_< |[ x ]|, |[ y ]| >^(1 x 2)
227
-------------------------
228
0, x*y^2-y^3,
229
y^2,y^4-2*y^3+2*y^2
230

231
modulo [ x^3+x^2-2*y^2 ]
232
/ |[ 1 ]|
233

234
the map is currently represented by the above 2 x 2 matrix
235
------------v------------
236
at homology degree: 0
237
Q[x,y]/( x^3+x^2-2*y^2 )_< |[ x ]|, |[ y ]| >^(1 x 2)
238
-------------------------
239

240
241
Try a residue class ring of a localization:
242
243
 Example 
244
gap> R0 := LocalizeAtZero( Qxy );
245
Q[x,y]_< x, y >
246
gap> Display( R0 );
247
<A local ring>
248
gap> wmat0 := R0 * wmat;
249
<A 2 x 2 matrix over a local ring>
250
gap> R01 := R0 / ( ec / R0 );
251
Q[x,y]_< x, y >/( (-x^3-x^2+2*y^2)/1 )
252
gap> Display( R01 );
253
<A residue class ring>
254
gap> wmat01 := R01 * wmat0;
255
<A 2 x 2 matrix over a residue class ring>
256
gap> W01 := LeftPresentation( wmat01 );
257
<A left module presented by 2 relations for 2 generators>
258
gap> Res01 := Resolution( 2 , W01 );
259
<A right acyclic complex containing 2 morphisms of left modules at degrees
260
[ 0 .. 2 ]>
261
gap> Display( Res01 );
262
-------------------------
263
at homology degree: 2
264
0
265
-------------------------
266
(an empty 0 x 2 matrix)
267

268
the map is currently represented by the above 0 x 2 matrix
269
------------v------------
270
at homology degree: 1
271
Q[x,y]_< x, y >/( (x^3+x^2-2*y^2)/1 )^(1 x 2)
272
-------------------------
273
y^2, x^2,
274
y^3+y^2,2*y^2
275
/ 1
276

277
modulo [ (x^3+x^2-2*y^2)/1 ]
278

279
the map is currently represented by the above 2 x 2 matrix
280
------------v------------
281
at homology degree: 0
282
Q[x,y]_< x, y >/( (x^3+x^2-2*y^2)/1 )^(1 x 2)
283
-------------------------
284

285
286
287
5.4 Testing the Intersection Formula
288
289
We want to check Serre's intersection formula i(I_1, I_2; 0)=∑_i(-1)^i
290
length(Tor^R_0_i(R_0/I_1,R_0/I_2)) on an easy affine example.
291
292
 Example 
293
 
294
gap> LoadPackage( "RingsForHomalg" );;
295
gap> R := HomalgFieldOfRationalsInSingular() * "w,x,y,z";;
296
gap> LoadPackage( "LocalizeRingForHomalg" );;
297
gap> R0 := LocalizePolynomialRingAtZeroWithMora( R );;
298
gap> M1 := HomalgMatrix( "[\
299
>  (w-x^2)*y, \
300
>  (w-x^2)*z, \
301
>  (x-w^2)*y, \
302
>  (x-w^2)*z \
303
>  ]", 4, 1, R );;
304
gap> M2 := HomalgMatrix( "[\
305
>  (w-x^2)-y, \
306
>  (x-w^2)-z \
307
>  ]", 2, 1, R );;
308
gap> LoadPackage( "Modules" );;
309
gap> RmodI1 := LeftPresentation( M1 );;
310
gap> RmodI2 := LeftPresentation( M2 );;
311
gap> T:=Tor( RmodI1, RmodI2 );
312
<A graded homology object consisting of 4 left modules at degrees [ 0 .. 3 ]>
313
gap> List( ObjectsOfComplex( T ), AffineDegree );
314
[ 12, 4, 0, 0 ]
315

316
317
We read, that the intersection multiplicity is 12-4=8 globally.
318
319
 Example 
320
gap> M10 := R0 * M1;
321
<A 4 x 1 matrix over a local (Mora) ring>
322
gap> M20 := R0 * M2;
323
<A 2 x 1 matrix over a local (Mora) ring>
324
gap> R0modI10 := LeftPresentation( M10 );;
325
gap> R0modI20 := LeftPresentation( M20 );;
326
gap> T0 := Tor( R0modI10, R0modI20 );
327
<A graded homology object consisting of 4 left modules at degrees [ 0 .. 3 ]>
328
gap> List( ObjectsOfComplex( T0 ), AffineDegree );
329
[ 3, 1, 0, 0 ]
330

331
332
The intersection multiplicity at zero is 3-1=2.
333
334
335