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: 4183461[1X5 [33X[0;0YExamples[133X[101X234[1X5.1 [33X[0;0YAn Easy Polynomial Example[133X[101X56[33X[0;0YThe ground ring used in this example is [22XF_3[x,y][122X. We want to see, how the7different rings in this package can be used to localize at different points8and how the results differ.[133X910[4X[32X Example [32X[104X11[4X[25Xgap>[125X [27XLoadPackage("RingsForHomalg");;[127X[104X12[4X[25Xgap>[125X [27XF3xy := HomalgRingOfIntegersInSingular(3) * "x,y";;[127X[104X13[4X[25Xgap>[125X [27Xx1 := HomalgRingElement( "x+2", F3xy );;[127X[104X14[4X[25Xgap>[125X [27Xy0 := HomalgRingElement( "y", F3xy );;[127X[104X15[4X[25Xgap>[125X [27XLoadPackage("LocalizeRingForHomalg");;[127X[104X16[4X[25Xgap>[125X [27XR00 := LocalizeAtZero( F3xy );;[127X[104X17[4X[25Xgap>[125X [27XR10 := LocalizeAt( F3xy, [ x1, y0 ] );;[127X[104X18[4X[25Xgap>[125X [27XRMora := LocalizePolynomialRingAtZeroWithMora( F3xy );;[127X[104X19[4X[25Xgap>[125X [27XM := HomalgMatrix( "[\[127X[104X20[4X[25X>[125X [27X y^3+2*y^2+x+x^2+2*x*y+y^4+x*y^2, \[127X[104X21[4X[25X>[125X [27X x*y^3+2*x^2*y+y^3+y^2+x+2*y+x^2, \[127X[104X22[4X[25X>[125X [27X x^2*y^2+2*x^3+x^2*y+y^3+2*x^2+2*x*y+y^2+2*y\[127X[104X23[4X[25X>[125X [27X ]", 1, 3, F3xy );;[127X[104X24[4X[25Xgap>[125X [27XLoadPackage( "Modules" );;[127X[104X25[4X[25Xgap>[125X [27XI := RightPresentation( M );;[127X[104X26[4X[25Xgap>[125X [27XM00 := HomalgLocalMatrix( M, R00 );;[127X[104X27[4X[25Xgap>[125X [27XM10 := HomalgLocalMatrix( M, R10 );;[127X[104X28[4X[25Xgap>[125X [27XMMora := HomalgLocalMatrix( M, RMora );;[127X[104X29[4X[25Xgap>[125X [27XI00 := RightPresentation( M00 );;[127X[104X30[4X[25Xgap>[125X [27XI10 := RightPresentation( M10 );;[127X[104X31[4X[25Xgap>[125X [27XIMora := RightPresentation( MMora );;[127X[104X32[4X[32X[104X3334[33X[0;0YThis ring is able to compute a standard basis of the module.[133X3536[4X[32X Example [32X[104X37[4X[25Xgap>[125X [27XDisplay( IMora );[127X[104X38[4X[28XGF(3)[x,y]_< x, y >/< (x+x^2-x*y-y^2+x*y^2+y^3+y^4)/1, (x-y+x^2+y^2-x^2*y+y^3+\[128X[104X39[4X[28Xx*y^3)/1, (-y-x^2-x*y+y^2-x^3+x^2*y+y^3+x^2*y^2)/1 >[128X[104X40[4X[25Xgap>[125X [27XByASmallerPresentation( IMora );[127X[104X41[4X[28X<A cyclic torsion right module on a cyclic generator satisfying 2 relations>[128X[104X42[4X[25Xgap>[125X [27XDisplay( IMora );[127X[104X43[4X[28XGF(3)[x,y]_< x, y >/< x/1, y/1 >[128X[104X44[4X[32X[104X4546[33X[0;0YThis ring recognizes, that the module is not zero, but is not able to find47better generators.[133X4849[4X[32X Example [32X[104X50[4X[25Xgap>[125X [27XDisplay( I00 );[127X[104X51[4X[28XGF(3)[x,y]_< x, y >/< (y^4+x*y^2+y^3+x^2-x*y-y^2+x)/1, (x*y^3-x^2*y+y^3+x^2+y^\[128X[104X52[4X[28X2+x-y)/1, (x^2*y^2-x^3+x^2*y+y^3-x^2-x*y+y^2-y)/1 >[128X[104X53[4X[25Xgap>[125X [27XByASmallerPresentation( I00 );[127X[104X54[4X[28X<A cyclic right module on a cyclic generator satisfying 3 relations>[128X[104X55[4X[25Xgap>[125X [27XDisplay( I00 );[127X[104X56[4X[28XGF(3)[x,y]_< x, y >/< (y^4+x*y^2+y^3+x^2-x*y-y^2+x)/1, (x*y^3-x^2*y+y^3+x^2+y^\[128X[104X57[4X[28X2+x-y)/1, (x^2*y^2-x^3+x^2*y+y^3-x^2-x*y+y^2-y)/1 >[128X[104X58[4X[32X[104X5960[33X[0;0YWe are able to change the ring, to compute a nicer basis.[133X6162[4X[32X Example [32X[104X63[4X[25Xgap>[125X [27XI00ToMora := RMora * I00;[127X[104X64[4X[28X<A cyclic right module on a cyclic generator satisfying 3 relations>[128X[104X65[4X[25Xgap>[125X [27XDisplay( I00ToMora );[127X[104X66[4X[28XGF(3)[x,y]_< x, y >/< (x+x^2-x*y-y^2+x*y^2+y^3+y^4)/1, (x-y+x^2+y^2-x^2*y+y^3+\[128X[104X67[4X[28Xx*y^3)/1, (-y-x^2-x*y+y^2-x^3+x^2*y+y^3+x^2*y^2)/1 >[128X[104X68[4X[25Xgap>[125X [27XByASmallerPresentation( I00ToMora );[127X[104X69[4X[28X<A cyclic torsion right module on a cyclic generator satisfying 2 relations>[128X[104X70[4X[25Xgap>[125X [27XDisplay( I00ToMora );[127X[104X71[4X[28XGF(3)[x,y]_< x, y >/< x/1, y/1 >[128X[104X72[4X[32X[104X7374[33X[0;0YWe are able to find out, that this module is actually zero.[133X7576[4X[32X Example [32X[104X77[4X[25Xgap>[125X [27XDisplay( I10 );[127X[104X78[4X[28XGF(3)[x,y]_< x-1, y >/< (y^4+x*y^2+y^3+x^2-x*y-y^2+x)/1, (x*y^3-x^2*y+y^3+x^2+\[128X[104X79[4X[28Xy^2+x-y)/1, (x^2*y^2-x^3+x^2*y+y^3-x^2-x*y+y^2-y)/1 >[128X[104X80[4X[25Xgap>[125X [27XByASmallerPresentation( I10 );[127X[104X81[4X[28X<A zero right module>[128X[104X82[4X[25Xgap>[125X [27XDisplay( I10 );[127X[104X83[4X[28X0[128X[104X84[4X[32X[104X858687[1X5.2 [33X[0;0YHom(Hom(-,Z128),Z16)[133X[101X8889[33X[0;0YThe following example is taken from Section 2 of [BR06].[133X90[33X[0;0YThe computation takes place over the local ring [22XR=ℤ_⟨ 2⟩[122X (i.e. ℤ localized91at the maximal ideal generated by [22X2[122X).[133X9293[33X[0;0YHere we compute the (infinite) long exact homology sequence of the covariant94functor [22XHom(Hom(-,R/2^7R),R/2^4R)[122X (and its left derived functors) applied to95the short exact sequence[133X96[33X[0;0Y[22X0 -> M_=R/2^2R --alpha_1--> M=R/2^5R --alpha_2--> _M=R/2^3R -> 0[122X.[133X9798[4X[32X Example [32X[104X99[4X[25Xgap>[125X [27XLoadPackage( "LocalizeRingForHomalg" );;[127X[104X100[4X[25Xgap>[125X [27XGlobalR := HomalgRingOfIntegersInExternalGAP( );[127X[104X101[4X[28XZ[128X[104X102[4X[25Xgap>[125X [27XDisplay( GlobalR );[127X[104X103[4X[28X<An external ring residing in the CAS GAP>[128X[104X104[4X[25Xgap>[125X [27XLoadPackage( "RingsForHomalg" );;[127X[104X105[4X[25Xgap>[125X [27XR := LocalizeAt( GlobalR , [ 2 ] );[127X[104X106[4X[28XZ_< 2 >[128X[104X107[4X[25Xgap>[125X [27XDisplay( R );[127X[104X108[4X[28X<A local ring>[128X[104X109[4X[25Xgap>[125X [27XM := LeftPresentation( HomalgMatrix( [ 2^5 ], R ) );[127X[104X110[4X[28X<A cyclic left module presented by 1 relation for a cyclic generator>[128X[104X111[4X[25Xgap>[125X [27X_M := LeftPresentation( HomalgMatrix( [ 2^3 ], R ) );[127X[104X112[4X[28X<A cyclic left module presented by 1 relation for a cyclic generator>[128X[104X113[4X[25Xgap>[125X [27Xalpha2 := HomalgMap( HomalgMatrix( [ 1 ], R ), M, _M );[127X[104X114[4X[28X<A "homomorphism" of left modules>[128X[104X115[4X[25Xgap>[125X [27XM_ := Kernel( alpha2 );[127X[104X116[4X[28X<A cyclic left module presented by yet unknown relations for a cyclic generato\[128X[104X117[4X[28Xr>[128X[104X118[4X[25Xgap>[125X [27Xalpha1 := KernelEmb( alpha2 );[127X[104X119[4X[28X<A monomorphism of left modules>[128X[104X120[4X[25Xgap>[125X [27Xseq := HomalgComplex( alpha2 );[127X[104X121[4X[28X<A "complex" containing a single morphism of left modules at degrees[128X[104X122[4X[28X[ 0 .. 1 ]>[128X[104X123[4X[25Xgap>[125X [27XAdd( seq, alpha1 );[127X[104X124[4X[25Xgap>[125X [27XIsShortExactSequence( seq );[127X[104X125[4X[28Xtrue[128X[104X126[4X[25Xgap>[125X [27XK := LeftPresentation( HomalgMatrix( [ 2^7 ], R ) );[127X[104X127[4X[28X<A cyclic left module presented by 1 relation for a cyclic generator>[128X[104X128[4X[25Xgap>[125X [27XL := RightPresentation( HomalgMatrix( [ 2^4 ], R ) );[127X[104X129[4X[28X<A cyclic right module on a cyclic generator satisfying 1 relation>[128X[104X130[4X[25Xgap>[125X [27Xtriangle := LHomHom( 4, seq, K, L, "t" );[127X[104X131[4X[28X<An exact triangle containing 3 morphisms of left complexes at degrees[128X[104X132[4X[28X[ 1, 2, 3, 1 ]>[128X[104X133[4X[25Xgap>[125X [27Xlehs := LongSequence( triangle );[127X[104X134[4X[28X<A sequence containing 14 morphisms of left modules at degrees [ 0 .. 14 ]>[128X[104X135[4X[25Xgap>[125X [27XByASmallerPresentation( lehs );[127X[104X136[4X[28X<A non-zero sequence containing 14 morphisms of left modules at degrees[128X[104X137[4X[28X[ 0 .. 14 ]>[128X[104X138[4X[25Xgap>[125X [27XIsExactSequence( lehs );[127X[104X139[4X[28Xtrue[128X[104X140[4X[32X[104X141142143[1X5.3 [33X[0;0YResidueClass[133X[101X144145[33X[0;0YWe want to show, how localization can work together with residue class146rings.[133X147148[4X[32X Example [32X[104X149[4X[25Xgap>[125X [27XLoadPackage( "RingsForHomalg" );;[127X[104X150[4X[25Xgap>[125X [27XQxy := HomalgFieldOfRationalsInDefaultCAS( ) * "x,y";[127X[104X151[4X[28XQ[x,y][128X[104X152[4X[25Xgap>[125X [27Xwmat := HomalgMatrix([127X[104X153[4X[25X>[125X [27X "[ y^3-y^2 , x^3-x^2 , y^3+y^2 , x^3+x^2 ]",[127X[104X154[4X[25X>[125X [27X 2, 2, Qxy );[127X[104X155[4X[28X<A 2 x 2 matrix over an external ring>[128X[104X156[4X[25Xgap>[125X [27Xec := HomalgRingElement( "-x^3-x^2+2*y^2", Qxy );[127X[104X157[4X[28X-x^3-x^2+2*y^2[128X[104X158[4X[32X[104X159160[33X[0;0YCompute globally:[133X161162[4X[32X Example [32X[104X163[4X[25Xgap>[125X [27XLoadPackage( "Modules" );;[127X[104X164[4X[25Xgap>[125X [27XW := LeftPresentation( wmat );[127X[104X165[4X[28X<A left module presented by 2 relations for 2 generators>[128X[104X166[4X[25Xgap>[125X [27XRes := Resolution( 2 , W );[127X[104X167[4X[28X<A right acyclic complex containing 2 morphisms of left modules at degrees[128X[104X168[4X[28X[ 0 .. 2 ]>[128X[104X169[4X[25Xgap>[125X [27XDisplay( Res );[127X[104X170[4X[28X-------------------------[128X[104X171[4X[28Xat homology degree: 2[128X[104X172[4X[28X0[128X[104X173[4X[28X-------------------------[128X[104X174[4X[28X(an empty 0 x 2 matrix)[128X[104X175[4X[28X[128X[104X176[4X[28Xthe map is currently represented by the above 0 x 2 matrix[128X[104X177[4X[28X------------v------------[128X[104X178[4X[28Xat homology degree: 1[128X[104X179[4X[28XQ[x,y]^(1 x 2)[128X[104X180[4X[28X-------------------------[128X[104X181[4X[28Xy^2, x^2,[128X[104X182[4X[28Xx*y^2-y^3,0[128X[104X183[4X[28X[128X[104X184[4X[28Xthe map is currently represented by the above 2 x 2 matrix[128X[104X185[4X[28X------------v------------[128X[104X186[4X[28Xat homology degree: 0[128X[104X187[4X[28XQ[x,y]^(1 x 2)[128X[104X188[4X[28X-------------------------[128X[104X189[4X[32X[104X190191[33X[0;0YTry a localization of a residue class ring:[133X192193[4X[32X Example [32X[104X194[4X[25Xgap>[125X [27XR1 := Qxy / ec;[127X[104X195[4X[28XQ[x,y]/( -x^3-x^2+2*y^2 )[128X[104X196[4X[25Xgap>[125X [27XDisplay( R1 );[127X[104X197[4X[28X<A residue class ring>[128X[104X198[4X[25Xgap>[125X [27Xwmat1 := R1 * wmat;[127X[104X199[4X[28X<A 2 x 2 matrix over a residue class ring>[128X[104X200[4X[25Xgap>[125X [27XLoadPackage( "LocalizeRingForHomalg" );;[127X[104X201[4X[25Xgap>[125X [27XR10 := LocalizeAt( R1 ,[127X[104X202[4X[25X>[125X [27X [ HomalgRingElement( "x", R1 ),[127X[104X203[4X[25X>[125X [27X HomalgRingElement( "y", R1 ) ][127X[104X204[4X[25X>[125X [27X );[127X[104X205[4X[28XQ[x,y]/( x^3+x^2-2*y^2 )_< |[ x ]|, |[ y ]| >[128X[104X206[4X[25Xgap>[125X [27XDisplay( R10 );[127X[104X207[4X[28X<A local ring>[128X[104X208[4X[25Xgap>[125X [27Xwmat10 := HomalgLocalMatrix( wmat, R10 );[127X[104X209[4X[28X<A 2 x 2 matrix over a local ring>[128X[104X210[4X[25Xgap>[125X [27XW10 := LeftPresentation( wmat10 );[127X[104X211[4X[28X<A left module presented by 2 relations for 2 generators>[128X[104X212[4X[25Xgap>[125X [27XRes10 := Resolution( 2 , W10 );[127X[104X213[4X[28X<A right acyclic complex containing 2 morphisms of left modules at degrees[128X[104X214[4X[28X[ 0 .. 2 ]>[128X[104X215[4X[25Xgap>[125X [27XDisplay( Res10 );[127X[104X216[4X[28X-------------------------[128X[104X217[4X[28Xat homology degree: 2[128X[104X218[4X[28X0[128X[104X219[4X[28X-------------------------[128X[104X220[4X[28X(an empty 0 x 2 matrix)[128X[104X221[4X[28X[128X[104X222[4X[28Xthe map is currently represented by the above 0 x 2 matrix[128X[104X223[4X[28X------------v------------[128X[104X224[4X[28Xat homology degree: 1[128X[104X225[4X[28XQ[x,y]/( x^3+x^2-2*y^2 )_< |[ x ]|, |[ y ]| >^(1 x 2)[128X[104X226[4X[28X-------------------------[128X[104X227[4X[28X0, x*y^2-y^3,[128X[104X228[4X[28Xy^2,y^4-2*y^3+2*y^2[128X[104X229[4X[28X[128X[104X230[4X[28Xmodulo [ x^3+x^2-2*y^2 ][128X[104X231[4X[28X/ |[ 1 ]|[128X[104X232[4X[28X[128X[104X233[4X[28Xthe map is currently represented by the above 2 x 2 matrix[128X[104X234[4X[28X------------v------------[128X[104X235[4X[28Xat homology degree: 0[128X[104X236[4X[28XQ[x,y]/( x^3+x^2-2*y^2 )_< |[ x ]|, |[ y ]| >^(1 x 2)[128X[104X237[4X[28X-------------------------[128X[104X238[4X[32X[104X239240[33X[0;0YTry a residue class ring of a localization:[133X241242[4X[32X Example [32X[104X243[4X[25Xgap>[125X [27XR0 := LocalizeAtZero( Qxy );[127X[104X244[4X[28XQ[x,y]_< x, y >[128X[104X245[4X[25Xgap>[125X [27XDisplay( R0 );[127X[104X246[4X[28X<A local ring>[128X[104X247[4X[25Xgap>[125X [27Xwmat0 := R0 * wmat;[127X[104X248[4X[28X<A 2 x 2 matrix over a local ring>[128X[104X249[4X[25Xgap>[125X [27XR01 := R0 / ( ec / R0 );[127X[104X250[4X[28XQ[x,y]_< x, y >/( (-x^3-x^2+2*y^2)/1 )[128X[104X251[4X[25Xgap>[125X [27XDisplay( R01 );[127X[104X252[4X[28X<A residue class ring>[128X[104X253[4X[25Xgap>[125X [27Xwmat01 := R01 * wmat0;[127X[104X254[4X[28X<A 2 x 2 matrix over a residue class ring>[128X[104X255[4X[25Xgap>[125X [27XW01 := LeftPresentation( wmat01 );[127X[104X256[4X[28X<A left module presented by 2 relations for 2 generators>[128X[104X257[4X[25Xgap>[125X [27XRes01 := Resolution( 2 , W01 );[127X[104X258[4X[28X<A right acyclic complex containing 2 morphisms of left modules at degrees[128X[104X259[4X[28X[ 0 .. 2 ]>[128X[104X260[4X[25Xgap>[125X [27XDisplay( Res01 );[127X[104X261[4X[28X-------------------------[128X[104X262[4X[28Xat homology degree: 2[128X[104X263[4X[28X0[128X[104X264[4X[28X-------------------------[128X[104X265[4X[28X(an empty 0 x 2 matrix)[128X[104X266[4X[28X[128X[104X267[4X[28Xthe map is currently represented by the above 0 x 2 matrix[128X[104X268[4X[28X------------v------------[128X[104X269[4X[28Xat homology degree: 1[128X[104X270[4X[28XQ[x,y]_< x, y >/( (x^3+x^2-2*y^2)/1 )^(1 x 2)[128X[104X271[4X[28X-------------------------[128X[104X272[4X[28Xy^2, x^2,[128X[104X273[4X[28Xy^3+y^2,2*y^2[128X[104X274[4X[28X/ 1[128X[104X275[4X[28X[128X[104X276[4X[28Xmodulo [ (x^3+x^2-2*y^2)/1 ][128X[104X277[4X[28X[128X[104X278[4X[28Xthe map is currently represented by the above 2 x 2 matrix[128X[104X279[4X[28X------------v------------[128X[104X280[4X[28Xat homology degree: 0[128X[104X281[4X[28XQ[x,y]_< x, y >/( (x^3+x^2-2*y^2)/1 )^(1 x 2)[128X[104X282[4X[28X-------------------------[128X[104X283[4X[32X[104X284285286[1X5.4 [33X[0;0YTesting the Intersection Formula[133X[101X287288[33X[0;0YWe want to check Serre's intersection formula [22Xi(I_1, I_2; 0)=∑_i(-1)^i289length(Tor^R_0_i(R_0/I_1,R_0/I_2))[122X on an easy affine example.[133X290291[4X[32X Example [32X[104X292[4X[28X [128X[104X293[4X[25Xgap>[125X [27XLoadPackage( "RingsForHomalg" );;[127X[104X294[4X[25Xgap>[125X [27XR := HomalgFieldOfRationalsInSingular() * "w,x,y,z";;[127X[104X295[4X[25Xgap>[125X [27XLoadPackage( "LocalizeRingForHomalg" );;[127X[104X296[4X[25Xgap>[125X [27XR0 := LocalizePolynomialRingAtZeroWithMora( R );;[127X[104X297[4X[25Xgap>[125X [27XM1 := HomalgMatrix( "[\[127X[104X298[4X[25X>[125X [27X (w-x^2)*y, \[127X[104X299[4X[25X>[125X [27X (w-x^2)*z, \[127X[104X300[4X[25X>[125X [27X (x-w^2)*y, \[127X[104X301[4X[25X>[125X [27X (x-w^2)*z \[127X[104X302[4X[25X>[125X [27X ]", 4, 1, R );;[127X[104X303[4X[25Xgap>[125X [27XM2 := HomalgMatrix( "[\[127X[104X304[4X[25X>[125X [27X (w-x^2)-y, \[127X[104X305[4X[25X>[125X [27X (x-w^2)-z \[127X[104X306[4X[25X>[125X [27X ]", 2, 1, R );;[127X[104X307[4X[25Xgap>[125X [27XLoadPackage( "Modules" );;[127X[104X308[4X[25Xgap>[125X [27XRmodI1 := LeftPresentation( M1 );;[127X[104X309[4X[25Xgap>[125X [27XRmodI2 := LeftPresentation( M2 );;[127X[104X310[4X[25Xgap>[125X [27XT:=Tor( RmodI1, RmodI2 );[127X[104X311[4X[28X<A graded homology object consisting of 4 left modules at degrees [ 0 .. 3 ]>[128X[104X312[4X[25Xgap>[125X [27XList( ObjectsOfComplex( T ), AffineDegree );[127X[104X313[4X[28X[ 12, 4, 0, 0 ][128X[104X314[4X[32X[104X315316[33X[0;0YWe read, that the intersection multiplicity is 12-4=8 globally.[133X317318[4X[32X Example [32X[104X319[4X[25Xgap>[125X [27XM10 := R0 * M1;[127X[104X320[4X[28X<A 4 x 1 matrix over a local (Mora) ring>[128X[104X321[4X[25Xgap>[125X [27XM20 := R0 * M2;[127X[104X322[4X[28X<A 2 x 1 matrix over a local (Mora) ring>[128X[104X323[4X[25Xgap>[125X [27XR0modI10 := LeftPresentation( M10 );;[127X[104X324[4X[25Xgap>[125X [27XR0modI20 := LeftPresentation( M20 );;[127X[104X325[4X[25Xgap>[125X [27XT0 := Tor( R0modI10, R0modI20 );[127X[104X326[4X[28X<A graded homology object consisting of 4 left modules at degrees [ 0 .. 3 ]>[128X[104X327[4X[25Xgap>[125X [27XList( ObjectsOfComplex( T0 ), AffineDegree );[127X[104X328[4X[28X[ 3, 1, 0, 0 ][128X[104X329[4X[32X[104X330331[33X[0;0YThe intersection multiplicity at zero is 3-1=2.[133X332333334335