GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
1[1X9 [33X[0;0YExamples and Tests[133X[101X234[1X9.1 [33X[0;0YBasic Commands[133X[101X56[4X[32X Example [32X[104X7[4X[25Xgap>[125X [27XQ := HomalgFieldOfRationals();;[127X[104X8[4X[25Xgap>[125X [27XA := VectorSpaceObject( 4, Q );;[127X[104X9[4X[25Xgap>[125X [27XB := VectorSpaceObject( 3, Q );;[127X[104X10[4X[25Xgap>[125X [27XC := VectorSpaceObject( 2, Q );;[127X[104X11[4X[25Xgap>[125X [27Xalpha := VectorSpaceMorphism( A, [127X[104X12[4X[25X>[125X [27XHomalgMatrix( [ [ 1, 1, 1 ], [ 0, 1, 1 ], [127X[104X13[4X[25X>[125X [27X[ 1, 0, 1 ], [ 1, 1, 0 ] ], 4, 3, Q ), B );;[127X[104X14[4X[25Xgap>[125X [27Xgamma := VectorSpaceMorphism( C, [127X[104X15[4X[25X>[125X [27XHomalgMatrix( [ [ -1, 1, -1 ], [ 1, 0, -1 ] ], 2, 3, Q ), B );;[127X[104X16[4X[25Xgap>[125X [27Xp := ProjectionInFactorOfFiberProduct( [ alpha, gamma ], 1 );;[127X[104X17[4X[25Xgap>[125X [27Xq := ProjectionInFactorOfFiberProduct( [ alpha, gamma ], 2 );;[127X[104X18[4X[25Xgap>[125X [27XPreCompose( AsGeneralizedMorphism( alpha ), GeneralizedInverse( gamma ) );[127X[104X19[4X[28X<A morphism in Generalized morphism category of Category of matrices over Q>[128X[104X20[4X[25Xgap>[125X [27Xgen1 := PreCompose( AsGeneralizedMorphism( alpha ), [127X[104X21[4X[25X>[125X [27X GeneralizedInverse( gamma ) );[127X[104X22[4X[28X<A morphism in Generalized morphism category of Category of matrices over Q>[128X[104X23[4X[25Xgap>[125X [27Xgen2 := PreCompose( GeneralizedInverse( p ), AsGeneralizedMorphism( q ) );[127X[104X24[4X[28X<A morphism in Generalized morphism category of Category of matrices over Q>[128X[104X25[4X[25Xgap>[125X [27XIsCongruentForMorphisms( gen1, gen2 );[127X[104X26[4X[28Xtrue[128X[104X27[4X[32X[104X282930[1X9.2 [33X[0;0YIntersection of Nodal Curve and Cusp[133X[101X3132[33X[0;0YWe are going to intersect the nodal curve [23Xf = y^2 - x^2(x+1)[123X and the cusp [23Xg33= (x+y)^2 - (y-x)^3[123X. The two curves are arranged in a way such that they34intersect at [23X(0,0)[123X with intersection number as high as possible. We are35going to compute this intersection number using the definition of the36intersection number as the length of the module [23XR/(f,g)[123X localized at [23X(0,0)[123X.37In order to model modules over the localization of [23XQ[x,y][123X at [23X(0,0)[123X, we use a38suitable Serre quotient category. 1 2 1 1 true We are going to intersect the39nodal curve [23Xf = y^2 - x^2(x+1)[123X and the cusp [23Xg = (x+y)^2 - (y-x)^3[123X. The two40curves are arranged in a way such that they intersect at [23X(0,0)[123X with41intersection number as high as possible. We are going to compute this42intersection number using the definition of the intersection number as the43length of the module [23XR/(f,g)[123X localized at [23X(0,0)[123X. In order to model modules44over the localization of [23XQ[x,y][123X at [23X(0,0)[123X, we use a suitable Serre quotient45category. 1 2 1 1 true We are going to intersect the nodal curve [23Xf = y^2 -46x^2(x+1)[123X and the cusp [23Xg = (x+y)^2 - (y-x)^3[123X. The two curves are arranged in47a way such that they intersect at [23X(0,0)[123X with intersection number as high as48possible. We are going to compute this intersection number using the49definition of the intersection number as the length of the module [23XR/(f,g)[123X50localized at [23X(0,0)[123X. In order to model modules over the localization of51[23XQ[x,y][123X at [23X(0,0)[123X, we use a suitable Serre quotient category. 1 2 1 1 true[133X525354[1X9.3 [33X[0;0YSweep[133X[101X5556[33X[0;0Y[23X\href{https://terrytao.wordpress.com/2015/10/07/sweeping-a-matrix-rotates-its-graph/}{\textrm{Geometric57interpretation of sweeping a matrix by Terence Tao.}}[123X[133X5859[4X[32X Example [32X[104X60[4X[25Xgap>[125X [27XQ := HomalgFieldOfRationals();;[127X[104X61[4X[25Xgap>[125X [27XV := VectorSpaceObject( 3, Q );;[127X[104X62[4X[25Xgap>[125X [27Xmat := HomalgMatrix( [ [ 9, 8, 7 ], [ 6, 5, 4 ], [ 3, 2, 1 ] ], 3, 3, Q );;[127X[104X63[4X[25Xgap>[125X [27Xalpha := VectorSpaceMorphism( V, mat, V );;[127X[104X64[4X[25Xgap>[125X [27Xgraph := FiberProductEmbeddingInDirectSum( [127X[104X65[4X[25X>[125X [27X [ alpha, IdentityMorphism( V ) ] );;[127X[104X66[4X[25Xgap>[125X [27XDisplay( graph );[127X[104X67[4X[28X[ [ 1, -2, 1, 0, 0, 0 ],[128X[104X68[4X[28X [ -4/3, 7/3, 0, 2, 1, 0 ],[128X[104X69[4X[28X [ 5/3, -8/3, 0, -1, 0, 1 ] ][128X[104X70[4X[28X[128X[104X71[4X[28XA split monomorphism in Category of matrices over Q[128X[104X72[4X[25Xgap>[125X [27XD := DirectSum( V, V );;[127X[104X73[4X[25Xgap>[125X [27Xrotmat := HomalgMatrix( [ [ 0, 0, 0, -1, 0, 0 ],[127X[104X74[4X[25X>[125X [27X [ 0, 1, 0, 0, 0, 0 ],[127X[104X75[4X[25X>[125X [27X [ 0, 0, 1, 0, 0, 0 ],[127X[104X76[4X[25X>[125X [27X [ 1, 0, 0, 0, 0, 0 ],[127X[104X77[4X[25X>[125X [27X [ 0, 0, 0, 0, 1, 0 ],[127X[104X78[4X[25X>[125X [27X [ 0, 0, 0, 0, 0, 1 ] ],[127X[104X79[4X[25X>[125X [27X 6, 6, Q );;[127X[104X80[4X[25Xgap>[125X [27Xrot := VectorSpaceMorphism( D, rotmat, D );;[127X[104X81[4X[25Xgap>[125X [27Xp := PreCompose( graph, rot );;[127X[104X82[4X[25Xgap>[125X [27XDisplay( p );[127X[104X83[4X[28X[ [ 0, -2, 1, -1, 0, 0 ],[128X[104X84[4X[28X [ 2, 7/3, 0, 4/3, 1, 0 ],[128X[104X85[4X[28X [ -1, -8/3, 0, -5/3, 0, 1 ] ][128X[104X86[4X[28X[128X[104X87[4X[28XA morphism in Category of matrices over Q[128X[104X88[4X[25Xgap>[125X [27Xpi1 := ProjectionInFactorOfDirectSum( [ V, V ], 1 );;[127X[104X89[4X[25Xgap>[125X [27Xpi2 := ProjectionInFactorOfDirectSum( [ V, V ], 2 );;[127X[104X90[4X[25Xgap>[125X [27Xreversed_arrow := PreCompose( p, pi1 );;[127X[104X91[4X[25Xgap>[125X [27Xarrow := PreCompose( p, pi2 );;[127X[104X92[4X[25Xgap>[125X [27Xg := GeneralizedMorphismBySpan( reversed_arrow, arrow );;[127X[104X93[4X[25Xgap>[125X [27XIsHonest( g );[127X[104X94[4X[28Xtrue[128X[104X95[4X[25Xgap>[125X [27Xsweep_1_alpha := HonestRepresentative( g );;[127X[104X96[4X[25Xgap>[125X [27XDisplay( sweep_1_alpha );[127X[104X97[4X[28X[ [ -1/9, 8/9, 7/9 ],[128X[104X98[4X[28X [ 2/3, -1/3, -2/3 ],[128X[104X99[4X[28X [ 1/3, -2/3, -4/3 ] ][128X[104X100[4X[28X[128X[104X101[4X[28XA morphism in Category of matrices over Q[128X[104X102[4X[25Xgap>[125X [27XDisplay( alpha );[127X[104X103[4X[28X[ [ 9, 8, 7 ],[128X[104X104[4X[28X [ 6, 5, 4 ],[128X[104X105[4X[28X [ 3, 2, 1 ] ][128X[104X106[4X[28X[128X[104X107[4X[28XA morphism in Category of matrices over Q[128X[104X108[4X[32X[104X109110111112