7 Examples 7.1 Betti Diagrams 7.1-1 DE-2.2  Example  gap> R := HomalgFieldOfRationalsInDefaultCAS( ) * "x0,x1,x2";; gap> S := GradedRing( R );; gap> mat := HomalgMatrix( "[ x0^2, x1^2, x2^2 ]", 1, 3, S );   gap> M := RightPresentationWithDegrees( mat, S );  gap> M := RightPresentationWithDegrees( mat );  gap> d := Resolution( M );  gap> betti := BettiTable( d ); > gap> Display( betti );  total: 1 3 3 1 ----------------  0: 1 . . .  1: . 3 . .  2: . . 3 .  3: . . . 1 ---------------- degree: 0 1 2 3 gap> ## we are still below the Castelnuovo-Mumford regularity, which is 3: gap> M2 := SubmoduleGeneratedByHomogeneousPart( 2, M );  gap> d2 := Resolution( M2 );  gap> betti2 := BettiTable( d2 ); > gap> Display( betti2 );  total: 3 8 6 1 ----------------  2: 3 8 6 .  3: . . . 1 ---------------- degree: 0 1 2 3  7.1-2 DE-Code  Example  gap> R := HomalgFieldOfRationalsInDefaultCAS( ) * "x0,x1,x2";; gap> S := GradedRing( R );; gap> mat := HomalgMatrix( "[ x0^2, x1^2 ]", 1, 2, S );  gap> M := RightPresentationWithDegrees( mat, S );  gap> d := Resolution( M );  gap> betti := BettiTable( d ); > gap> Display( betti );  total: 1 2 1 --------------  0: 1 . .  1: . 2 .  2: . . 1 -------------- degree: 0 1 2 gap> m := SubmoduleGeneratedByHomogeneousPart( 2, M );  gap> d2 := Resolution( m );  gap> betti2 := BettiTable( d2 ); > gap> Display( betti2 );  2: 4 8 4 -------------- degree: 0 1 2  7.1-3 Schenck-3.2 This is an example from Section 3.2 in [Sch03].  Example  gap> Qxyz := HomalgFieldOfRationalsInDefaultCAS( ) * "x,y,z";; gap> mmat := HomalgMatrix( "[ x, x^3 + y^3 + z^3 ]", 1, 2, Qxyz );  gap> S := GradedRing( Qxyz );; gap> M := RightPresentationWithDegrees( mmat, S );  gap> Mr := Resolution( M );  gap> bettiM := BettiTable( Mr ); > gap> Display( bettiM );  total: 1 2 1 --------------  0: 1 1 .  1: . . .  2: . 1 1 -------------- degree: 0 1 2 gap> R := GradedRing( CoefficientsRing( S ) * "x,y,z,w" );; gap> nmat := HomalgMatrix( "[ z^2 - y*w, y*z - x*w, y^2 - x*z ]", 1, 3, R );  gap> N := RightPresentationWithDegrees( nmat );  gap> Nr := Resolution( N );  gap> bettiN := BettiTable( Nr ); > gap> Display( bettiN );  total: 1 3 2 --------------  0: 1 . .  1: . 3 2 -------------- degree: 0 1 2  7.1-4 Schenck-8.3 This is an example from Section 8.3 in [Sch03].  Example  gap> R := HomalgFieldOfRationalsInDefaultCAS( ) * "x,y,z,w";; gap> S := GradedRing( R );; gap> jmat := HomalgMatrix( "[ z*w, x*w, y*z, x*y, x^3*z - x*z^3 ]", 1, 5, S );  gap> J := RightPresentationWithDegrees( jmat );  gap> Jr := Resolution( J );  gap> betti := BettiTable( Jr ); > gap> Display( betti );  total: 1 5 6 2 ----------------  0: 1 . . .  1: . 4 4 1  2: . . . .  3: . 1 2 1 ---------------- degree: 0 1 2 3  7.1-5 Schenck-8.3.3 This is Exercise 8.3.3 in [Sch03].  Example  gap> Qxyz := HomalgFieldOfRationalsInDefaultCAS( ) * "x,y,z";; gap> S := GradedRing( Qxyz );; gap> mat := HomalgMatrix( "[ x*y*z, x*y^2, x^2*z, x^2*y, x^3 ]", 1, 5, S );  gap> M := RightPresentationWithDegrees( mat, S );  gap> Mr := Resolution( M );  gap> betti := BettiTable( Mr ); > gap> Display( betti );  total: 1 5 6 2 ----------------  0: 1 . . .  1: . . . .  2: . 5 6 2 ---------------- degree: 0 1 2 3  7.2 Commutative Algebra 7.2-1 Saturate  Example  gap> R := HomalgFieldOfRationalsInDefaultCAS( ) * "x,y,z";; gap> S := GradedRing( R );; gap> m := GradedLeftSubmodule( "x,y,z", S );  gap> I := Intersect( m^3, GradedLeftSubmodule( "x", S ) );  gap> NrRelations( I ); 8 gap> Im := SubobjectQuotient( I, m );  gap> I_m := Saturate( I, m );  gap> Is := Saturate( I );  gap> Assert( 0, Is = I_m );  7.3 Global Section Modules of the Induced Sheaves 7.3-1 Examples of the ModuleOfGlobalSections Functor and Purity Filtrations  Example  gap> LoadPackage( "GradedRingForHomalg" );; gap> Qxyzt := HomalgFieldOfRationalsInDefaultCAS( ) * "x,y,z,t";; gap> S := GradedRing( Qxyzt );; gap>  gap> wmat := HomalgMatrix( "[ \ > x*y, y*z, z*t, 0, 0, 0,\ > x^3*z,x^2*z^2,0, x*z^2*t, -z^2*t^2, 0,\ > x^4, x^3*z, 0, x^2*z*t, -x*z*t^2, 0,\ > 0, 0, x*y, -y^2, x^2-t^2, 0,\ > 0, 0, x^2*z, -x*y*z, y*z*t, 0,\ > 0, 0, x^2*y-x^2*t,-x*y^2+x*y*t,y^2*t-y*t^2,0,\ > 0, 0, 0, 0, -1, 1 \ > ]", 7, 6, Qxyzt );; gap>  gap> LoadPackage( "GradedModules" );; gap> wmor := GradedMap( wmat, "free", "free", "left", S );; gap> IsMorphism( wmor );; gap> W := LeftPresentationWithDegrees( wmat, S );; gap> HW := ModuleOfGlobalSections( W );  gap> LinearStrandOfTateResolution( W, 0,4 );  gap> purity_iso := IsomorphismOfFiltration( PurityFiltration( W ) );  gap> Hpurity_iso := ModuleOfGlobalSections( purity_iso );  gap> ModuleOfGlobalSections( wmor );  gap> NaturalMapToModuleOfGlobalSections( W );   7.3-2 Horrocks Mumford bundle This example computes the global sections module of the Horrocks-Mumford bundle.  Example  gap> LoadPackage( "GradedRingForHomalg" );; gap> R := HomalgFieldOfRationalsInDefaultCAS( ) * "x0..x4";; gap> S := GradedRing( R );; gap> A := KoszulDualRing( S, "e0..e4" );; gap> LoadPackage( "GradedModules" );; gap> mat := HomalgMatrix( "[ \ > e1*e4, e2*e0, e3*e1, e4*e2, e0*e3, \ > e2*e3, e3*e4, e4*e0, e0*e1, e1*e2 \ > ]", > 2, 5, A );  gap> phi := GradedMap( mat, "free", "free", "left", A );; gap> IsMorphism( phi ); true gap> M := GuessModuleOfGlobalSectionsFromATateMap( 2, phi ); #I GuessModuleOfGlobalSectionsFromATateMap uses a heuristic for efficiency; please check the correctness of the following result   gap> IsPure( M ); true gap> Rank( M ); 2  gap> Display( BettiTable( Resolution( M ) ) );  total: 19 35 20 2 --------------------  3: 4 . . .  4: 15 35 20 .  5: . . . 2 -------------------- degree: 0 1 2 3 gap> Display( BettiTable( TateResolution( M, -5, 5 ) ) ); total: 100 37 14 10 5 2 5 10 14 37 100 ? ? ? ? ----------|---|---|---|---|---|---|---|---|---|---|---|---|---|---|  4: 100 35 4 . . . . . . . . 0 0 0 0  3: * . 2 10 10 5 . . . . . . 0 0 0  2: * * . . . . . 2 . . . . . 0 0  1: * * * . . . . . . 5 10 10 2 . 0  0: * * * * . . . . . . . . 4 35 100 ----------|---|---|---|---|---|---|---|---|---|---|---|---|---|---S twist: -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 ------------------------------------------------------------------- Euler: 100 35 2 -10 -10 -5 0 2 0 -5 -10 -10 2 35 100 gap> M;  gap> P := ElementOfGrothendieckGroup( M ); ( 2*O_{P^4} - 1*O_{P^3} - 4*O_{P^2} - 2*O_{P^1} ) -> P^4 gap> P!.DisplayTwistedCoefficients := true; true gap> P; ( 2*O(-3) - 10*O(-2) + 15*O(-1) - 5*O(0) ) -> P^4 gap> chi := HilbertPolynomial( M ); 1/12*t^4+2/3*t^3-1/12*t^2-17/3*t-5 gap> c := ChernPolynomial( M ); ( 2 | 1-h+4*h^2 ) -> P^4 gap> ChernPolynomial( M * S^3 ); ( 2 | 1+5*h+10*h^2 ) -> P^4 gap> ch := ChernCharacter( M ); [ 2-u-7*u^2/2!+11*u^3/3!+17*u^4/4! ] -> P^4 gap> HilbertPolynomial( ch ); 1/12*t^4+2/3*t^3-1/12*t^2-17/3*t-5 gap> List( [ -8 .. 7 ], i -> Value( chi, i ) ); [ 35, 2, -10, -10, -5, 0, 2, 0, -5, -10, -10, 2, 35, 100, 210, 380 ] gap> HF := HilbertFunction( M ); function( t ) ... end gap> List( [ 0 .. 7 ], HF ); [ 0, 0, 0, 4, 35, 100, 210, 380 ] gap> IndexOfRegularity( M ); 4 gap> DataOfHilbertFunction( M ); [ [ [ 4 ], [ 3 ] ], 1/12*t^4+2/3*t^3-1/12*t^2-17/3*t-5 ]