  
  [1X7 Examples[0X
  
  
  [1X7.1 Betti Diagrams[0X
  
  
  [1X7.1-1 DE-2.2[0X
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> S := HomalgFieldOfRationalsInDefaultCAS( ) * "x0,x1,x2";;[0X
    [4XDisplay( S );[0X
    [4XQ[x0,x1,x2][0X
    [4Xgap> mat := HomalgMatrix( "[ x0^2, x1^2, x2^2 ]", 1, 3, S ); [0X
    [4X<A 1 x 3 matrix over an external ring>[0X
    [4Xgap> M := RightPresentationWithDegrees( mat );[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 3 morphisms of right modules at degrees[0X
    [4X[ 0 .. 3 ]>[0X
    [4Xgap> betti := BettiDiagram( d );[0X
    [4X<A Betti diagram of <A right acyclic complex containing[0X
    [4X3 morphisms of 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 3 morphisms of right modules at degrees[0X
    [4X[ 0 .. 3 ]>[0X
    [4Xgap> betti2 := BettiDiagram( d2 );[0X
    [4X<A Betti diagram of <A right acyclic complex containing[0X
    [4X3 morphisms of 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> S := HomalgFieldOfRationalsInDefaultCAS( ) * "x0,x1,x2";;[0X
    [4XDisplay( S );[0X
    [4XQ[x0,x1,x2][0X
    [4Xgap> mat := HomalgMatrix( "[ x0^2, x1^2 ]", 1, 2, S );[0X
    [4X<A 1 x 2 matrix over an external ring>[0X
    [4Xgap> M := RightPresentationWithDegrees( mat );[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 2 morphisms of right modules at degrees[0X
    [4X[ 0 .. 2 ]>[0X
    [4Xgap> betti := BettiDiagram( d );[0X
    [4X<A Betti diagram of <A right acyclic complex containing[0X
    [4X2 morphisms of 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 2 morphisms of right modules at degrees[0X
    [4X[ 0 .. 2 ]>[0X
    [4Xgap> betti2 := BettiDiagram( d2 );[0X
    [4X<A Betti diagram of <A right acyclic complex containing[0X
    [4X2 morphisms of 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> M := RightPresentationWithDegrees( mmat );[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 2 morphisms of right modules at degrees[0X
    [4X[ 0 .. 2 ]>[0X
    [4Xgap> bettiM := BettiDiagram( Mr );[0X
    [4X<A Betti diagram of <A right acyclic complex containing[0X
    [4X2 morphisms of 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 := CoefficientsRing( Qxyz ) * "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 an external 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 2 morphisms of right modules at degrees[0X
    [4X[ 0 .. 2 ]>[0X
    [4Xgap> bettiN := BettiDiagram( Nr );[0X
    [4X<A Betti diagram of <A right acyclic complex containing[0X
    [4X2 morphisms of 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> jmat := HomalgMatrix( "[ z*w, x*w, y*z, x*y, x^3*z - x*z^3 ]", 1, 5, R );[0X
    [4X<A 1 x 5 matrix over an external 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 3 morphisms of right modules at degrees[0X
    [4X[ 0 .. 3 ]>[0X
    [4Xgap> betti := BettiDiagram( Jr );[0X
    [4X<A Betti diagram of <A right acyclic complex containing[0X
    [4X3 morphisms of 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> mat := HomalgMatrix( "[ x*y*z, x*y^2, x^2*z, x^2*y, x^3 ]", 1, 5, Qxyz );[0X
    [4X<A 1 x 5 matrix over an external ring>[0X
    [4Xgap> M := RightPresentationWithDegrees( mat );[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 3 morphisms of right modules at degrees[0X
    [4X[ 0 .. 3 ]>[0X
    [4Xgap> betti := BettiDiagram( Mr );[0X
    [4X<A Betti diagram of <A right acyclic complex containing[0X
    [4X3 morphisms of 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
    [4X<A graded torsion-free (left) ideal given by 3 generators>[0X
    [4Xgap> m := GradedLeftSubmodule( "x,y,z", R );[0X
    [4X<A graded torsion-free (left) ideal given by 3 generators>[0X
    [4Xgap> I := Intersect( m^3, GradedLeftSubmodule( "x", R ) );[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 given by a free generator>[0X
    [4Xgap> Is := Saturate( I );[0X
    [4X<A graded principal (left) ideal of rank 1 given by a free generator>[0X
    [4Xgap> Assert( 0, Is = I_m );[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1X7.2-2 Eliminate[0X
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> R := HomalgFieldOfRationalsInDefaultCAS( ) * "x,y,z,l,m";;;[0X
    [4X gap> Display( R );[0X
    [4X Q[x,y,z,l,m][0X
    [4Xgap> var := Indeterminates( R );[0X
    [4X[ x, y, z, l, m ][0X
    [4Xgap> x := var[1];; y := var[2];; z := var[3];; l := var[4];; m := var[5];;[0X
    [4Xgap> L := [ x*m+l-4, y*m+l-2, z*m-l+1, x^2+y^2+z^2-1, x+y-z ];[0X
    [4X[ x*m+l-4, y*m+l-2, z*m-l+1, x^2+y^2+z^2-1, x+y-z ][0X
    [4Xgap> e := Eliminate( L, [ l, m ] );[0X
    [4X<A ? x 1 matrix over an external ring>[0X
    [4X gap> Display( e );[0X
    [4X x+y-z,       [0X
    [4X x-3*y-2*z,   [0X
    [4X x^2+y^2+z^2-1[0X
    [4X [0X
    [4X A (left) ideal generated by the 3 entries of the above matrix[0X
    [4Xgap> I := LeftSubmodule( e );[0X
    [4X<A torsion-free (left) ideal given by 3 generators>[0X
    [4Xgap> J := LeftSubmodule( "x+y-z, -2*z-3*y+x, x^2+y^2+z^2-1", R );[0X
    [4X<A torsion-free (left) ideal given by 3 generators>[0X
    [4Xgap> I = J;[0X
    [4Xtrue[0X
  [4X------------------------------------------------------------------[0X
  
