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_Annihilator">7<Heading>Annihilator</Heading>89<Example><![CDATA[10gap> ZZ := HomalgRingOfIntegersInSingular();;11gap> M1 := AsLeftPresentation( HomalgMatrix( [ [ "2" ] ], ZZ ) );;12gap> M2 := AsLeftPresentation( HomalgMatrix( [ [ "3" ] ], ZZ ) );;13gap> M3 := AsLeftPresentation( HomalgMatrix( [ [ "4" ] ], ZZ ) );;14gap> M := DirectSum( M1, M2, M3 );;15gap> Display( Annihilator( M ) );16121718A monomorphism in Category of left presentations of Z19gap> M1 := AsRightPresentation( HomalgMatrix( [ [ "2" ] ], ZZ ) );;20gap> M2 := AsRightPresentation( HomalgMatrix( [ [ "3" ] ], ZZ ) );;21gap> M3 := AsRightPresentation( HomalgMatrix( [ [ "4" ] ], ZZ ) );;22gap> M := DirectSum( M1, M2, M3 );;23gap> Display( Annihilator( M ) );24122526A monomorphism in Category of right presentations of Z27]]></Example>282930</Section>313233<Section Label="Chapter_Examples_and_Tests_Section_Intersection_of_Submodules">34<Heading>Intersection of Submodules</Heading>3536<Example><![CDATA[37gap> Q := HomalgFieldOfRationalsInSingular();;38gap> R := Q * "x,y";39Q[x,y]40gap> F := AsLeftPresentation( HomalgMatrix( [ [ 0 ] ], R ) );41<An object in Category of left presentations of Q[x,y]>42gap> I1 := AsLeftPresentation( HomalgMatrix( [ [ "x" ] ], R ) );;43gap> I2 := AsLeftPresentation( HomalgMatrix( [ [ "y" ] ], R ) );;44gap> Display( I1 );45x4647An object in Category of left presentations of Q[x,y]48gap> Display( I2 );49y5051An object in Category of left presentations of Q[x,y]52gap> eps1 := PresentationMorphism( F, HomalgMatrix( [ [ 1 ] ], R ), I1 );53<A morphism in Category of left presentations of Q[x,y]>54gap> eps2 := PresentationMorphism( F, HomalgMatrix( [ [ 1 ] ], R ), I2 );55<A morphism in Category of left presentations of Q[x,y]>56gap> kernelemb1 := KernelEmbedding( eps1 );57<A monomorphism in Category of left presentations of Q[x,y]>58gap> kernelemb2 := KernelEmbedding( eps2 );59<A monomorphism in Category of left presentations of Q[x,y]>60gap> P := FiberProduct( kernelemb1, kernelemb2 );;61gap> Display( P );62(an empty 0 x 1 matrix)6364An object in Category of left presentations of Q[x,y]65gap> pi1 := ProjectionInFactorOfFiberProduct( [ kernelemb1, kernelemb2 ], 1 );66<A monomorphism in Category of left presentations of Q[x,y]>67gap> composite := PreCompose( pi1, kernelemb1 );68<A monomorphism in Category of left presentations of Q[x,y]>69gap> Display( composite );70x*y7172A monomorphism in Category of left presentations of Q[x,y]73]]></Example>747576</Section>777879<Section Label="Chapter_Examples_and_Tests_Section_Koszul_Complex">80<Heading>Koszul Complex</Heading>8182<Example><![CDATA[83gap> Q := HomalgFieldOfRationalsInSingular();;84gap> R := Q * "x,y,z";;85gap> M := HomalgMatrix( [ [ "x" ], [ "y" ], [ "z" ] ], 3, 1, R );;86gap> Ml := AsLeftPresentation( M );;87gap> eps := CoverByFreeModule( Ml );;88gap> iota1 := KernelEmbedding( eps );;89gap> Display( iota1 );90x,91y,92z9394A monomorphism in Category of left presentations of Q[x,y,z]95gap> Display( Source( iota1 ) );960, -z,y,97-y,x, 0,98-z,0, x99100An object in Category of left presentations of Q[x,y,z]101gap> pi1 := CoverByFreeModule( Source( iota1 ) );;102gap> d1 := PreCompose( pi1, iota1 );;103gap> Display( d1 );104x,105y,106z107108A morphism in Category of left presentations of Q[x,y,z]109gap> iota2 := KernelEmbedding( d1 );;110gap> Display( iota2 );1110, -z,y,112-y,x, 0,113-z,0, x114115A monomorphism in Category of left presentations of Q[x,y,z]116gap> Display( Source( iota2 ) );;117x,z,-y118119An object in Category of left presentations of Q[x,y,z]120gap> pi2 := CoverByFreeModule( Source( iota2 ) );;121gap> d2 := PreCompose( pi2, iota2 );;122gap> Display( d2 );1230, -z,y,124-y,x, 0,125-z,0, x126127A morphism in Category of left presentations of Q[x,y,z]128gap> iota3 := KernelEmbedding( d2 );;129gap> Display( iota3 );130x,z,-y131132A monomorphism in Category of left presentations of Q[x,y,z]133gap> Display( Source( iota3 ) );134(an empty 0 x 1 matrix)135136An object in Category of left presentations of Q[x,y,z]137gap> pi3 := CoverByFreeModule( Source( iota3 ) );;138gap> d3 := PreCompose( pi3, iota3 );;139gap> Display( d3 );140x,z,-y141142A morphism in Category of left presentations of Q[x,y,z]143gap> N := HomalgMatrix( [ [ "x" ] ], 1, 1, R );;144gap> Nl := AsLeftPresentation( N );;145gap> d2Nl := TensorProductOnMorphisms( d2, IdentityMorphism( Nl ) );;146gap> d1Nl := TensorProductOnMorphisms( d1, IdentityMorphism( Nl ) );;147gap> IsZero( PreCompose( d2Nl, d1Nl ) );148true149gap> cycles := KernelEmbedding( d1Nl );;150gap> boundaries := ImageEmbedding( d2Nl );;151gap> boundaries_in_cyles := LiftAlongMonomorphism( cycles, boundaries );;152gap> homology := CokernelObject( boundaries_in_cyles );;153gap> LessGenFunctor := FunctorLessGeneratorsLeft( R );;154gap> homology := ApplyFunctor( LessGenFunctor, homology );;155gap> StdBasisFunctor := FunctorStandardModuleLeft( R );;156gap> homology := ApplyFunctor( StdBasisFunctor, homology );;157gap> Display( homology );158z,159y,160x161162An object in Category of left presentations of Q[x,y,z]163]]></Example>164165166</Section>167168169<Section Label="Chapter_Examples_and_Tests_Section_Closed_Monoidal_Structure">170<Heading>Closed Monoidal Structure</Heading>171172<Example><![CDATA[173gap> R := HomalgRingOfIntegers( );;174gap> M := AsLeftPresentation( HomalgMatrix( [ [ 2 ] ], 1, 1, R ) );175<An object in Category of left presentations of Z>176gap> N := AsLeftPresentation( HomalgMatrix( [ [ 3 ] ], 1, 1, R ) );177<An object in Category of left presentations of Z>178gap> T := TensorProductOnObjects( M, N );179<An object in Category of left presentations of Z>180gap> Display( T );181[ [ 3 ],182[ 2 ] ]183184An object in Category of left presentations of Z185gap> IsZero( T );186true187gap> H := InternalHomOnObjects( DirectSum( M, M ), DirectSum( M, N ) );188<An object in Category of left presentations of Z>189gap> Display( H );190[ [ -4, -2 ],191[ 2, 2 ] ]192193An object in Category of left presentations of Z194gap> alpha := StandardGeneratorMorphism( H, 1 );195<A morphism in Category of left presentations of Z>196gap> l := LambdaElimination( DirectSum( M, M ), DirectSum( M, N ), alpha );197<A morphism in Category of left presentations of Z>198gap> IsZero( l );199false200gap> Display( l );201[ [ 0, 0 ],202[ 1, 0 ] ]203204A morphism in Category of left presentations of Z205gap> alpha2 := StandardGeneratorMorphism( H, 2 );206<A morphism in Category of left presentations of Z>207gap> l2 := LambdaElimination( DirectSum( M, M ), DirectSum( M, N ), alpha2 );208<A morphism in Category of left presentations of Z>209gap> IsZero( l2 );210false211gap> Display( l2 );212[ [ 1, 0 ],213[ 0, 0 ] ]214215A morphism in Category of left presentations of Z216]]></Example>217218219</Section>220221222</Chapter>223224225226