# cayleyTrick -- Cayley trick

## Synopsis

• Usage:
cayleyTrick(I,k)
• Inputs:
• I, an ideal, a homogeneous ideal defining a projective variety X=V(I)⊂ℙn
• k, an integer, the dimension of X, or more generally an integer k not exceeding the dimension of X and not smaller than the dual defect of X
• Outputs:
• a pair (J,J’), where J is the defining ideal of the Segre product X×ℙk⊂ℙ(k+1)(n+1)-1, while J’ is the principal ideal defining the dual hypersurface (X×ℙk)*⊂P(k+1)(n+1)-1*

## Description

Let X⊂ℙn be a k-dimensional projective variety. Consider the product W = X×ℙk as a subvariety of ℙ(Mat(k+1,n+1)), the projectivization of the space of (k+1)×(n+1)-matrices, and consider the projection p:ℙ(Mat(k+1,n+1))--->G(k,n)=G(n-k-1,n). Then the "Cayley trick" states that the dual variety W* of W equals the closure of p-1(Z0(X)), where Z0(X)⊂G(n-k-1,n) is the Chow hypersurface of X. The defining form of W* is also called the X-resultant. For details and proof, see Multiplicative properties of projectively dual varieties, by J. Weyman and A. Zelevinsky; see also the preprint Coisotropic Hypersurfaces in the Grassmannian, by K. Kohn.

In the example below, we apply the method to the quadric 1×ℙ1⊂ℙ3.

 ```i1 : QQ[x_0..x_3]; P1xP1 = ideal(x_0*x_1-x_2*x_3) o2 = ideal(x x - x x ) 0 1 2 3 o2 : Ideal of QQ[x , x , x , x ] 0 1 2 3``` ```i3 : time (P1xP1xP2,P1xP1xP2') = cayleyTrick(P1xP1,2); -- used 0.0332765 seconds```

In the next example, we calculate the defining ideal of 1×ℙ1×ℙ1⊂ℙ7 and that of its dual variety.

 ```i4 : time (P1xP1xP1,P1xP1xP1') = cayleyTrick(P1xP1,1) -- used 0.0367862 seconds o4 = (ideal (x x - x x , x x - x x , x x - x x , 0,3 1,2 0,2 1,3 1,0 1,1 1,2 1,3 0,3 1,1 0,1 1,3 ------------------------------------------------------------------------ x x - x x , x x - x x , x x - x x , x x 0,2 1,1 0,1 1,2 0,0 1,1 0,2 1,3 0,3 1,0 0,0 1,3 0,2 1,0 ------------------------------------------------------------------------ 2 2 - x x , x x - x x , x x - x x ), ideal(x x - 0,0 1,2 0,1 1,0 0,2 1,3 0,0 0,1 0,2 0,3 0,1 1,0 ------------------------------------------------------------------------ 2 2 2x x x x + 4x x x x + x x - 2x x x x - 0,0 0,1 1,0 1,1 0,2 0,3 1,0 1,1 0,0 1,1 0,1 0,3 1,0 1,2 ------------------------------------------------------------------------ 2 2 2x x x x + x x - 2x x x x - 2x x x x + 0,0 0,3 1,1 1,2 0,3 1,2 0,1 0,2 1,0 1,3 0,0 0,2 1,1 1,3 ------------------------------------------------------------------------ 2 2 4x x x x - 2x x x x + x x )) 0,0 0,1 1,2 1,3 0,2 0,3 1,2 1,3 0,2 1,3 o4 : Sequence```

If the option Duality is set to true, then the method applies the so-called "dual Cayley trick".

 ```i5 : time cayleyTrick(P1xP1,1,Duality=>true); -- used 0.0699019 seconds``` ```i6 : oo == (P1xP1xP1,P1xP1xP1') o6 = true``` ```i7 : time cayleyTrick(P1xP1,2,Duality=>true); -- used 0.052734 seconds``` ```i8 : oo == (P1xP1xP2,P1xP1xP2') o8 = true```