We are now ready to prove the results mentioned earlier about dimensions of intersections of varieties in affine and projective space, but first we need to discuss products of varieties.  Given affine varieties $V,W$ lying in $K^n,K^m$, respectively, with corresponding ideals $I,J$ lying in
$K[x_1,\ldots,x_n],K[y_1,\ldots,y_m]$, we make the Cartesian product $V\times W$ into a variety in a fairly obvious way, its ideal generated by the copies of $I$ and $J$ inside the larger polynomial ring
$K[x_1,\ldots,x_n,y_1,\ldots,y_m]$.  We insert a warning here that the Zariski topology on
$V\times W$ is {\sl not} the product of these topologies on $V$ and $W$; it has many more closed sets.  Nevertheless, $V\times W$ is irreducible whenever $V,W$ are, for given a decomposition
$V_1\cup V_2$ of $V\times W$ into proper closed subsets, irreducibility forces for each $w\in W$ the subset $S_w = \{v\in V: (v,w)\in V_1\}$ to be either empty or all of $V$; then the union of all $w\in W$ for which $S_w = V$ is either empty or all of $W$, whence finally $V_1 = V\times W$ or
$V_2 = V\times W$, as desired.  The dimension of $V\times W$ is the sum of the dimensions of $V$ and $W$, as one easily sees by constructing an appropriate decreasing chain of varieties from $V\times W$ down to a poin.  We can similarly define the product of two projective varieties, but this is trickier, as the product of subvarieties of $\Bbb P^n,\Bbb P^m$ will not embed in
$\Bbb P^{m+n}$ in any straightforward way, thanks (or no thanks) to the equivalence relation on coordinates in $\Bbb P^n$.  We first define the product $\Bbb P^n\times\Bbb P^m$ of $\Bbb P^n$ and $\Bbb P^m$ themselves; this may be identified with the collection of all $nm+n+m+1$-tuples in
$\Bbb P^{mn+m+n}$ of the form $(x_0y_0,\ldots,x_ny_0,x_0y_1,\ldots,x_ny_1,\ldots,x_ny_m)$; note that these coordinates are replaced by equivalent ones if either or both of the $x_i$ and $y_j$ are so replaced.  The image of $\Bbb P^n\times \Bbb P^m$ is then identified with the subvariety of
$\Bbb P^{nm+n+m}$ corresponding to the ideal which is the kernel of the map
$K[z_ij:0\le i\len,0\le j\le m]\rightarrow K[x_0,\ldots x_n,y_0,\ldots y_m]$ sending $z_{ij} to $x_i y_j$ (as an exercise, write down generators of this kernel).  Then the product $V\times W$ of subvarieties of $\Bbb P^n,\Bbb P^m$ is defined to be its image under the embedding of
$\Bbb P^n\times \Bbb P^m$ into $\Bbb P^{nm+n+m}$, called the {\sl Segre embedding}.  It too is irreducible if $V$ and $W$ are and has dimension the sum of the dimensions of $V$ and $W$.  For example, if $n=m=1$, then the image of this embedding is the subvariety of $\Bbb P^3$ with defining equation $xy = zw$.  

Now we can prove our dimension inequalities for intersections.  Let $X,Y$ be irreducible affine subvarieties of $K^n$ of dimensions $r,s$, respectively.  First suppose that $Y$ is a hypersurface, defined by a single equation $f=0$.  Then we have seen in our treatment of dimension theory that either $X\subset Y$ or every component of $X\cap Y$ has dimension $r-1$, as desired.  In general, look at the product $X\times Y\in K^{2n}$.  Let $\Delta = \{P\times P: P\in K^n\}$ be the diagonal copy of $K^n$ in $K^{2n}$; the isomorphism $\Delta$ to $K^n$ identifies $X\cap Y$ with
$(X\times Y)\cap\Delta$.  We intersect $X\times Y$ with $\Delta$ by intersecting this product with each of the coordinate hyperplanes $x_i - y_i = 0$ in turn; at each step, we either keep the same dimension or drop in dimension by 1, so that in the end all components of $X\cap Y$ have dimension at least $r+s-n$, as claimed (but this intersection could be empty even if $r+s>n$).  If instead $X,Y$ are irreducible subvarieties of $P^n$, then we pass to their affine cones $C(X),C(Y)$, of dimensions $r+1,s+1$ in $K^{n+1}$.  If $r+s\ge n$, then $r+1+s+1>n+1$, and $C(X),C(Y)$ must intersect in the origin at least, so {\sl all irreducible components of $X\cap Y$ have dimension at least $r+s-n$ and this intersection is nonempty whenever $r+s\ge n$}.

Returning to dimension theory of Noetherian local rings, we wrap up this topic with some final results.  Let $A$ be Noetherian local with dimension $d$ and maximal ideal $M$,  We have seen that there are $x_1,\ldots,x_d$ in $M$ such that the ideal $Q$ they generate contains a power $M^k$ of $M$; we call the $x_i$ a {\sl system of parameters}.  Let $f(t_1,\ldots,t_d)$ be a homogeneous polynomial of degree $s$ with coefficients in $A$ and assume that $f(x_1,\ldots,x_d)\in Q^{s+1}$.  Then we claim that {\sl all coefficients of $f$ lies in $M$}.  Indeed, we have seen that there is a surjection $\alpha$ from the polynomial ring over $A/Q$ in indeterminates $t_1,\ldots,t_d$ to the graded ring $G$ corresponding to $A$ and the stable $Q$-filtration $(Q^n)$ of it, sending $t_i$ to the image $\bar{x}_i$ of $x_i$ in $Q/Q^2\subset G$.  The hypothesis implies that $\bar{f}$, the reduction of $f$ mod $Q$, is in the kernel of $\alpha$.  If some coefficient of $f$ is not in $M$, so that it is a unit, then $f$ is not a zero divisor, by a result in upcoming homework; but then the dimension $d(G)$ of $G$ would then have to be at most $d-1$, a contradiction.  As a simple consequence, if there is a subring $K$ of $A$ mapping isomorphically onto $A/M$ (as there is for quotients of polynomial rings), then any set of elements $x_1,\ldots,x_d$ as above is algebraically independent over $K$; thus any quotient of
$K[x_1,\ldots,x_n]$ of dimension $d$ contains a copy of the polynomial ring $K[y_1,\ldots,y_d]$ (as we already knew thanks to Noether normalization).  Matters are even nicer (for general Noetherian local rings) if the dimension of $M/M^2$ equals $d$, for then any $K$-basis $y_1,\ldots,y_d$ of
$M/M^2$, pulled back to elements $x_1,\ldots,x_d$, is such that the quotient $M/I$ of $M$ by the ideal $I$ generated by the $x_i$, equals $M(M/I)$, whence $M/I = 0, I = M$ by Nakayama's Lemma.  In this case the graded ring $G$ attached to the standard $M$-filtration $(M^n)$ of $A$ is isomorphic to the polynomial ring $K[y_1,\ldots,y_d]$.  We call Noetherian local rings with this property
{\sl regular}; for example, the localization of any nonsingular irreducible variety at any point is regular.  In general the $K$-dimension of $M/M^2$ is at least $d=\dim A$.