% Authors: R/"udiger Achilles and Davide Aliffi
% achilles@dm.unibo.it, aliffi@dm.unibo.it
COMMENT
This is an example session demonstrating and testing the facilities
offered by the module SEGRE, an extension of the REDUCE package CALI.
END COMMENT;
comment
##################################################
### ###
### St\"uckrad-Vogel intersection cycle ###
### ###
##################################################
end comment;
% Example 1. Self-intersection of a monomial curve
% [J.~St\"uckrad and W.~Vogel: An Euler-Poincar\'e characteristic for
% improper intersections. Math. Ann. 274 (1986), 257-271], Example 2,
% p. 269: self-intersection of the curve $C$ in $P^3$, characteristic
% $\neq 2,3$, given parametrically by $(s^6, s^4t^2,s^3t^3,t^6)$.
% We use "vars(x,n)" to generate the variables $x_i$.
vars(x,3);
% Let us compute the defining ideal $p$ of the curve $C$:
p:=proj_monomial_curve({6,4,3,0},vars(x,3));
% Now we calculate the multiplicity sequence (see [R.~Achilles and
% M.~Manaresi: Multiplicities of a bigraded ring and intersection
% theory. Math. Ann. 309 (1997), 573-591] with respect to the diagonal
% ideal in the ring of coordinates of the join variety $J(C,C)$.
% This takes about 10 seconds, on older computers even 10 minutes.
ms:=int_segre{p,p};
% The result tells us that the "empty subvariety" is counted by $12$,
% and that the intersection cycle has a $0$-dimensional part of degree
% $18$ and a $2$-dimensional part of degree $6$.
% If you prefer an output ordered by the codimension in the join
% variety, then you write simply "reverse ms;".
reverse ms;
% By the theory it is known that the codimensional one singular locus
% contributes to the intersection cycle. Let us find the singular
% points of C.
radical(singular_locus(p,2));
% So we have two singular points, $P=(0:0:0:1)$ and $Q=(1:0:0:0)$.
% These are distinguished subvarieties of intersection in the sense of
% Fulton-MacPherson, that is, they are obtained as images of components
% of the normal cone of $C$ in the join variety $J(C,C)$ (diagonally
% embedded) under the map from the normal cone to $C$. Let us calculate
% the normal cone, call it nc.
nc:=int_ncone{p,p};
% Observe that int_ncone forms automatically the join variety, maps the
% equations of the diagonal to new variables ending with index $2$,
% and changes the base ring to have the correct ring for the embedding
% of the normal cone. In fact, the new ring is:
getring();
% The normal cone ideal is obviously a complete intersection ideal.
% Hence we can calculate its primary decoposition with
% "easyprimarydecomposition". It takes about quarter an hour on older
% machines!
pd:=easyprimarydecomposition nc;
% The primary decomposition consists of $4$ primary ideals.
% We calculate their degrees and obtain for the first one:
setideal(q1,first first pd)$
degree q1;
% The associated prime ideal is:
setideal(p1,second first pd);
% For the second one:
setideal(q2,first second pd)$
degree q2;
% The associated prime ideal is:
setideal(p2,second second pd);
% For the third one:
setideal(q3,first third pd)$
degree q3;
% The associated prime ideal is:
setideal(p3,second third pd);
% For the fourth one:
setideal(q4,part(pd,4,1))$
degree q4;
% The associated prime ideal is:
setideal(p4,second part(pd,4));
% Are $q4$ and $p4$ equal?
modequalp(q4,p4);
% It is easy to see that $p1$ corresponds to $Q$, $p2$ to the "empty
% subvariety", $p3$ to $P$, and $p4$ to $C$. There could be hidden
% non K-rational or movable points in $p4$. In order to find them, we
% compute the bidegrees of $p4$:
degs(p4,{4,4});
% We see that the total degree $13$ of $p4$ splits up into $7$ and $6$.
% due to the fact that $p4$ contributes $6$ in Krull-dimension $2$
% (namely gives the curve $C$ of degree $6$) and $7$ in Krull-dimension
% one, that is, there are $7$ non $K$-rational points.
% The other prime ideals have only one non-zero bidegree. That means
% that the intersection number of the "empty variety" is $12$,
% that of $P=(0:0:0:1)$ is $8$ and that of $Q=(1:0:0:0)$ is $3$.
% Here is another way to calculate the intersection number of $P$
% in the self-intersection of $C=V(p)$ using "localization" at $P$:
setring(vars(x,2),{},lex);
int_segre{sub(x3=1,p),sub(x3=1,p)};
% The result shows you the local contributions of all components
% of the intersection cycle passing through $P$: $8$ for the point and
% $3$ for the curve $C$, since the local degree of $C$ at $P$ is $3$.
% The analogue calculation for $Q$ is:
setring(rest vars(x,3),{},lex);
int_segre{sub(x0=1,p),sub(x0=1,p)};
;end;