GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
<?xml version="1.0" encoding="UTF-8"?>12<!-- This is an automatically generated file. -->3<Chapter Label="Chapter_Examples_and_Tests">4<Heading>Examples and Tests</Heading>56<Section Label="Chapter_Examples_and_Tests_Section_Basic_Commands">7<Heading>Basic Commands</Heading>89<Example><![CDATA[10gap> Q := HomalgFieldOfRationals();;11gap> A := VectorSpaceObject( 4, Q );;12gap> B := VectorSpaceObject( 3, Q );;13gap> C := VectorSpaceObject( 2, Q );;14gap> alpha := VectorSpaceMorphism( A,15> HomalgMatrix( [ [ 1, 1, 1 ], [ 0, 1, 1 ],16> [ 1, 0, 1 ], [ 1, 1, 0 ] ], 4, 3, Q ), B );;17gap> gamma := VectorSpaceMorphism( C,18> HomalgMatrix( [ [ -1, 1, -1 ], [ 1, 0, -1 ] ], 2, 3, Q ), B );;19gap> p := ProjectionInFactorOfFiberProduct( [ alpha, gamma ], 1 );;20gap> q := ProjectionInFactorOfFiberProduct( [ alpha, gamma ], 2 );;21gap> PreCompose( AsGeneralizedMorphism( alpha ), GeneralizedInverse( gamma ) );22<A morphism in Generalized morphism category of Category of matrices over Q>23gap> gen1 := PreCompose( AsGeneralizedMorphism( alpha ),24> GeneralizedInverse( gamma ) );25<A morphism in Generalized morphism category of Category of matrices over Q>26gap> gen2 := PreCompose( GeneralizedInverse( p ), AsGeneralizedMorphism( q ) );27<A morphism in Generalized morphism category of Category of matrices over Q>28gap> IsCongruentForMorphisms( gen1, gen2 );29true30]]></Example>313233</Section>343536<Section Label="Chapter_Examples_and_Tests_Section_Intersection_of_Nodal_Curve_and_Cusp">37<Heading>Intersection of Nodal Curve and Cusp</Heading>3839We are going to intersect the nodal curve40<Math>f = y^2 - x^2(x+1)</Math>41and the cusp <Math>g = (x+y)^2 - (y-x)^3</Math>.42The two curves are arranged in a way such that they intersect43at <Math>(0,0)</Math> with intersection number as high as possible.44We are going to compute this intersection number45using the definition of the intersection number as the46length of the module <Math>R/(f,g)</Math> localized at <Math>(0,0)</Math>.47In order to model modules over the localization of <Math>Q[x,y]</Math> at48<Math>(0,0)</Math>, we use a suitable Serre quotient category.49150251152153true54We are going to intersect the nodal curve55<Math>f = y^2 - x^2(x+1)</Math>56and the cusp <Math>g = (x+y)^2 - (y-x)^3</Math>.57The two curves are arranged in a way such that they intersect58at <Math>(0,0)</Math> with intersection number as high as possible.59We are going to compute this intersection number60using the definition of the intersection number as the61length of the module <Math>R/(f,g)</Math> localized at <Math>(0,0)</Math>.62In order to model modules over the localization of <Math>Q[x,y]</Math> at63<Math>(0,0)</Math>, we use a suitable Serre quotient category.64165266167168true69We are going to intersect the nodal curve70<Math>f = y^2 - x^2(x+1)</Math>71and the cusp <Math>g = (x+y)^2 - (y-x)^3</Math>.72The two curves are arranged in a way such that they intersect73at <Math>(0,0)</Math> with intersection number as high as possible.74We are going to compute this intersection number75using the definition of the intersection number as the76length of the module <Math>R/(f,g)</Math> localized at <Math>(0,0)</Math>.77In order to model modules over the localization of <Math>Q[x,y]</Math> at78<Math>(0,0)</Math>, we use a suitable Serre quotient category.79180281182183true84</Section>858687<Section Label="Chapter_Examples_and_Tests_Section_Sweep">88<Heading>Sweep</Heading>8990<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>91<Example><![CDATA[92gap> Q := HomalgFieldOfRationals();;93gap> V := VectorSpaceObject( 3, Q );;94gap> mat := HomalgMatrix( [ [ 9, 8, 7 ], [ 6, 5, 4 ], [ 3, 2, 1 ] ], 3, 3, Q );;95gap> alpha := VectorSpaceMorphism( V, mat, V );;96gap> graph := FiberProductEmbeddingInDirectSum(97> [ alpha, IdentityMorphism( V ) ] );;98gap> Display( graph );99[ [ 1, -2, 1, 0, 0, 0 ],100[ -4/3, 7/3, 0, 2, 1, 0 ],101[ 5/3, -8/3, 0, -1, 0, 1 ] ]102103A split monomorphism in Category of matrices over Q104gap> D := DirectSum( V, V );;105gap> rotmat := HomalgMatrix( [ [ 0, 0, 0, -1, 0, 0 ],106> [ 0, 1, 0, 0, 0, 0 ],107> [ 0, 0, 1, 0, 0, 0 ],108> [ 1, 0, 0, 0, 0, 0 ],109> [ 0, 0, 0, 0, 1, 0 ],110> [ 0, 0, 0, 0, 0, 1 ] ],111> 6, 6, Q );;112gap> rot := VectorSpaceMorphism( D, rotmat, D );;113gap> p := PreCompose( graph, rot );;114gap> Display( p );115[ [ 0, -2, 1, -1, 0, 0 ],116[ 2, 7/3, 0, 4/3, 1, 0 ],117[ -1, -8/3, 0, -5/3, 0, 1 ] ]118119A morphism in Category of matrices over Q120gap> pi1 := ProjectionInFactorOfDirectSum( [ V, V ], 1 );;121gap> pi2 := ProjectionInFactorOfDirectSum( [ V, V ], 2 );;122gap> reversed_arrow := PreCompose( p, pi1 );;123gap> arrow := PreCompose( p, pi2 );;124gap> g := GeneralizedMorphismBySpan( reversed_arrow, arrow );;125gap> IsHonest( g );126true127gap> sweep_1_alpha := HonestRepresentative( g );;128gap> Display( sweep_1_alpha );129[ [ -1/9, 8/9, 7/9 ],130[ 2/3, -1/3, -2/3 ],131[ 1/3, -2/3, -4/3 ] ]132133A morphism in Category of matrices over Q134gap> Display( alpha );135[ [ 9, 8, 7 ],136[ 6, 5, 4 ],137[ 3, 2, 1 ] ]138139A morphism in Category of matrices over Q140]]></Example>141142143</Section>144145146</Chapter>147148149150