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
2 Examples and Tests
3
4
5
2.1 Annihilator
6
7
 Example 
8
gap> ZZ := HomalgRingOfIntegersInSingular();;
9
gap> M1 := AsLeftPresentation( HomalgMatrix( [ [ "2" ] ], ZZ ) );;
10
gap> M2 := AsLeftPresentation( HomalgMatrix( [ [ "3" ] ], ZZ ) );;
11
gap> M3 := AsLeftPresentation( HomalgMatrix( [ [ "4" ] ], ZZ ) );;
12
gap> M := DirectSum( M1, M2, M3 );;
13
gap> Display( Annihilator( M ) );
14
12
15

16
A monomorphism in Category of left presentations of Z
17
gap> M1 := AsRightPresentation( HomalgMatrix( [ [ "2" ] ], ZZ ) );;
18
gap> M2 := AsRightPresentation( HomalgMatrix( [ [ "3" ] ], ZZ ) );;
19
gap> M3 := AsRightPresentation( HomalgMatrix( [ [ "4" ] ], ZZ ) );;
20
gap> M := DirectSum( M1, M2, M3 );;
21
gap> Display( Annihilator( M ) );
22
12
23

24
A monomorphism in Category of right presentations of Z
25

26
27
28
2.2 Intersection of Submodules
29
30
 Example 
31
gap> Q := HomalgFieldOfRationalsInSingular();;
32
gap> R := Q * "x,y";
33
Q[x,y]
34
gap> F := AsLeftPresentation( HomalgMatrix( [ [ 0 ] ], R ) );
35
<An object in Category of left presentations of Q[x,y]>
36
gap> I1 := AsLeftPresentation( HomalgMatrix( [ [ "x" ] ], R ) );;
37
gap> I2 := AsLeftPresentation( HomalgMatrix( [ [ "y" ] ], R ) );;
38
gap> Display( I1 );
39
x
40

41
An object in Category of left presentations of Q[x,y]
42
gap> Display( I2 );
43
y
44

45
An object in Category of left presentations of Q[x,y]
46
gap> eps1 := PresentationMorphism( F, HomalgMatrix( [ [ 1 ] ], R ), I1 );
47
<A morphism in Category of left presentations of Q[x,y]>
48
gap> eps2 := PresentationMorphism( F, HomalgMatrix( [ [ 1 ] ], R ), I2 );
49
<A morphism in Category of left presentations of Q[x,y]>
50
gap> kernelemb1 := KernelEmbedding( eps1 );
51
<A monomorphism in Category of left presentations of Q[x,y]>
52
gap> kernelemb2 := KernelEmbedding( eps2 );
53
<A monomorphism in Category of left presentations of Q[x,y]>
54
gap> P := FiberProduct( kernelemb1, kernelemb2 );;
55
gap> Display( P );
56
(an empty 0 x 1 matrix)
57

58
An object in Category of left presentations of Q[x,y]
59
gap> pi1 := ProjectionInFactorOfFiberProduct( [ kernelemb1, kernelemb2 ], 1 );
60
<A monomorphism in Category of left presentations of Q[x,y]>
61
gap> composite := PreCompose( pi1, kernelemb1 );
62
<A monomorphism in Category of left presentations of Q[x,y]>
63
gap> Display( composite );
64
x*y
65

66
A monomorphism in Category of left presentations of Q[x,y]
67

68
69
70
2.3 Koszul Complex
71
72
 Example 
73
gap> Q := HomalgFieldOfRationalsInSingular();;
74
gap> R := Q * "x,y,z";;
75
gap> M := HomalgMatrix( [ [ "x" ], [ "y" ], [ "z" ] ], 3, 1, R );;
76
gap> Ml := AsLeftPresentation( M );;
77
gap> eps := CoverByFreeModule( Ml );;
78
gap> iota1 := KernelEmbedding( eps );;
79
gap> Display( iota1 );
80
x,
81
y,
82
z 
83

84
A monomorphism in Category of left presentations of Q[x,y,z]
85
gap> Display( Source( iota1 ) );
86
0, -z,y,
87
-y,x, 0,
88
-z,0, x 
89

90
An object in Category of left presentations of Q[x,y,z]
91
gap> pi1 := CoverByFreeModule( Source( iota1 ) );;
92
gap> d1 := PreCompose( pi1, iota1 );;
93
gap> Display( d1 );
94
x,
95
y,
96
z 
97

98
A morphism in Category of left presentations of Q[x,y,z]
99
gap> iota2 := KernelEmbedding( d1 );;
100
gap> Display( iota2 );
101
0, -z,y,
102
-y,x, 0,
103
-z,0, x 
104

105
A monomorphism in Category of left presentations of Q[x,y,z]
106
gap> Display( Source( iota2 ) );;
107
x,z,-y
108

109
An object in Category of left presentations of Q[x,y,z]
110
gap> pi2 := CoverByFreeModule( Source( iota2 ) );;
111
gap> d2 := PreCompose( pi2, iota2 );;
112
gap> Display( d2 );
113
0, -z,y,
114
-y,x, 0,
115
-z,0, x 
116

117
A morphism in Category of left presentations of Q[x,y,z]
118
gap> iota3 := KernelEmbedding( d2 );;
119
gap> Display( iota3 );
120
x,z,-y
121

122
A monomorphism in Category of left presentations of Q[x,y,z]
123
gap> Display( Source( iota3 ) );
124
(an empty 0 x 1 matrix)
125

126
An object in Category of left presentations of Q[x,y,z]
127
gap> pi3 := CoverByFreeModule( Source( iota3 ) );;
128
gap> d3 := PreCompose( pi3, iota3 );;
129
gap> Display( d3 );
130
x,z,-y
131

132
A morphism in Category of left presentations of Q[x,y,z]
133
gap> N := HomalgMatrix( [ [ "x" ] ], 1, 1, R );;
134
gap> Nl := AsLeftPresentation( N );;
135
gap> d2Nl := TensorProductOnMorphisms( d2, IdentityMorphism( Nl ) );;
136
gap> d1Nl := TensorProductOnMorphisms( d1, IdentityMorphism( Nl ) );;
137
gap> IsZero( PreCompose( d2Nl, d1Nl ) );
138
true
139
gap> cycles := KernelEmbedding( d1Nl );;
140
gap> boundaries := ImageEmbedding( d2Nl );;
141
gap> boundaries_in_cyles := LiftAlongMonomorphism( cycles, boundaries );;
142
gap> homology := CokernelObject( boundaries_in_cyles );;
143
gap> LessGenFunctor := FunctorLessGeneratorsLeft( R );;
144
gap> homology := ApplyFunctor( LessGenFunctor, homology );;
145
gap> StdBasisFunctor := FunctorStandardModuleLeft( R );;
146
gap> homology := ApplyFunctor( StdBasisFunctor, homology );;
147
gap> Display( homology );
148
z,
149
y,
150
x 
151

152
An object in Category of left presentations of Q[x,y,z]
153

154
155
156
2.4 Closed Monoidal Structure
157
158
 Example 
159
gap> R := HomalgRingOfIntegers( );;
160
gap> M := AsLeftPresentation( HomalgMatrix( [ [ 2 ] ], 1, 1, R ) );
161
<An object in Category of left presentations of Z>
162
gap> N := AsLeftPresentation( HomalgMatrix( [ [ 3 ] ], 1, 1, R ) );
163
<An object in Category of left presentations of Z>
164
gap> T := TensorProductOnObjects( M, N );
165
<An object in Category of left presentations of Z>
166
gap> Display( T );
167
[ [ 3 ],
168
 [ 2 ] ]
169

170
An object in Category of left presentations of Z
171
gap> IsZero( T );
172
true
173
gap> H := InternalHomOnObjects( DirectSum( M, M ), DirectSum( M, N ) );
174
<An object in Category of left presentations of Z>
175
gap> Display( H );
176
[ [ -4, -2 ],
177
 [ 2, 2 ] ]
178

179
An object in Category of left presentations of Z
180
gap> alpha := StandardGeneratorMorphism( H, 1 );
181
<A morphism in Category of left presentations of Z>
182
gap> l := LambdaElimination( DirectSum( M, M ), DirectSum( M, N ), alpha );
183
<A morphism in Category of left presentations of Z>
184
gap> IsZero( l );
185
false
186
gap> Display( l );
187
[ [ 0, 0 ],
188
 [ 1, 0 ] ]
189

190
A morphism in Category of left presentations of Z
191
gap> alpha2 := StandardGeneratorMorphism( H, 2 );
192
<A morphism in Category of left presentations of Z>
193
gap> l2 := LambdaElimination( DirectSum( M, M ), DirectSum( M, N ), alpha2 );
194
<A morphism in Category of left presentations of Z>
195
gap> IsZero( l2 );
196
false
197
gap> Display( l2 );
198
[ [ 1, 0 ],
199
 [ 0, 0 ] ]
200

201
A morphism in Category of left presentations of Z
202

203
204
205