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_Spectral_Sequences">
8
<Heading>Spectral Sequences</Heading>
9
10
<Example><![CDATA[
11
gap> ZZ := HomalgRingOfIntegersInSingular( );
12
Z
13
gap> C1 := FreeLeftPresentation( 1, ZZ );
14
<An object in Category of left presentations of Z>
15
gap> C2 := FreeLeftPresentation( 2, ZZ );
16
<An object in Category of left presentations of Z>
17
gap> h1 := PresentationMorphism( C2, HomalgMatrix( [ [ 0 ], [ 4 ] ], ZZ ), C1 );
18
<A morphism in Category of left presentations of Z>
19
gap> h2 := PresentationMorphism( C2, HomalgMatrix( [ [ 0 ], [ 2 ] ], ZZ ), C1 );
20
<A morphism in Category of left presentations of Z>
21
gap> v1 := PresentationMorphism( C2, HomalgMatrix( [ [ 2, 0 ], [ 1, 2 ] ], ZZ ), C2 );
22
<A morphism in Category of left presentations of Z>
23
gap> v2 := PresentationMorphism( C1, HomalgMatrix( [ [ 4 ] ], ZZ ), C1 );
24
<A morphism in Category of left presentations of Z>
25
gap> cocomplex_h1 := CocomplexFromMorphismList( [ h1 ] );
26
<An object in Cocomplex category of Category of left presentations of Z>
27
gap> cocomplex_h2 := CocomplexFromMorphismList( [ h2 ] );
28
<An object in Cocomplex category of Category of left presentations of Z>
29
gap> cocomplex_mor := CochainMap( cocomplex_h2, [ v1, v2 ], cocomplex_h1 );
30
<A morphism in Cocomplex category of Category of left presentations of Z>
31
gap> Zmod := CapCategory( C1 );
32
Category of left presentations of Z
33
gap> CH0 := CohomologyFunctor( Zmod, 0 );
34
0-th cohomology functor of Category of left presentations of Z
35
gap> cmor0 := ApplyFunctor( CH0, cocomplex_mor );
36
<A morphism in Category of left presentations of Z>
37
gap> Display( UnderlyingMatrix( cmor0 ) );
38
2
39
gap> CH1 := CohomologyFunctor( Zmod, 1 );
40
1-th cohomology functor of Category of left presentations of Z
41
gap> cmor1 := ApplyFunctor( CH1, cocomplex_mor );
42
<A morphism in Category of left presentations of Z>
43
gap> Display( UnderlyingMatrix( cmor1 ) );
44
4
45
gap> ToComplex := CocomplexToComplexFunctor( Zmod );
46
Cocomplex to complex functor of Category of left presentations of Z
47
gap> complex_mor := ApplyFunctor( ToComplex, cocomplex_mor );
48
<A morphism in Complex category of Category of left presentations of Z>
49
gap> H0 := HomologyFunctor( Zmod, 0 );
50
0-th homology functor of Category of left presentations of Z
51
gap> mor0 := ApplyFunctor( H0, complex_mor );
52
<A morphism in Category of left presentations of Z>
53
gap> Display( UnderlyingMatrix( mor0 ) );
54
2
55
gap> Hm1 := HomologyFunctor( Zmod, -1 );
56
-1-th homology functor of Category of left presentations of Z
57
gap> mor1 := ApplyFunctor( Hm1, complex_mor );
58
<A morphism in Category of left presentations of Z>
59
gap> Display( UnderlyingMatrix( mor1 ) );
60
4
61
]]></Example>
62
63
64
<Example><![CDATA[
65
gap> QQ := HomalgFieldOfRationalsInSingular( );;
66
gap> R := QQ * "x,y";
67
Q[x,y]
68
gap> SetRecursionTrapInterval( 10000 );
69
gap> category := LeftPresentations( R );
70
Category of left presentations of Q[x,y]
71
gap> S := FreeLeftPresentation( 1, R );
72
<An object in Category of left presentations of Q[x,y]>
73
gap> object_func := function( i ) return S; end;
74
function( i ) ... end
75
gap> morphism_func := function( i ) return IdentityMorphism( S ); end;
76
function( i ) ... end
77
gap> C0 := ZFunctorObjectExtendedByInitialAndIdentity( object_func, morphism_func, category, 0, 4 );
78
<An object in Functors from integers into Category of left presentations of Q[x,y]>
79
gap> S2 := FreeLeftPresentation( 2, R );
80
<An object in Category of left presentations of Q[x,y]>
81
gap> C1 := ZFunctorObjectFromMorphismList( [ InjectionOfCofactorOfDirectSum( [ S2, S ], 1 ) ], 2 );
82
<An object in Functors from integers into Category of left presentations of Q[x,y]>
83
gap> C1 := ZFunctorObjectExtendedByInitialAndIdentity( C1, 2, 3 );
84
<An object in Functors from integers into Category of left presentations of Q[x,y]>
85
gap> C2 := ZFunctorObjectFromMorphismList( [ InjectionOfCofactorOfDirectSum( [ S, S ], 1 ) ], 3 );
86
<An object in Functors from integers into Category of left presentations of Q[x,y]>
87
gap> C2 := ZFunctorObjectExtendedByInitialAndIdentity( C2, 3, 4 );
88
<An object in Functors from integers into Category of left presentations of Q[x,y]>
89
gap> delta_1_3 := PresentationMorphism( C1[3], HomalgMatrix( [ [ "x^2" ], [ "xy" ], [ "y^3"] ], 3, 1, R ), C0[3] );
90
<A morphism in Category of left presentations of Q[x,y]>
91
gap> delta_1_2 := PresentationMorphism( C1[2], HomalgMatrix( [ [ "x^2" ], [ "xy" ] ], 2, 1, R ), C0[2] );
92
<A morphism in Category of left presentations of Q[x,y]>
93
gap> delta1 := ZFunctorMorphism( C1, [ UniversalMorphismFromInitialObject( C0[1] ), UniversalMorphismFromInitialObject( C0[1] ), delta_1_2, delta_1_3 ], 0, C0 );
94
<A morphism in Functors from integers into Category of left presentations of Q[x,y]>
95
gap> delta1 := ZFunctorMorphismExtendedByInitialAndIdentity( delta1, 0, 3 );
96
<A morphism in Functors from integers into Category of left presentations of Q[x,y]>
97
gap> delta1 := AsAscendingFilteredMorphism( delta1 );
98
<A morphism in Ascending filtered object category of Category of left presentations of Q[x,y]>
99
gap> delta_2_3 := PresentationMorphism( C2[3], HomalgMatrix( [ [ "y", "-x", "0" ] ], 1, 3, R ), C1[3] );
100
<A morphism in Category of left presentations of Q[x,y]>
101
gap> delta_2_4 := PresentationMorphism( C2[4], HomalgMatrix( [ [ "y", "-x", "0" ], [ "0", "y^2", "-x" ] ], 2, 3, R ), C1[4] );
102
<A morphism in Category of left presentations of Q[x,y]>
103
gap> delta2 := ZFunctorMorphism( C2, [ UniversalMorphismFromInitialObject( C1[2] ), delta_2_3, delta_2_4 ], 2, C1 );
104
<A morphism in Functors from integers into Category of left presentations of Q[x,y]>
105
gap> delta2 := ZFunctorMorphismExtendedByInitialAndIdentity( delta2, 2, 4 );
106
<A morphism in Functors from integers into Category of left presentations of Q[x,y]>
107
gap> delta2 := AsAscendingFilteredMorphism( delta2 );
108
<A morphism in Ascending filtered object category of Category of left presentations of Q[x,y]>
109
gap> SetIsAdditiveCategory( CategoryOfAscendingFilteredObjects( category ), true );
110
gap> complex := ZFunctorObjectFromMorphismList( [ delta2, delta1 ], -2 );
111
<An object in Functors from integers into Ascending filtered object category of Category of left presentations of Q[x,y]>
112
gap> complex := AsComplex( complex );
113
<An object in Complex category of Ascending filtered object category of Category of left presentations of Q[x,y]>
114
gap> LessGenFunctor := FunctorLessGeneratorsLeft( R );
115
Less generators for Category of left presentations of Q[x,y]
116
gap> s := SpectralSequenceEntryOfAscendingFilteredComplex( complex, 0, 0, 0 );
117
<A morphism in Generalized morphism category of Category of left presentations of Q[x,y]>
118
gap> Display( UnderlyingMatrix( ApplyFunctor( LessGenFunctor, UnderlyingHonestObject( Source( s ) ) ) ) );
119
(an empty 0 x 1 matrix)
120
gap> s := SpectralSequenceEntryOfAscendingFilteredComplex( complex, 1, 0, 0 );
121
<A morphism in Generalized morphism category of Category of left presentations of Q[x,y]>
122
gap> Display( UnderlyingMatrix( ApplyFunctor( LessGenFunctor, UnderlyingHonestObject( Source( s ) ) ) ) );
123
(an empty 0 x 1 matrix)
124
gap> s := SpectralSequenceEntryOfAscendingFilteredComplex( complex, 2, 0, 0 );
125
<A morphism in Generalized morphism category of Category of left presentations of Q[x,y]>
126
gap> Display( UnderlyingMatrix( ApplyFunctor( LessGenFunctor, UnderlyingHonestObject( Source( s ) ) ) ) );
127
(an empty 0 x 1 matrix)
128
gap> s := SpectralSequenceEntryOfAscendingFilteredComplex( complex, 3, 0, 0 );
129
<A morphism in Generalized morphism category of Category of left presentations of Q[x,y]>
130
gap> Display( UnderlyingMatrix( ApplyFunctor( LessGenFunctor, UnderlyingHonestObject( Source( s ) ) ) ) );
131
x*y,
132
x^2
133
gap> s := SpectralSequenceEntryOfAscendingFilteredComplex( complex, 4, 0, 0 );
134
<A morphism in Generalized morphism category of Category of left presentations of Q[x,y]>
135
gap> Display( UnderlyingMatrix( ApplyFunctor( LessGenFunctor, UnderlyingHonestObject( Source( s ) ) ) ) );
136
x*y,
137
x^2,
138
y^3
139
gap> s := SpectralSequenceEntryOfAscendingFilteredComplex( complex, 5, 0, 0 );
140
<A morphism in Generalized morphism category of Category of left presentations of Q[x,y]>
141
gap> Display( UnderlyingMatrix( ApplyFunctor( LessGenFunctor, UnderlyingHonestObject( Source( s ) ) ) ) );
142
x*y,
143
x^2,
144
y^3
145
gap> s := SpectralSequenceDifferentialOfAscendingFilteredComplex( complex, 3, 3, -2 );
146
<A morphism in Category of left presentations of Q[x,y]>
147
gap> Display( UnderlyingMatrix( ApplyFunctor( LessGenFunctor, s ) ) );
148
y^3
149
gap> AscToDescFunctor := AscendingToDescendingFilteredObjectFunctor( category );
150
Ascending to descending filtered object functor of Category of left presentations of Q[x,y]
151
gap> cocomplex := ZFunctorObjectFromMorphismList( [ ApplyFunctor( AscToDescFunctor, delta2 ), ApplyFunctor( AscToDescFunctor, delta1 ) ], -2 );
152
<An object in Functors from integers into Descending filtered object category of Category of left presentations of Q[x,y]>
153
gap> SetIsAdditiveCategory( CategoryOfDescendingFilteredObjects( category ), true );
154
gap> cocomplex := AsCocomplex( cocomplex );
155
<An object in Cocomplex category of Descending filtered object category of Category of left presentations of Q[x,y]>
156
gap> s := SpectralSequenceEntryOfDescendingFilteredCocomplex( cocomplex, 0, -2, 1 );
157
<A morphism in Generalized morphism category of Category of left presentations of Q[x,y]>
158
gap> Display( UnderlyingMatrix( ApplyFunctor( LessGenFunctor, UnderlyingHonestObject( Source( s ) ) ) ) );
159
(an empty 0 x 2 matrix)
160
gap> s := SpectralSequenceEntryOfDescendingFilteredCocomplex( cocomplex, 1, -2, 1 );
161
<A morphism in Generalized morphism category of Category of left presentations of Q[x,y]>
162
gap> Display( UnderlyingMatrix( ApplyFunctor( LessGenFunctor, UnderlyingHonestObject( Source( s ) ) ) ) );
163
(an empty 0 x 2 matrix)
164
gap> s := SpectralSequenceEntryOfDescendingFilteredCocomplex( cocomplex, 2, -2, 1 );
165
<A morphism in Generalized morphism category of Category of left presentations of Q[x,y]>
166
gap> Display( UnderlyingMatrix( ApplyFunctor( LessGenFunctor, UnderlyingHonestObject( Source( s ) ) ) ) );
167
-y,x
168
gap> s := SpectralSequenceEntryOfDescendingFilteredCocomplex( cocomplex, 3, -2, 1 );
169
<A morphism in Generalized morphism category of Category of left presentations of Q[x,y]>
170
gap> Display( UnderlyingMatrix( ApplyFunctor( LessGenFunctor, UnderlyingHonestObject( Source( s ) ) ) ) );
171
(an empty 0 x 0 matrix)
172
gap> s := SpectralSequenceDifferentialOfDescendingFilteredCocomplex( cocomplex, 2, -2, 1 );
173
<A morphism in Category of left presentations of Q[x,y]>
174
gap> Display( UnderlyingMatrix( ApplyFunctor( LessGenFunctor, s ) ) );
175
x^2,
176
x*y
177
]]></Example>
178
179
180
</Section>
181
182
183
<Section Label="Chapter_Examples_and_Tests_Section_Monoidal_Categories">
184
<Heading>Monoidal Categories</Heading>
185
186
<Example><![CDATA[
187
gap> ZZ := HomalgRingOfIntegers();;
188
gap> Ml := AsLeftPresentation( HomalgMatrix( [ [ 2 ] ], 1, 1, ZZ ) );
189
<An object in Category of left presentations of Z>
190
gap> Nl := AsLeftPresentation( HomalgMatrix( [ [ 3 ] ], 1, 1, ZZ ) );
191
<An object in Category of left presentations of Z>
192
gap> Tl := TensorProductOnObjects( Ml, Nl );
193
<An object in Category of left presentations of Z>
194
gap> Display( UnderlyingMatrix( Tl ) );
195
[ [ 3 ],
196
[ 2 ] ]
197
gap> IsZeroForObjects( Tl );
198
true
199
gap> Bl := Braiding( DirectSum( Ml, Nl ), DirectSum( Ml, Ml ) );
200
<A morphism in Category of left presentations of Z>
201
gap> Display( UnderlyingMatrix( Bl ) );
202
[ [ 1, 0, 0, 0 ],
203
[ 0, 0, 1, 0 ],
204
[ 0, 1, 0, 0 ],
205
[ 0, 0, 0, 1 ] ]
206
gap> IsWellDefined( Bl );
207
true
208
gap> Ul := TensorUnit( CapCategory( Ml ) );
209
<An object in Category of left presentations of Z>
210
gap> IntHoml := InternalHomOnObjects( DirectSum( Ml, Ul ), Nl );
211
<An object in Category of left presentations of Z>
212
gap> Display( UnderlyingMatrix( IntHoml ) );
213
[ [ -2, -1 ],
214
[ 1, -1 ] ]
215
gap> generator_l1 := StandardGeneratorMorphism( IntHoml, 1 );
216
<A morphism in Category of left presentations of Z>
217
gap> morphism_l1 := LambdaElimination( DirectSum( Ml, Ul ), Nl, generator_l1 );
218
<A morphism in Category of left presentations of Z>
219
gap> Display( UnderlyingMatrix( morphism_l1 ) );
220
[ [ 0 ],
221
[ 2 ] ]
222
gap> generator_l2 := StandardGeneratorMorphism( IntHoml, 2 );
223
<A morphism in Category of left presentations of Z>
224
gap> morphism_l2 := LambdaElimination( DirectSum( Ml, Ul ), Nl, generator_l2 );
225
<A morphism in Category of left presentations of Z>
226
gap> Display( UnderlyingMatrix( morphism_l2 ) );
227
[ [ 0 ],
228
[ 2 ] ]
229
gap> IsEqualForMorphisms( LambdaIntroduction( morphism_l1 ), generator_l1 );
230
false
231
gap> IsCongruentForMorphisms( LambdaIntroduction( morphism_l1 ), generator_l1 );
232
true
233
gap> IsEqualForMorphisms( LambdaIntroduction( morphism_l2 ), generator_l2 );
234
false
235
gap> IsCongruentForMorphisms( LambdaIntroduction( morphism_l2 ), generator_l2 );
236
true
237
gap> Mr := AsRightPresentation( HomalgMatrix( [ [ 2 ] ], 1, 1, ZZ ) );
238
<An object in Category of right presentations of Z>
239
gap> Nr := AsRightPresentation( HomalgMatrix( [ [ 3 ] ], 1, 1, ZZ ) );
240
<An object in Category of right presentations of Z>
241
gap> Tr := TensorProductOnObjects( Mr, Nr );
242
<An object in Category of right presentations of Z>
243
gap> Display( UnderlyingMatrix( Tr ) );
244
[ [ 3, 2 ] ]
245
gap> IsZeroForObjects( Tr );
246
true
247
gap> Br := Braiding( DirectSum( Mr, Nr ), DirectSum( Mr, Mr ) );
248
<A morphism in Category of right presentations of Z>
249
gap> Display( UnderlyingMatrix( Br ) );
250
[ [ 1, 0, 0, 0 ],
251
[ 0, 0, 1, 0 ],
252
[ 0, 1, 0, 0 ],
253
[ 0, 0, 0, 1 ] ]
254
gap> IsWellDefined( Br );
255
true
256
gap> Ur := TensorUnit( CapCategory( Mr ) );
257
<An object in Category of right presentations of Z>
258
gap> IntHomr := InternalHomOnObjects( DirectSum( Mr, Ur ), Nr );
259
<An object in Category of right presentations of Z>
260
gap> Display( UnderlyingMatrix( IntHomr ) );
261
[ [ -2, 1 ],
262
[ -1, -1 ] ]
263
gap> generator_r1 := StandardGeneratorMorphism( IntHomr, 1 );
264
<A morphism in Category of right presentations of Z>
265
gap> morphism_r1 := LambdaElimination( DirectSum( Mr, Ur ), Nr, generator_r1 );
266
<A morphism in Category of right presentations of Z>
267
gap> Display( UnderlyingMatrix( morphism_r1 ) );
268
[ [ 0, 2 ] ]
269
gap> generator_r2 := StandardGeneratorMorphism( IntHoml, 2 );
270
<A morphism in Category of left presentations of Z>
271
gap> morphism_r2 := LambdaElimination( DirectSum( Ml, Ul ), Nl, generator_r2 );
272
<A morphism in Category of left presentations of Z>
273
gap> Display( UnderlyingMatrix( morphism_r2 ) );
274
[ [ 0 ],
275
[ 2 ] ]
276
gap> IsEqualForMorphisms( LambdaIntroduction( morphism_r1 ), generator_r1 );
277
false
278
gap> IsCongruentForMorphisms( LambdaIntroduction( morphism_r1 ), generator_r1 );
279
true
280
gap> IsEqualForMorphisms( LambdaIntroduction( morphism_r2 ), generator_r2 );
281
false
282
gap> IsCongruentForMorphisms( LambdaIntroduction( morphism_r2 ), generator_r2 );
283
true
284
]]></Example>
285
286
287
</Section>
288
289
290
<Section Label="Chapter_Examples_and_Tests_Section_Generalized_Morphisms_Category">
291
<Heading>Generalized Morphisms Category</Heading>
292
293
<Example><![CDATA[
294
gap> vecspaces := CreateCapCategory( "VectorSpacesForGeneralizedMorphismsTest" );
295
VectorSpacesForGeneralizedMorphismsTest
296
gap> ReadPackage( "CAP", "examples/testfiles/VectorSpacesAllMethods.gi" );
297
true
298
gap> LoadPackage( "GeneralizedMorphismsForCAP" );
299
true
300
gap> B := QVectorSpace( 2 );
301
<A rational vector space of dimension 2>
302
gap> C := QVectorSpace( 3 );
303
<A rational vector space of dimension 3>
304
gap> B_1 := QVectorSpace( 1 );
305
<A rational vector space of dimension 1>
306
gap> C_1 := QVectorSpace( 2 );
307
<A rational vector space of dimension 2>
308
gap> c1_source_aid := VectorSpaceMorphism( B_1, [ [ 1, 0 ] ], B );
309
A rational vector space homomorphism with matrix:
310
[ [ 1, 0 ] ]
311
312
gap> SetIsSubobject( c1_source_aid, true );
313
gap> c1_range_aid := VectorSpaceMorphism( C, [ [ 1, 0 ], [ 0, 1 ], [ 0, 0 ] ], C_1 );
314
A rational vector space homomorphism with matrix:
315
[ [ 1, 0 ],
316
[ 0, 1 ],
317
[ 0, 0 ] ]
318
319
gap> SetIsFactorobject( c1_range_aid, true );
320
gap> c1_associated := VectorSpaceMorphism( B_1, [ [ 1, 1 ] ], C_1 );
321
A rational vector space homomorphism with matrix:
322
[ [ 1, 1 ] ]
323
324
gap> c1 := GeneralizedMorphism( c1_source_aid, c1_associated, c1_range_aid );
325
<A morphism in Generalized morphism category of VectorSpacesForGeneralizedMorphismsTest>
326
gap> B_2 := QVectorSpace( 1 );
327
<A rational vector space of dimension 1>
328
gap> C_2 := QVectorSpace( 2 );
329
<A rational vector space of dimension 2>
330
gap> c2_source_aid := VectorSpaceMorphism( B_2, [ [ 2, 0 ] ], B );
331
A rational vector space homomorphism with matrix:
332
[ [ 2, 0 ] ]
333
334
gap> SetIsSubobject( c2_source_aid, true );
335
gap> c2_range_aid := VectorSpaceMorphism( C, [ [ 3, 0 ], [ 0, 3 ], [ 0, 0 ] ], C_2 );
336
A rational vector space homomorphism with matrix:
337
[ [ 3, 0 ],
338
[ 0, 3 ],
339
[ 0, 0 ] ]
340
341
gap> SetIsFactorobject( c2_range_aid, true );
342
gap> c2_associated := VectorSpaceMorphism( B_2, [ [ 6, 6 ] ], C_2 );
343
A rational vector space homomorphism with matrix:
344
[ [ 6, 6 ] ]
345
346
gap> c2 := GeneralizedMorphism( c2_source_aid, c2_associated, c2_range_aid );
347
<A morphism in Generalized morphism category of VectorSpacesForGeneralizedMorphismsTest>
348
gap> IsCongruentForMorphisms( c1, c2 );
349
true
350
gap> IsCongruentForMorphisms( c1, c1 );
351
true
352
gap> c3_associated := VectorSpaceMorphism( B_1, [ [ 2, 2 ] ], C_1 );
353
A rational vector space homomorphism with matrix:
354
[ [ 2, 2 ] ]
355
356
gap> c3 := GeneralizedMorphism( c1_source_aid, c3_associated, c1_range_aid );
357
<A morphism in Generalized morphism category of VectorSpacesForGeneralizedMorphismsTest>
358
gap> IsCongruentForMorphisms( c1, c3 );
359
false
360
gap> IsCongruentForMorphisms( c2, c3 );
361
false
362
gap> c1 + c2;
363
<A morphism in Generalized morphism category of VectorSpacesForGeneralizedMorphismsTest>
364
gap> Arrow( c1 + c2 );
365
A rational vector space homomorphism with matrix:
366
[ [ 12, 12 ] ]
367
368
]]></Example>
369
370
371
First composition test:
372
<Example><![CDATA[
373
gap> vecspaces := CreateCapCategory( "VectorSpacesForGeneralizedMorphismsTest" );
374
VectorSpacesForGeneralizedMorphismsTest
375
gap> ReadPackage( "CAP", "examples/testfiles/VectorSpacesAllMethods.gi" );
376
true
377
gap> A := QVectorSpace( 1 );
378
<A rational vector space of dimension 1>
379
gap> B := QVectorSpace( 2 );
380
<A rational vector space of dimension 2>
381
gap> C := QVectorSpace( 3 );
382
<A rational vector space of dimension 3>
383
gap> phi_tilde_associated := VectorSpaceMorphism( A, [ [ 1, 2, 0 ] ], C );
384
A rational vector space homomorphism with matrix:
385
[ [ 1, 2, 0 ] ]
386
387
gap> phi_tilde_source_aid := VectorSpaceMorphism( A, [ [ 1, 2 ] ], B );
388
A rational vector space homomorphism with matrix:
389
[ [ 1, 2 ] ]
390
391
gap> phi_tilde := GeneralizedMorphismWithSourceAid( phi_tilde_source_aid, phi_tilde_associated );
392
<A morphism in Generalized morphism category of VectorSpacesForGeneralizedMorphismsTest>
393
gap> psi_tilde_associated := IdentityMorphism( B );
394
A rational vector space homomorphism with matrix:
395
[ [ 1, 0 ],
396
[ 0, 1 ] ]
397
398
gap> psi_tilde_source_aid := VectorSpaceMorphism( B, [ [ 1, 0, 0 ], [ 0, 1, 0 ] ], C );
399
A rational vector space homomorphism with matrix:
400
[ [ 1, 0, 0 ],
401
[ 0, 1, 0 ] ]
402
403
gap> psi_tilde := GeneralizedMorphismWithSourceAid( psi_tilde_source_aid, psi_tilde_associated );
404
<A morphism in Generalized morphism category of VectorSpacesForGeneralizedMorphismsTest>
405
gap> composition := PreCompose( phi_tilde, psi_tilde );
406
<A morphism in Generalized morphism category of VectorSpacesForGeneralizedMorphismsTest>
407
gap> Arrow( composition );
408
A rational vector space homomorphism with matrix:
409
[ [ 1/2, 1 ] ]
410
411
gap> SourceAid( composition );
412
A rational vector space homomorphism with matrix:
413
[ [ 1/2, 1 ] ]
414
415
gap> RangeAid( composition );
416
A rational vector space homomorphism with matrix:
417
[ [ 1, 0 ],
418
[ 0, 1 ] ]
419
]]></Example>
420
421
422
Second composition test
423
<Example><![CDATA[
424
gap> vecspaces := CreateCapCategory( "VectorSpacesForGeneralizedMorphismsTest" );
425
VectorSpacesForGeneralizedMorphismsTest
426
gap> ReadPackage( "CAP", "examples/testfiles/VectorSpacesAllMethods.gi" );
427
true
428
gap> A := QVectorSpace( 1 );
429
<A rational vector space of dimension 1>
430
gap> B := QVectorSpace( 2 );
431
<A rational vector space of dimension 2>
432
gap> C := QVectorSpace( 3 );
433
<A rational vector space of dimension 3>
434
gap> phi2_tilde_associated := VectorSpaceMorphism( A, [ [ 1, 5 ] ], B );
435
A rational vector space homomorphism with matrix:
436
[ [ 1, 5 ] ]
437
438
gap> phi2_tilde_range_aid := VectorSpaceMorphism( C, [ [ 1, 0 ], [ 0, 1 ], [ 1, 1 ] ], B );
439
A rational vector space homomorphism with matrix:
440
[ [ 1, 0 ],
441
[ 0, 1 ],
442
[ 1, 1 ] ]
443
444
gap> phi2_tilde := GeneralizedMorphismWithRangeAid( phi2_tilde_associated, phi2_tilde_range_aid );
445
<A morphism in Generalized morphism category of VectorSpacesForGeneralizedMorphismsTest>
446
gap> psi2_tilde_associated := VectorSpaceMorphism( C, [ [ 1 ], [ 3 ], [ 4 ] ], A );
447
A rational vector space homomorphism with matrix:
448
[ [ 1 ],
449
[ 3 ],
450
[ 4 ] ]
451
452
gap> psi2_tilde_range_aid := VectorSpaceMorphism( B, [ [ 1 ], [ 1 ] ], A );
453
A rational vector space homomorphism with matrix:
454
[ [ 1 ],
455
[ 1 ] ]
456
457
gap> psi2_tilde := GeneralizedMorphismWithRangeAid( psi2_tilde_associated, psi2_tilde_range_aid );
458
<A morphism in Generalized morphism category of VectorSpacesForGeneralizedMorphismsTest>
459
gap> composition2 := PreCompose( phi2_tilde, psi2_tilde );
460
<A morphism in Generalized morphism category of VectorSpacesForGeneralizedMorphismsTest>
461
gap> Arrow( composition2 );
462
A rational vector space homomorphism with matrix:
463
[ [ 16 ] ]
464
465
gap> RangeAid( composition2 );
466
A rational vector space homomorphism with matrix:
467
[ [ 1 ],
468
[ 1 ] ]
469
470
gap> SourceAid( composition2 );
471
A rational vector space homomorphism with matrix:
472
[ [ 1 ] ]
473
]]></Example>
474
475
476
Third composition test
477
<Example><![CDATA[
478
gap> vecspaces := CreateCapCategory( "VectorSpacesForGeneralizedMorphismsTest" );
479
VectorSpacesForGeneralizedMorphismsTest
480
gap> ReadPackage( "CAP", "examples/testfiles/VectorSpacesAllMethods.gi" );
481
true
482
gap> A := QVectorSpace( 3 );
483
<A rational vector space of dimension 3>
484
gap> Asub := QVectorSpace( 2 );
485
<A rational vector space of dimension 2>
486
gap> B := QVectorSpace( 3 );
487
<A rational vector space of dimension 3>
488
gap> Bfac := QVectorSpace( 1 );
489
<A rational vector space of dimension 1>
490
gap> Bsub := QVectorSpace( 2 );
491
<A rational vector space of dimension 2>
492
gap> C := QVectorSpace( 3 );
493
<A rational vector space of dimension 3>
494
gap> Cfac := QVectorSpace( 1 );
495
<A rational vector space of dimension 1>
496
gap> Asub_into_A := VectorSpaceMorphism( Asub, [ [ 1, 0, 0 ], [ 0, 1, 0 ] ], A );
497
A rational vector space homomorphism with matrix:
498
[ [ 1, 0, 0 ],
499
[ 0, 1, 0 ] ]
500
501
gap> Asub_to_Bfac := VectorSpaceMorphism( Asub, [ [ 1 ], [ 1 ] ], Bfac );
502
A rational vector space homomorphism with matrix:
503
[ [ 1 ],
504
[ 1 ] ]
505
506
gap> B_onto_Bfac := VectorSpaceMorphism( B, [ [ 1 ], [ 1 ], [ 1 ] ], Bfac );
507
A rational vector space homomorphism with matrix:
508
[ [ 1 ],
509
[ 1 ],
510
[ 1 ] ]
511
512
gap> Bsub_into_B := VectorSpaceMorphism( Bsub, [ [ 2, 2, 0 ], [ 0, 2, 2 ] ], B );
513
A rational vector space homomorphism with matrix:
514
[ [ 2, 2, 0 ],
515
[ 0, 2, 2 ] ]
516
517
gap> Bsub_to_Cfac := VectorSpaceMorphism( Bsub, [ [ 3 ], [ 0 ] ], Cfac );
518
A rational vector space homomorphism with matrix:
519
[ [ 3 ],
520
[ 0 ] ]
521
522
gap> C_onto_Cfac := VectorSpaceMorphism( C, [ [ 1 ], [ 2 ], [ 3 ] ], Cfac );
523
A rational vector space homomorphism with matrix:
524
[ [ 1 ],
525
[ 2 ],
526
[ 3 ] ]
527
528
gap> generalized_morphism1 := GeneralizedMorphism( Asub_into_A, Asub_to_Bfac, B_onto_Bfac );
529
<A morphism in Generalized morphism category of VectorSpacesForGeneralizedMorphismsTest>
530
gap> generalized_morphism2 := GeneralizedMorphism( Bsub_into_B, Bsub_to_Cfac, C_onto_Cfac );
531
<A morphism in Generalized morphism category of VectorSpacesForGeneralizedMorphismsTest>
532
gap> IsWellDefined( generalized_morphism1 );
533
true
534
gap> IsWellDefined( generalized_morphism2 );
535
true
536
gap> p := PreCompose( generalized_morphism1, generalized_morphism2 );
537
<A morphism in Generalized morphism category of VectorSpacesForGeneralizedMorphismsTest>
538
gap> SourceAid( p );
539
A rational vector space homomorphism with matrix:
540
[ [ -1, 1, 0 ],
541
[ 1, 0, 0 ] ]
542
543
gap> Arrow( p );
544
A rational vector space homomorphism with matrix:
545
(an empty 2 x 0 matrix)
546
547
gap> RangeAid( p );
548
A rational vector space homomorphism with matrix:
549
(an empty 3 x 0 matrix)
550
gap> A := QVectorSpace( 3 );
551
<A rational vector space of dimension 3>
552
gap> Asub := QVectorSpace( 2 );
553
<A rational vector space of dimension 2>
554
gap> B := QVectorSpace( 3 );
555
<A rational vector space of dimension 3>
556
gap> Bfac := QVectorSpace( 1 );
557
<A rational vector space of dimension 1>
558
gap> Bsub := QVectorSpace( 2 );
559
<A rational vector space of dimension 2>
560
gap> C := QVectorSpace( 3 );
561
<A rational vector space of dimension 3>
562
gap> Cfac := QVectorSpace( 2 );
563
<A rational vector space of dimension 2>
564
gap> Asub_into_A := VectorSpaceMorphism( Asub, [ [ 1, 0, 0 ], [ 0, 1, 0 ] ], A );
565
A rational vector space homomorphism with matrix:
566
[ [ 1, 0, 0 ],
567
[ 0, 1, 0 ] ]
568
569
gap> Asub_to_Bfac := VectorSpaceMorphism( Asub, [ [ 1 ], [ 1 ] ], Bfac );
570
A rational vector space homomorphism with matrix:
571
[ [ 1 ],
572
[ 1 ] ]
573
574
gap> B_onto_Bfac := VectorSpaceMorphism( B, [ [ 1 ], [ 1 ], [ 1 ] ], Bfac );
575
A rational vector space homomorphism with matrix:
576
[ [ 1 ],
577
[ 1 ],
578
[ 1 ] ]
579
580
gap> Bsub_into_B := VectorSpaceMorphism( Bsub, [ [ 2, 2, 0 ], [ 0, 2, 2 ] ], B );
581
A rational vector space homomorphism with matrix:
582
[ [ 2, 2, 0 ],
583
[ 0, 2, 2 ] ]
584
585
gap> Bsub_to_Cfac := VectorSpaceMorphism( Bsub, [ [ 3, 3 ], [ 0, 0 ] ], Cfac );
586
A rational vector space homomorphism with matrix:
587
[ [ 3, 3 ],
588
[ 0, 0 ] ]
589
590
gap> C_onto_Cfac := VectorSpaceMorphism( C, [ [ 1, 0 ], [ 0, 2 ], [ 3, 3 ] ], Cfac );
591
A rational vector space homomorphism with matrix:
592
[ [ 1, 0 ],
593
[ 0, 2 ],
594
[ 3, 3 ] ]
595
596
gap> generalized_morphism1 := GeneralizedMorphism( Asub_into_A, Asub_to_Bfac, B_onto_Bfac );
597
<A morphism in Generalized morphism category of VectorSpacesForGeneralizedMorphismsTest>
598
gap> generalized_morphism2 := GeneralizedMorphism( Bsub_into_B, Bsub_to_Cfac, C_onto_Cfac );
599
<A morphism in Generalized morphism category of VectorSpacesForGeneralizedMorphismsTest>
600
gap> IsWellDefined( generalized_morphism1 );
601
true
602
gap> IsWellDefined( generalized_morphism2 );
603
true
604
gap> p := PreCompose( generalized_morphism1, generalized_morphism2 );
605
<A morphism in Generalized morphism category of VectorSpacesForGeneralizedMorphismsTest>
606
gap> SourceAid( p );
607
A rational vector space homomorphism with matrix:
608
[ [ -1, 1, 0 ],
609
[ 1, 0, 0 ] ]
610
611
gap> Arrow( p );
612
A rational vector space homomorphism with matrix:
613
[ [ 0 ],
614
[ 0 ] ]
615
616
gap> RangeAid( p );
617
A rational vector space homomorphism with matrix:
618
[ [ -1 ],
619
[ 2 ],
620
[ 0 ] ]
621
]]></Example>
622
623
624
Honest representative test
625
<Example><![CDATA[
626
gap> vecspaces := CreateCapCategory( "VectorSpacesForGeneralizedMorphismsTest" );
627
VectorSpacesForGeneralizedMorphismsTest
628
gap> ReadPackage( "CAP", "examples/testfiles/VectorSpacesAllMethods.gi" );
629
true
630
gap> A := QVectorSpace( 1 );
631
<A rational vector space of dimension 1>
632
gap> B := QVectorSpace( 2 );
633
<A rational vector space of dimension 2>
634
gap> phi_tilde_source_aid := VectorSpaceMorphism( A, [ [ 2 ] ], A );
635
A rational vector space homomorphism with matrix:
636
[ [ 2 ] ]
637
638
gap> phi_tilde_associated := VectorSpaceMorphism( A, [ [ 1, 1 ] ], B );
639
A rational vector space homomorphism with matrix:
640
[ [ 1, 1 ] ]
641
642
gap> phi_tilde_range_aid := VectorSpaceMorphism( B, [ [ 1, 2 ], [ 3, 4 ] ], B );
643
A rational vector space homomorphism with matrix:
644
[ [ 1, 2 ],
645
[ 3, 4 ] ]
646
647
gap> phi_tilde := GeneralizedMorphism( phi_tilde_source_aid, phi_tilde_associated, phi_tilde_range_aid );
648
<A morphism in Generalized morphism category of VectorSpacesForGeneralizedMorphismsTest>
649
gap> HonestRepresentative( phi_tilde );
650
A rational vector space homomorphism with matrix:
651
[ [ -1/4, 1/4 ] ]
652
653
gap> IsWellDefined( phi_tilde );
654
true
655
gap> IsWellDefined( psi_tilde );
656
true
657
]]></Example>
658
659
660
</Section>
661
662
663
<Section Label="Chapter_Examples_and_Tests_Section_IsWellDefined">
664
<Heading>IsWellDefined</Heading>
665
666
<Example><![CDATA[
667
gap> vecspaces := CreateCapCategory( "VectorSpacesForIsWellDefinedTest" );
668
VectorSpacesForIsWellDefinedTest
669
gap> ReadPackage( "CAP", "examples/testfiles/VectorSpacesAllMethods.gi" );
670
true
671
gap> LoadPackage( "GeneralizedMorphismsForCAP" );
672
true
673
gap> A := QVectorSpace( 1 );
674
<A rational vector space of dimension 1>
675
gap> B := QVectorSpace( 2 );
676
<A rational vector space of dimension 2>
677
gap> alpha := VectorSpaceMorphism( A, [ [ 1, 2 ] ], B );
678
A rational vector space homomorphism with matrix:
679
[ [ 1, 2 ] ]
680
681
gap> g := GeneralizedMorphism( alpha, alpha, alpha );
682
<A morphism in Generalized morphism category of VectorSpacesForIsWellDefinedTest>
683
gap> IsWellDefined( alpha );
684
true
685
gap> IsWellDefined( g );
686
true
687
]]></Example>
688
689
690
</Section>
691
692
693
<Section Label="Chapter_Examples_and_Tests_Section_Kernel">
694
<Heading>Kernel</Heading>
695
696
<Example><![CDATA[
697
gap> vecspaces := CreateCapCategory( "VectorSpaces01" );
698
VectorSpaces01
699
gap> ReadPackage( "CAP", "examples/testfiles/VectorSpacesAddKernel01.gi" );
700
true
701
gap> V := QVectorSpace( 2 );
702
<A rational vector space of dimension 2>
703
gap> W := QVectorSpace( 3 );
704
<A rational vector space of dimension 3>
705
gap> alpha := VectorSpaceMorphism( V, [ [ 1, 1, 1 ], [ -1, -1, -1 ] ], W );
706
A rational vector space homomorphism with matrix:
707
[ [ 1, 1, 1 ],
708
[ -1, -1, -1 ] ]
709
710
gap> k := KernelObject( alpha );
711
<A rational vector space of dimension 1>
712
gap> T := QVectorSpace( 2 );
713
<A rational vector space of dimension 2>
714
gap> tau := VectorSpaceMorphism( T, [ [ 2, 2 ], [ 2, 2 ] ], V );
715
A rational vector space homomorphism with matrix:
716
[ [ 2, 2 ],
717
[ 2, 2 ] ]
718
719
gap> k_lift := KernelLift( alpha, tau );
720
A rational vector space homomorphism with matrix:
721
[ [ 2 ],
722
[ 2 ] ]
723
724
gap> HasKernelEmbedding( alpha );
725
false
726
gap> KernelEmbedding( alpha );
727
A rational vector space homomorphism with matrix:
728
[ [ 1, 1 ] ]
729
730
]]></Example>
731
732
733
<Example><![CDATA[
734
gap> vecspaces := CreateCapCategory( "VectorSpaces02" );
735
VectorSpaces02
736
gap> ReadPackage( "CAP", "examples/testfiles/VectorSpacesAddKernel02.gi" );
737
true
738
gap> V := QVectorSpace( 2 );
739
<A rational vector space of dimension 2>
740
gap> W := QVectorSpace( 3 );
741
<A rational vector space of dimension 3>
742
gap> alpha := VectorSpaceMorphism( V, [ [ 1, 1, 1 ], [ -1, -1, -1 ] ], W );
743
A rational vector space homomorphism with matrix:
744
[ [ 1, 1, 1 ],
745
[ -1, -1, -1 ] ]
746
747
gap> k := KernelObject( alpha );
748
<A rational vector space of dimension 1>
749
gap> T := QVectorSpace( 2 );
750
<A rational vector space of dimension 2>
751
gap> tau := VectorSpaceMorphism( T, [ [ 2, 2 ], [ 2, 2 ] ], V );
752
A rational vector space homomorphism with matrix:
753
[ [ 2, 2 ],
754
[ 2, 2 ] ]
755
756
gap> k_lift := KernelLift( alpha, tau );
757
A rational vector space homomorphism with matrix:
758
[ [ 2 ],
759
[ 2 ] ]
760
761
gap> HasKernelEmbedding( alpha );
762
false
763
]]></Example>
764
765
766
<Example><![CDATA[
767
gap> vecspaces := CreateCapCategory( "VectorSpaces03" );
768
VectorSpaces03
769
gap> ReadPackage( "CAP", "examples/testfiles/VectorSpacesAddKernel03.gi" );
770
true
771
gap> V := QVectorSpace( 2 );
772
<A rational vector space of dimension 2>
773
gap> W := QVectorSpace( 3 );
774
<A rational vector space of dimension 3>
775
gap> alpha := VectorSpaceMorphism( V, [ [ 1, 1, 1 ], [ -1, -1, -1 ] ], W );
776
A rational vector space homomorphism with matrix:
777
[ [ 1, 1, 1 ],
778
[ -1, -1, -1 ] ]
779
780
gap> k := KernelObject( alpha );
781
<A rational vector space of dimension 1>
782
gap> k_emb := KernelEmbedding( alpha );
783
A rational vector space homomorphism with matrix:
784
[ [ 1, 1 ] ]
785
786
gap> IsIdenticalObj( Source( k_emb ), k );
787
true
788
gap> V := QVectorSpace( 2 );
789
<A rational vector space of dimension 2>
790
gap> W := QVectorSpace( 3 );
791
<A rational vector space of dimension 3>
792
gap> beta := VectorSpaceMorphism( V, [ [ 1, 1, 1 ], [ -1, -1, -1 ] ], W );
793
A rational vector space homomorphism with matrix:
794
[ [ 1, 1, 1 ],
795
[ -1, -1, -1 ] ]
796
797
gap> k_emb := KernelEmbedding( beta );
798
A rational vector space homomorphism with matrix:
799
[ [ 1, 1 ] ]
800
801
gap> IsIdenticalObj( Source( k_emb ), KernelObject( beta ) );
802
true
803
]]></Example>
804
805
806
</Section>
807
808
809
<Section Label="Chapter_Examples_and_Tests_Section_FiberProduct">
810
<Heading>FiberProduct</Heading>
811
812
<Example><![CDATA[
813
gap> vecspaces := CreateCapCategory( "VectorSpacesForFiberProductTest" );
814
VectorSpacesForFiberProductTest
815
gap> ReadPackage( "CAP", "examples/testfiles/VectorSpacesAllMethods.gi" );
816
true
817
gap> A := QVectorSpace( 1 );
818
<A rational vector space of dimension 1>
819
gap> B := QVectorSpace( 2 );
820
<A rational vector space of dimension 2>
821
gap> C := QVectorSpace( 3 );
822
<A rational vector space of dimension 3>
823
gap> AtoC := VectorSpaceMorphism( A, [ [ 1, 2, 0 ] ], C );
824
A rational vector space homomorphism with matrix:
825
[ [ 1, 2, 0 ] ]
826
827
gap> BtoC := VectorSpaceMorphism( B, [ [ 1, 0, 0 ], [ 0, 1, 0 ] ], C );
828
A rational vector space homomorphism with matrix:
829
[ [ 1, 0, 0 ],
830
[ 0, 1, 0 ] ]
831
832
gap> P := FiberProduct( AtoC, BtoC );
833
<A rational vector space of dimension 1>
834
gap> p1 := ProjectionInFactorOfFiberProduct( [ AtoC, BtoC ], 1 );
835
A rational vector space homomorphism with matrix:
836
[ [ 1/2 ] ]
837
838
gap> p2 := ProjectionInFactorOfFiberProduct( [ AtoC, BtoC ], 2 );
839
A rational vector space homomorphism with matrix:
840
[ [ 1/2, 1 ] ]
841
842
]]></Example>
843
844
845
</Section>
846
847
848
</Chapter>
849
850
851