+ M2 --no-readline --print-width 99
Macaulay2, version 1.9.2
with packages: ConwayPolynomials, Elimination, IntegralClosure, LLLBases, PrimaryDecomposition,
               ReesAlgebra, TangentCone

i1 : loadPackage("MatFacCurvesP4")

o1 = MatFacCurvesP4

o1 : Package

i2 : ------------------------------------------------------------------
     -- Proposition 4.4                                              --
     -- A general matrix factorization of shape 15  2    		--
     --    	      	      	      	     	    2 15	     	--
     -- and a general choice of the quotient q yield a smooth curve  --
     -- of genus 10 and degree 13	    	    	    	    	-- 
     ------------------------------------------------------------------
     --
     p=32009; -- a prime number

i3 : Fp=ZZ/p; -- a prime field

i4 : S=Fp[x_0..x_4];

i5 : time IC=randomCurveGenus12Degree14InP4(S); -- takes 11 sec
     -- used 10.5968 seconds

o5 : Ideal of S

i6 : omegaC=Ext^2(IC,S^{-5}); -- canonical module of C

i7 : fomega=res omegaC;

i8 : sM=S^{1:-5}**coker transpose fomega.dd_3;

i9 : (psi,phi)=matrixFactorizationFromModule(sM);

i10 : -- We choose a quotient q as in Proposition 4.4
      SX=ring phi;                 

i11 : A1=((psi_{0,1}))^{0..14};

               15        2
o11 : Matrix SX   <--- SX

i12 : A2=syz transpose A1;

               15        27
o12 : Matrix SX   <--- SX

i13 : q=transpose(A2*random(source A2, SX^{4:0}));

               4        15
o13 : Matrix SX  <--- SX

i14 : q*A1==0

o14 = true

i15 : -- q is a generally chosen quotient. We verify that the complex in
      -- Proposition 4.4 is a locally free resolution:
      incl=id_(source A1)||map(source q,source A1,0);

               17        2
o15 : Matrix SX   <--- SX

i16 : alpha=inducedMap(target(q++id_(S^{2:-1})),coker phi,(q++id_(S^{2:-1}))*psi);

o16 : Matrix

i17 : beta=inducedMap(coker phi,source A1,incl);

o17 : Matrix

i18 : prune(ker(alpha)/image(beta)) == 0

o18 = true

i19 : -- exactness in F is verified
      prune ker(beta) == 0

o19 = true

i20 : -- exactness in O_X^2(-4) is verified too.
      -- We compute the ideal of the resulting curve with respect to SX
      -- and the ideal on S
      hom=Hom(coker ((q++id_(S^{2:-1}))*psi_{2..16}),SX);

i21 : f=homomorphism hom_{0};

o21 : Matrix

i22 : ICX = ann coker f;

o22 : Ideal of SX

i23 : pr=map(SX,S);

o23 : RingMap SX <--- S

i24 : IC=preimage(pr,ICX);

o24 : Ideal of S

i25 : -- We check that IC is a smooth curve of genus 10 and degree 13
      betti res IC

             0 1  2  3 4
o25 = total: 1 7 15 11 2
          0: 1 .  .  . .
          1: . .  .  . .
          2: . 5  .  . .
          3: . 2 15 11 2

o25 : BettiTally

i26 : (codim IC, genus IC, degree IC)==(3,10,13)

o26 = true

i27 : isSmoothCurve(IC)

o27 = true

i28 :