The natural morphisms $X\times_{Z} Y\to X$ and $X\times_{Z} Y\to Y$ can be easily obtained using projections and multirationalMap.
As an example, we calculate the fiber product of the blowing up $\phi:Bl_{C}(\mathbb{P}^3)\to\mathbb{P}^3$ of $\mathbb{P}^3$ along a twisted cubic curve $C\subset\mathbb{P}^3$ and the inclusion $\psi:L\to \PP^3$ of a secant line $L\subset\mathbb{P}^3$ to $C$.
i1 : ringP3 = ZZ/33331[a..d]; C = ideal(c^2-b*d,b*c-a*d,b^2-a*c), L = ideal(b+c+d,a-d) 2 2 o2 = (ideal (c - b*d, b*c - a*d, b - a*c), ideal (b + c + d, a - d)) o2 : Sequence |
i3 : phi = first graph rationalMap C; o3 : MultihomogeneousRationalMap (birational map from threefold in PP^3 x PP^2 to PP^3) |
i4 : psi = parametrize L; o4 : RationalMap (linear rational map from PP^1 to PP^3) |
i5 : F = fiberProduct(phi,psi); o5 : ProjectiveVariety, curve in PP^3 x PP^2 x PP^1 |
i6 : describe F o6 = ambient:.............. PP^3 x PP^2 x PP^1 dim:.................. 1 codim:................ 5 degree:............... 4 multidegree:.......... T_0^3*T_1^2+2*T_0^3*T_1*T_2+T_0^2*T_1^2*T_2 generators:........... (0,1,1)^2 (0,2,0)^1 (1,0,0)^2 (1,0,1)^1 (1,1,0)^2 purity:............... true dim sing. l.:......... 0 gens sing. l.:........ (0,0,2)^1 (0,1,0)^2 (1,0,0)^2 (1,0,1)^2 (2,0,0)^1 Segre embedding:...... map to PP^4 ⊂ PP^23 |
i7 : p = projections F; |
i8 : -- first natural morphism phi' = check rationalMap({p_0,p_1},projectiveVariety source phi); o8 : MultirationalMap (rational map from F to threefold in PP^3 x PP^2) |
i9 : -- second natural morphism psi' = check rationalMap({p_2},projectiveVariety source psi); o9 : MultirationalMap (rational map from F to PP^1) |
i10 : assert(phi' * phi == psi' * psi) |
The object fiberProduct is a method function.