-- This function takes an homogeneous ideal I and a positive integer r. -- If the ideal contains a linear form, the function outputs -- "The ideal contains a linear form" and terminates. -- Otherwise, the function returns the dimension of the locus of quadrics in I of rank at most r. -- Negative dimension means that the locus is empty. rankQuadrics = (I,r) ->( if numgens(ring I) - hilbertFunction(1,I)>0 then return "The ideal contains a linear form." else k = coefficientRing(ring I); R = k[D_1..D_(numgens(ring I))]; g =map(R,ring I,vars R); J = g(I); use R; n=hilbertFunction(2,R)-hilbertFunction(2,J); b=submatrix(mingens J,toList(0..(n-1))); Jac=jacobian super b; quadrics = for i from 0 to n-1 list jacobian transpose matrix Jac_i; S = QQ[F_0..F_(n-1)]; f=map(S,R); Q=0; for i from 0 to n-1 do Q=Q+F_i*f(quadrics_i); return dim(saturate minors(r+1,Q))-1 ) -- Example: -- i1 : load "rankQuadrics.m2" -- i2 : R = QQ[X_0,X_1,X_2,X_3]; -- i3 : I = ideal(X_0^2+X_1^2,X_1*X_2-X_0^2,X_1*X_2-X_3*X_0); -- i4 : rankQuadrics(I,1) -- o4 = -2 -- i5 : rankQuadrics(I,2) -- o5 = 0 -- i6 : rankQuadrics(I,3) -- o6 = 1 -- i7 : rankQuadrics(I,4) -- o7 = 2 -- i8 : rankQuadrics(I,5) -- o8 = 2 ------------------------------------------------------- -- In the following computation we take the blow-up X of PP^2 at the points P_1, ..., P_16 -- where P_1=[0,0,1], P_15 = [0,1,0], P_16 = [1,0,0], and the other points are chosen randomly. -- Then we consider the map X---->PP^7 induced by the linear system (9H-3E_1 - 2(E_2+...+E_14) -E_15 -E_16) -- and prove that the image is not contained in any quadric of rank less or equal than 6. -- We set up the ring of PP^2 k=ZZ/101; R=k[X,Y,Z]; -- P_1 = [0,0,1]. P1=ideal(X,Y); J1=saturate(P1^3); -- I_2 is the ideal of a random subset of 13 points in the plane. M=random(R^{-4,-4,-5,-5},R^{-6,-6,-6}) I2=minors(3,M); -- We check that I_2 defines actualy 13 distinct points. degree I2 I2==radical I2 J2=saturate(I2^2); -- P_15 = [0,1,0], P_16=[1,0,0] P15=ideal(X,Z); P16=ideal(Y,Z); J3=saturate intersect(P15,P16); -- We compute a basis of the linear system. J = intersect(J1,J2,J3); B=basis(9,module J); -- The linear system has projective dimension 7. hilbertFunction(9,module J) -- We set up the ring of PP^7 and the map f:PP^2---->PP^7 induced by the linear system. T=k[W_0..W_7]; f = map(R,T,super B); -- We compute the ideal of the surface S, as the kernel of the map. I = kernel f; -- We see that the ideal I contains 3 linearly independent quadrics hilbertFunction(2,T)-hilbertFunction(2,I) -- We check that there are no quadrics of rank less or equal than 6. time rankQuadrics(I,6)