  
  [1X7 Examples[0X
  
  
  [1X7.1 Betti Diagrams[0X
  
  
  [1X7.1-1 DE-2.2[0X
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> R := HomalgFieldOfRationalsInDefaultCAS( ) * "x0,x1,x2";;[0X
    [4Xgap> S := GradedRing( R );;[0X
    [4Xgap> mat := HomalgMatrix( "[ x0^2, x1^2, x2^2 ]", 1, 3, S ); [0X
    [4X<A 1 x 3 matrix over a graded ring>[0X
    [4Xgap> M := RightPresentationWithDegrees( mat, S );[0X
    [4X<A graded cyclic right module on a cyclic generator satisfying 3 relations>[0X
    [4Xgap> M := RightPresentationWithDegrees( mat );[0X
    [4X<A graded cyclic right module on a cyclic generator satisfying 3 relations>[0X
    [4Xgap> d := Resolution( M );[0X
    [4X<A right acyclic complex containing[0X
    [4X3 morphisms of graded right modules at degrees [ 0 .. 3 ]>[0X
    [4Xgap> betti := BettiDiagram( d );[0X
    [4X<A Betti diagram of <A right acyclic complex containing[0X
    [4X3 morphisms of graded right modules at degrees [ 0 .. 3 ]>>[0X
    [4Xgap> Display( betti );[0X
    [4X total:  1 3 3 1[0X
    [4X----------------[0X
    [4X     0:  1 . . .[0X
    [4X     1:  . 3 . .[0X
    [4X     2:  . . 3 .[0X
    [4X     3:  . . . 1[0X
    [4X----------------[0X
    [4Xdegree:  0 1 2 3[0X
    [4Xgap> ## we are still below the Castelnuovo-Mumford regularity, which is 3:[0X
    [4Xgap> M2 := SubmoduleGeneratedByHomogeneousPart( 2, M );[0X
    [4X<A graded torsion right submodule given by 3 generators>[0X
    [4Xgap> d2 := Resolution( M2 );[0X
    [4X<A right acyclic complex containing[0X
    [4X3 morphisms of graded right modules at degrees [ 0 .. 3 ]>[0X
    [4Xgap> betti2 := BettiDiagram( d2 );[0X
    [4X<A Betti diagram of <A right acyclic complex containing[0X
    [4X3 morphisms of graded right modules at degrees [ 0 .. 3 ]>>[0X
    [4Xgap> Display( betti2 );[0X
    [4X total:  3 8 6 1[0X
    [4X----------------[0X
    [4X     2:  3 8 6 .[0X
    [4X     3:  . . . 1[0X
    [4X----------------[0X
    [4Xdegree:  0 1 2 3[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1X7.1-2 DE-Code[0X
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> R := HomalgFieldOfRationalsInDefaultCAS( ) * "x0,x1,x2";;[0X
    [4Xgap> S := GradedRing( R );;[0X
    [4Xgap> mat := HomalgMatrix( "[ x0^2, x1^2 ]", 1, 2, S );[0X
    [4X<A 1 x 2 matrix over a graded ring>[0X
    [4Xgap> M := RightPresentationWithDegrees( mat, S );[0X
    [4X<A graded cyclic right module on a cyclic generator satisfying 2 relations>[0X
    [4Xgap> d := Resolution( M );[0X
    [4X<A right acyclic complex containing[0X
    [4X2 morphisms of graded right modules at degrees [ 0 .. 2 ]>[0X
    [4Xgap> betti := BettiDiagram( d );[0X
    [4X<A Betti diagram of <A right acyclic complex containing[0X
    [4X2 morphisms of graded right modules at degrees [ 0 .. 2 ]>>[0X
    [4Xgap> Display( betti );[0X
    [4X total:  1 2 1[0X
    [4X--------------[0X
    [4X     0:  1 . .[0X
    [4X     1:  . 2 .[0X
    [4X     2:  . . 1[0X
    [4X--------------[0X
    [4Xdegree:  0 1 2[0X
    [4Xgap> m := SubmoduleGeneratedByHomogeneousPart( 2, M );[0X
    [4X<A graded torsion right submodule given by 4 generators>[0X
    [4Xgap> d2 := Resolution( m );[0X
    [4X<A right acyclic complex containing[0X
    [4X2 morphisms of graded right modules at degrees [ 0 .. 2 ]>[0X
    [4Xgap> betti2 := BettiDiagram( d2 );[0X
    [4X<A Betti diagram of <A right acyclic complex containing[0X
    [4X2 morphisms of graded right modules at degrees [ 0 .. 2 ]>>[0X
    [4Xgap> Display( betti2 );[0X
    [4X     2:  4 8 4[0X
    [4X--------------[0X
    [4Xdegree:  0 1 2[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1X7.1-3 Schenck-3.2[0X
  
  This is an example from Section 3.2 in [Sch03].
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> Qxyz := HomalgFieldOfRationalsInDefaultCAS( ) * "x,y,z";;[0X
    [4Xgap> mmat := HomalgMatrix( "[ x, x^3 + y^3 + z^3 ]", 1, 2, Qxyz );[0X
    [4X<A 1 x 2 matrix over an external ring>[0X
    [4Xgap> S := GradedRing( Qxyz );;[0X
    [4Xgap> M := RightPresentationWithDegrees( mmat, S );[0X
    [4X<A graded cyclic right module on a cyclic generator satisfying 2 relations>[0X
    [4Xgap> Mr := Resolution( M );[0X
    [4X<A right acyclic complex containing[0X
    [4X2 morphisms of graded right modules at degrees [ 0 .. 2 ]>[0X
    [4Xgap> bettiM := BettiDiagram( Mr );[0X
    [4X<A Betti diagram of <A right acyclic complex containing[0X
    [4X2 morphisms of graded right modules at degrees [ 0 .. 2 ]>>[0X
    [4Xgap> Display( bettiM );[0X
    [4X total:  1 2 1[0X
    [4X--------------[0X
    [4X     0:  1 1 .[0X
    [4X     1:  . . .[0X
    [4X     2:  . 1 1[0X
    [4X--------------[0X
    [4Xdegree:  0 1 2[0X
    [4Xgap> R := GradedRing( CoefficientsRing( S ) * "x,y,z,w" );;[0X
    [4Xgap> nmat := HomalgMatrix( "[ z^2 - y*w, y*z - x*w, y^2 - x*z ]", 1, 3, R );[0X
    [4X<A 1 x 3 matrix over a graded ring>[0X
    [4Xgap> N := RightPresentationWithDegrees( nmat );[0X
    [4X<A graded cyclic right module on a cyclic generator satisfying 3 relations>[0X
    [4Xgap> Nr := Resolution( N );[0X
    [4X<A right acyclic complex containing[0X
    [4X2 morphisms of graded right modules at degrees [ 0 .. 2 ]>[0X
    [4Xgap> bettiN := BettiDiagram( Nr );[0X
    [4X<A Betti diagram of <A right acyclic complex containing[0X
    [4X2 morphisms of graded right modules at degrees [ 0 .. 2 ]>>[0X
    [4Xgap> Display( bettiN );[0X
    [4X total:  1 3 2[0X
    [4X--------------[0X
    [4X     0:  1 . .[0X
    [4X     1:  . 3 2[0X
    [4X--------------[0X
    [4Xdegree:  0 1 2[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1X7.1-4 Schenck-8.3[0X
  
  This is an example from Section 8.3 in [Sch03].
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> R := HomalgFieldOfRationalsInDefaultCAS( ) * "x,y,z,w";;[0X
    [4Xgap> S := GradedRing( R );;[0X
    [4Xgap> jmat := HomalgMatrix( "[ z*w, x*w, y*z, x*y, x^3*z - x*z^3 ]", 1, 5, S );[0X
    [4X<A 1 x 5 matrix over a graded ring>[0X
    [4Xgap> J := RightPresentationWithDegrees( jmat );[0X
    [4X<A graded cyclic right module on a cyclic generator satisfying 5 relations>[0X
    [4Xgap> Jr := Resolution( J );[0X
    [4X<A right acyclic complex containing[0X
    [4X3 morphisms of graded right modules at degrees [ 0 .. 3 ]>[0X
    [4Xgap> betti := BettiDiagram( Jr );[0X
    [4X<A Betti diagram of <A right acyclic complex containing[0X
    [4X3 morphisms of graded right modules at degrees [ 0 .. 3 ]>>[0X
    [4Xgap> Display( betti );[0X
    [4X total:  1 5 6 2[0X
    [4X----------------[0X
    [4X     0:  1 . . .[0X
    [4X     1:  . 4 4 1[0X
    [4X     2:  . . . .[0X
    [4X     3:  . 1 2 1[0X
    [4X----------------[0X
    [4Xdegree:  0 1 2 3[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1X7.1-5 Schenck-8.3.3[0X
  
  This is Exercise 8.3.3 in [Sch03].
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> Qxyz := HomalgFieldOfRationalsInDefaultCAS( ) * "x,y,z";;[0X
    [4Xgap> S := GradedRing( Qxyz );;[0X
    [4Xgap> mat := HomalgMatrix( "[ x*y*z, x*y^2, x^2*z, x^2*y, x^3 ]", 1, 5, S );[0X
    [4X<A 1 x 5 matrix over a graded ring>[0X
    [4Xgap> M := RightPresentationWithDegrees( mat, S );[0X
    [4X<A graded cyclic right module on a cyclic generator satisfying 5 relations>[0X
    [4Xgap> Mr := Resolution( M );[0X
    [4X<A right acyclic complex containing[0X
    [4X3 morphisms of graded right modules at degrees [ 0 .. 3 ]>[0X
    [4Xgap> betti := BettiDiagram( Mr );[0X
    [4X<A Betti diagram of <A right acyclic complex containing[0X
    [4X3 morphisms of graded right modules at degrees [ 0 .. 3 ]>>[0X
    [4Xgap> Display( betti );[0X
    [4X total:  1 5 6 2[0X
    [4X----------------[0X
    [4X     0:  1 . . .[0X
    [4X     1:  . . . .[0X
    [4X     2:  . 5 6 2[0X
    [4X----------------[0X
    [4Xdegree:  0 1 2 3[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1X7.2 Commutative Algebra[0X
  
  
  [1X7.2-1 Saturate[0X
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> R := HomalgFieldOfRationalsInDefaultCAS( ) * "x,y,z";;[0X
    [4Xgap> S := GradedRing( R );;[0X
    [4Xgap> m := GradedLeftSubmodule( "x,y,z", S );[0X
    [4X<A graded torsion-free (left) ideal given by 3 generators>[0X
    [4Xgap> I := Intersect( m^3, GradedLeftSubmodule( "x", S ) );[0X
    [4X<A graded torsion-free (left) ideal given by 6 generators>[0X
    [4Xgap> NrRelations( I );[0X
    [4X8[0X
    [4Xgap> Im := SubobjectQuotient( I, m );[0X
    [4X<A graded torsion-free rank 1 (left) ideal given by 3 generators>[0X
    [4Xgap> I_m := Saturate( I, m );[0X
    [4X<A graded principal (left) ideal of rank 1 on a free generator>[0X
    [4Xgap> Is := Saturate( I );[0X
    [4X<A graded principal (left) ideal of rank 1 on a free generator>[0X
    [4Xgap> Assert( 0, Is = I_m );[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1X7.3 Global Section Modules of the Induced Sheaves[0X
  
  
  [1X7.3-1 Examples of the ModuleOfGlobalSections Functor and Purity Filtrations[0X
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> LoadPackage( "GradedRingForHomalg" );;[0X
    [4Xgap> Qxyzt := HomalgFieldOfRationalsInDefaultCAS( ) * "x,y,z,t";;[0X
    [4Xgap> S := GradedRing( Qxyzt );;[0X
    [4Xgap> [0X
    [4Xgap> wmat := HomalgMatrix( "[ \[0X
    [4X> x*y,  y*z,    z*t,        0,           0,          0,\[0X
    [4X> x^3*z,x^2*z^2,0,          x*z^2*t,     -z^2*t^2,   0,\[0X
    [4X> x^4,  x^3*z,  0,          x^2*z*t,     -x*z*t^2,   0,\[0X
    [4X> 0,    0,      x*y,        -y^2,        x^2-t^2,    0,\[0X
    [4X> 0,    0,      x^2*z,      -x*y*z,      y*z*t,      0,\[0X
    [4X> 0,    0,      x^2*y-x^2*t,-x*y^2+x*y*t,y^2*t-y*t^2,0,\[0X
    [4X> 0,    0,      0,          0,           -1,         1 \[0X
    [4X> ]", 7, 6, Qxyzt );;[0X
    [4Xgap> [0X
    [4Xgap> LoadPackage( "GradedModules" );;[0X
    [4Xgap> wmor := GradedMap( wmat, "free", "free", "left", S );;[0X
    [4Xgap> IsMorphism( wmor );;[0X
    [4Xgap> W := LeftPresentationWithDegrees( wmat, S );;[0X
    [4Xgap> HW := ModuleOfGlobalSections( W );[0X
    [4X<A graded left module presented by yet unknown relations for 6 generators>[0X
    [4Xgap> LinearStrandOfTateResolution( W, 0,4 );[0X
    [4X<A cocomplex containing 4 morphisms of graded left modules at degrees[0X
    [4X[ 0 .. 4 ]>[0X
    [4Xgap> purity_iso := IsomorphismOfFiltration( PurityFiltration( W ) );[0X
    [4X<A non-zero isomorphism of graded left modules>[0X
    [4Xgap> Hpurity_iso := ModuleOfGlobalSections( purity_iso );[0X
    [4X<An isomorphism of graded left modules>[0X
    [4Xgap> ModuleOfGlobalSections( wmor );[0X
    [4X<A homomorphism of graded left modules>[0X
    [4Xgap> NaturalMapToModuleOfGlobalSections( W );[0X
    [4X<A homomorphism of graded left modules>[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1X7.3-2 Horrocks Mumford bundle[0X
  
  This  example  computes  the  global sections module of the Horrocks-Mumford
  bundle.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> LoadPackage( "GradedRingForHomalg" );;[0X
    [4Xgap> R := HomalgFieldOfRationalsInDefaultCAS( ) * "x0..x4";;[0X
    [4Xgap> S := GradedRing( R );;[0X
    [4Xgap> A := KoszulDualRing( S, "e0..e4" );;[0X
    [4Xgap> LoadPackage( "GradedModules" );;[0X
    [4Xgap> mat := HomalgMatrix( "[ \[0X
    [4X> e1*e4, e2*e0, e3*e1, e4*e2, e0*e3, \[0X
    [4X> e2*e3, e3*e4, e4*e0, e0*e1, e1*e2  \[0X
    [4X> ]",[0X
    [4X> 2, 5, A );[0X
    [4X<A 2 x 5 matrix over a graded ring>[0X
    [4Xgap> phi := GradedMap( mat, "free", "free", "left", A );;[0X
    [4Xgap> IsMorphism( phi );[0X
    [4Xtrue[0X
    [4Xgap> M := GuessModuleOfGlobalSectionsFromATateMap( 2, phi );[0X
    [4X#I  GuessModuleOfGlobalSectionsFromATateMap uses unproven assumptions.[0X
    [4X Do not trust the result.[0X
    [4X<A graded left module presented by yet unknown relations for 19 generators>[0X
    [4Xgap> IsPure( M );[0X
    [4Xtrue[0X
    [4Xgap> Rank( M );[0X
    [4X2 [0X
    [4Xgap> Display( BettiDiagram( Resolution( M ) ) );[0X
    [4X total:  19 35 20  2[0X
    [4X--------------------[0X
    [4X     3:   4  .  .  .[0X
    [4X     4:  15 35 20  .[0X
    [4X     5:   .  .  .  2[0X
    [4X--------------------[0X
    [4Xdegree:   0  1  2  3[0X
    [4Xgap> Display( BettiDiagram( TateResolution( M, -4, 6 ) ) );[0X
    [4Xtotal:   37  14  10   5   2   5  10  14  37 100 210   ?   ?   ?   ?[0X
    [4X----------|---|---|---|---|---|---|---|---|---|---|---|---|---|---|[0X
    [4X    4:   35   4   .   .   .   .   .   .   .   .   .   0   0   0   0[0X
    [4X    3:    *   2  10  10   5   .   .   .   .   .   .   .   0   0   0[0X
    [4X    2:    *   *   .   .   .   .   2   .   .   .   .   .   .   0   0[0X
    [4X    1:    *   *   *   .   .   .   .   .   5  10  10   2   .   .   0[0X
    [4X    0:    *   *   *   *   .   .   .   .   .   .   .   4  35 100 210[0X
    [4X----------|---|---|---|---|---|---|---|---|---|---|---|---|---S---|[0X
    [4Xtwist:   -8  -7  -6  -5  -4  -3  -2  -1   0   1   2   3   4   5   6[0X
    [4X-------------------------------------------------------------------[0X
    [4XEuler:   35   2 -10 -10  -5   0   2   0  -5 -10 -10   2  35 100 210[0X
    [4Xgap> M;[0X
    [4X<A graded reflexive rank 2 left module presented by 94 relations for 19 genera\[0X
    [4Xtors>[0X
    [4Xgap> P := ElementOfGrothendieckGroup( M );[0X
    [4X( 2*O_{P^4} - 1*O_{P^3} - 4*O_{P^2} - 2*O_{P^1} ) -> P^4[0X
    [4Xgap> P!.DisplayTwistedCoefficients := true;[0X
    [4Xtrue[0X
    [4Xgap> P;[0X
    [4X( 2*O(-3) - 10*O(-2) + 15*O(-1) - 5*O(0) ) -> P^4[0X
    [4Xgap> chi := HilbertPolynomial( M );[0X
    [4X1/12*t^4+2/3*t^3-1/12*t^2-17/3*t-5[0X
    [4Xgap> c := ChernPolynomial( M );[0X
    [4X( 2 | 1-h+4*h^2 ) -> P^4[0X
    [4Xgap> ChernPolynomial( M * S^3 );[0X
    [4X( 2 | 1+5*h+10*h^2 ) -> P^4[0X
    [4Xgap> ch := ChernCharacter( M );[0X
    [4X[ 2-t-7*t^2/2!+11*t^3/3!+17*t^4/4! ] -> P^4[0X
    [4Xgap> HilbertPolynomial( ch );[0X
    [4X1/12*t^4+2/3*t^3-1/12*t^2-17/3*t-5[0X
    [4Xgap> List( [ -8 .. 7 ], i -> Value( chi, i ) );[0X
    [4X[ 35, 2, -10, -10, -5, 0, 2, 0, -5, -10, -10, 2, 35, 100, 210, 380 ][0X
    [4Xgap> HF := HilbertFunction( M );[0X
    [4Xfunction( t ) ... end[0X
    [4Xgap> List( [ 0 .. 7 ], HF );[0X
    [4X[ 0, 0, 0, 4, 35, 100, 210, 380 ][0X
    [4Xgap> IndexOfRegularity( M );[0X
    [4X4[0X
    [4Xgap> DataOfHilbertFunction( M );[0X
    [4X[ [ [ 4 ], [ 3 ] ], 1/12*t^4+2/3*t^3-1/12*t^2-17/3*t-5 ][0X
  [4X------------------------------------------------------------------[0X
  
