Let $I$ be an ideal of $k[x\_1, \ldots, x\_m, y\_1, \ldots, y\_n]$, $k$ being a field. Does any of the computer algebra systems implement any algorithm to calculate the generators of the 'bi-homogenization' $\tilde I$ of $I$ with respect to $x$ and $y$ variables? 


(Recall that the 'bi-homogenization' of a polynomial $f = \sum a\_{\alpha, \beta} x^\alpha y^\beta$ is by definition $\tilde f := \sum a\_{\alpha, \beta} x^\alpha y^\beta x\_0^{d - |\alpha|} y\_0^{e- |\beta|}$, where $x\_0$ and $y\_0$ are two new variables, $d := \deg\_x(f)$ and $e := \deg\_y(f)$. Then $\tilde I := ${$\tilde f: f \in I$}.)


My motivation is geometric: to find the closure $\overset{-}{V}$ of a subvariety $V$ of $k^{m+n}$ in $\mathbb{P}^m \times \mathbb{P}^n$. Of course I could as well calculate the Segre embedding of $\overset{-}{V}$ in $\mathbb{P}^{mn + m +n}$, but I would like to have something computationally less expensive.


I can think of an algorithm which involves introducing $n$ (or $m$, whichever is the smaller) new variables $t\_1, \ldots, t\_n$ and computing the monomial basis of an ideal $J$ in $k[x,y,t]$, where $J$ is to be constructed from $I$. But I was wondering if someone had already implemented some (possibly better) algorithm which would do this job. 



Any implemented algorithm to compute the closure of an affine variety in a product of projective spaces?
This can be done in a few steps in probably any computer algebra package. You take the generators of your original ideal $I$, and bi-homogenize them, as described in the question. Then saturate with respect to the two hyperplanes at infinity, which are defined by the equation $x\_0 y\_0$.


For example, the diagonal in $\mathbb A^3 \times \mathbb A^3$ is defined by $x\_1 - y\_1$, $x\_2 - y\_2$, and $x\_3 - y\_3$. If I wanted to use this to compute the ideal of the diagonal in $\mathbb P^3 \times \mathbb P^3$, I would use the following commands in Macaulay2:



```
 r = QQ[x0,x1,x2,x3,y0,y1,y2,y3]
 i = ideal(x1*y0-y1*x0, x2*y0-y2*x0, x3*y0-y3*x0)
 saturate(i, x0*y0)

```

The code in Singular would be:



```
 ring r = 0, (x0,x1,x2,x3,y0,y1,y2,y3), dp;
 ideal i = x1*y0-y1*x0, x2*y0-y2*x0, x3*y0-y3*x0;
 LIB "elim.lib";
 sat(i, x0*y0);

```

