Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

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

563554 views
1
2
9 Examples and Tests
3
4
5
9.1 Basic Commands
6
7
 Example 
8
gap> Q := HomalgFieldOfRationals();;
9
gap> A := VectorSpaceObject( 4, Q );;
10
gap> B := VectorSpaceObject( 3, Q );;
11
gap> C := VectorSpaceObject( 2, Q );;
12
gap> alpha := VectorSpaceMorphism( A, 
13
> HomalgMatrix( [ [ 1, 1, 1 ], [ 0, 1, 1 ], 
14
> [ 1, 0, 1 ], [ 1, 1, 0 ] ], 4, 3, Q ), B );;
15
gap> gamma := VectorSpaceMorphism( C, 
16
> HomalgMatrix( [ [ -1, 1, -1 ], [ 1, 0, -1 ] ], 2, 3, Q ), B );;
17
gap> p := ProjectionInFactorOfFiberProduct( [ alpha, gamma ], 1 );;
18
gap> q := ProjectionInFactorOfFiberProduct( [ alpha, gamma ], 2 );;
19
gap> PreCompose( AsGeneralizedMorphism( alpha ), GeneralizedInverse( gamma ) );
20
<A morphism in Generalized morphism category of Category of matrices over Q>
21
gap> gen1 := PreCompose( AsGeneralizedMorphism( alpha ), 
22
>  GeneralizedInverse( gamma ) );
23
<A morphism in Generalized morphism category of Category of matrices over Q>
24
gap> gen2 := PreCompose( GeneralizedInverse( p ), AsGeneralizedMorphism( q ) );
25
<A morphism in Generalized morphism category of Category of matrices over Q>
26
gap> IsCongruentForMorphisms( gen1, gen2 );
27
true
28

29
30
31
9.2 Intersection of Nodal Curve and Cusp
32
33
We are going to intersect the nodal curve f = y^2 - x^2(x+1) and the cusp g
34
= (x+y)^2 - (y-x)^3. The two curves are arranged in a way such that they
35
intersect at (0,0) with intersection number as high as possible. We are
36
going to compute this intersection number using the definition of the
37
intersection number as the length of the module R/(f,g) localized at (0,0).
38
In order to model modules over the localization of Q[x,y] at (0,0), we use a
39
suitable Serre quotient category. 1 2 1 1 true We are going to intersect the
40
nodal curve f = y^2 - x^2(x+1) and the cusp g = (x+y)^2 - (y-x)^3. The two
41
curves are arranged in a way such that they intersect at (0,0) with
42
intersection number as high as possible. We are going to compute this
43
intersection number using the definition of the intersection number as the
44
length of the module R/(f,g) localized at (0,0). In order to model modules
45
over the localization of Q[x,y] at (0,0), we use a suitable Serre quotient
46
category. 1 2 1 1 true We are going to intersect the nodal curve f = y^2 -
47
x^2(x+1) and the cusp g = (x+y)^2 - (y-x)^3. The two curves are arranged in
48
a way such that they intersect at (0,0) with intersection number as high as
49
possible. We are going to compute this intersection number using the
50
definition of the intersection number as the length of the module R/(f,g)
51
localized at (0,0). In order to model modules over the localization of
52
Q[x,y] at (0,0), we use a suitable Serre quotient category. 1 2 1 1 true
53
54
55
9.3 Sweep
56
57
\href{https://terrytao.wordpress.com/2015/10/07/sweeping-a-matrix-rotates-its-graph/}{\textrm{Geometric
58
interpretation of sweeping a matrix by Terence Tao.}}
59
60
 Example 
61
gap> Q := HomalgFieldOfRationals();;
62
gap> V := VectorSpaceObject( 3, Q );;
63
gap> mat := HomalgMatrix( [ [ 9, 8, 7 ], [ 6, 5, 4 ], [ 3, 2, 1 ] ], 3, 3, Q );;
64
gap> alpha := VectorSpaceMorphism( V, mat, V );;
65
gap> graph := FiberProductEmbeddingInDirectSum( 
66
>  [ alpha, IdentityMorphism( V ) ] );;
67
gap> Display( graph );
68
[ [ 1, -2, 1, 0, 0, 0 ],
69
 [ -4/3, 7/3, 0, 2, 1, 0 ],
70
 [ 5/3, -8/3, 0, -1, 0, 1 ] ]
71

72
A split monomorphism in Category of matrices over Q
73
gap> D := DirectSum( V, V );;
74
gap> rotmat := HomalgMatrix( [ [ 0, 0, 0, -1, 0, 0 ],
75
>  [ 0, 1, 0, 0, 0, 0 ],
76
>  [ 0, 0, 1, 0, 0, 0 ],
77
>  [ 1, 0, 0, 0, 0, 0 ],
78
>  [ 0, 0, 0, 0, 1, 0 ],
79
>  [ 0, 0, 0, 0, 0, 1 ] ],
80
>  6, 6, Q );;
81
gap> rot := VectorSpaceMorphism( D, rotmat, D );;
82
gap> p := PreCompose( graph, rot );;
83
gap> Display( p );
84
[ [ 0, -2, 1, -1, 0, 0 ],
85
 [ 2, 7/3, 0, 4/3, 1, 0 ],
86
 [ -1, -8/3, 0, -5/3, 0, 1 ] ]
87

88
A morphism in Category of matrices over Q
89
gap> pi1 := ProjectionInFactorOfDirectSum( [ V, V ], 1 );;
90
gap> pi2 := ProjectionInFactorOfDirectSum( [ V, V ], 2 );;
91
gap> reversed_arrow := PreCompose( p, pi1 );;
92
gap> arrow := PreCompose( p, pi2 );;
93
gap> g := GeneralizedMorphismBySpan( reversed_arrow, arrow );;
94
gap> IsHonest( g );
95
true
96
gap> sweep_1_alpha := HonestRepresentative( g );;
97
gap> Display( sweep_1_alpha );
98
[ [ -1/9, 8/9, 7/9 ],
99
 [ 2/3, -1/3, -2/3 ],
100
 [ 1/3, -2/3, -4/3 ] ]
101

102
A morphism in Category of matrices over Q
103
gap> Display( alpha );
104
[ [ 9, 8, 7 ],
105
 [ 6, 5, 4 ],
106
 [ 3, 2, 1 ] ]
107

108
A morphism in Category of matrices over Q
109

110
111
112