Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 418346<?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( 3, Q );12<A vector space object over Q of dimension 3>13gap> b := VectorSpaceObject( 4, Q );14<A vector space object over Q of dimension 4>15gap> homalg_matrix := HomalgMatrix( [ [ 1, 0, 0, 0 ],16> [ 0, 1, 0, -1 ],17> [ -1, 0, 2, 1 ] ], 3, 4, Q );18<A 3 x 4 matrix over an internal ring>19gap> alpha := VectorSpaceMorphism( a, homalg_matrix, b );20<A morphism in Category of matrices over Q>21gap> Display( alpha );22[ [ 1, 0, 0, 0 ],23[ 0, 1, 0, -1 ],24[ -1, 0, 2, 1 ] ]2526A morphism in Category of matrices over Q27gap> homalg_matrix := HomalgMatrix( [ [ 1, 1, 0, 0 ],28> [ 0, 1, 0, -1 ],29> [ -1, 0, 2, 1 ] ], 3, 4, Q );30<A 3 x 4 matrix over an internal ring>31gap> beta := VectorSpaceMorphism( a, homalg_matrix, b );32<A morphism in Category of matrices over Q>33gap> CokernelObject( alpha );34<A vector space object over Q of dimension 1>35gap> c := CokernelProjection( alpha );;36gap> Display( c );37[ [ 0 ],38[ 1 ],39[ -1/2 ],40[ 1 ] ]4142A split epimorphism in Category of matrices over Q43gap> gamma := UniversalMorphismIntoDirectSum( [ c, c ] );;44gap> Display( gamma );45[ [ 0, 0 ],46[ 1, 1 ],47[ -1/2, -1/2 ],48[ 1, 1 ] ]4950A morphism in Category of matrices over Q51gap> colift := CokernelColift( alpha, gamma );;52gap> IsEqualForMorphisms( PreCompose( c, colift ), gamma );53true54gap> FiberProduct( alpha, beta );55<A vector space object over Q of dimension 2>56gap> F := FiberProduct( alpha, beta );57<A vector space object over Q of dimension 2>58gap> p1 := ProjectionInFactorOfFiberProduct( [ alpha, beta ], 1 );59<A morphism in Category of matrices over Q>60gap> Display( PreCompose( p1, alpha ) );61[ [ 0, 1, 0, -1 ],62[ -1, 0, 2, 1 ] ]6364A morphism in Category of matrices over Q65gap> Pushout( alpha, beta );66<A vector space object over Q of dimension 5>67gap> i1 := InjectionOfCofactorOfPushout( [ alpha, beta ], 1 );68<A morphism in Category of matrices over Q>69gap> i2 := InjectionOfCofactorOfPushout( [ alpha, beta ], 2 );70<A morphism in Category of matrices over Q>71gap> u := UniversalMorphismFromDirectSum( [ b, b ], [ i1, i2 ] );72<A morphism in Category of matrices over Q>73gap> Display( u );74[ [ 0, 1, 1, 0, 0 ],75[ 1, 0, 1, 0, -1 ],76[ -1/2, 0, 1/2, 1, 1/2 ],77[ 1, 0, 0, 0, 0 ],78[ 0, 1, 0, 0, 0 ],79[ 0, 0, 1, 0, 0 ],80[ 0, 0, 0, 1, 0 ],81[ 0, 0, 0, 0, 1 ] ]8283A morphism in Category of matrices over Q84gap> KernelObjectFunctorial( u, IdentityMorphism( Source( u ) ), u ) = IdentityMorphism( VectorSpaceObject( 3, Q ) );85true86gap> IsZero( CokernelObjectFunctorial( u, IdentityMorphism( Range( u ) ), u ) );87true88gap> DirectProductFunctorial( [ u, u ] ) = DirectSumFunctorial( [ u, u ] );89true90gap> CoproductFunctorial( [ u, u ] ) = DirectSumFunctorial( [ u, u ] );91true92gap> IsOne( FiberProductFunctorial( [ [ u, IdentityMorphism( Source( u ) ), u ], [ u, IdentityMorphism( Source( u ) ) , u ] ] ) );93true94gap> IsOne( PushoutFunctorial( [ [ u, IdentityMorphism( Range( u ) ), u ], [ u, IdentityMorphism( Range( u ) ) , u ] ] ) );95true96]]></Example>979899</Section>100101102</Chapter>103104105106