Skip to content

Commit b02b07f

Browse files
committed
Add example using the precompiled matrix category
1 parent 1fa31d6 commit b02b07f

File tree

1 file changed

+137
-0
lines changed

1 file changed

+137
-0
lines changed
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
#! @Chapter Examples and Tests
2+
3+
#! @Section Basic Commands
4+
5+
LoadPackage( "LinearAlgebraForCAP" );;
6+
7+
#! @Example
8+
Q := HomalgFieldOfRationals();;
9+
vec := MatrixCategoryPrecompiled( Q );;
10+
a := MatrixCategoryObject( vec, 3 );
11+
#! <A vector space object over Q of dimension 3>
12+
HasIsProjective( a ) and IsProjective( a );
13+
#! true
14+
ap := 3/vec;;
15+
IsEqualForObjects( a, ap );
16+
#! true
17+
b := MatrixCategoryObject( vec, 4 );
18+
#! <A vector space object over Q of dimension 4>
19+
homalg_matrix := HomalgMatrix( [ [ 1, 0, 0, 0 ],
20+
[ 0, 1, 0, -1 ],
21+
[ -1, 0, 2, 1 ] ], 3, 4, Q );
22+
#! <A 3 x 4 matrix over an internal ring>
23+
alpha := VectorSpaceMorphism( a, homalg_matrix, b );
24+
#! <A morphism in Category of matrices over Q>
25+
Display( alpha );
26+
#! [ [ 1, 0, 0, 0 ],
27+
#! [ 0, 1, 0, -1 ],
28+
#! [ -1, 0, 2, 1 ] ]
29+
#!
30+
#! A morphism in Category of matrices over Q
31+
alphap := homalg_matrix/vec;;
32+
IsCongruentForMorphisms( alpha, alphap );
33+
#! true
34+
homalg_matrix := HomalgMatrix( [ [ 1, 1, 0, 0 ],
35+
[ 0, 1, 0, -1 ],
36+
[ -1, 0, 2, 1 ] ], 3, 4, Q );
37+
#! <A 3 x 4 matrix over an internal ring>
38+
beta := VectorSpaceMorphism( a, homalg_matrix, b );
39+
#! <A morphism in Category of matrices over Q>
40+
CokernelObject( alpha );
41+
#! <A vector space object over Q of dimension 1>
42+
c := CokernelProjection( alpha );;
43+
Display( c );
44+
#! [ [ 0 ],
45+
#! [ 1 ],
46+
#! [ -1/2 ],
47+
#! [ 1 ] ]
48+
#!
49+
#! A split epimorphism in Category of matrices over Q
50+
gamma := UniversalMorphismIntoDirectSum( [ c, c ] );;
51+
Display( gamma );
52+
#! [ [ 0, 0 ],
53+
#! [ 1, 1 ],
54+
#! [ -1/2, -1/2 ],
55+
#! [ 1, 1 ] ]
56+
#!
57+
#! A morphism in Category of matrices over Q
58+
colift := CokernelColift( alpha, gamma );;
59+
IsEqualForMorphisms( PreCompose( c, colift ), gamma );
60+
#! true
61+
FiberProduct( alpha, beta );
62+
#! <A vector space object over Q of dimension 2>
63+
F := FiberProduct( alpha, beta );
64+
#! <A vector space object over Q of dimension 2>
65+
p1 := ProjectionInFactorOfFiberProduct( [ alpha, beta ], 1 );
66+
#! <A morphism in Category of matrices over Q>
67+
Display( PreCompose( p1, alpha ) );
68+
#! [ [ 0, 1, 0, -1 ],
69+
#! [ -1, 0, 2, 1 ] ]
70+
#!
71+
#! A morphism in Category of matrices over Q
72+
Pushout( alpha, beta );
73+
#! <A vector space object over Q of dimension 5>
74+
i1 := InjectionOfCofactorOfPushout( [ alpha, beta ], 1 );
75+
#! <A morphism in Category of matrices over Q>
76+
i2 := InjectionOfCofactorOfPushout( [ alpha, beta ], 2 );
77+
#! <A morphism in Category of matrices over Q>
78+
u := UniversalMorphismFromDirectSum( [ b, b ], [ i1, i2 ] );
79+
#! <A morphism in Category of matrices over Q>
80+
Display( u );
81+
#! [ [ 0, 1, 1, 0, 0 ],
82+
#! [ 1, 0, 1, 0, -1 ],
83+
#! [ -1/2, 0, 1/2, 1, 1/2 ],
84+
#! [ 1, 0, 0, 0, 0 ],
85+
#! [ 0, 1, 0, 0, 0 ],
86+
#! [ 0, 0, 1, 0, 0 ],
87+
#! [ 0, 0, 0, 1, 0 ],
88+
#! [ 0, 0, 0, 0, 1 ] ]
89+
#!
90+
#! A morphism in Category of matrices over Q
91+
KernelObjectFunctorial( u, IdentityMorphism( Source( u ) ), u ) = IdentityMorphism( MatrixCategoryObject( vec, 3 ) );
92+
#! true
93+
IsZero( CokernelObjectFunctorial( u, IdentityMorphism( Range( u ) ), u ) );
94+
#! true
95+
DirectProductFunctorial( [ u, u ] ) = DirectSumFunctorial( [ u, u ] );
96+
#! true
97+
CoproductFunctorial( [ u, u ] ) = DirectSumFunctorial( [ u, u ] );
98+
#! true
99+
IsOne( FiberProductFunctorial( [ u, u ], [ IdentityMorphism( Source( u ) ), IdentityMorphism( Source( u ) ) ], [ u, u ] ) );
100+
#! true
101+
IsOne( PushoutFunctorial( [ u, u ], [ IdentityMorphism( Range( u ) ), IdentityMorphism( Range( u ) ) ], [ u, u ] ) );
102+
#! true
103+
IsCongruentForMorphisms( (1/2) * alpha, alpha * (1/2) );
104+
#! true
105+
Dimension( HomomorphismStructureOnObjects( a, b ) ) = Dimension( a ) * Dimension( b );
106+
#! true
107+
IsCongruentForMorphisms(
108+
PreCompose( [ u, DualOnMorphisms( i1 ), DualOnMorphisms( alpha ) ] ),
109+
InterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism( Source( u ), Source( alpha ),
110+
PreCompose(
111+
InterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructure( DualOnMorphisms( i1 ) ),
112+
HomomorphismStructureOnMorphisms( u, DualOnMorphisms( alpha ) )
113+
)
114+
)
115+
);
116+
#! true
117+
vec := CapCategory( alpha );;
118+
t := TensorUnit( vec );;
119+
z := ZeroObject( vec );;
120+
IsCongruentForMorphisms(
121+
ZeroObjectFunctorial( vec ),
122+
InterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism( z, z, ZeroMorphism( t, z ) )
123+
);
124+
#! true
125+
IsCongruentForMorphisms(
126+
ZeroObjectFunctorial( vec ),
127+
InterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism(
128+
z, z,
129+
InterpretMorphismAsMorphismFromDistinguishedObjectToHomomorphismStructure( ZeroObjectFunctorial( vec ) )
130+
)
131+
);
132+
#! true
133+
right_side := PreCompose( [ i1, DualOnMorphisms( u ), u ] );;
134+
x := SolveLinearSystemInAbCategory( [ [ i1 ] ], [ [ u ] ], [ right_side ] )[1];;
135+
IsCongruentForMorphisms( PreCompose( [ i1, x, u ] ), right_side );
136+
#! true
137+
#! @EndExample

0 commit comments

Comments
 (0)