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

563501 views
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_Basic_Commands">
8
<Heading>Basic Commands</Heading>
9
10
<Example><![CDATA[
11
gap> Q := HomalgFieldOfRationals();;
12
gap> A := VectorSpaceObject( 4, Q );;
13
gap> B := VectorSpaceObject( 3, Q );;
14
gap> C := VectorSpaceObject( 2, Q );;
15
gap> alpha := VectorSpaceMorphism( A,
16
> HomalgMatrix( [ [ 1, 1, 1 ], [ 0, 1, 1 ],
17
> [ 1, 0, 1 ], [ 1, 1, 0 ] ], 4, 3, Q ), B );;
18
gap> gamma := VectorSpaceMorphism( C,
19
> HomalgMatrix( [ [ -1, 1, -1 ], [ 1, 0, -1 ] ], 2, 3, Q ), B );;
20
gap> p := ProjectionInFactorOfFiberProduct( [ alpha, gamma ], 1 );;
21
gap> q := ProjectionInFactorOfFiberProduct( [ alpha, gamma ], 2 );;
22
gap> PreCompose( AsGeneralizedMorphism( alpha ), GeneralizedInverse( gamma ) );
23
<A morphism in Generalized morphism category of Category of matrices over Q>
24
gap> gen1 := PreCompose( AsGeneralizedMorphism( alpha ),
25
> GeneralizedInverse( gamma ) );
26
<A morphism in Generalized morphism category of Category of matrices over Q>
27
gap> gen2 := PreCompose( GeneralizedInverse( p ), AsGeneralizedMorphism( q ) );
28
<A morphism in Generalized morphism category of Category of matrices over Q>
29
gap> IsCongruentForMorphisms( gen1, gen2 );
30
true
31
]]></Example>
32
33
34
</Section>
35
36
37
<Section Label="Chapter_Examples_and_Tests_Section_Intersection_of_Nodal_Curve_and_Cusp">
38
<Heading>Intersection of Nodal Curve and Cusp</Heading>
39
40
We are going to intersect the nodal curve
41
<Math>f = y^2 - x^2(x+1)</Math>
42
and the cusp <Math>g = (x+y)^2 - (y-x)^3</Math>.
43
The two curves are arranged in a way such that they intersect
44
at <Math>(0,0)</Math> with intersection number as high as possible.
45
We are going to compute this intersection number
46
using the definition of the intersection number as the
47
length of the module <Math>R/(f,g)</Math> localized at <Math>(0,0)</Math>.
48
In order to model modules over the localization of <Math>Q[x,y]</Math> at
49
<Math>(0,0)</Math>, we use a suitable Serre quotient category.
50
1
51
2
52
1
53
1
54
true
55
We are going to intersect the nodal curve
56
<Math>f = y^2 - x^2(x+1)</Math>
57
and the cusp <Math>g = (x+y)^2 - (y-x)^3</Math>.
58
The two curves are arranged in a way such that they intersect
59
at <Math>(0,0)</Math> with intersection number as high as possible.
60
We are going to compute this intersection number
61
using the definition of the intersection number as the
62
length of the module <Math>R/(f,g)</Math> localized at <Math>(0,0)</Math>.
63
In order to model modules over the localization of <Math>Q[x,y]</Math> at
64
<Math>(0,0)</Math>, we use a suitable Serre quotient category.
65
1
66
2
67
1
68
1
69
true
70
We are going to intersect the nodal curve
71
<Math>f = y^2 - x^2(x+1)</Math>
72
and the cusp <Math>g = (x+y)^2 - (y-x)^3</Math>.
73
The two curves are arranged in a way such that they intersect
74
at <Math>(0,0)</Math> with intersection number as high as possible.
75
We are going to compute this intersection number
76
using the definition of the intersection number as the
77
length of the module <Math>R/(f,g)</Math> localized at <Math>(0,0)</Math>.
78
In order to model modules over the localization of <Math>Q[x,y]</Math> at
79
<Math>(0,0)</Math>, we use a suitable Serre quotient category.
80
1
81
2
82
1
83
1
84
true
85
</Section>
86
87
88
<Section Label="Chapter_Examples_and_Tests_Section_Sweep">
89
<Heading>Sweep</Heading>
90
91
<Math>\href{https://terrytao.wordpress.com/2015/10/07/sweeping-a-matrix-rotates-its-graph/}{\textrm{Geometric interpretation of sweeping a matrix by Terence Tao.}}</Math>
92
<Example><![CDATA[
93
gap> Q := HomalgFieldOfRationals();;
94
gap> V := VectorSpaceObject( 3, Q );;
95
gap> mat := HomalgMatrix( [ [ 9, 8, 7 ], [ 6, 5, 4 ], [ 3, 2, 1 ] ], 3, 3, Q );;
96
gap> alpha := VectorSpaceMorphism( V, mat, V );;
97
gap> graph := FiberProductEmbeddingInDirectSum(
98
> [ alpha, IdentityMorphism( V ) ] );;
99
gap> Display( graph );
100
[ [ 1, -2, 1, 0, 0, 0 ],
101
[ -4/3, 7/3, 0, 2, 1, 0 ],
102
[ 5/3, -8/3, 0, -1, 0, 1 ] ]
103
104
A split monomorphism in Category of matrices over Q
105
gap> D := DirectSum( V, V );;
106
gap> rotmat := HomalgMatrix( [ [ 0, 0, 0, -1, 0, 0 ],
107
> [ 0, 1, 0, 0, 0, 0 ],
108
> [ 0, 0, 1, 0, 0, 0 ],
109
> [ 1, 0, 0, 0, 0, 0 ],
110
> [ 0, 0, 0, 0, 1, 0 ],
111
> [ 0, 0, 0, 0, 0, 1 ] ],
112
> 6, 6, Q );;
113
gap> rot := VectorSpaceMorphism( D, rotmat, D );;
114
gap> p := PreCompose( graph, rot );;
115
gap> Display( p );
116
[ [ 0, -2, 1, -1, 0, 0 ],
117
[ 2, 7/3, 0, 4/3, 1, 0 ],
118
[ -1, -8/3, 0, -5/3, 0, 1 ] ]
119
120
A morphism in Category of matrices over Q
121
gap> pi1 := ProjectionInFactorOfDirectSum( [ V, V ], 1 );;
122
gap> pi2 := ProjectionInFactorOfDirectSum( [ V, V ], 2 );;
123
gap> reversed_arrow := PreCompose( p, pi1 );;
124
gap> arrow := PreCompose( p, pi2 );;
125
gap> g := GeneralizedMorphismBySpan( reversed_arrow, arrow );;
126
gap> IsHonest( g );
127
true
128
gap> sweep_1_alpha := HonestRepresentative( g );;
129
gap> Display( sweep_1_alpha );
130
[ [ -1/9, 8/9, 7/9 ],
131
[ 2/3, -1/3, -2/3 ],
132
[ 1/3, -2/3, -4/3 ] ]
133
134
A morphism in Category of matrices over Q
135
gap> Display( alpha );
136
[ [ 9, 8, 7 ],
137
[ 6, 5, 4 ],
138
[ 3, 2, 1 ] ]
139
140
A morphism in Category of matrices over Q
141
]]></Example>
142
143
144
</Section>
145
146
147
</Chapter>
148
149
150