---------------------------------------------------------------- -- PrintLn; -- PrintLn ' POINTS.COC by G. de Dominicis and M. Kreuzer ' -- PrintLn 'Help Points; gives a listing of available functions'; ---------------------------------------------------------------- // Date created: 18/7/95 // Last modification: 23/7/97 // Version: 1.1 // CoCoA Version: 3.02 // Author(s): G. de Dominicis, M. Kreuzer Define Points() End; Define Help_Points() PrintLn 'POINTS.COC: functions for sets of points in projective space'; PrintLn 'General Functions: FindFirstNonZero(L), Homcomp(M,N),'; PrintLn ' Hilbmod(M,N), Hilb(M,N), Alpha(I), Is_hom(F), Putcoeffs(F,N),'; PrintLn ' Getcoeffs(N), Soc(M), HSoc(M,N), Annmod(M,F), Ann(M)'; PrintLn 'Functions for creating ideals of points: Genpt(N),'; PrintLn ' Genpts(S,N), Genci(L), Idopt(L), Idopts(M)'; PrintLn 'Kaehler differentials: KD(I), SocKD(I), HSocKD(I)'; PrintLn ' RelKD(I,L), HSocRelKD(I,L), BarKD(I,L)'; PrintLn 'Differents: Kdiff(I), HKdiff(I), RelKdiff(I,L),'; PrintLn ' HRelKdiff(I,L), Ndiff(I), RelNdiff(I).'; End; ---------------------------------------------------------------- // General Functions ---------------------------------------------------------------- Define PoincareMod(M) G:=Transposed(Mat(LT(M))); PSS:=Sum([SPToPoly(PSer_Num(Poincare(CurrentRing/Ideal(G[I]))))| I In 1..Len(G)]); Return PSeries(PSS,NumIndets()) End; Define HilbertMod(M) Global DH_PS := PoincareMod(M); Return PSer_Hilbert(DH_PS) End; Define FindFirstNonzero(L) For I:=1 To Len(L) Do If L[I]<>0 Then Return I End; End; Return 0 End; Define Help_FindFirstNonzero() PrintLn 'FindFirstNonzero ( L : List ) : Int'; PrintLn 'returns the index of the first nonzero element of L.'; PrintLn 'Remark: If all elements of L are zero, it returns zero.'; End; ------------------------------------------------------------------- Define Homcomp(M,N) L:=Gens(M); Maxid:=Ideal([Indet(I) | I In 1..NumIndets()]); Result:=[]; For I:=1 To Len(L) Do F:=FindFirstNonzero(Cast(L[I],LIST)); D:=Deg(L[I,F]); If DIdeal(1)]; V:=NewList(N+1,0); For C:=0 To N Do V[C+1]:=Sum([Hilbert(CurrentRing/H[I],C)| I In 1..Len(H)]); End; Return V; End; Define HilbertFree(M,N) H:=[Hilbmod(M,I)|I In 0..N]; M:=Mat(M); P:=[Len(M[1])*Bin(NumIndets()+I-1,I)| I In 0..N]; Return P-H End; Define Help_Hilb() PrintLn 'Hilb( M : Module , N : Int ) : List'; PrintLn 'returns the first N values of the Hilbert function'; PrintLn 'of the quotient module represented by M.'; End; ------------------------------------------------------------------- Define Alpha(I) G:=Cast(Gens(I),LIST); For J:=1 To Len(G) Do G[J]:=Deg(G[J]) End; Return Min(G) End; Define Help_Alpha() PrintLn 'Alpha( I : Ideal ) : Int'; PrintLn 'returns the smallest degree of a polynomial in the ideal I.'; PrintLn 'Remark: the ideal I should be homogeneous.' End; ------------------------------------------------------------------- Define Is_hom(F) Return F=Homogenized(Indet(1),F) End; Define Help_Is_hom() PrintLn 'Is_hom( F : Poly ) : Bool'; PrintLn 'returns TRUE, if F is homogeneous, and FALSE otherwise.'; End; ---------------------------------------------------------------- Define PutCoeffs(F,N) D:=DensePoly(Deg(F)); For I:=N+1 To NumIndets() Do D:=Subst(D,Indet(I),Poly(0)) End; L:=Monomials(D); Global MyCoeffList:=NewList(Len(L)); Global DN:=[Deg(F),N]; For I:=1 To Len(L) Do Global MyCoeffList[I]:=CoeffOfTerm(L[I],F) End; End; Define Help_PutCoeffs() PrintLn 'PutCoeffs( F : Poly , N : Int ) : Null'; PrintLn 'puts the list of coefficients of the terms of F involving'; PrintLn 'only the first N variables into a list "MyCoeffList" in the'; PrintLn 'Global Memory. The global variable "DN" contains [Deg(F),N].'; PrintLn 'Remark: F should be a homogeneous polynomial.'; End; ---------------------------------------------------------------- Define GetCoeffs(Start) D:=DensePoly(DN[1]); N:=DN[2]; If Start+N-1>NumIndets() Then Return Error('Too few variables') End; For I:=Start+N To NumIndets() Do D:=Subst(D,Indet(I),Poly(0)) End; For I:=1 To Start-1 Do D:=Subst(D,Indet(I),Poly(0)) End; L:=Monomials(D); F:=Poly(0); For I:=1 To Len(MyCoeffList) Do F:=F+Poly(MyCoeffList[I])*L[I] End; Return F End; Define Help_GetCoeffs() PrintLn 'GetCoeffs( N : Int ) : Poly'; PrintLn 'recreates a polynomial in a (possibly different) ring from'; PrintLn 'the list "MyCoeffList" using DN[2] variables, starting with'; PrintLn 'variable number N.'; PrintLn 'Remark: CurrentRing must have at least N+DN[2]-1 variables.'; End; ---------------------------------------------------------------- Define Soc(M) N:=NumIndets(); G:=Gens(M); NN:=Len(G[1]); A:=NewList(N); For J:=1 To N Do A[J]:=NewMat(NN,NN,0); For J1:=1 To NN Do A[J,J1,J1]:=Indet(J) End; A[J]:=Cast(A[J],MODULE); A[J]:=Intersection(A[J],M); A[J]:=Gens(A[J]); B:=NewList(Len(A[J])); For J1:=1 To Len(A[J]) Do Temp:=Cast(A[J,J1],LIST); For J2:=1 To Len(Temp) Do Temp[J2]:=Div(Temp[J2],Indet(J)) End; Temp:=Cast(Temp,VECTOR); B[J1]:=Temp End; A[J]:=Cast(B,MODULE); Print '[',J,']' End; S:=A[1]; For J:=2 To N Do S:=Intersection(S,A[J]); Print '[',J,']' End; S:=Minimalized(S); PrintLn; Return S End; Define Help_Soc() PrintLn 'Soc( M : Module ) : Module'; PrintLn 'returns the module representing the socle of the quotient'; PrintLn 'module represented by M. In particular, M NumIndets()-1 Then Return Ideal(Poly(0)) End; C:=NewList(LL); For I:=1 To LL Do LI:=L[I]; C[I]:=Randomized(DensePoly(LI)) End; Return Ideal(C) End; Define Help_Genci() PrintLn 'Genci( L: List ) : Ideal'; PrintLn 'returns the ideal of a generic 0-dimensional complete'; PrintLn 'intersection of type L=[C1, ..., Cn].'; PrintLn 'Remark: CurrentRing should have Len(L)+1 indeterminates,'; PrintLn 'otherwise the ideal (0) is returned.' End; ------------------------------------------------------------------- Define Idopt(P) L:=NewList(Len(P)-1); F:=FindFirstNonzero(P); If F=0 Then Return Ideal(Poly(0)) End; If F>1 Then For I:=1 To F-1 Do L[I]:=Indet(I) End End; If F