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
<?xml version="1.0" encoding="UTF-8"?>
2
3
<!-- This is an automatically generated file. -->
4
<Chapter Label="Chapter_Examples_and_Tests">
5
<Heading>Examples and Tests</Heading>
6
7
<Section Label="Chapter_Examples_and_Tests_Section_Annihilator">
8
<Heading>Annihilator</Heading>
9
10
<Example><![CDATA[
11
gap> ZZ := HomalgRingOfIntegersInSingular();;
12
gap> M1 := AsLeftPresentation( HomalgMatrix( [ [ "2" ] ], ZZ ) );;
13
gap> M2 := AsLeftPresentation( HomalgMatrix( [ [ "3" ] ], ZZ ) );;
14
gap> M3 := AsLeftPresentation( HomalgMatrix( [ [ "4" ] ], ZZ ) );;
15
gap> M := DirectSum( M1, M2, M3 );;
16
gap> Display( Annihilator( M ) );
17
12
18
19
A monomorphism in Category of left presentations of Z
20
gap> M1 := AsRightPresentation( HomalgMatrix( [ [ "2" ] ], ZZ ) );;
21
gap> M2 := AsRightPresentation( HomalgMatrix( [ [ "3" ] ], ZZ ) );;
22
gap> M3 := AsRightPresentation( HomalgMatrix( [ [ "4" ] ], ZZ ) );;
23
gap> M := DirectSum( M1, M2, M3 );;
24
gap> Display( Annihilator( M ) );
25
12
26
27
A monomorphism in Category of right presentations of Z
28
]]></Example>
29
30
31
</Section>
32
33
34
<Section Label="Chapter_Examples_and_Tests_Section_Intersection_of_Submodules">
35
<Heading>Intersection of Submodules</Heading>
36
37
<Example><![CDATA[
38
gap> Q := HomalgFieldOfRationalsInSingular();;
39
gap> R := Q * "x,y";
40
Q[x,y]
41
gap> F := AsLeftPresentation( HomalgMatrix( [ [ 0 ] ], R ) );
42
<An object in Category of left presentations of Q[x,y]>
43
gap> I1 := AsLeftPresentation( HomalgMatrix( [ [ "x" ] ], R ) );;
44
gap> I2 := AsLeftPresentation( HomalgMatrix( [ [ "y" ] ], R ) );;
45
gap> Display( I1 );
46
x
47
48
An object in Category of left presentations of Q[x,y]
49
gap> Display( I2 );
50
y
51
52
An object in Category of left presentations of Q[x,y]
53
gap> eps1 := PresentationMorphism( F, HomalgMatrix( [ [ 1 ] ], R ), I1 );
54
<A morphism in Category of left presentations of Q[x,y]>
55
gap> eps2 := PresentationMorphism( F, HomalgMatrix( [ [ 1 ] ], R ), I2 );
56
<A morphism in Category of left presentations of Q[x,y]>
57
gap> kernelemb1 := KernelEmbedding( eps1 );
58
<A monomorphism in Category of left presentations of Q[x,y]>
59
gap> kernelemb2 := KernelEmbedding( eps2 );
60
<A monomorphism in Category of left presentations of Q[x,y]>
61
gap> P := FiberProduct( kernelemb1, kernelemb2 );;
62
gap> Display( P );
63
(an empty 0 x 1 matrix)
64
65
An object in Category of left presentations of Q[x,y]
66
gap> pi1 := ProjectionInFactorOfFiberProduct( [ kernelemb1, kernelemb2 ], 1 );
67
<A monomorphism in Category of left presentations of Q[x,y]>
68
gap> composite := PreCompose( pi1, kernelemb1 );
69
<A monomorphism in Category of left presentations of Q[x,y]>
70
gap> Display( composite );
71
x*y
72
73
A monomorphism in Category of left presentations of Q[x,y]
74
]]></Example>
75
76
77
</Section>
78
79
80
<Section Label="Chapter_Examples_and_Tests_Section_Koszul_Complex">
81
<Heading>Koszul Complex</Heading>
82
83
<Example><![CDATA[
84
gap> Q := HomalgFieldOfRationalsInSingular();;
85
gap> R := Q * "x,y,z";;
86
gap> M := HomalgMatrix( [ [ "x" ], [ "y" ], [ "z" ] ], 3, 1, R );;
87
gap> Ml := AsLeftPresentation( M );;
88
gap> eps := CoverByFreeModule( Ml );;
89
gap> iota1 := KernelEmbedding( eps );;
90
gap> Display( iota1 );
91
x,
92
y,
93
z
94
95
A monomorphism in Category of left presentations of Q[x,y,z]
96
gap> Display( Source( iota1 ) );
97
0, -z,y,
98
-y,x, 0,
99
-z,0, x
100
101
An object in Category of left presentations of Q[x,y,z]
102
gap> pi1 := CoverByFreeModule( Source( iota1 ) );;
103
gap> d1 := PreCompose( pi1, iota1 );;
104
gap> Display( d1 );
105
x,
106
y,
107
z
108
109
A morphism in Category of left presentations of Q[x,y,z]
110
gap> iota2 := KernelEmbedding( d1 );;
111
gap> Display( iota2 );
112
0, -z,y,
113
-y,x, 0,
114
-z,0, x
115
116
A monomorphism in Category of left presentations of Q[x,y,z]
117
gap> Display( Source( iota2 ) );;
118
x,z,-y
119
120
An object in Category of left presentations of Q[x,y,z]
121
gap> pi2 := CoverByFreeModule( Source( iota2 ) );;
122
gap> d2 := PreCompose( pi2, iota2 );;
123
gap> Display( d2 );
124
0, -z,y,
125
-y,x, 0,
126
-z,0, x
127
128
A morphism in Category of left presentations of Q[x,y,z]
129
gap> iota3 := KernelEmbedding( d2 );;
130
gap> Display( iota3 );
131
x,z,-y
132
133
A monomorphism in Category of left presentations of Q[x,y,z]
134
gap> Display( Source( iota3 ) );
135
(an empty 0 x 1 matrix)
136
137
An object in Category of left presentations of Q[x,y,z]
138
gap> pi3 := CoverByFreeModule( Source( iota3 ) );;
139
gap> d3 := PreCompose( pi3, iota3 );;
140
gap> Display( d3 );
141
x,z,-y
142
143
A morphism in Category of left presentations of Q[x,y,z]
144
gap> N := HomalgMatrix( [ [ "x" ] ], 1, 1, R );;
145
gap> Nl := AsLeftPresentation( N );;
146
gap> d2Nl := TensorProductOnMorphisms( d2, IdentityMorphism( Nl ) );;
147
gap> d1Nl := TensorProductOnMorphisms( d1, IdentityMorphism( Nl ) );;
148
gap> IsZero( PreCompose( d2Nl, d1Nl ) );
149
true
150
gap> cycles := KernelEmbedding( d1Nl );;
151
gap> boundaries := ImageEmbedding( d2Nl );;
152
gap> boundaries_in_cyles := LiftAlongMonomorphism( cycles, boundaries );;
153
gap> homology := CokernelObject( boundaries_in_cyles );;
154
gap> LessGenFunctor := FunctorLessGeneratorsLeft( R );;
155
gap> homology := ApplyFunctor( LessGenFunctor, homology );;
156
gap> StdBasisFunctor := FunctorStandardModuleLeft( R );;
157
gap> homology := ApplyFunctor( StdBasisFunctor, homology );;
158
gap> Display( homology );
159
z,
160
y,
161
x
162
163
An object in Category of left presentations of Q[x,y,z]
164
]]></Example>
165
166
167
</Section>
168
169
170
<Section Label="Chapter_Examples_and_Tests_Section_Closed_Monoidal_Structure">
171
<Heading>Closed Monoidal Structure</Heading>
172
173
<Example><![CDATA[
174
gap> R := HomalgRingOfIntegers( );;
175
gap> M := AsLeftPresentation( HomalgMatrix( [ [ 2 ] ], 1, 1, R ) );
176
<An object in Category of left presentations of Z>
177
gap> N := AsLeftPresentation( HomalgMatrix( [ [ 3 ] ], 1, 1, R ) );
178
<An object in Category of left presentations of Z>
179
gap> T := TensorProductOnObjects( M, N );
180
<An object in Category of left presentations of Z>
181
gap> Display( T );
182
[ [ 3 ],
183
[ 2 ] ]
184
185
An object in Category of left presentations of Z
186
gap> IsZero( T );
187
true
188
gap> H := InternalHomOnObjects( DirectSum( M, M ), DirectSum( M, N ) );
189
<An object in Category of left presentations of Z>
190
gap> Display( H );
191
[ [ -4, -2 ],
192
[ 2, 2 ] ]
193
194
An object in Category of left presentations of Z
195
gap> alpha := StandardGeneratorMorphism( H, 1 );
196
<A morphism in Category of left presentations of Z>
197
gap> l := LambdaElimination( DirectSum( M, M ), DirectSum( M, N ), alpha );
198
<A morphism in Category of left presentations of Z>
199
gap> IsZero( l );
200
false
201
gap> Display( l );
202
[ [ 0, 0 ],
203
[ 1, 0 ] ]
204
205
A morphism in Category of left presentations of Z
206
gap> alpha2 := StandardGeneratorMorphism( H, 2 );
207
<A morphism in Category of left presentations of Z>
208
gap> l2 := LambdaElimination( DirectSum( M, M ), DirectSum( M, N ), alpha2 );
209
<A morphism in Category of left presentations of Z>
210
gap> IsZero( l2 );
211
false
212
gap> Display( l2 );
213
[ [ 1, 0 ],
214
[ 0, 0 ] ]
215
216
A morphism in Category of left presentations of Z
217
]]></Example>
218
219
220
</Section>
221
222
223
</Chapter>
224
225
226