Let X = V((F_1(X_i),...,F_n(X_i))) and Y = V((G_1(Y_j),...,G_m(Y_j))),
and suppose that X -> Y is defined by (H_1(X_i),...,h_r(X_i)).
Then the preimage scheme of a point (y_1,...,y_r) in the affine setting
is just generated by H_k(X_i)-y_k (together with the F_j(X_i)), or in
the projective (over a field) setting by cross products to define the
homogeneous submodules, so y_j H_k(X_i) - y_k H_j(X_i).

To find the preimage of a general subscheme Z of Y, just evaluate the
defining polynomials for Z at the point (H_1(X_i),...,H_r(X_i)).

In Magma one can't form subschemes T/S of X/R where S->R. The morphism
structures would have to handle phi: T/S -> X/R, but otherwise it is
well-defined (provided the morphism S->R on base schemes is defined).
This would let one form the preimage scheme of a point in X(S), for
which we give an error.

Note that the preimage of a point under any morphism is defined to be
the preimage scheme (of the closed point as a scheme).  If this seems
to be an abuse of notation, then one could define phi.preimage_scheme(P);
Magma just uses existing notation @@ and it had to be decided what the
meaning would be in the context of scheme maps.

(David Kohel, 27/01/2006)

Alternatively, note that the preimage_scheme of Z under pi is the base
extension of pi: X -> Y by i: Z -> Y, and is constructed as a fiber
product of X \times_Y Z.

(David Kohel, 30/01/2006)