\section{Overview of classical results from algebra} \label{section:var-prereq}
In this chapter we give a quick overview of the properties of algebraic varieties that we use in this book. In this section we go over the basic results that we are going to use without any proof. The rest of the chapter is essentially self-contained, provided one is willing to work through the exercises. As everywhere else in this book, unless explicitly stated otherwise in this chapter $\kk$ is an algebraically closed field. The first two results, which are due to D.\ Hilbert, are part of the foundation of modern algebraic geometry, and are used in this chapter implicitly or explicitly from the very beginning.

\begin{thm}[Hilbert's Basis Theorem] \label{thm:Hilbert-basis}
The ring of polynomials in finitely many variables over a Noetherian ring is also Noetherian.
\end{thm}

Given a subset $X$ of $\kk^n$ we write $I(X)$ for the set of all polynomials in $\kk[x_1, \ldots, x_n]$ which are zero at all points of $X$; it is straightforward to check that $I(X)$ is an ideal of $\kk[x_1, \ldots, x_n]$. Conversely, if $\qqq$ is an ideal of $\kk[x_1, \ldots, x_n]$, we write $V(\qqq)$ for the set of points on $\kk^n$ on which each element of $\qqq$ is zero; it is straightforward to check that $I(V(\qqq)) \supseteq \qqq$ and $V(I(X)) \supseteq X$. The following result describes the basic correspondence between $I(\cdot)$ and $V(\cdot)$. 

\begin{thm}[Hilbert's Nullstellensatz] \label{thm:Hillbert-nulls}
Assume $\kk$ is algebraically closed. Then for each ideal $\qqq$ of $\kk[x_1, \ldots, x_n]$, $I(V(\qqq))$ is the radical of $\qqq$. In particular, the maximal ideals of $\kk[x_1, \ldots, x_n]$ are of the form $I(a)$ for $a \in \kk^n$.
\end{thm}

The ``principal ideal theorem'' of W.\ Krull is a fundamental tool in algebraic treatments of dimension. We use the following special case frequently, starting from the proof that the dimension of the set of common zeroes of $k$ polynomials in $n$-variables has dimension at least $n-k$ (\cref{thm:pure-dimension}).

\begin{thm} [A special case of Krull's Principal Ideal Theorem] \label{thm:principal-ideal}
Let $R$ be a finitely generated integral domain over a field $k$, $f$ be a nonzero element of $R$ and $\ppp$ be an isolated prime ideal of the principal ideal $fR$ of $R$ generated by $f$ (i.e., $\ppp$ is minimal among the prime ideals containing $fR$). If $f$ is not a unit, then $\trd_k(R/\ppp) = \trd_k(R) - 1$ (where $\trd_k$ is the transcendence degree over $k$). 
\end{thm}

We also use some of the basic properties of {\em localization} and {\em completion} of Noetherian rings. Short introductions to these notions are provided in \cref{local-ring-section,completion-section}. \Cref{thm:Krull,power-basics} are used in our proof that near a nonsingular point a variety is a ``locally complete intersection'' (\cref{local-equations}) and \cref{thm:exactly-complete} is used for the first time in the proof that the local ring at a nonsingular point of a variety is isomorphic to a power series ring (\cref{smooth-completion}). We use \cref{thm:Krull,thm:exactly-complete} only in the case that $R$ is the ring of rational functions in $n$ variables (for some $n \geq 1$) over a field whose denominators have nonzero constant terms.


\begin{thm}[{Krull \cite[Corollary 10.18]{am}}] \label{thm:Krull}
Let $R$ be a Noetherian local ring with maximal ideal $\mmm$. If $\qqq$ is an ideal of $R$, then $\qqq = \bigcap_{k \geq 0} (\qqq + \mmm^k)$.
\end{thm}


\begin{thm}[Basic properties of formal power series rings] \label{power-basics}
Let $R := k[[x_1, \ldots, x_n]]$ be the ring of formal power series over a field $k$. Let $\mmm$ be the ideal of $R$ generated by $x_1, \ldots, x_n$.
\begin{enumerate}
\item $\mmm$ is the unique maximal ideal of $R$. Every element in $R \setminus \mmm$ is invertible.
\item If $f_1, \ldots, f_n \in \mmm$ are such that the linear parts of the $f_j$ are linearly independent (over $\kk$), then the map $x_j \mapsto f_j$, $j = 1, \ldots, n$, induces an isomorphism of $R$.
\end{enumerate}
\end{thm}


\begin{thm}[{Exactness of completion \cite[Proposition 10.12]{am}}] \label{thm:exactly-complete}
Let $I \subset J$ be ideals of a Noetherian ring $R$ and let $\bar R := R/I$. Let $\hat R$ (respectively ($\hat {\bar R}$) be the {\em completion} of $R$ (respectively $\bar R$) with respect to $J$ (respectively $J\bar R$). Then $\hat {\bar R} \cong \hat R/I \hat R$.
\end{thm}

Elsewhere in this book (but not in this chapter) we also use that formal power series rings (in finitely many variables over a field) are Noetherian; however, we provide a proof of this fact in \cref{power-basis}.
The next two results state fundamental properties of separable extensions of a field. These are used in \cref{exercise:birational-hypersurface} to show that every irreducible variety is birational to a hypersurface, which is in turn used in our proof that the dimension of a variety can be read off from the dimension of tangent spaces at points on it (\cref{tangent-dimension}). \Cref{thm:Schmidt} is not used anywhere else; the only other place we use \cref{thm:primitive-element} is in the proof of the defining properties of degree of a morphism (\cref{degree-morphism}).  

\begin{thm}[Primitive Element Theorem] \label{thm:primitive-element}
If $L$ is a finite separable extension field of a field $K$, then there is $\alpha \in L$ such that $L = K(\alpha)$ (i.e.\ every element of $L$ can be expressed as a polynomial in $\alpha$ with coefficients in $K$).
\end{thm}


\begin{thm}[F.\ K.\ Schmidt {\cite[Chapter II, Theorem 31]{zsI}}] \label{thm:Schmidt}
If $k$ is a perfect field, then any finitely generated field extension $K/k$ is {\em separably generated}, i.e.\ there are $x_1, \ldots, x_d \in K$ which are algebraically independent over $k$, and $K$ is a separable algebraic extension of $k(x_1, \ldots, x_n)$.
\end{thm}


\section{Quasiprojective Varieties} \label{var-section}
Let $(x_0, \ldots, x_n)$ be a system of coordinates on $\kk^{n+1}$, $n \geq 0$. Consider the relation $\sim$ on $\kk^{n+1} \setminus \{0\}$, $n \geq 0$, defined as follows: if $a, b \in \kk^{n+1} \setminus \{0\}$ with coordinates (with respect to $(x_0, \ldots, x_n)$) respectively $(a_0, \ldots, a_n)$ and $(b_0, \ldots, b_n)$, then $a \sim b$ if and only if there is $\lambda \in \kk\setminus \{0\}$ such that $a_j = \lambda b_j$ for each $j = 0, \ldots, n$. It is straightforward to check that $\sim$ is an equivalence relation; the {\em $n$-dimensional projective space} $\pp^n$ is the set of the equivalence classes of $\sim$. We denote the equivalence class of $\sim$ containing $a$ by $[a_0: \cdots : a_n]$ and say that $[a_0: \cdots: a_n]$ is the {\em homogeneous coordinate} of the point of $\pp^n(\kk)$ determined by $a$. Recall that a polynomial is {\em homogeneous} if each of its monomials has the same degree. If $f$ is a homogeneous polynomial in $(x_0, \ldots, x_n)$, then the set $V(f) := \{[a_0: \cdots: a_n]: f(a_0, \ldots, a_n) = 0\}$ of zeroes of $f$ is a well defined subset of $\pp^n$; we say that $V(f)$ is the {\em hypersurface} of $\pp^n$ determined by $f$. We leave it an exercise to check that there is a unique topology on $\pp^n$ in which the basic closed subsets are intersections of hypersurfaces of $\pp^n$ (\cref{exercise:zariski-topology}); it is called the {\em Zariski topology}. A {\em projective variety} is a Zariski closed subset of the projective space (equipped with the topology induced from the Zariski topology of $\pp^n$)\footnote{Traditionally it was common to define a projective variety as an {\em irreducible} Zariski closed subset of the projective space (a set is ``irreducible'' if it cannot be expressed as a union of two closed proper subsets); however, our definition is also widely used.}. A {\em quasiprojective variety} is a Zariski open subset of a projective variety (also equipped with the Zariski topology induced from $\pp^n$). A {\em subvariety} of a quasiprojective variety $X$ is a Zariski closed subset of $X$. The following theorem states the fundamental property that varieties can be ``finitely presented'' in terms of polynomials.

\begin{figure}[h]
\newcommand\conecolor{green}
\newcommand\intersectcolor{red}
\tikzstyle{sdot} = [yellow, circle, minimum size = 3pt, inner sep = 0pt, fill]
\pgfmathsetmacro\scalefactor{1}
\pgfmathsetmacro\axiscalefactor{1}
\pgfmathsetmacro\samplenum{5}
\pgfmathsetmacro\sampley{45}
\pgfmathsetmacro\opacity{0.3}
\pgfmathsetmacro\fillopacity{0.3}

\begin{center}
\begin{tikzpicture}[scale = \scalefactor]

\pgfmathsetmacro\b{0.75}
\pgfmathsetmacro\c{1}

\pgfmathsetmacro\conerpluslimit{1}
\pgfmathsetmacro\conerminuslimit{1}

\begin{scope}
\begin{axis}[
    axis lines = middle,
    axis equal,
    view/h = 45, view/v = 15,
    scale = \axiscalefactor,
    xticklabels = {,,},
    yticklabels = {,,},
    zticklabels = {,,},
    xlabel = {\picfontsize $x_1$},
    ylabel = {\picfontsize $x_2$},
    zlabel = {\picfontsize $x_0$}
]


\addplot3 [
    surf,
    color = \conecolor,
    opacity = \opacity,
    fill opacity = \fillopacity,
    faceted color = \conecolor,
    samples = \samplenum,
    samples y = \sampley,
    domain = 0 : \conerpluslimit,
    y domain = 0 : 360
] (
	{x*cos(y)*\c},
    {x*sin(y)*\c},
   	{x}
);

\addplot3 [
    surf,
    color = \conecolor,
    opacity = \opacity,
    fill opacity = \fillopacity,
    faceted color = \conecolor,
    samples = \samplenum,
    samples y = \sampley,
    domain = 0 : \conerminuslimit,
    y domain = 0 : 360
] (
	{x*cos(y)*\c},
    {x*sin(y)*\c},
   	{-x}
);

\addplot3 [
    samples = \sampley,
    samples y = 0,
    domain = 0 : 360,
    \intersectcolor, thick
] (
	{\b*\c*cos(x)},
	{\b*\c*sin(x)},
    {\b}
);


\end{axis}
\end{scope}

\end{tikzpicture}
\caption{For $\kk = \cc$, the real points of $X := V(x_0^2 - x_1^2 - x_2^2) \subset \pp^2$ can be pictured as a cross section of the real points of the {\em cone} $C(X)$ over $X$ in $\cc^3$}
\label{fig:cone-over-circle}
\end{center}
\end{figure}


\begin{thm} \label{thm:projective-intersection}
Let $X$ be a subvariety of $\pp^n$. There are {\em finitely} many homogeneous polynomials $f_1, \ldots, f_k$ in $(x_0, \ldots ,x_n)$ such that
\begin{align*}
X 	= V(f_1, \ldots, f_k)
	:= \{[x_0: \cdots: x_n] : f_j(x_0, \ldots, x_n) = 0\ \text{for each}\ j = 1, \ldots, k\}
	\subseteq \pp^n
\end{align*}
\end{thm}

\begin{proof}
Let $a = [a_0: \ldots : a_n] \in \pp^n$ and $L(a) := \{(ta_0, \ldots, ta_n): t \in \kk\}$ be the ``line in $\kk^{n+1}$ represented by $a$.''

\begin{proclaim} \label{line-claim}
A polynomial in $(x_0, \ldots, x_n)$ vanishes on $L(a)$ if and only if each of its homogeneous components vanishes on $a$.
\end{proclaim}

\begin{proof}
Pick $f  \in \kk[x_0, \ldots, x_n]$ such that $f|_{L(a)} \equiv 0$. Write $f= \sum_{d = 0}^e f_d$, where each $f_d$ is homogeneous of degree $d$. Then $f(ta_0, \ldots, ta_n) = \sum_{d=0}^e t^df_d(a)$ is a polynomial in $t$ with infinitely many zeroes, so that it must be identically zero. Therefore $f_d(a) = 0$ for each $d$, as required.
\end{proof}

Now let $X = \bigcap_{i \in \scrI} V(g_i) \subset \pp^n$, where each $g_i$ is a homogeneous polynomial in $(x_0, \ldots, x_n)$. Let $C(X) := \bigcup_{a \in X} L(a)$ be the {\em cone} over $X$ in $\kk^{n+1}$. Hilbert's basis theorem (\cref{thm:Hilbert-basis}), Nullstellensatz (\cref{thm:Hillbert-nulls}) and \cref{line-claim} imply that the ideal $I(C(X))$ of polynomials in $(x_0, \ldots, x_n)$ that vanish on $C(X)$ is generated by finitely many {\em homogeneous} polynomials $f_1, \ldots, f_k$ and that $X = V(f_1, \ldots, f_k) \subseteq \pp^n$.
\end{proof}

\subsection{Regular functions, morphisms}
If $f,g$ are homogeneous polynomials in $(x_0, \ldots, x_n)$ of the same degree, then $f/g$ is a well defined function on the Zariski open subset $\pp^n\setminus V(g)$ of $\pp^n$; we say that $f/g$ is a {\em rational function} on $\pp^n$ which is {\em regular} on $\pp^n \setminus V(g)$. In general, a {\em regular function} on a quasiprojective variety $X$ is a function $\phi: X \to \kk$ which can be ``locally represented by rational functions,'' i.e.\ there is an open cover $\{U_i\}$ of $X$ such that for each $i$, $\phi|_{U_i}$ is the restriction to $U_i$ of a rational function $f_i/g_i$ such that $g_i$ does {\em not} vanish at any point of $U_i$; the set $\kk[X]$ of regular functions on $X$ has the natural structure of a $\kk$-algebra. The following is straightforward to see from the definition of regular functions:

\begin{prop} \label{prop:regular-zeroes}
If $f$ is a regular function on a quasiprojective variety $X$, then $V(f) := \{x \in X: f(x) = 0\}$ is Zariski closed in $X$. \qed
\end{prop}

Given $J \subseteq \kk[X]$, we denote by $V(J)$ the ``subvariety of $X$ determined by $J$,'' i.e.\ the set of points on $X$ on which each $f \in J$ vanishes; \cref{prop:regular-zeroes} implies that $V(J)$ is indeed a subvariety of $X$. A {\em morphism} $\phi: X \to Y$ of quasiprojective varieties is a continuous map with respect to Zariski topology such that for every Zariski open subset $U$ of $Y$ and every regular function $h$ on $U$, the pullback $h \circ \phi$ is a regular function on $\phi^{-1}(U)$. An {\em isomorphism} is a bijective morphism whose inverse is also a morphism. We say that a morphism $\phi:X \to Y$ is a {\em closed embedding} if $\phi(X)$ is a (closed) subvariety of $Y$ and $\phi$ is an isomorphism between $X$ and $\phi(X)$. It is straightforward to check that a morphism $\phi: X \to Y$ induces via pullback a $\kk$-algebra homomorphism $\phi^*: \kk[Y] \to \kk[X]$. We say that $\phi$ is {\em dominant} or {\em dominating} if $\phi(X)$ is Zariski dense in $Y$.

\begin{prop} \label{prop:star-injective}
If a morphism $\phi: X \to Y$ of quasiprojective varieties is dominant (in particular, if it is surjective), then $\phi^*$ is injective. 
\end{prop}

\begin{proof}
Given a nonzero regular function $f$ on $Y$, the set $Y \setminus V(f)$ is nonempty and, due to \cref{prop:regular-zeroes}, Zariski open in $Y$. Since $\phi$ is dominant, $\phi(X)$ intersects $Y \setminus V(f)$, so that $U := \phi^{-1}(Y \setminus V(f))$ is a nonempty Zariski open subset of $X$. Since $\phi^*(f)$ is nonzero on $U$, the proposition follows.
\end{proof}

The converse of \cref{prop:star-injective} is {\em not} true. Indeed, you will show in \cref{exercise:p^n-constant} that the only regular functions on $\pp^n$ are constants, i.e.\ $\kk[\pp^n] = \kk$. It follows that if $\phi: \pp^n \to \pp^n$ is a constant morphism that maps every point to a fixed point on $\pp^n$, then $\phi^*$ is injective even though $\phi$ is far from being dominant. 

\subsection{Exercises}

\begin{exercise} \label{exercise:zariski-topology}
Show that the collection of Zariski closed sets satisfy the axioms of a topology, namely that it contains the empty set and the projective space itself, and it is closed under finite unions and arbitrary intersections.
\end{exercise}

\begin{exercise} \label{exercise:zariski-closure}
Given $X \subseteq \pp^n$, let $I(X)$ be the ideal of $\kk[x_0, \ldots, x_n]$ generated by all the homogeneous polynomials $f$ in $(x_0, \ldots, x_n)$ such that $f(x_0, \ldots, x_n) = 0$ for each $[x_0: \cdots : x_n] \in X$. Show that the closure of $X$ in $\pp^n$ under the Zariski topology is $\bar X := V(I(X)) = \{[x_0: \cdots :x_n] : f(x_0, \ldots, x_n) = 0$ for each homogeneous $f \in I(X)\}$; we say that $\bar X$ is the {\em Zariski closure} of $X$ in $\pp^n$.
\end{exercise}

\begin{exercise} \label{exercise:nonempty-hypersurface}
This exercise illustrates a fundamental property of algebraically closed fields.
\begin{enumerate}
\item Show that every non-constant polynomial over $\kk$ in $(x_1, \ldots, x_n)$ vanishes at some point of $\kk^n$. [Hint: proceed by induction on $n$. Treat polynomials in $(x_1, \ldots, x_n)$ over $\kk$ as polynomials in $x_n$ over $\kk[x_1, \ldots, x_{n-1}]$, and use inductive hypothesis to reduce to the case of $n = 1$.]
\item Deduce that for every homogeneous polynomial $f$ in $(x_0, \ldots, x_n)$, $n \geq 1$, the hypersurface $V(f) \subset \pp^n$ is nonempty.
\item Show by examples that the preceding statements may be false if $\kk$ is not algebraically closed.
\end{enumerate}
\end{exercise}


\begin{exercise} \label{exercise:k^1-intro}
Consider $\pp^1$ with homogeneous coordinates $[x_0:x_1]$.
\begin{enumerate}
\item Show that the map $[x_0: x_1] \mapsto x_1/x_0$ gives a one-to-one correspondence between $U_0 := \pp^1 \setminus V(x_0)$ and $\kk$. This correspondence is used to give $\kk$ the structure of a quasiprojective variety. 
\item Show that the Zariski topology on $\kk$ coincides with the {\em cofinite topology} (i.e.\ the topology in which open sets are precisely complements of finite subsets).
\end{enumerate}
\end{exercise}


\begin{exercise} \label{exercise:Zariski-continuous}
Prove that every regular function on a quasiprojective variety $X$ is ``Zariski continuous,'' i.e.\ continuous with respect to Zariski topology (recall from \cref{exercise:k^1-intro} that the Zariski topology on $\kk$ is the cofinite topology); in particular, morphisms from $X \to \kk$ are precisely regular functions on $X$. Show that the only proper Zariski closed subsets of $\pp^1$ are finite sets of points; conclude that every bijection of $\pp^1$ is Zariski continuous. Show that there are Zariski continuous maps from $\pp^1$ to $\pp^1$ which are not morphisms.
\end{exercise}

\section{Affine varieties}  \label{affine-section}
\subsection{Affine space, basic open subsets of the projective space}
For each $j = 0, \ldots, n$, $U_j := \{[a_0: \cdots : a_n]: a_j \neq 0\} = \pp^n \setminus V(x_j)$ is a Zariski open subset of $\pp^n$; it is clear that $\pp^n = \bigcup_j U_j$. We say that the $U_j$ are {\em basic open subsets} of $\pp^n$. Each $U_j$ has a one-to-one correspondence with $\kk^n$ via the map 
\begin{align}
\kk^n \ni (x_1, \ldots, x_n) \mapsto [x_1: \cdots:x_j: 1: x_{j+1}: \cdots : x_n] \in U_j \label{map:k^n-to-U_j}
\end{align}
The {\em affine space} is $\kk^n$ equipped with the Zariski topology induced by this correspondence. Unless stated explicitly otherwise, in this book we always write $\kk^n$ to denote the affine space. \Cref{thm:k^n-coordinates} below shows that the Zariski topology on $\kk^n$ does not depend on $j$ from the correspondence in \eqref{map:k^n-to-U_j}.

\begin{prop} \label{prop:k^n-irreducible}
$\kk^n$ is {\em irreducible}, i.e.\ every pair of nonempty open subsets of $\kk^n$ has a nonempty intersection. In particular, if two regular functions on $\kk^n$ agree on some Zariski open subset, then they agree everywhere. 
\end{prop}

\begin{proof}
Fix $j$, $0 \leq j \leq n$. Since $\kk$ is algebraically closed, the following can be proved by a straightforward induction on $n$ (see \cref{exercise:nonempty-hypersurface}). 

\begin{proclaim}
Let $H$ be a homogeneous polynomial in $(x_0, \ldots, x_n)$. Then $V(H) \cap U_j = \emptyset$ if and only if $H = cx_j^m$ for some $m \geq 0$ and $c \in \kk\setminus \{0\}$ and $m \geq 0$. \qed
\end{proclaim}

If $F_1, F_2$ are homogeneous polynomials in $(x_0, \ldots, x_n)$ such that $U_j \setminus V(F_i) \neq \emptyset$ for each $i$, then the above claim implies that $U_j \setminus V(F_1F_2) \neq \emptyset$, which proves the first assertion of the proposition. The second assertion then follows from \cref{prop:regular-zeroes}. 
\end{proof}


\begin{thm} \label{thm:k^n-coordinates}
The regular functions on $\kk^n$ are precisely the polynomials in $(x_1, \ldots, x_n)$. Every subvariety of $\kk^n$ is an intersection of zero sets of {\em finitely many} polynomials in $(x_1, \ldots, x_n)$.
\end{thm}

\begin{proof}[Proof {\cite[Proposition 1.11]{mummetry}}]
Denote the map $\kk^n \to U_j$ from \eqref{map:k^n-to-U_j} by $\psi_j$. It is straightforward to check that every polynomial in $(x_1, \ldots, x_n)$ corresponds to a regular function on $U_j$ via $\psi_j$. We will now show that conversely every regular function on $U_j$ comes from a polynomial in $(x_1, \ldots, x_n)$. Given a regular function $H$ on $U_j$, let $\qqq$ be the ideal of $\kk[x_1, \ldots, x_n]$ consisting of all polynomials $g$ such that $g\psi_j*(H)$ is a polynomial on some nonempty open subset of $\kk^n$. For each $a \in \kk^n$, there are homogeneous polynomials $F,G$ of same degree such that $G(\psi_j(a)) \neq 0$ and $H = F/G$ on an open neighborhood $U$ of $\psi_j(a)$. Let $d := \deg(F) = \deg(G)$. Write $f = \psi_j^*(F/x_j^d)$ and $g = \psi_j^*(G/x_j^d)$, i.e.\ $f,g$ are constructed respectively from $F/x_j^d$ and $G/x_j^d$ by substituting $x_i$ for $x_{i-1}/x_j$ for $i = 1, \ldots, j$, and for $x_{i+1}/x_j$ for $i = j+1, \ldots, n$. Then $g \in \qqq$ and $g(a) \neq 0$. It follows that $V(\qqq) = \emptyset$. The Nullstellensatz (\cref{thm:Hillbert-nulls}) then implies that $1 \in \qqq$, i.e.\ $\psi_j^*(H)$ agrees with a polynomial on some nonempty open subset of $\kk^n$. Since $\kk^n$ is irreducible (\cref{prop:k^n-irreducible}), it follows that $\psi_j^*(H)$ is a polynomial, which completes the proof of the first assertion of the theorem. The second assertion then follows from \cref{thm:projective-intersection}.
\end{proof}

\subsection{Affine varieties}
An {\em affine variety} $X$ is simply a subvariety of the affine space $\kk^n$.
The ring $\kk[X]$ of regular functions on $X$ is also denoted as the {\em coordinate ring} of $X$. The restriction of polynomials in $(x_1, \ldots, x_n)$ to $X$ induces an isomorphism $\kk[X] \cong \kk[x_1, \ldots, x_n]/I(X)$, where $I(X)$ is the ideal of $\kk[x_1, \ldots, x_n]$ consisting of all polynomials which vanish on $X$ (\cref{exercise:affine-coordinates}). Morphisms between two affine varieties are completely determined by the induced ($\kk$-algebra) homomorphisms of their coordinate rings. In particular, two affine varieties are isomorphic if and only if their coordinate rings are isomorphic as $\kk$-algebras (\cref{exercise:affine-isomorphic}). Affine varieties are ``building blocks'' of the category of varieties:

\begin{prop} \label{affine-cover}
Every variety has a finite open cover by affine varieties.
\end{prop}

\begin{proof}
Let $V$ be a quasiprojective variety in $\pp^n$. Then $V$ is covered by $V \cap U_j$, $j = 0, \ldots, n$, and $V \cap U_j$ are by definition open subsets of affine varieties. Therefore it suffices to prove that an open subset $U$ of a subvariety $X$ of $\kk^n$ in has a finite open cover by affine varieties. \Cref{thm:k^n-coordinates} implies that $U = X \setminus V(g_1, \ldots, g_l)$ for some polynomials $g_i$. Since $U = \bigcup_i (X \setminus V(g_i))$, the result follows from the fact that the complement of an hypersurface in an affine variety is also an affine variety (\cref{exercise:affine-complement}).
\end{proof}

Identify $\kk^n$ with the open subset $U_0$ of $\pp^n$. Let $X$ be a subvariety of $\kk^n$ defined by the ideal $\qqq$ of $\kk[x_1, \ldots, x_n]$ vanishing on $X$. For each $f \in \kk[x_1, \ldots, x_n]$, the {\em homogenization} of $f$ in $(x_0, \ldots, x_n)$ is the homogeneous polynomial $\tilde f := x_0^{\deg(f)}f(x_1/x_0, \ldots, x_n/x_0)$. Given an ideal $\qqq$ of $\kk[x_1, \ldots, x_n]$, the Zariski closure of $V(\qqq)$ in $\pp^n$ is the subvariety of $\pp^n$ defined by
\begin{align}
\tilde \qqq := \{\tilde f: f \in \qqq\} \subseteq \kk[x_0, \ldots, x_n] \label{ideal-homogenization}
\end{align}
(\cref{exercise:projective-closure}). A {\em hypersurface} of the affine (respectively, projective) space is a subvariety defined by a single (respectively, single homogeneous) polynomial, and a {\em hyperplane} is a hypersurface defined by a linear polynomial. \Cref{exercise:projective-closure} implies that the Zariski closure of an affine hypersurface (respectively, hyperplane) is a projective hypersurface (respectively, hyperplane).

\subsection{Exercises}

\begin{exercise} \label{exercise:p^n-constant}
Show that $\kk[\pp^n] = \kk$ [Hint:  apply \cref{thm:k^n-coordinates} to $U_i$ and $U_j$ for $i \neq j$; then compute $\kk[U_i] \cap \kk[U_j]$]. Conclude that the only possible morphism from a projective space into an affine space is the trivial map which maps everything to a point.
\end{exercise}

\begin{exercise} \label{exercise:dominant-affine}
Let $\phi:X \to Y$ be a morphism between affine varieties such that $\phi^*: \kk[Y] \to \kk[X]$ is injective. Show that $\phi$ is dominant. [Hint: if $\phi$ is not dominant, then the closure of $\phi(X)$ is a proper subvariety of $Y$ and there is a nontrivial regular function on $Y$ whose pullback is zero on $X$.] Contrast this with \cref{prop:star-injective}.
\end{exercise}

\begin{exercise} \label{exercise:affine-coordinates}
Let $X$ be a subvariety of $\kk^n$, with coordinates $(x_1, \ldots, x_n)$. Show that $\kk[X] \cong \kk[x_1, \ldots, x_n]/I(X)$, where $I(X)$ is the ideal of $\kk[x_1, \ldots, x_n]$ consisting of all polynomials which vanish on $X$ [Hint: mimic the proof of \cref{thm:k^n-coordinates}].
\end{exercise}

\begin{exercise}\label{exercise:affine-isomorphic}
Prove that two affine varieties are isomorphic if and only if their coordinate rings are isomorphic as $\kk$-algebras. Show that this is not true without the ``affineness'' condition.
\end{exercise}

\begin{exercise}\label{exercise:algebra-to-affine-variety}
Let $R$ be a finitely generated $\kk$-algebra which is {\em reduced}\footnote{A ring is {\em reduced} if it does not have any nonzero nilpotent elements.}. Show that there is an affine variety $X$ such that $\kk[X] \cong R$. \Cref{exercise:affine-isomorphic} shows that $X$ is unique up to an isomorphism, and therefore the categories of affine varieties and finitely generated reduced $\kk$-algebras are equivalent.
\end{exercise}

\begin{exercise} \label{exercise:affine-complement}
Let $f$ be a nonzero polynomial in $(x_1, \ldots, x_n)$.
\begin{enumerate}
\item Show that $\kk^n \setminus V(f)$ is an affine variety with coordinate ring $\kk[x_1, \ldots, x_n, 1/f]$. [Hint: consider $\{(x_1, \ldots, x_n, y) \in \kk^{n+1}: f(x)y = 1\}$.]
\item More generally, if $X$ is an affine variety and $f$ is a regular function on $X$, then show that $X \setminus V(f)$ is also an affine variety whose coordinate ring is the {\em localization} (see \cref{local-ring-section}) $\kk[X]_f$ of $\kk[X]$ at $f$.
\end{enumerate}
\end{exercise}

\begin{exercise}[Projective closure of affine varieties] \label{exercise:projective-closure}
Identify $\kk^n$ with the open subset $U_0$ of $\pp^n$. Given an ideal $\qqq$ of $\kk[x_1, \ldots, x_n]$, define $\tilde \qqq$ as in \eqref{ideal-homogenization}. Prove that
\begin{enumerate}
\item $V(\tilde \qqq)$ is the Zariski closure in $\pp^n$ of $V(\qqq) \subseteq \kk^n$. In particular, $\kk^n$ is Zariski dense in $\pp^n$.
\item $V(\qqq)$ is Zariski open in $V(\tilde \qqq)$.
\item If $X = V(f) \subseteq \kk^n$ for some $f \in \kk[x_1, \ldots, x_n]$, then the Zariski closure $\bar X$ of $X$ in $\pp^n$ is $V(\tilde f)$.
\item \label{homogeneous-closure} If $\qqq$ is generated by {\em homogeneous} polynomials $f_1, \ldots, f_k \in \kk[x_1, \ldots, x_k]$, show that $\tilde \qqq$ is also generated by $f_1, \ldots, f_k$. In particular, $\tilde f_j = f_j$ for each $j$, and $\bar X = V(\tilde f_1, \ldots, \tilde f_k)$ as a subvariety of $\pp^n$. [Hint: if $\qqq$ is generated by homogeneous polynomials, then show that $f \in \qqq$ if and only if each homogeneous component of $f$ belongs to $\qqq$.]
\item Show that in general, if $X = V(f_1, \ldots, f_k)$, then $\bar X \subsetneqq V(\tilde f_1, \ldots, \tilde f_k)$. [Hint: consider e.g.\ the case that $f_1 = x_1$ and $f_2 = x_2 - x_1^2$. Show that $V(f_1, f_2) \subset \kk^2$ is a point, whereas $V(\tilde f_1, \tilde f_2)$ consists of two points. Cf.\ \cref{bezout-counterexample}.]
\end{enumerate}
\end{exercise}

\begin{exercise} \label{exercise:projective-closure-example}
Let $a = (a_1, \ldots, a_n), b = (b_1, \ldots, b_n) \in \kk^n$, $b \neq 0$, and $L$ be the line $\{a + bt: t \in \kk\} \subset \kk^n$.
\begin{enumerate}
\item Show that ideal $I(L)$ of polynomials vanishing on $L$ is generated by linear polynomials of the form $c_ix_j - c_kx_l$ (for appropriate $c_i, c_k, j, l$). Determine a set of generators of $I(L)$ of this form. [Hint: at first consider the case that $a = 0$.]
\item Show that the closure $\bar L$ of $L$ in $\pp^n$ (where the inclusion $\kk^n \into \pp^n$ is as in \cref{exercise:projective-closure}), is $L \cup \{0: b_1: \cdots :b_n]\}$. [Hint: use assertion \eqref{homogeneous-closure} of \cref{exercise:projective-closure}.]
\item Conclude that two lines in $\kk^2$ intersect at infinity in $\pp^2$ if and only if they are parallel.
\end{enumerate}
\end{exercise}

\begin{exercise}[Converse to \cref{exercise:projective-closure}] \label{exercise:basic-open-equation}
Let $V$ be a a subvariety of $\pp^n$ defined by a homogeneous ideal $\qqq$ of $\kk[x_0, \ldots, x_n]$. The basic open subset $U_0$ of $\pp^n$ is isomorphic to $\kk^n$ with coordinates $(x_1/x_0, \ldots, x_n/x_0)$. Let
\begin{align*}
\qqq_0 := \{f/x_0^{\deg(f)}: f\ \text{is a homogeneous polynomial in}\ \qqq\}
\end{align*}
Show that
\begin{enumerate}
\item $\qqq_0$ is an ideal of $\kk[x_1/x_0, \ldots, x_n/x_0]$.
\item $V \cap U_0$ is the subvariety of $U_0$ defined by $\qqq_0$.
\end{enumerate}
\end{exercise}


\begin{exercise} \label{exercise:complement-hypersurface}
Let $S_1, S_2$ be finite subsets of $\pp^n$ such that $S_1 \cap S_2 = \emptyset$.
\begin{enumerate}
\item \label{assertion:complement-hypersurface} Show that there is a projective hypersurface $X$ containing $S_1$ but not containing any point of $S_2$. [Hint: reduce to the case that $|S_1| = 1$.]
\item If $|S_1| < n$, show that it is possible to ensure that $X$ of assertion \eqref{assertion:complement-hypersurface} is a hyperplane.
\end{enumerate}
\end{exercise}


\section{(Ir)reducibility} \label{irreducible-section}
A topological space $X$ is called {\em reducible} (respectively, {\em irreducible}) if it can (respectively, can not) be represented as the union of two proper closed subsets; it is straightforward to check that a topological space is irreducible if and only if any two of its nonempty subsets has a nonempty intersection (\cref{exercise:irreducible}); this explains the statement of \cref{prop:k^n-irreducible} that $\kk^n$ is irreducible. A finite set of points in $\kk^n$ is irreducible if and only if it consists of only one point. An {\em irreducible component} of $X$ is a closed irreducible subset which is not properly contained in any other irreducible subset of $X$. Each point of a finite subset $S$ of $\kk^n$ is an irreducible component of $S$. If $X = V(x_1 \cdots x_n) \subset \kk^n$ is the union of coordinate hyperplanes of $\kk^n$, then the irreducible components of $X$ are the coordinate hyperplanes $V(x_i)$, $i = 1, \ldots, n$. In the preceding example note that that the ideal $I(X)$ of $X$ is $\langle x_1 \cdots x_n \rangle$, which is precisely the intersection of the ideals of its irreducible components. This is in fact true for all affine varieties - since the ideal $I(X)$ of a subvariety $X$ of $\kk^n$ is radical, it can be represented as the intersection of finitely many {\em prime} ideals (\cref{thm:primary-decomposition}). There is a unique such representation $I(X) = \bigcap_j \ppp_j$ which is minimal, and the irreducible components of $X$ are precisely the zero sets $V(\ppp_j)$ of $\ppp_j$. In particular, $X$ is irreducible if and only if $I(X)$ is prime (\cref{exercise:prime-irreducible}).

\subsection{Exercises}
\begin{exercise} \label{exercise:irreducible}
Show that a topological space $X$ is irreducible if and only if any two of its nonempty open subsets has a nonempty intersection. Deduce that $\kk^n$ is irreducible for each $n$.
\end{exercise}

\begin{exercise} \label{exercise:irreducible-union}
Let $V_1, \ldots, V_k$ be closed subsets of a topological space $X$. If $V$ is a closed irreducible subset of $X$ such that $V \subseteq \bigcup_j V_j$, then show that $V \subseteq V_j$ for some $j$.
\end{exercise}

\begin{exercise} \label{exercise:projaffine-irreducible}
If $U$ is a dense subset of $V$, show that $U$ is irreducible if and only if $V$ is irreducible. Conclude that $\pp^n$ is irreducible.
\end{exercise}

\begin{exercise} \label{exercise:prime-irreducible}
Let $\qqq$ be an ideal of $\kk[x_1, \ldots, x_n]$. Show that $V(\qqq)$ is irreducible if and only if the radical of $\qqq$ is prime. Conclude that an affine variety is irreducible if and only if its coordinate ring is an integral domain.
\end{exercise}

\section{Rational functions and rational maps on irreducible varieties}
Let $X$ be an irreducible quasiprojective variety. A {\em rational function} on $X$ is a regular function on a nonempty Zariski open subset of $X$. Formally, a rational function is an equivalence class of pairs $(f, U)$, where $U$ is a nonempty Zariski open subset of $X$ and $f$ is a regular function on $U$, and the equivalence relation is defined as follows: $(f, U) \sim (f',U')$ if and only if $f$ and $f'$ agree on $U \cap U'$; we write $\kk(X)$ for the set of rational functions on $X$. The irreducibility of $X$ forces every pair of its nonempty Zariski open subsets to have a nonempty intersection, which in turn implies that $\kk(X)$ is a field (\cref{exercise:k(X)-0}). If $X$ is in addition {\em affine}, then $\kk(X)$ can be identified with the field of fractions of $\kk[X]$. A {\em rational map} $\phi$ from a variety $X$ to a variety $Y$ is a morphism from a nonempty open subset $U$ of $X$ to $Y$; usually a rational map is denoted by a broken arrow
\begin{align*}
\phi : X \dashrightarrow Y
\end{align*}
It is called {\em dominant} if the image of $U$ is dense in $Y$, and {\em birational} if there are open subsets $U'$ of $U$ and $V$ of $Y$ such that $\phi|_{U'}: U' \to V$ is an isomorphism. We say that {\em $X$ and $Y$ are birational} or {\em $X$ is birational to $Y$} if there is a birational map from $X$ to $Y$. Fields of rational functions of birational irreducible varieties are isomorphic (\cref{exercise:birational-fields}). Every irreducible variety is birational to a hypersurface (\cref{exercise:birational-hypersurface}).

\subsection{Exercises}
\begin{exercise} \label{exercise:k(X)-examples}
Compute $\kk(X)$ for the following cases: $X = \kk^n$; $X = U_i \cap U_j$, for $i \neq j$, where $U_j$ are affine open subsets of $\pp^n$ from \cref{affine-section}; $X = \pp^n$.
\end{exercise}

\begin{exercise} \label{exercise:k(X)-0}
Let $X$ be an irreducible variety.
\begin{enumerate}
\item If $U$ is a nonempty open subset of $X$, show that $\kk(X) = \kk(U)$.
\item Show that $\kk(X)$ is a field.
\item If $X$ is also affine, then show that $\kk(X)$ can be identified with the field of fractions of $\kk[X]$. Show that this may not hold if $X$ is not affine.
\item Which parts of the proof that ``$\kk(X)$ is a field'' go wrong when $X$ is reducible? What is an appropriate generalization of $\kk(X)$ to the case of reducible varieties?
\end{enumerate}
\end{exercise}

\begin{exercise} \label{exercise:dominantly-irreducible}
Let $\phi: X \to Y$ be a dominant rational map. Show that if $X$ is irreducible, then so is $Y$.
\end{exercise}


\begin{exercise} \label{exercise:dominant-k(X)}
Let $\phi$ be a rational map from $X$ to $Y$, both irreducible varieties. Show that
\begin{enumerate}
\item If $\phi$ is dominant, then $\phi$ induces an injection $\phi^*: \kk(Y) \into \kk(X)$.
\item Conversely, every injection $\kk(Y) \into \kk(X)$ is induced by a dominant rational map; contrast this with \cref{prop:star-injective}.
\end{enumerate}

\end{exercise}


\begin{exercise} \label{exercise:birational-fields}
Let $X$ and $Y$ be irreducible varieties. Show that $X$ is birational to $Y$ if and only if $\kk(X) \cong \kk(Y)$.
\end{exercise}

\begin{exercise} \label{exercise:birational-hypersurface}
Let $X$ be an irreducible variety. In this exercise you will show that there is $n \geq 1$ and a polynomial $f$ in $(x_1, \ldots, x_n)$ such that $X$ is birational to $V(f) \subset \kk^n$.
\begin{enumerate}
\item Use \cref{exercise:affine-coordinates,exercise:k(X)-0} to show that $\kk(X)$ is a finitely generated field extension of $\kk$.
\item Use \cref{thm:primitive-element,thm:Schmidt} to show that there are $x_1, \ldots, x_n \in \kk(X)$ such that
\begin{enumerate}
\item $x_1, \ldots, x_{n-1}$ are algebraically independent over $\kk$,
\item $x_n$ is algebraic over $\kk(x_1, \ldots, x_{n-1})$,
\item $f(x_n) = 0$ for some irreducible $f \in \kk[x_1, \ldots, x_n]$, and
\item $\kk(X) = \kk(x_1, \ldots, x_n)$.
\end{enumerate}
\item Compute the field of rational functions of $Y := V(f) \subset \kk^n$ and use \cref{exercise:birational-fields} to conclude that $X$ is birational to $Y$.
\end{enumerate}
\end{exercise}

\section{Product spaces, Segre map, Veronese embedding} \label{product-section}
\subsection{Product spaces, Segre map}
\label{segre-subsection}
The most basic topology on products of topological spaces is the ``product topology,'' whose open sets are unions of products of open subsets of each factor. The product topology on algebraic varieties however is very restrictive:

\begin{example} \label{example:product-top}
Since the only proper closed subsets of $\kk$ are finite sets of points (\cref{exercise:k^1-intro}), the proper closed subsets of $\kk^2 \cong \kk \times \kk$ under the product topology are finite unions of sets of the form $S_1 \times S_2$, where at least one of the $S_i$ is finite. Given a polynomial $f$ in $(x,y)$, it follows that the curve $V(f)$ on $\kk^2$ is closed in the product topology if and only if $f$ can be expressed as $g(x)h(y)$ for polynomials $g,h$ in one variable. 
\end{example}

A more natural topology on algebraic varieties is constructed as follows: consider projective spaces $\pp^m, \pp^n$ with homogeneous coordinates respectively $[x_0 : \cdots : x_m]$ and $[y_0: \cdots : y_n]$. A polynomial $f$ in $(x_0, \ldots, x_m, y_0, \ldots, y_n)$ is called {\em bi-homogeneous} of {\em bi-degree}$(d,e)$ in the $x_i$ and $y_j$ if each monomial that appears in $f$ has degree $d$ in the $x$-variables and $e$ in the $y$-variables. The set of zeroes of a bi-homogeneous polynomial on $\pp^m \times \pp^n$ is well-defined, and the Zariski topology on $\pp^m \times \pp^n$ is by definition the (unique) topology whose basic closed subsets are intersections of zero sets of bi-homogeneous polynomials. If $V, W$ are quasiprojective varieties with their Zariski closures being subvarieties respectively of $\pp^m, \pp^n$, $j = 1, 2$, then the Zariski topology on $V \times W$ is the topology induced from the Zariski topology on $\pp^m \times \pp^n$. An equivalent formulation of the Zariski topology on product spaces can be given via the {\em Segre map} $s: \pp^m \times \pp^n \to \pp^k$, where $k := (m+1)(n+1) - 1$. It is defined as follows: let $z_{ij}$, $0 \leq i \leq m$, $0\leq j \leq n$, be a system of homogeneous coordinates on $\pp^k$; then
\begin{align}
s:([x_0 : \cdots : x_m], [y_0: \cdots : y_n]) \mapsto \text{the point}\ z_{ij} = x_iy_j
\label{segre-defn}
\end{align}

The proof of the following result is left as an exercise (\cref{exercise:segre})

\begin{prop} \label{prop:segre}
The image of $\pp^m \times \pp^n$ under the Segre map is the subvariety $Z$ of $\pp^k$ defined by (homogeneous) quadrics of the form $z_{ij}z_{kl} - z_{il}z_{kj}$ and $s$ induces an homeomorphism between $\pp^m \times \pp^n$ and its image. \qed
\end{prop}

\Cref{prop:segre} implies that the Zariski topology on a product space agrees with the topology induced by the Zariski topology on the projective space upon identification of the product space with its image under the Segre map. In particular, we view $\pp^m \times \pp^n$ as a projective variety by identifying it with the subvariety $s(\pp^m \times \pp^n)$ of $\pp^k$.

\subsection{Veronese embedding}
\label{veronese-subsection}

Let $d$ be a positive integer and $\scrV_d := \{\alpha = (\alpha_0, \ldots, \alpha_n) \in \zzeroo{n+1}: \sum_{j=0}^n \alpha_j = d\}$ be the set of exponents of monomials of degree $d$ in $(x_0, \ldots, x_n)$. The {\em degree-$d$ Veronese map} $\nu_d: \pp^n \to \pp^{|\scrV_d|-1}$ is given by
\begin{align}
\nu_d &: [x_0: \cdots : x_n] \mapsto [ x^\alpha: \alpha \in \scrV_d] \label{veronese-defn}
\end{align}

\begin{prop} \label{veronese-embedding}
$\nu_d$ is a {\em closed embedding}, i.e.\ $\nu_d(\pp^n)$ is a subvariety of $\pp^{|\scrV_d|-1}$, and $\nu_d$ is an isomorphism between $\pp^n$ and $\nu_d(\pp^n)$.
\end{prop}

\begin{proof}
It is straightforward to see that $\nu_d$ can be expressed as a composition
\begin{align*}
\pp^n
	\overset{\delta}{\rightarrow}
		\pp^n \times \cdots \times \pp^n
	\overset{s_d}{\rightarrow}
		\pp^{(n+1)^d - 1}
	\overset{\pi}{\dashrightarrow}
		\pp^{|\scrV_d|-1}	
\end{align*}
where $\delta:x \mapsto (x, \ldots, x)$ is the diagonal map to the product of $d$ copies of $\pp^n$, $s_d$ is the Segre map on the $d$ factors, and $\pi$ is a projection which omits ``redundant'' coordinates of $s_d \circ \delta$ (i.e.\ for each $\alpha \in \scrV_d$, $\pi$ retains only one of the coordinates of $s_d \circ \delta$ equalling $x^\alpha$). Since $\delta$ and $s_d$ are closed embeddings (\cref{exercise:closed-graph,exercise:segre}), so is $s_d \circ \delta$. It is then straightforward to check that $\pi \circ s_d \circ \delta$ is a closed embedding as well.
\end{proof}

We use \cref{veronese-embedding} to show that the complement of a projective hypersurface in a projective variety is affine. It is the projective analogue of the fact that the complement of a hypersurface in an affine variety is also affine (\cref{exercise:affine-complement}). For this result we will use the terminology of {\em graded rings} from \cref{graded-section}. The degree of polynomials induce the structure of a graded ring on $S := \kk[x_0, \ldots, x_n]$ (\cref{example:graded-polynomials}). If $f$ is a homogeneous polynomial, then the localization $S_f = \kk[x_0, \ldots, x_n, 1/f]$ is also a graded ring with a well-defined degree given by: $\deg(g/f^k) := \deg(g) - k\deg(f)$ for each $g \in S$ (\cref{prop:graded-localization}), and the subring of zero degree elements of $S_f$ is denoted by $S_{(f)}$. If $I$ is a {\em homogeneous ideal} of $S$, i.e.\ if $I$ is generated by homogeneous polynomials, we write $I_{(f)}$ for the ideal of $S_{(f)}$ generated by $I$, i.e.\ $I_{(f)} := \{g/f^k: g$ is a homogeneous element of $I,\ k \geq 0,\ \deg(g) = k\deg(f)\}$.

\begin{prop} \label{projective-complement}
Let $X$ be a subvariety of $\pp^n$ and $f$ be a nonzero homogeneous polynomial in $(x_0, \ldots, x_n)$. Then $X \setminus V(f)$ is an affine variety with coordinate ring isomorphic to $\kk[x_0, \ldots, x_n]_{(f)}/I(X)_{(f)}$, where $I(X)$ is the ideal of homogeneous polynomials identically vanishing on $X$.
\end{prop}

\begin{proof}
Let $d := \deg(f)$. If $d = 0$, then the result is trivial. If $d = 1$, then after a linear isomorphism (which preserves degree, and therefore induces an automorphism of $\pp^n$) of $\kk[x_0, \ldots, x_n]$ we may assume that $f \cong x_0$. But then $X \setminus V(f)$ is the basic open set $U_0$, which is isomorphic to the affine space with coordinate ring $\kk[x_1/x_0, \ldots, x_n/x_0]$ (\cref{thm:k^n-coordinates}), as required. In the case that $d > 1$, let $Y := \nu_d(X) \subset \pp^{|\scrV_d|-1}$, then $\nu_d$ maps $X \setminus V(f)$ isomorphically onto $Y \setminus V(h)$ for a linear polynomial $h$ on $\nu_d$, and the result follows from the $d = 1$ case [sort out the details carefully].
\end{proof}

\subsection{Exercises}

\begin{exercise} \label{exercise:Zariski-affine-product}
Show that $\kk^m \times \kk^n$ (with the topology induced from the Zariski topology of $\pp^m \times \pp^n$) is homeomorphic to $\kk^{m+n}$ (with the usual Zariski topology, i.e.\ the topology induced from the Zariski topology of $\pp^{m+n}$).
\end{exercise}

\begin{exercise} \label{exercise:segre}
Prove \cref{prop:segre}. 
\end{exercise}

\begin{exercise} \label{exercise:Zariski-affine-times-projective}
Show that the Zariski topology on $\kk^m \times \pp^n$ can be described as follows: let $(x_1, \ldots, x_m)$ be a system of coordinates  polynomial coordinates of $\kk^m$ and $[y_0: \cdots : y_n]$ be homogeneous coordinates on $\pp^n$. Then the closed sets on $\kk^m \times \pp^n$ are (finite) intersections of zero sets of polynomials $f \in \kk[x_1, \ldots, x_m, y_0, \ldots, y_n]$ which are {\em homogeneous in the $y$-variables}, i.e.\ of the form
\begin{align*}
f = \sum_{\beta_0 + \cdots + \beta_n = d} (\text{coefficient}) x_1^{\alpha_1} \cdots x_m^{\alpha_m}  y_0^{\beta_0} \cdots y_n^{\beta_n}
\end{align*}
for some $d \geq 0$ (in this case $d$ is said to be the {\em degree} of $f$ in $(y_0, \ldots, y_n)$).
\end{exercise}

\begin{exercise}\label{exercise:closed-graph}
Let $\phi: X \to Y$ be a morphism of varieties. Show that its {\em graph}, i.e.\ the set $\{(x,\phi(x)): x \in X\}$ is a subvariety (i.e.\ a Zariski closed subset) of $X \times Y$ and it is isomorphic to $X$. [Hint: reduce to the case that $X$ and $Y$ are affine. Then use \cref{exercise:Zariski-affine-product}.]
\end{exercise}


\section{Completeness and compactification} \label{complete-section}
While studying manifolds, it is often necessary to compactify them in order that the intersection theory of submanifolds is well behaved. The Noetherianness of finitely generated $\kk$-algebras (Hilbert's basis theorem) implies that {\em all} algebraic varieties satisfy the usual definitions of compactness (\cref{exercise:noetherian-to-compact}). The property which plays in the case of varieties the role similar to that of compactness in the case of manifolds is {\em completeness}. A variety $X$ is called {\em complete} if for every variety $Y$, the projection map $X \times Y \to Y$ is closed, i.e.\ it maps closed sets on to closed sets. For many ``natural'' topological spaces (e.g.\ the Euclidean topology), compactness is equivalent to completeness (\cref{exercise:compact=complete}). A {\em compactification}\footnote{We would have liked to use ``completion'' instead of ``compactification''; however, it might suggest a (misleading) connection with the notion of completion of local rings or modules.} of a variety $X$ is a complete variety $\bar X$ containing an open dense subset isomorphic to $X$. The projective space is complete (\cref{exercise:projective-complete}). Since every closed subset of a complete variety is complete (\cref{exercise:closed-sub-complete}), every quasiprojective variety has a compactification (namely its closure in an ambient projective space).


\subsection{Exercises}

\begin{exercise} \label{exercise:noetherian-to-compact}
Recall that a topological space is called {\em compact} if each of its open covers has a finite subcover, and it is called {\em sequentially compact} if every infinite sequence of points has a convergent subsequence. Show that
\begin{enumerate}
\item Every quasiprojective variety is compact. [Hint: start with the affine varieties, use the Noetherianness of their coordinate rings.]
\item Every quasiprojective variety is sequentially compact. [Hint (the following strategy requires the notion of {\em dimension} covered in \cref{dimension-section}): start with a sequence of points on a quasiprojective variety $X$ and take its closure $Z$ in $X$. Reduce to the case that $Z$ is irreducible and affine. Then consider two cases: (i) there is a nonzero regular function on $Z$ that vanishes on an infinite subsequence, and (ii) every nonzero regular function vanishes on only finitely many points from that sequence.]
\end{enumerate}

\end{exercise}

\begin{exercise} \label{exercise:first-countable}
We say that a topological space $X$ is {\em first-countable} if for every point $x \in X$, there is a sequence of open neighborhoods $\{U_j\}_j$ of $x$ in $X$ such that every open neighborhood $U$ of $x$ in $X$ contains some $U_j$. Show that the following are equivalent:
\begin{enumerate}
\item $X$ is first countable.
\item \label{strongly-first-countable} For every point $x \in X$, there is a sequence of open neighborhoods $\{U_j\}_j$ of $x$ in $X$ such that for every open neighborhood $U$ of $x$ in $X$, there is $N$ such that $U$ contains $U_j$ for each $j \geq N$.
\end{enumerate}
\end{exercise}


\begin{exercise} \label{exercise:compact=complete}
Let $X$ be a first countable topological space. Consider the following properties:
\begin{enumerate}
\item \label{seq-compactness} $X$ is sequentially compact.
\item \label{completeness-general} For every first countable topological space $Y$, the projection map $X \times Y \to Y$ is closed with respect to the product topology on $X \times Y$.

\end{enumerate}
Show that \eqref{seq-compactness} implies \eqref{completeness-general}. If $X$ is a first countable $T_1$-space\footnote{A topological space is $T_1$ if for every pair of distinct points, each has an open neighborhood not containing the other.}, show that \eqref{completeness-general} implies \eqref{seq-compactness}.
\end{exercise}


\begin{exercise}\label{exercise:closed-sub-complete}
Show that
\begin{enumerate}
\item a complete subset of a variety is also (Zariski) closed,
\item every subvariety of a complete variety is complete,
\item the image of a complete variety under a morphism is also complete.
\end{enumerate}
\end{exercise}

\begin{exercise}
If $f$ is a regular function on a complete variety $X$, show that $f$ takes finitely many values [Hint: consider the subvariety $Z$ of $X \times \kk$ given by $tf = 1$, where $t$ is the coordinate on $\kk$]. Conclude that
\begin{enumerate}
\item Every regular function on a complete irreducible variety is constant, i.e.\ $\kk[X] = \kk$.
\item If $f$ is a morphism from an irreducible complete variety to the affine space, then the image of $f$ is a point.
\item If $\bar X$ is a compactification of an affine variety $X$ and $C$ is a complete subset of $\bar X$ consisting of infinitely many points, then $C \cap (\bar X \setminus X) \neq \emptyset$.
\end{enumerate}
\end{exercise}


\begin{exercise} \label{exercise:projective-complete}
In this exercise you will prove that $\pp^n$ is complete (following the structure of \cite[Proof of Theorem 2.23]{mummetry}).
\begin{enumerate}
\item Show that it suffices to prove that the projection map $\pi: \pp^n \times \kk^m \to \kk^m$ is closed for each $m$. [Hint: every variety has a finite open covering by closed subsets of the affine space (\cref{affine-cover}).]
\item Let $\pi$ be as in the preceding step. Choose affine coordinates $(Y_1, \ldots, Y_m)$ on $\kk^m$ and homogeneous coordinates $[X_0: \cdots: X_n]$ on $\pp^n$. Let $Z$ be a closed subset of  $\pp^n \times \kk^m$.  \Cref{exercise:Zariski-affine-times-projective} implies that $Z = V(f_1, \ldots, f_k)$ for polynomials $f_j (X,Y) \in \kk[X_0, \ldots, X_n, Y_1, \ldots, Y_m]$ which are homogeneous of degree $d_j \geq 0$ in the $X$-variables. Show that for each $y \in \kk^m$, $y \not\in \pi(Z)$ if and only if there is $d \geq 1$ such that $\mmm^d$ is contained in the ideal of $\kk[X_0, \ldots, X_n]$ generated by $f_1(X,y), \ldots, f_k(X,y)$, where $\mmm$ is the maximal ideal of $\kk[X_0, \ldots, X_n]$ generated by $X_0, \ldots, X_n$.
\item For each integer $e$, let $V_e$ be the vector space of homogeneous polynomials of degree $e$ in $(X_0, \ldots, X_n)$ (with $V_e = 0$ if $e < 0$) and let $m_e := \dim_\kk(V_e)$. For each  $y \in \kk^m$, and $d \geq 0$, let $T^d(y)$ be the linear map $V_{d - d_1} \dsum \cdots \dsum V_{d-d_k} \to V_d$ defined by $(g_1(X), \ldots, g_k(X)) \mapsto \sum_{j=1}^k f_j(X,y)g_j(X) $. Let $[T^d(y)]$ be the matrix of $T^d(y)$ with respect to fixed bases of $\dsum_j V_{d-d_j}$ and $V_d$. Show that $T^d(y)$ is surjective if and only if there is an $m_d \times m_d$-minor of $[T^d(y)]$ with nonzero determinant.
\item Conclude that $\kk^m \setminus \pi(Z)$ is open, as required.
\item What goes wrong with the proof if $\pp^n$ is replaced by $\kk^n$?
\end{enumerate}
\end{exercise}

\begin{exercise} \label{exercise:dominant-to-surjective}
Let $\phi: X \to Y$ be a dominant morphism. Show that $\phi$ can be extended to a {\em surjective} morphism $\phi': X' \to Y$ where $X'$ is a variety which contains (an isomorphic copy of) $X$ as a dense subset. [Hint: let $\bar X$ be a compactification of $X$. Take $X'$ to be the closure of the graph (\cref{exercise:closed-graph}) of $\phi$ in $X \times Y$.]
\end{exercise}


\section{Dimension}\label{dimension-section}
The {\em dimension} $\dim(X)$ of an irreducible quasiprojective variety $X$ is the transcendence degree over $\kk$ of the field $\kk(X)$ of rational functions on $X$. In general $\dim(X)$ is the maximum of the dimensions of all its irreducible components. The dimension of a variety is an analogue of the dimension of smooth manifolds. In particular, when $\kk = \cc$ and $X$ is irreducible, it turns out that there is an open Zariski dense subset of $X$ (consisting of {\em nonsingular} points (see \cref{nonsingular-section}) of $X$) which is a smooth manifold of (complex) dimension $\dim(X)$. We say that $X$ has {\em pure dimension} $d$ if each of its irreducible components has dimension $d$. If $a \in X$ and there is a Zariski open neighborhood $U$ of $a$ in $X$ which has pure dimension $d$, we say that $X$ has pure dimension $d$ {\em near} $a$.

\subsection{Dimension of subvarieties}

The following is a fundamental property of dimension:

\begin{thm} \label{thm:dim-smaller}
Every proper subvariety of an irreducible variety $X$ has smaller dimension than that of $X$.
\end{thm}

\begin{proof}
Let $Y$ be a proper subvariety of $X$. Since the field of rational functions does not change after restricting to a (nonempty) open subset (\cref{exercise:k(X)-0}), taking an open neighborhood of a point on $Y$ if necessary we may assume \woutlog\ that $X,Y$ are affine. Since $X,Y$ are also irreducible, it follows that $X = V(\ppp)$ and $Y = V(\qqq)$ for prime ideals $\ppp \subsetneq \qqq$ of $\kk[x_1, \ldots, x_n]$, $n \geq 1$ (\cref{exercise:prime-irreducible}). Let $d := \dim(X)$. \Woutlog\ we may assume that $x_1, \ldots, x_d$ are algebraically independent over $\kk$ in $\kk(X)$. It suffices to show [why?] that $x_1, \ldots, x_d$ are {\em not} algebraically independent over $\kk$ in $\kk(Y)$. Pick a nonzero element $q \in \qqq$. Since $x_1, \ldots, x_d, q$ are algebraically dependent over $\kk$ in $\kk(X)$, there is an irreducible polynomial $F(x_1, \ldots, x_d, y) \in \kk[x_1, \ldots, x_d, y]$ such that $F(x_1, \ldots, x_d, q) = 0$ in $\kk[X]$. Since $q \neq 0$ in $\kk[X]$, it follows that $F$ is {\em not} a multiple of $y$. Therefore $F(x_1, \ldots, x_d, 0)$ is a nonzero polynomial in $\kk[x_1, \ldots, x_d]$ which represents an algebraic relation of $x_1, \ldots, x_d$ in $\kk[Y]$, as required.
\end{proof}

We presented \cref{thm:dim-smaller} above due to its simple proof (which we found in \cite[Proof of Proposition 1.14]{mummetry}). However, if one is willing to use more elaborate machinery, namely Krull's principal ideal theorem (\cref{thm:principal-ideal}), then in a straightforward way one can obtain the following more precise version of \cref{thm:dim-smaller}; we leave its proof as an exercise (\cref{exercise:pure-dimension}). 

\begin{thm} \label{thm:pure-dimension}
Let $f_1, \ldots, f_k$ be regular functions on a variety $X$ of pure dimension $n$. Show that
\begin{enumerate}
\item $V(f_1) \subseteq X$ is either empty or has pure dimension $n-1$.
\item The dimension of every irreducible component of $V := V(f_1, \ldots, f_k) \subseteq X$ is at least $n - k$.
\item If $\dim(V) = n- k$, then for all $I \subseteq [k]$, $V(f_i: i \in I)$ has pure dimension $n - |I|$ near every point of $V$. \qed
\end{enumerate}
\end{thm}

In general the dimension of $V(f_1, \ldots, f_k)$ may be greater than $n-k$, e.g.\ $V(x(x-y), y(x-y))$ is the diagonal line $x = y$ on $\kk^2$, and therefore has dimension $1 > 2 -2$.


\subsection{Curve selection lemma}
A {\em curve} (respectively, {\em surface}) is a variety of pure dimension one (respectively, two). The following is our first version of the algebraic ``curve selection lemma.'' A more refined statement is given in \cref{closure-curve-prop}.

\begin{cor}[Curve selection lemma I] \label{closure-curve-lemma}
Let $U$ be a nonempty Zariski open subset of an irreducible variety $X$ and $a \in X$. If $\dim(X) > 0$, then there is an irreducible curve $C$ on $X$ containing $a$ such that $C \cap U$ is nonempty.
\end{cor}

\begin{proof}
We prove this by induction on $\dim(X)$. If $\dim(X) = 1$, then it is trivially true, so assume $\dim(X) > 1$. \Woutlog\ we may assume that $X$ is affine. Pick $f \in \kk[X]$ such that $f(a) = 0$ and $f$ is not identically zero on $X$ [why does such $f$ exist?]. Let $X'$ be an irreducible component of $V(f)$ containing $a$. \Cref{thm:pure-dimension} implies that $\dim(X') = \dim(X) - 1$, so that we are done by induction.
\end{proof}

\subsection{Dimension of the image and fibers of a morphism}
Intuitively, the image of a map can not have bigger dimension than the source. The following result makes it precise:
\begin{prop} \label{dominant-dimension}
Let $\phi:X \to Y$ be a dominant morphism of varieties. Then $\dim(X) \geq \dim(Y)$.
\end{prop}

\begin{proof}
This is immediate from the observation that $\phi^*: \kk(Y) \to \kk(X)$ is an injection (\cref{exercise:dominant-k(X)}). 
\end{proof}

Now we study the dimension of the fibers of a morphism. Consider e.g.\ the map $\phi: \kk^2 \to \kk^2$ given by $(x,y) \mapsto (x,xy)$. The image of $\phi$ is $(\kk^2 \setminus V(x)) \cup \{(0,0)\}$. For most points on the image, in fact for all $(u,v) \in \phi(\kk^2) \setminus \{(0,0)\}$, the fiber $\phi^{-1}(u,v)$ over $(u,v)$ is zero dimensional, and consists of a single point $(u,v/u)$. On the other hand, $\phi^{-1}(0,0)$ is all of the $y$-axis, and hence has dimension one. In particular, the dimension of fibers is constant over a nonempty Zariski open subset of the image, and it is possible that some fibers have higher dimension. \Cref{fiber-dimension} below shows that this is true in general.

\begin{thm}
\label{fiber-dimension}
Let $X$ be an irreducible variety and $\phi: X \to Y$ be a surjective morphism. Then for every $y \in Y$ and every irreducible component $V$ of $\phi^{-1}(y)$, $\dim (V) \geq \dim(X) - \dim(Y)$. Moreover, there is a nonempty Zariski open subset $U$ of $Y$ such that $\phi^{-1}(y)$ is of pure dimension $\dim(X) - \dim(Y)$ for each $y \in U$.
\end{thm}

\begin{proof}[Proof {\cite[Proof of Threorem I.7]{shaf1}}]
We may assume \woutlog\ that $Y$ is affine. Let $m := \dim(Y)$. Take $y \in Y$. The following can be proved via an induction on $m$, we leave its proof as an exercise (\cref{exercise:complementary-intersection}).

\begin{proclaim} \label{claim:complementary-intersection}
There are regular functions $h_1, \ldots, h_m$ on $Y$ such that $V(h_1, \ldots, h_m) \cap U = \{y\}$ for some open neighborhood $U$ of $y$ in $Y$. \qed
\end{proclaim}

Pick $h_1, \ldots, h_m, U$ as in \cref{claim:complementary-intersection}. Since $X$ is irreducible, it follows that $\dim(\phi^{-1}(U)) = \dim(X)$ (\cref{exercise:dimension-examples}). Since the fiber of $\phi^{-1}(y)$ is the zero-set of $h_j \circ \phi$, $j = 1, \ldots, m$, on $\phi^{-1}(U)$, the first assertion follows from \cref{thm:pure-dimension}. For the second assertion we proceed by induction on $n := \dim(X)$. Clearly it is true for $n = 0$. Let $X'$ be an arbitrary nonempty affine open subset of $\phi^{-1}(Y)$. Due to the first assertion it suffices [why?] to prove that
\begin{align}
\parbox{.54\textwidth}{
there is a nonempty Zariski open subset $Y'$ of $Y$ such that $\dim(\phi^{-1}(y) \cap X') \leq n - m$ for each $y \in Y' \cap \phi(X')$.
} \label{fiber-reduction}
\end{align}
Since $X'$ is dense in $X$ and $\phi$ is continuous (\cref{exercise:Zariski-continuous}) and surjective, it follows that $\phi(X')$ is dense in $Y$. Therefore $\phi$ induces an injection $\kk[Y] \to \kk[X']$ (\cref{prop:star-injective}); we will consider $\kk[Y]$ as a subring of $\kk[X']$. Let $g_1, \ldots, g_M$ (respectively $f_1, \ldots, f_N$) be $\kk$-algebra generators of $\kk[Y]$ (respectively $\kk[X']$). Since $\dim(X') = \dim(X) = n$, the transcendence degree of $\kk(X')$ over $\kk(Y)$ is $n-m$. Therefore we may assume \woutlog\ that $f_1, \ldots, f_{n-m}$ are algebraically independent over $\kk(Y)$ and $f_j$ is algebraically dependent over $\kk(Y)(f_1, \ldots, f_{n-m})$ for each $j > n-m$. Fix $j$, $n-m+1 \leq j \leq  N$, and pick a nonzero polynomial $F_j(u_1, \ldots, u_{n-m},v)$ in variables $u_1, \ldots, u_{n-m}, v$ with coefficients in $\kk[Y]$ such that $F_j(f_1, \ldots, f_{n-m},f_j) = 0$. Write
\begin{align*}
F_j(u_1, \ldots, u_{n-m},v)
	= \sum_{i = 0}^{d_j} F_{j,i}(u_1, \ldots, u_{n-m})v^i
\end{align*}
where $d_j$ is the degree of $F_j$ in $v$, and write
\begin{align*}
F_{j,d_j}(u_1, \ldots, u_{n-m})
	= \sum_{\alpha = (\alpha_1, \ldots, \alpha_{n-m})} g_{j,\alpha} u_1^{\alpha_1} \cdots u_{n-m}^{\alpha_{n-m}}
\end{align*}
where each $g_{j,\alpha} \in \kk[Y]$. Fix $\alpha^j = (\alpha^j_1, \ldots, \alpha^j_{n-m})$ such that $g_{j,\alpha^j}$ is a {\em nonzero} regular function on $Y$. Let $\tilde Y:= Y \setminus V(\prod_j g_{j,\alpha^j})$. \Cref{thm:dim-smaller} implies that $\tilde Y$ is a nonempty open subset of $Y$.

\begin{proclaim} \label{fiber-non-containment}
There is a nonempty open subset $Y'$ of $\tilde Y$ such that for each $y \in Y'$, no irreducible component of $\phi^{-1}(y)$ is contained in $V := \bigcup_{j = n-m+1}^N V(F_{j,d_j}) \cap X'$.
\end{proclaim}

\begin{proof}
If $\phi(V)$ is not dense in $Y$, then we can simply take $Y'$ to be the complement in $\tilde Y$ of the closure of $\phi(V)$. So assume $\phi(V)$ is dense in $Y$. Then $\phi|_V$ can be extended to a surjective morphism $\phi':V' \to Y$ which contains $V$ as a dense subset (\cref{exercise:dominant-to-surjective}). Since $\dim(V') = \dim(V)$ (\cref{exercise:closure-dimension}), \cref{thm:dim-smaller} implies that $\dim(V') < n$. The inductive hypothesis then implies that there is a nonempty open subset $Y'$ of $\tilde Y$ such that $\dim(\phi'^{-1}(y)) = \dim(V') - m$ for each $y \in Y'$. The first assertion of \cref{fiber-dimension} therefore implies that for each $y \in Y'$, no component of $\phi^{-1}(y)$ can be contained in $V'$, as required.
\end{proof}

Let $Y'$ be as in \cref{fiber-non-containment}. Fix $y \in Y' \cap \phi(X')$ and an irreducible component $W$ of $\phi^{-1}(y) \cap X'$. Let $\bar f_j := f_j|_W$, $j = 1, \ldots, N$. Now fix $j$, $n-m < j \leq N$. Let $\bar F_j(u_1, \ldots, u_{n-m},v)$ be the polynomial in $\kk[u_1, \ldots, u_{n-m}, v]$ constructed from $F_j$ by evaluating each coefficient from $\kk[Y]$ at $y$. Since $\bar F_j(\bar f_1, \ldots, \bar f_{n-m}, \bar f_j) = 0$, \cref{fiber-non-containment} implies that $\bar f_j$ is algebraically dependent on $\kk(\bar f_1, \ldots, \bar f_{n-m})$ [why?]. Since $\kk[W] = \kk[\bar f_1, \ldots, \bar f_N]$, and since $\kk(W)$ is the quotient field of $\kk[W]$ (\cref{exercise:k(X)-0}), it follows that $\dim(W) \leq n-m$, as required.
\end{proof}


\subsection{Exercises}

\begin{exercise} \label{exercise:dimension-examples}
Show that a zero dimensional variety is the union of finitely many points. If $X$ is an irreducible variety and $U$ is a nonempty open subset of $X$, show that $\dim(X) = \dim(U)$. Compute the dimension of $\kk^n$ and $\pp^n$.
\end{exercise}

\begin{exercise} \label{exercise:closure-dimension}
Let $X \subseteq Y$ be irreducible quasiprojective varieties, and let $X'$ be the closure of $X$ in $X'$. Show that $\dim(X') = \dim(X)$.
\end{exercise}

\begin{exercise} \label{exercise:pure-dimension}
Prove \cref{thm:pure-dimension} [Hint: use \cref{thm:principal-ideal}].
\end{exercise}


\begin{exercise} \label{exercise:complementary-intersection}
Let $X$ be an affine variety in $\kk^n$ of dimension $m \geq 1$ and $a \in X$. Fix $d \geq 1$. Show that it is possible to find $m$ polynomials $h_1, \ldots, h_m$ in $(x_1, \ldots, x_n)$ of degree $d$ such that $a$ is an {\em isolated point} of $V(h_1, \ldots, h_m) \cap X$, i.e.\ there is a Zariski open subset $U$ of $a$ in $\kk^n$ such that $U \cap X \cap V(h_1, \ldots, h_m) = \{a\}$. [Hint: use induction on dimension as in the proof of \cref{closure-curve-lemma}.]
\end{exercise}

\begin{exercise} \label{exercise:positively-infinite}
Show that a positive dimensional variety contains infinitely many points.
\end{exercise}

\begin{exercise} \label{exercise:affine-inverse}
Let $C \subset \pp^n$ be a projective curve, and $\phi: C \to \pp^1$ be a surjective morphism which is not constant on any of the irreducible components of $C$. Let $T \subset \pp^1$ be a finite set. In this exercise you will show that 
\begin{align}
\parbox{0.66\textwidth}{
	there is a finite set $S \subset \pp^1 \setminus T$ such that $\phi^{-1}(\pp^1 \setminus S)$ is an affine curve.
}\label{display:affine-inverse}
\end{align}
\begin{enumerate}
\item Pick a point on $\pp^1 \setminus T$; denote it by $\infty$. Show that there is a hypersurface $X$ of $\pp^n$ containing $\phi^{-1}(\infty)$ such that $X \cap \phi^{-1}(T) = \emptyset$ and $|X \cap C| < \infty$. [Hint: use \cref{exercise:complement-hypersurface}.]
\item Show that $C' := C \setminus X$ is a subvariety of $X'$. [Hint: use \cref{projective-complement}.]
\item Identifying $\pp^1 \setminus \{\infty\}$ with $\kk$, show that $\phi|_{C'}$ is induced by a regular function $f$ on $C'$. [Hint: use \cref{exercise:Zariski-continuous}.]
\item Let $T' := \phi( X \cap C) \setminus \{\infty\} = \phi(C\setminus C') \cap \kk$. Show that $C'' := C' \setminus V(\prod_{t \in T'}(f - t))$ is an affine curve. [Hint: use \cref{exercise:affine-complement}.]
\item Conclude that \eqref{display:affine-inverse} holds with $S := T' \cup \{\infty\}$. 
\end{enumerate}
\end{exercise} 

\section{Constructible sets} \label{constructible-section}
You have shown in \cref{exercise:closed-sub-complete} that the image of a morphism from the projective space (or more generally, a projective variety) to a variety $X$ is closed in $X$. This is not true for morphisms from the affine space, e.g.\ the image of the map from $\kk^2$ to $\kk^2$ given by $(x,y) \mapsto (x, xy)$ is $(\kk^2 \setminus V(x)) \cup \{(0,0)\}$ which is neither open nor closed in $\kk^2$. However, it is a {\em constructible} subset of $\kk^2$: a constructible subset of a topological space is a finite union of open subsets of its closed subsets (i.e.\ constructible subsets of quasiprojective varieties are simply finite unions of quasiprojective varieties). The next result follows in a straightforward way from curve selection lemma I (\cref{closure-curve-lemma}) and the definition of constructible sets; we leave its proof as an exercise (\cref{exercise:curve-selection}).

\begin{prop}[Curve selection lemma II] \label{closure-curve-prop}
Let $W$ be a constructible subset of a variety $X$ and $\bar W$ be the Zariski closure of $W$ in $X$. Pick an irreducible component $Z$ of $\bar W$ and a point $a \in Z$. If $\dim(Z) \geq 1$, then there is an irreducible curve $C$ on $Z$ containing $a$ such that $C \cap W$ is nonempty and (Zariski) open in $C$. \qed
\end{prop}

The main result of this section is the following result of C.\ Chevalley:

\begin{thm}[Chevalley's theorem]\label{Chevalley}
The image $\phi(X)$ of a morphism $\phi:X \to Y$ of varieties is a constructible subset of $Y$.
\end{thm}

We give a proof of \cref{Chevalley} following \cite[Section 2C]{mummetry}. We leave it as an exercise (\cref{exercise:constructible-projection}) to shows that it is equivalent to the following property of varieties (note that this property is precisely what you get from substituting ``closed subsets'' by ``constructible subsets'' in the definition of complete varieties).

\begin{thm} \label{thm:constructible-projection}
Let $X,Y$ be varieties. Then the projection map $X \times Y \to Y$ maps constructible sets to constructible sets.
\end{thm}

\begin{proof}
It suffices [why?] to consider the case that $X = \kk^n$ and $Y = \kk^m$. Then taking compositions we can further reduce it to the case of the projection $\pi: \kk \times \kk^m \to \kk^m$. It is straightforward to check, and we leave it as an exercise (\cref{exercise:constructible-projection-2}) to show, that it suffices to prove the following statement:
\begin{align}
\parbox{0.8\textwidth}{
If $V$ is an irreducible subvariety of $\kk \times \kk^m \cong \kk^{m+1}$ and $U$ is a nonempty open subset of $V$, then $\pi(U)$ contains a nonempty open subset of the closure of $\pi(V)$ in $\kk^m$.
}  \label{constructible-projection-claim}
\end{align}
We now prove \eqref{constructible-projection-claim}. Let $W$ be the closure of $\pi(V)$ in $\kk^m$. Then $\pi$ induces an injective map $\kk[W] \into \kk[V]$ (\cref{prop:star-injective}), so that $\kk[V] \cong \kk[W][x_1]/\ppp$ for some ideal $\ppp$ of the polynomial ring $\kk[W][x_1]$ in one variable over $\kk[W]$. At first consider the case that $\ppp = 0$. Then $V = \kk \times W$. Let $(a_1, \ldots, a_{m+1})$ be any point of $U$. Then $W' :=  \{a_1\} \times W$ is a subvariety of $V$ and therefore $U \cap W'$ is a nonempty open subset of $W'$ whose projection is open in $W$. Now consider the remaining case that $\ppp \neq 0$. Then \cref{thm:dim-smaller} and \cref{dominant-dimension} imply that $\dim(V) = \dim(W)$. Let $\bar V$ be the closure of $V$ in $\pp^1 \times \kk^m$ and $V' := \bar V \setminus U$. Since $\pp^1$ is complete (\cref{exercise:projective-complete}), it follows that $\pi(\bar V)$ and $\pi(V')$ are closed in $\kk^m$. Since $\pi(\bar V)$ is closed, it follows that $\pi(\bar V) \supset W$. On the other hand $\dim(V') < \dim(\bar V) = \dim(V) = \dim(W)$ (\cref{thm:dim-smaller,exercise:closure-dimension}), and therefore $\pi(V')$ cannot contain $W$ (\cref{dominant-dimension}). Since $\pi(U) \supset \pi(\bar V) \setminus \pi(V') \supset W \setminus \pi(V')$, the claim follows.
\end{proof}

\begin{cor} \label{constructible-fiber-dimension}
Let $\phi:X \to Y$ be a morphism of varieties and $k$ be a nonnegative integer. Then $Y_k := \{y \in Y: \dim(\phi^{-1}(y)) < k\}$ is a constructible subset of $Y$.
\end{cor}

\begin{proof}
We proceed by double induction on $m_\phi := \dim(\phi(X))$ and $k$. Due to \cref{fiber-dimension,Chevalley} the corollary is true whenever $m_\phi = 0$ or $k \leq \dim(X) - m_\phi$. Now assume it is true for all $\phi$ such that $m_{\phi} < m$. Pick $\phi$ with $m_\phi = m$ and $k'$ such that the corollary holds for $\phi$ and $k'$. We will show that it holds for $\phi$ and $k' + 1$. By the inductive hypothesis $Y \setminus Y_{k'}$ is constructible, and therefore is a union of quasiprojective varieties. Let $Y^0_{k'}$ be an irreducible component of $Y \setminus Y_{k'}$, and $X'^0_{k'}$ be an irreducible component of $\phi^{-1}(Y^0_{k'})$. Note that both $Y^0_{k'}$ and $X'^0_{k'}$ are quasiprojective varieties, so that $Y'^0_{k'} := \phi(X'^0_{k'})$ is constructible due to Chevalley's theorem (\cref{Chevalley}). It suffices to show that $Y'^0_{k'} \cap Y_{k'+1}$ is constructible. Let $\phi'^0_{k'}$ be the restriction of $\phi$ to $X'^0_{k'}$. Then $\phi'^0_{k'}: X'^0_{k'} \to Y'^0_{k'}$ is surjective and by construction $\dim((\phi'^0_{k'})^{-1}(y)) \geq k'$ for each $y \in Y'^0_{k'}$. If $k' < \dim(X'^0_{k'}) - \dim(Y'^0_{k'})$, then \cref{fiber-dimension} implies that $Y_{k'+1} \cap Y'^0_{k'} = \emptyset$, which is trivially constructible. Otherwise \cref{fiber-dimension} implies that $k' =  \dim(X'^0_{k'}) - \dim(Y'^0_{k'})$ and there is a nonempty Zariski open subset $U'^0_{k'}$ of $Y'^0_{k'}$ such that $\dim((\phi'^0_{k'})^{-1}(y))= k'$ for each $y \in U'^0_{k'}$. Let $Y''^0_{k'} := Y'^0_{k'} \setminus U'^0_{k'}$ and $\phi''^0_{k'}$ be the restriction of $\phi$ to $\phi^{-1}(Y''^0_{k'})$. Since $\dim(Y''^0_{k'}) < \dim(Y) = m$, the corollary is true for $\phi''^0_{k'}$ (and {\em all} values of $k$), so that $Y_{k'+1} \cap Y''^0_{k'}$ is constructible. Therefore $Y_{k'+1} \cap Y'^0_{k'} = U'^0_{k'} \cup (Y_{k'+1} \cap Y''^0_{k'})$ is constructible as well.
\end{proof}

\subsection{Exercises}

\begin{exercise}\label{exercise:curve-selection}
Prove \cref{closure-curve-prop}.
\end{exercise}

\begin{exercise} \label{exercise:constructibly-open}
Let $\phi: X \to Y$ be a morphism of varieties and $U$ be a constructible subset of $Y$. Show that the following are equivalent:
\begin{enumerate}
  \item $U$ contains a nonempty Zariski open subset of $Y$.
  \item $\phi^{-1}(U)$ contains a nonempty Zariski open subset of $X$.
\end{enumerate}
\end{exercise}

\begin{exercise} \label{exercise:constructible-inverse}
Let $\phi: X \to Y$ be a morphism of varieties and $U$ be a constructible subset of $X$. Show that for each constructible subset $V$ of $Y$, $\phi^{-1}(V) \cap U$ is a constructible subset of $X$.
\end{exercise}

\begin{exercise} \label{exercise:dimstructibly-open}
The {\em dimension} of a constructible subset $U$ of a variety $X$ is simply the dimension of the Zariski closure of $U$ in $X$. Let $\phi: X \to Y$ be a dominant morphism of varieties. If $X$ is irreducible, then show that the following are equivalent:
\begin{enumerate}
  \item $U$ contains a nonempty Zariski open subset of $X$.
  \item there is a nonempty Zariski open subset $Y'$ of $Y$ such that for each $y \in Y'$, $\dim(\phi^{-1}(y) \cap U) = \dim(X) - \dim(Y)$.
\end{enumerate}
\end{exercise}


\begin{exercise}\label{exercise:constructible-projection}
Show that \cref{Chevalley} is equivalent to \cref{thm:constructible-projection}. 
\end{exercise}

\begin{exercise}\label{exercise:constructible-projection-2}
Show that it suffices to prove \eqref{constructible-projection-claim} in order to prove that the projection $\kk \times \kk^m \to \kk^m$ maps constructible sets to constructible sets. [Hint: use induction on dimension.]
\end{exercise}


\section{Zariski closure of the image of a morphism}
In this section we describe the (Zariski) closures of images of morphisms to affine and projective spaces.

\begin{prop} \label{affine-embedding}
Let $f_1, \ldots, f_N$ be regular functions on a (possibly reducible) affine variety $X$. Let $\phi: X \to \kk^N$ be the morphism which maps $x \mapsto (f_1(x), \ldots, f_N(x))$, and $Z$ be the closure of $\phi(X)$ in $\kk^N$. Let $R$ be the $\kk$-subalgebra of $\kk[X]$ generated by $f_1, \ldots, f_N$.
\begin{enumerate}
\item $\kk[Z] \cong R$.
\item \label{subspace-assertion} Let $\pi: \kk^N \to \kk^M$ be the natural projection onto the first $M$ coordinates, where $M \leq N$, and let $H$ be the coordinate subspace of $\kk^N$ spanned by the first $M$ coordinates. Then $Z \cap H$ is contained in the closure of $\pi \circ \phi(X)$.
\item If $\phi(X) \subseteq \nktoruss{N}$ (where $\kk^* := \kk \setminus \{0\}$), then the coordinate ring of the closure of $\phi(X)$ in $\nktoruss{N}$ is isomorphic to $R_{f_1\cdots f_N} := \kk[f_1,  f_1^{-1}, \ldots, f_N, f_N^{-1}]$.
\end{enumerate}
\end{prop}

\begin{proof}
Let $\phi^*: \kk[y_1, \ldots, y_N] \to R$ be the ring homomorphism which maps each $y_i \mapsto f_i$. Let $I(Z)$ be the ideal of $\kk[y_1, \ldots, y_N]$ consisting of polynomials that vanish on $Z$. Then $g \in I(Z)$ if and only if $g$ vanishes on $\phi(X)$ if and only if $g(f_1, \ldots, f_N)(x)$ is zero for all $x \in X$ if and only if $\phi^*(g) = 0$ in $\kk[X]$. Therefore $I(Z) = \ker \phi^*$, and $R \cong \kk[y_1, \ldots, y_N]/I(Z) \cong \kk[Z]$ (see \cref{exercise:affine-coordinates} for the last isomorphism). The second assertion follows from a general property of retractions - see \cref{exercise:retraction-intersection}.

Finally, since $\nktoruss{N} = \kk^n \setminus V(y_1 \cdots y_N)$, the closure of $\phi(X)$ in $\nktoruss{N}$ is $Z\setminus V(y_1 \cdots y_N)$ (\cref{exercise:closure-in-open-subset}), so that the coordinate ring of $Z\setminus V(y_1 \cdots y_N)$ is $\kk[Z]_{y_1 \cdots y_N}$ (\cref{exercise:affine-complement}), which by the first assertion is isomorphic to $R_{f_1 \cdots f_N}$, as required for the third assertion.

\end{proof}


\begin{cor} \label{projective-embedding}
Let $f_0, \ldots, f_N$ be regular functions on an irreducible affine variety $X$, and $Z$ be the closure in $\pp^N$ of the image of the map $\phi: X \setminus V(f_0, \ldots, f_N) \to \pp^N$ defined by $x \mapsto [f_0(x): \cdots : f_N(x)]$. Let $[z_0: \cdots : z_N]$ be homogeneous coordinates on $\pp^N$ and $U_i := \pp^N\setminus V(z_i)$, $0 \leq i \leq N$. Then
\begin{enumerate}
\item \label{projective-i} $\kk[Z \cap U_i] \cong \kk[f_0/f_i, \ldots, f_N/f_i]$,
\item \label{projective-ij} $\kk[Z \cap U_i \cap U_j] \cong \kk[f_0/f_i, \ldots, f_N/f_i, f_i/f_j]$.
\item \label{rational-combination} Assume there exists $b \in \zplus$ and $b_1, \ldots, b_N \in \zzero$ such that $b = \sum_{i=1}^n b_i$ and $f_0^{b} = \prod_{i \geq 1} f_i^{b_i}$. Then $Z \cap U_0 \subseteq \bigcup_{i \geq 1} (Z \cap U_i)$.
\item \label{subspace-intersection}  Let $H = V(z_{M+1}, \ldots, z_N)$, $H' := V(z_0, \ldots, z_M)$ for some $M \leq N$, and $\pi: \pp^N\setminus H' \to H$ be the natural projection onto the first $M$ coordinates. Then $Z \cap H$ is contained in the closure of $\pi \circ \phi(X \setminus V(f_0, \ldots, f_M))$.
\end{enumerate}
\end{cor}

\begin{proof}
Since each $U_i \cong \kk^N$, assertion \eqref{projective-i} follows from \cref{affine-embedding}. Write $Z_i := Z \cap U_i$ and $Z_{ij} := Z \cap U_i \cap U_j$. Since $Z_i$ is an affine variety, $f_j/f_i$ is a regular function on $Z_i$, and $Z_{ij} = Z_{i} \setminus V(f_j/f_i)$, it follows that $\kk[Z_{ij}] = \kk[Z_i]_{f_j/f_i} =  \kk[f_0/f_i, \ldots, f_N/f_i]$ (see \cref{exercise:affine-complement} for the first equality), which proves assertion \eqref{projective-ij}. For assertion \eqref{rational-combination}, note that $z_0^b - \prod_{i \geq 1} z_i^{b_i}$ is identically zero on $Z$. It follows that $Z \cap U_0 = Z \setminus V(z_0^b) = Z \setminus V(\prod_{i \geq 1} z_i^{b_i}) \subseteq \bigcup_{i \geq 1} (Z \cap U_i)$, as required. For the last assertion it suffices to show that $Z \cap H \cap U_i$ is contained in the closure of $\pi \circ \phi(X \setminus V(f_i))$  for each $i = 0, \ldots, M$. This follows from assertion \eqref{subspace-assertion} of \cref{affine-embedding}.
\end{proof}


\begin{center}
\begin{figure}
\begin{tikzpicture}
\pgfmathsetmacro\scalefactor{1}
\pgfmathsetmacro\bottomarrowstartx{1.71*\scalefactor}
\pgfmathsetmacro\bottomarrowstarty{0.2*\scalefactor}
\pgfmathsetmacro\bottomarrowendy{-0.4*\scalefactor}
\pgfmathsetmacro\bottomfigdist{2.5*\scalefactor}

\pgfmathsetmacro\rightarrowstartx{4*\scalefactor}
\pgfmathsetmacro\rightarrowstarty{1.5*\scalefactor}
\pgfmathsetmacro\rightarrowendx{6.5*\scalefactor}
\pgfmathsetmacro\rightfigdist{7.25*\scalefactor}
\pgfmathsetmacro\rightfigtopdist{0.4*\scalefactor}

\pgfmathsetmacro\diagarrowstartx{\rightarrowendx}
\pgfmathsetmacro\diagarrowstarty{\bottomarrowstarty}
\pgfmathsetmacro\diagarrowendx{\rightarrowstartx}
\pgfmathsetmacro\diagarrowendy{\bottomarrowendy}

\pgfmathsetmacro\axiscalefactor{0.5}
	
\begin{scope}
				
\begin{axis}[
    hide axis,
    view={0}{30},
    scale=\axiscalefactor
]

\addplot3 [
    samples=40,
    samples y=0,
	domain=150:-30,
	red, ultra thick
] (
    {-cos(-x)},
    {-sin(-x)},
    {(-(x)^3)/90}
);

\addplot3 [
    surf, shader=faceted interp,
    point meta=x,
    
    samples=40,
    samples y=5,
    z buffer=sort,
    domain=150:-30,
    y domain=-1:1
] (
    {y*cos(-x)},
    {y*sin(-x)},
    {(-(x)^3)/90});


\addplot3 [
    samples=50,
    domain=150:135, 
    samples y=0,
    green, ultra thick
] (
    {0},
    {0},
    {-x^3/90});

\addplot3 [
    samples=50,
    domain=135:100, 
    samples y=0,
    green, ultra thick,
    dashed
] (
    {0},
    {0},
    {-x^3/90});

\addplot3 [
    samples=50,
    domain=90:-30, 
    samples y=0,
    green, ultra thick
] (
    {0},
    {0},
    {-x^3/90});

\addplot3 [
    samples=40,
    samples y=0,
	domain=-1:1,
] (
    {x*cos(30)},
    {x*sin(30)},
    {-150^3/90});

\addplot3 [
    samples=40,
    samples y=0,
	domain=-1:1,
] (
    {x*cos(30)},
    {x*sin(30)},
    {30^3/90});

\addplot3 [
    samples=40,
    samples y=0,
	domain=150:-30,
	red, ultra thick
] (
    {cos(-x)},
    {sin(-x)},
    {(-(x)^3)/90}
);
\end{axis}


\begin{scope}[shift={(0,-\bottomfigdist)}]

\begin{axis}[
    hide axis,
    view={0}{30},
    scale=\axiscalefactor
]

\addplot3 [
    surf, shader=faceted interp,
    point meta=x,
    
    samples=40,
    samples y=5,
    z buffer=sort,
    domain=150:-30,
    y domain=-1:1
] (
    {y*cos(-x)},
    {y*sin(-x)},
    {-190^3/90});

\addplot3 [
    samples=2,
    samples y=0,
	domain=-1:1,
] (
    {x*cos(30)},
    {x*sin(30)},
    {-190^3/90});


\addplot3 [
    samples=40,
    samples y=0,
   domain=-180:180,
   red, ultra thick
] (
    {cos(x)},
    {sin(x)},
    {-190^3/90});

\addplot3 [
    surf, shader=faceted interp,
    point meta=x,
    
    colormap = {greenmap}{rgb(0cm)=(0,1,0); rgb(1cm)=(0,1,0)},
    samples=40,
    samples y=2,
    z buffer=sort,
    domain=150:-30,
    y domain=-0.05:0.05
] (
    {y*cos(-x)},
    {y*sin(-x)},
    {-190^3/90});

\end{axis}
\end{scope}

\begin{scope}[shift={(\rightfigdist,\rightfigtopdist)}]
\begin{axis}[
    hide axis,
    view={70}{-10},
    scale = \axiscalefactor
]

\addplot3 [
    surf, shader=faceted interp,
    point meta=x,
    
    samples=40,
    samples y=5,
    z buffer=sort,
    domain=0:360,
    y domain=-0.5:0.5
] (
	{0.5*y*sin(x/2)},
	{(1+0.5*y*cos(x/2))*sin(x)},
    {(1+0.5*y*cos(x/2))*cos(x)}
    );

\addplot3 [
    samples=50,
    domain=130:190, 
    samples y=0,
    dashed,
    green, ultra thick
] (
	{0},
    {sin(x)},
    {cos(x)}
    );	


\addplot3 [
    samples=50,
    samples y=0,
    domain=0:360,
    red, ultra thick
] (
	{0.25*sin(x/2)},
	{(1+0.25*cos(x/2))*sin(x)},
    {(1+0.25*cos(x/2))*cos(x)}
    );

\addplot3 [
    samples=50,
    samples y=0,
    domain=0:123,
    red, ultra thick
] (
	{-0.25*sin(x/2)},
	{(1-0.25*cos(x/2))*sin(x)},
    {(1-0.25*cos(x/2))*cos(x)}
    );


\addplot3 [
    samples=50,
    samples y=0,
    domain=145:360,
    red, ultra thick
] (
	{-0.25*sin(x/2)},
	{(1-0.25*cos(x/2))*sin(x)},
    {(1-0.25*cos(x/2))*cos(x)}
    );

\addplot3 [
    samples=50,
    domain=-190:130, 
    samples y=0,
    green, ultra thick
] (
	{0},
    {sin(x)},
    {cos(x)}
    );
    		
\end{axis}
\end{scope}

\draw [dashed, ->] (\bottomarrowstartx,\bottomarrowendy) -- (\bottomarrowstartx,\bottomarrowstarty);

\draw [->] (\rightarrowstartx,\rightarrowstarty) -- (\rightarrowendx, \rightarrowstarty) node [above, pos=0.5] {\scriptsize{identify two ends}};

\draw [->] (\diagarrowstartx,\diagarrowstarty) -- (\diagarrowendx, \diagarrowendy) node [above, pos=0.5] {\scriptsize{blow up map}};
\end{scope}

\end{tikzpicture}
\caption{Blow up of a point on a disk in $\rr^2$}
\label{fig:blow-up}
\end{figure}
\end{center}

\subsection{Blow up}
Let $X$ be an irreducible affine variety and $\qqq$ be an ideal of $\kk[X]$. Given generators $f_1, \ldots, f_N$ of $\qqq$, the {\em blow up $\bl_\qqq(X)$ of $X$ at $\qqq$} is the closure in $X \times \pp^{N-1}$ of the graph of the map $X \setminus V(\qqq) \to \pp^{N-1}$ given by $x \mapsto [f_1(x) : \cdots : f_N(x)]$. You will prove in \cref{exercise:blow-up-invariance} below that $\bl_\qqq(X)$ does not depend on the choice of the $f_j$. In \cref{exericse:blow-up-isomorphism} below you will show that the restriction to $\bl_{\qqq}(X)$ of the natural projection from $X \times \pp^{N-1}$ to $X$ induces a surjective map $\sigma:\bl_{\qqq}(X) \to X$ which is an isomorphism away from $V(\qqq) \subset X$; often this map is what one means by the ``blow up of $X$ at $\qqq$.'' If $V$ is an irreducible subvariety of $X$ not contained in $V(\qqq) \subset X$, then the {\em strict transform} of $V$ on $\bl_\qqq(X)$ is the closure in $\bl_\qqq(X)$ of $\sigma^{-1}(V \setminus V(\qqq))$. In the case that $\qqq$ is the ideal of $\kk[X]$ consisting of regular functions vanishing on a subvariety $Y$ of $X$, we also write $\bl_Y(X)$ for $\bl_\qqq(X)$, and call it the ``blow up of $Y$ in $X$.'' The name ``blow up'' is probably motivated by the case that $Y$ is a point in $X = \kk^2$, in which case the point is ``blown up'' to a line, see \cref{fig:blow-up,exercise:blow-mobius}.

\subsection{Exercises}

\begin{exercise} \label{exercise:retraction-intersection}
Let $Y$ be a topological space, and $r:Y \to H$ be a {\em retract} onto a subset $H \subset Y$ (which means $r$ restricts to the identity map on $H$). Given $W \subset Y$, show that $\overline{W} \cap H \subset \overline{r(W)}$.

\end{exercise}


\begin{exercise}\label{exercise:closure-in-open-subset}
Let $U$ be an open subset of a topological space $Y$ and $W \subseteq U$. Show that the closure of $W$ in $U$ is the intersection of $U$ and the closure of $W$ in $Y$.


\end{exercise}

\begin{exercise} \label{exericse:blow-up-isomorphism}
Let $\qqq$ be an ideal of the coordinate ring of an irreducible affine variety $X$ and $\sigma: \bl_\qqq(X) \to X$ be th blow up of $X$ at $\qqq$. Show that
\begin{enumerate}
\item $\sigma$ is surjective, and
\item $\sigma$ induces an isomorphism $\bl_\qqq(X) \setminus \sigma^{-1}(V(\qqq)) \cong X \setminus V(\qqq)$. In particular, $X$ and $\bl_\qqq(X)$ are birational.
\end{enumerate}
\end{exercise}

\begin{exercise} \label{exercise:blow-mobius}
Let $X = \kk^n$ and $Y$ be a point in $X$. Show that in $\bl_Y(X)$ the strict transforms of distinct lines through $Y$ in $X$ do not intersect, and the pre-image of $Y$ is isomorphic to $\pp^{n-1}$. In the case that $\kk = \rr$ and $X$ is a disk in $\rr^2$, show that $\bl_Y(X)$ is homeomorphic to a {\em M\"obius strip} (see \cref{fig:blow-up}).
\end{exercise}

\begin{exercise} \label{exercise:blow-up-invariance}
Let $X$ be an irreducible affine variety and $\qqq$ be an ideal of $\kk[X]$. Let $f_1, \ldots, f_N$ and $g_1, \ldots, g_M$ be two sets of generators of $\qqq$ in $\kk[X]$. Write $Z$ (respectively, $Y$) for the closure in $X \times \pp^{N-1}$ (respectively, $X \times \pp^{M-1}$) of the graph of the map $x \mapsto [f_1(x) : \cdots : f_N(x)]$ (respectively, $x \mapsto [g_1(x) : \cdots : g_M(x)]$). In this exercise you will show that $Y \cong Z$.
\begin{enumerate}
\item Show that it suffices to consider the case that $M = N+1$ and $g_j = f_j$, $j = 1, \ldots, N$.
\item Consider the case of the preceding assertion. Assume $g_{N+1} = f_1h_1 + \cdots + f_Nh_N$, where $h_1, \ldots, h_N \in \kk[X]$. Let $\psi: X  \times \pp^{N-1} \to X \times \pp^N$ be the map that sends
$$(x,[z_1: \cdots : z_N])
\mapsto
(x, [z_1: \cdots : z_N : h_1(x)z_1 + \cdots + h_N(x)z_N])$$
Show that $\psi$ induces an isomorphism $Z \cong Y$.
\end{enumerate}
\end{exercise}

\section{Tangent space, singularities, local ring at a point}\label{nonsingular-section}
\subsection{The case of affine varieties}
Consider a straight line $L = \{a + tv: t \in \kk\}$ through a point $a = (a_1, \ldots, a_N) \in \kk^N$, where $v = (v_1, \ldots, v_N) \in \kk^N$ determines the ``direction'' of $L$. Assume $f(a) = 0$, where $f$ is a polynomial in $(x_1, \ldots, x_N)$. We say that $L$ is {\em tangent} to $V(f)$ at $a$ if $\ord_t(f(a+tv)) > 1$, or equivalently, if
\begin{align}
\sum_{i=1}^N v_i\partialxifrac{f}(a) = 0 \label{partial-tangency}
\end{align}
More generally, $L$ is {\em tangent at $a$} to an {\em affine variety $X$} containing $a$ if \eqref{partial-tangency} holds for {\em all} $f$ vanishing on $X$. The {\em tangent space} $\tangent{X}{a}$ to $X$ at $a$ is the union of all tangent lines to $X$ at $a$. It is straightforward to check (\cref{exercise:tangent-equation}) that
\begin{align}
\tangent{X}{a} = V \left(\sum_{i=1}^N (x_i - a_i)\partialxifrac{f}(a) : f \in I(X) \right) \label{tangent-equation}
\end{align}
where $I(X)$ is the ideal in $\kk[x_1, \ldots, x_N]$ of polynomials vanishing on $X$. It is clear from \eqref{tangent-equation} that $T_a(X)$ is of the form $V + a$ where $V$ is a linear subspace (through the origin) of $\kk^N$; the {\em dimension} of $\tangent{X}{a}$ is simply the dimension of $V$ (as a vector space over $\kk$). Let $f_1, \ldots, f_s$ be a set of generators of $I(X)$, then \cref{exercise:tangent-equation} implies that
\begin{align}
\dim \tangent{X}{a}
	&= N - \rank \left(
				\partialxiifrac{f_i}{j}(a)
		   \right)_{\substack{1 \leq i \leq s \\ 1 \leq j \leq N}}
	\label{tangent-dim}
\end{align}
where $\rank(\cdot)$ is the rank over $\kk$ of the corresponding matrix.

\begin{prop} \label{tangent-upper-semicontinuous}
For each integer $k$, the set $X_{\geq k} := \{a \in X: \dim \tangent{X}{a} \geq k\}$ is Zariski closed in $X$; in other words, the map $X \mapsto \zz$ given by $a \mapsto \dim\tangent{X}{a}$ is {\em upper semicontinuous}.
\end{prop}

\begin{proof}[Proof {\cite[Section 1A]{mummetry}}]
Let $\qqq_k$ be the ideal of $\kk[x_1, \ldots, x_N]$ generated by $(N-k+1) \times (N-k+1)$-minors of the matrix $(\partialxiifrac{f_i}{j}(a))$. Identity \eqref{tangent-dim} implies that $X_{\geq k} = V(I(X) + \qqq_k)$.
\end{proof}

Let $d := \min \{\dim \tangent{X}{a}: a \in X\}$. Assume $X$ is irreducible. Then we say that $a \in X$ is a {\em singular} (respectively {\em nonsingular}) point if $\dim \tangent{X}{a} > d$ (respectively $\dim \tangent{X}{a} = d$). \Cref{tangent-upper-semicontinuous} implies that the set of nonsingular points of $X$ is a nonempty Zariski open subset of $X$.

\begin{example} \label{example:curve-singularities}
Every line or a quadric curve on $\kk^2$ is everywhere nonsingular (\cref{exercise:nonsingular<3}). Both the curves $C_1 = \{x^2 = y^3\}$ and $C_2 = \{x^2 = y^2 - y^3\}$ are singular at the origin (\cref{exercise:singular3}); see \cref{fig:curve-singularities}. The singularity of $C_1$ is called a {\em cusp}, and that of $C_2$ is called a {\em node}.
\end{example}


\begin{center}
\begin{figure}
\begin{subfigure}[b]{0.36\textwidth}
\begin{tikzpicture}[scale=0.5]
\def\alabelx{2.6}
\def\alabely{2.7}
\def\nsamples{103}
\def\tmin{-3}
\def\tmax{3}

\def\xmin{-1.2}
\def\xmax{1}
\def\ymin{-1.3}
\def\ymax{1.3}
\def\initialshift{3}

\begin{axis}[
xmin = \xmin, xmax=\xmax, ymin = \ymin, ymax= \ymax,
axis equal=true, axis equal image=true, hide axis
]
\addplot[blue, thick, domain=\tmin:\tmax, samples=\nsamples] ({x^3} ,{x^2});
\end{axis}
\draw (\alabelx, \alabely) node [below] {\picfontsize $O$};

\end{tikzpicture}
\caption{$x^2 = y^3$}
\label{fig:cusp}
\end{subfigure}\hspace{0.18\textwidth}
\begin{subfigure}[b]{0.36\textwidth}
\begin{tikzpicture}[scale=0.5]
\def\alabelx{2.6}
\def\alabely{2.7}
\def\nsamples{103}
\def\tmin{-3}
\def\tmax{3}

\def\xmin{-1.2}
\def\xmax{1}
\def\ymin{-1.3}
\def\ymax{1.3}
\def\initialshift{3}

\begin{axis}[
xmin = \xmin, xmax=\xmax, ymin = \ymin, ymax= \ymax,
axis equal=true, axis equal image=true, hide axis
]
\addplot[blue, thick, domain=\tmin:\tmax, samples=\nsamples] ({x-x^3} ,{1 - x^2});
\end{axis}
\draw (\alabelx, \alabely) node [below] {\picfontsize $O$};

\end{tikzpicture}
\caption{$x^2 = y^2 - y^3$}
\label{fig:node}
\end{subfigure}
\caption{Some curve singularities}
\label{fig:curve-singularities}

\end{figure}
\end{center}


\subsection{Intrinsicness of the tangent space; definition of tangent space and singularities for arbitrary varieties} \label{intrinsiction}
The definitions of tangent spaces and (non-)singular points given above applies only to affine varieties; moreover, they depend on the defining equations of the affine variety, and a priori it is not clear if they are preserved by isomorphisms. In this section we show that these notions depend only on the ring of regular functions on an (arbitrarily small) open neighborhood of the given point (in the affine variety in question), and extend these notions to arbitrary varieties. Given a point $a$ of a subvariety $X$ of $\kk^N$, a map $D: \kk[X] \to \kk$ is called a {\em derivation {\em centered} at $a$} if $D$ satisfied the following properties:
\begin{defnlist}
\item $D$ is $\kk$-linear,
\item \label{derivative-property} $D(fg) = f(a)D(g) + g(a)D(f)$ for all $f, g \in \kk[X]$,
\item $D(\alpha) = 0$ for all $\alpha \in \kk$.
\end{defnlist}
The following is straightforward to see; we leave the proof as an exercise (\cref{exercise:poly-derivations}). 

\begin{prop} \label{prop:poly-derivations}
Given $a = (a_1, \ldots, a_N) \in \kk^N$, the derivations $D: \kk[x_1, \ldots, x_N] \to \kk$ centered at $a$ are in one-to-one correspondence with $\kk^N$ given by:
\begin{align}
\lambda = (\lambda_1, \ldots, \lambda_N) \mapsto D_\lambda,\ \text{where}\
D_\lambda(f) = \sum_{i=1}^N \lambda_i \partialxifrac{f}(a),\ \text{for all}\ f \in \kk[x_1, \ldots, x_N] \label{D-lambda} 
\end{align}
\end{prop}

The {\em local ring} $\local{X}{a}$ of $X$ at $a$ is the {\em localization} of $\kk[X]$ with respect to the multiplicative set of regular functions {\em not} vanishing at $a$; equivalently $\local{X}{a}$ is the ring of rational functions $\{f/g: f, g \in \kk[x_1, \ldots, x_N],\ g(a) \neq 0\}$ modulo the ideal generated by polynomials vanishing on $X$. If $X'$ is an arbitrary (i.e.\ not necessarily affine) variety and $a \in X'$, then $\local{X'}{a}$ is by definition $\local{X}{a}$ for any open affine neighborhood $X$ of $a$ in $X'$; \cref{exercise:local-isomorphism} below shows that $\local{X'}{a}$ is well-defined, and \cref{exercise:local=local} below shows that it is in fact a {\em local ring}.

\begin{thm} \label{thm:tangent-space}
The following spaces are isomorphic as vector spaces over $\kk$:
\begin{enumerate}
\item \label{txa} $\tangent{X}{a}$ with the vector space structure on $\tangent{X}{a}$ induced from that of $\tangent{X}{a} - a$ (in particular, $a$ is the origin of $\tangent{X}{a}$),
\item \label{dxa} the space of derivations $\kk[X] \to \kk$ centered at $a$,
\item \label{mxa} the space $(\mmm_a/\mmm_a^2)^*$ of linear functions from $\mmm_a/\mmm_a^2$ to $\kk$, where $\mmm_a$ is the maximal ideal of $\local{X}{a}$ generated by functions vanishing at $a$.

\end{enumerate}
\end{thm}

\begin{proof}[Proof {\cite[Section 1A]{mummetry}}]
A derivation $\kk[X] \to \kk$ centered at $a$ is the same as a derivation $\kk[x_1, \ldots, x_N] \to \kk$ centered at $a$ which vanishes on $I(X)$. Derivations $\kk[x_1, \ldots, x_N] \to \kk$ centered at $a$ are of the form $D_\lambda$ from the map defined in \eqref{D-lambda}. Given $\lambda \in \kk^n$, identity \eqref{tangent-equation} implies that $D_\lambda$ vanishes on all $f \in I(X)$ if and only if $\lambda + a \in \tangent{X}{a}$, which proves the isomorphisms between \eqref{txa} and \eqref{dxa}. \Cref{exercise:local-derivation} below shows that every derivation $\kk[X] \to \kk$ centered at $a$ defines an element of $(\mmm_a/\mmm_a^2)^*$. Conversely, given a linear map $\phi: \mmm_a \to \kk$ such that $\phi|_{\mmm_a^2} \equiv 0$, let $\lambda_\phi := (\phi((x_1-a_1)|_X), \ldots, \phi((x_N - a_N)|_X)) \in \kk^N$, and define $D_\phi := D_{\lambda_\phi}$ as in \eqref{D-lambda}. Let $f \in I(X)$. The Taylor series expansion of $f$ shows that $f = f(a) + \sum_{i=1}^n (x_i-a_i) \partialxifrac{f}(a) + f'$, where $f'$ is of order two or higher in the $(x_i - a_i)$. Since $f(a) = 0$ and $\phi(f|_X) = 0 = \phi(f'|_X)$ [why?], it follows that $\sum_{i=1}^N \phi((x_i-a_i)|_X) \partialxifrac{f}(a) = 0$, i.e.\ $D_\phi(f) = 0$. It follows that $D_\phi$ is a derivation $\kk[X] \to \kk$. It is straightforward to check that the maps we defined between \eqref{dxa} and \eqref{mxa} are inverse to each other, and induce an isomorphism of vector spaces.
\end{proof}

The {\em tangent space} to a variety $X'$ at a point $a \in X'$ is by definition $\tangent{X}{a}$ for an affine neighborhood $X$ of $a$ in $X'$ [why does such $X$ exist?]; equivalently, $\tangent{X'}{a} = (\mmm_a/\mmm_a^2)^*$, where $\mmm_a$ is the maximal ideal of $\local{X'}{a}$ generated by functions vanishing at $a$.

\begin{prop} \label{tangent-dimension}
Assume $X$ is an irreducible variety. Then $\min \{\dim \tangent{X}{a}: a \in X\} = \dim(X)$.
\end{prop}

\begin{proof}
Let $d := \min \{\dim \tangent{X}{a}: a \in X\}$ and $U := \{x \in X: \dim \tangent{X}{a} = d\}$. \Cref{tangent-upper-semicontinuous} implies that $U$ is Zariski open in $X$. Since $X$ is birational to a hypersurface (\cref{exercise:birational-hypersurface}), and since dimension is invariant under birational maps (\cref{exercise:birational-fields}), \woutlog\ we may assume $X = V(f) \subset \kk^N$ for some polynomial $f$ in $(x_1, \ldots, x_N)$. If $f = 0$, then an easy computation shows that $U = \kk^N$ (\cref{exercise:tangent-k^n}) and $d = N$, as required. Otherwise $f$ is a nonzero irreducible polynomial, and since $\kk$ is algebraically closed, not all the partial derivatives $\partial f/\partial x_j$ vanish identically on $X$ (\cref{exercise:nonzero-derivative}). It then follows the definition of the tangent space (or identity \eqref{tangent-dim}) that $d = N - 1 = \dim(X)$.
\end{proof}

Now we can extend the notion of (non-)singular points to arbitrary (possibly reducible) varieties. Let $X$ be a variety and $a \in X$. Define $\dim_a(X)$ to be the maximum of the dimensions of the irreducible components of $X$ containing $a$. We say that $a$ is a {\em singular} (respectively {\em nonsingular}) point of $X$ if $\dim \tangent{X}{a} > \dim_a(X)$ (respectively  $\dim \tangent{X}{a} = \dim_a(X)$). \Cref{tangent-upper-semicontinuous,tangent-dimension} imply that the subset of $X$ consisting of nonsingular points is Zariski open and has a nonempty intersection with every irreducible component of $X$; in particular, a curve has at most finitely many singular points. A variety is called singular if it has a singular point; otherwise it is called nonsingular. The {\em codimension} of a subvariety $Y$ of a variety $X$ is the integer $\dim(X) - \dim(Y)$.

\subsection{Equations near a nonsingular point}
In this section we show that every nonsingular point on a variety of dimension $n$ has an affine neighborhood which can be described by $N-n$ equations in $\kk^N$ (for some $N \geq n$); we follow the approach of \cite[Proof of Theorem 1.16]{mummetry}. Let $R := \local{\kk^N}{0}$ and $\hat R := \kk[[x_1, \ldots, x_N]]$ be the ring of formal power series in $(x_1, \ldots, x_N)$ over $\kk$. We consider $R$ as a subring of $\hat R$ via the expansion $(1 - \sum_{i=1}^N x_ig_i)^{-1} = 1 + \sum_{j \geq 1} (x_ig_i)^j$ for any $g_1, \ldots, g_N \in \kk[x_1, \ldots, x_N]$.


\begin{lemma} \label{hat-intersection}
If $\qqq$ is an ideal of $R$, then $\qqq \hat R \cap R = \qqq$.
\end{lemma}

\begin{proof}
Given $f \in \qqq \hat R \cap R$, it suffices to show that $f \in \qqq$. Indeed, write $f = \sum_j \phi_j f_j$, where $f_j$ are polynomials which generate $\qqq$ and $\phi_j$ are power series in $(x_1, \ldots, x_n)$. For each $k > \deg(f)$, if $\phi_{j,k}$ are the {\em polynomials} consisting of all monomial terms of $\phi_j$ of order at most $k$, then $g_k := \sum_j f_j \phi_{j,k} \in \qqq$, so that $f = g_k + \sum_j f_j(\phi - \phi_{j,k}) \in \qqq + \mmm^k$, where $\mmm$ is the (unique) maximal ideal of $\hat R$. It follows that $f \in \bigcap_{k \geq 0} (\qqq + \mmm^k) = \qqq$ (the last equality follows from \cref{thm:Krull}).
\end{proof}

\begin{thm}[{\cite[Theorem 1.16]{mummetry}}] \label{locally-prime}
Let $f_1, \ldots, f_r$ be polynomials in $(x_1, \ldots, x_N)$ with no constant term and linearly independent (over $\kk$) linear terms. Then the ideal $\ppp$ generated by $f_1, \ldots, f_r$ in $\local{\kk^N}{0}$ is prime. 
\end{thm}

\begin{proof}
It follows from basic properties of formal power series that $f_1, \ldots, f_r$ generate a prime ideal in $\hat R$ (\cref{exercise:hat-prime}). The theorem then follows from \cref{hat-intersection}.
\end{proof}

\begin{cor} \label{local-equations}
Every nonsingular point on a variety of dimension $n$ has an open neighborhood which is irreducible and isomorphic to a subvariety of $\kk^N$ (for some $N \geq n$) whose ideal is generated by $N-n$ polynomials (in $N$-variables).
\end{cor}

\begin{proof}
Let $a$ be a nonsingular point of a variety $X$, with $\dim(X) = n$. We may assume \woutlog\ that $X$ is a subvariety of $\kk^m$ for some $m \geq n$, and $a$ is the origin in $\kk^m$. Identity \eqref{tangent-dim} implies that there are $f_1, \ldots, f_{m-n} \in I(X)$ with no constant term and linearly independent linear terms. Let $\qqq$ be the ideal of $\kk[x_1, \ldots, x_m]$ generated by $f_1, \ldots, f_{m-n}$. \Cref{locally-prime} implies that the ideal $\qqq \local{\kk^m}{a}$ generated by $\qqq$ in $\local{\kk^m}{a}$ is prime, so that $\qqq' := (\qqq \local{\kk^m}{a}) \cap \kk[x_1, \ldots, x_m]$ is also prime. Let $X' := V(\qqq') \subseteq \kk^m$. Note that $X'$ is an irreducible variety containing $a$.

\begin{proclaim} \label{equal-claim}
$\dim(X') = n$. There is a polynomial $g$ such that $g(a) \neq 0$ and $X \setminus V(g) = X' \setminus V(g)$.
\end{proclaim}

\begin{proof}
Since $X'$ is defined by $m-n$ equations in $\kk^m$, \cref{thm:pure-dimension} implies that $\dim X'\geq n$. On the other hand the assumptions of linear parts of $f_j$ and \cref{tangent-dimension} implies that $\dim X' \leq n$. It follows that $\dim X' = n$. Let $h'_1, \ldots, h'_s$ be a set of generators of $\qqq'$. Then each $f'_j$ can be expressed as $h_j/g_j$ for some polynomials $g_j,h_j$ such that $h_j \in \qqq$ and $g_j(a) \neq 0$ [why?]. Let $g := \prod_j g_j$. It is straightforward to check that $X \setminus V(g) = X' \setminus V(g)$, as required.
\end{proof}

Since $\kk[X\setminus V(g)] \cong \kk[X']_g \cong \kk[x_1, \ldots, x_m, y]/\langle f_1, \ldots, f_{m-n}, yg - 1 \rangle$ (see e.g.\ \cref{exercise:affine-complement}), the corollary holds with $N := m + 1$.
\end{proof}

\subsection{Exercises}

\begin{exercise}\label{exercise:tangent-equation}
Prove identity \eqref{tangent-equation}. If $f_1, \ldots, f_s$ generate $I(X)$, then show that $\sum_{i=1}^N (x_i - a_i)\partialxifrac{f_j}(a)$, $j = 1, \ldots, s$, generate the ideal of polynomials vanishing on $\tangent{X}{a}$.
\end{exercise}

\begin{exercise} \label{exercise:tangent-k^n}
Show that $\kk^N$ is nonsingular everywhere. Given $a \in \kk^N$, compute $\tangent{\kk^N}{a}$. 
\end{exercise}

\begin{exercise} \label{exercise:nonsingular<3}
Let $C = V(f) \subset \kk^2$, where $f$ is an irreducible polynomial of degree $1$ or $2$. Show that $C$ is everywhere nonsingular. [Hint: recall that over an algebraically closed field $\kk$ every homogeneous polynomial of degree $2$ can be written as $ax^2 + by^2$, $a, b \in \kk$, after an appropriate change of coordinates on $\kk^2$. If $\deg(f) = 2$, then use this fact to reduce to the following cases: (1) $f = ax^2 + by^2 + c$, $a,b,c \neq 0$, and (2) $f = ax^2 + by$, $a, b \neq 0$.]
\end{exercise}

\begin{exercise} \label{exercise:singular3}
Let $C = V(f) \subset \kk^2$. If either $f = x^2 - y^3$ or $f = x^2 - y^2 + y^3$, show that the origin is the only singular point of $C$.
\end{exercise}

\begin{exercise} \label{exercise:poly-derivations}
Prove \cref{prop:poly-derivations}.
\end{exercise}

\begin{exercise}\label{exercise:local-isomorphism}
Let $X$ be an affine variety and $U$ be an open neighborhood of $a \in X$.
\begin{enumerate}
\item Show that $\local{X}{a} \cong \local{U}{a}$.
\item Let $\phi:X \to Y$ be an isomorphism. Show that $\local{X}{a} \cong \local{Y}{\phi(a)}$.
\item Assume $a \in Z \subseteq X$, where $Z$ is a subvariety of $X$. Let $\qqq$ be the ideal of $\kk[X]$ consisting of regular functions vanishing on $Z$. Then show that $\local{Z}{a} \cong \local{X}{a}/(\qqq\local{X}{a})$.
\end{enumerate}
\end{exercise}

\begin{exercise}\label{exercise:local=local}
Let $a$ be a point on a variety $X$, and let $\mmm_a$ be the ideal of $\local{X}{a}$ generated by the regular functions which are defined on a neighborhood of $a$ on $X$ and vanish at $a$. Show that $\mmm_a$ is the {\em unique} maximal ideal of $\local{X}{a}$; in other words, $\local{X}{a}$ is a {\em local ring}.
\end{exercise}

\begin{exercise}\label{exercise:local-derivation}
Let $X$ be an affine variety, $a \in X$, and $D:\kk[X] \to \kk$ be a derivation centered at $a$. If $\mmm_a$ is the maximal ideal of $\local{X}{a}$ generated by polynomials vanishing at $a$, show that
\begin{enumerate}
\item $D$ extends to a linear map $\mmm_a \to \kk$ given by
\begin{align*}
D(f/g) := D(f)/g(a)\ \text{for all}\ f,g \in \kk[X]
\end{align*}
\item $D(h) = 0$ for all $h \in \mmm_a^2$.
\end{enumerate}
\end{exercise}


\begin{exercise} \label{exercise:nonzero-derivative}
Let $f$ be an irreducible (nonzero) polynomial in $(x_1, \ldots, x_N)$. Show that there is $i$ such that $\partialxi{f}$ does {\em not} identically vanish on $V(f)$. [Hint: you have to use that $f$ is irreducible. In the case that $\character(\kk)$ is positive, you have to use that $\kk$ is algebraically closed.]
\end{exercise}

\begin{exercise} \label{exercise:hat-prime}
Let $f_1, \ldots, f_r$ be elements of $\kk[[x_1, \ldots, x_n]]$ with no constant term and linearly independent (over $\kk$) linear terms. Then the ideal $\ppp$ generated by $f_1, \ldots, f_r$ in $\kk[[x_1, \ldots, x_n]]$ is prime. [Hint: use \cref{power-basics}.]
\end{exercise}


\begin{exercise} \label{exercise:curve-dvr}
Let $a$ be a nonsingular point on a curve $X$. In this exercise you will show that $\local{X}{a}$ is a {\em discrete valuation ring} (see \cref{discrete-valuection}). Let $\mmm_a$ be the (unique) maximal ideal of $\local{X}{a}$. Pick $f \in \mmm_a \setminus \mmm_a^2$, so that (the image of) $f$ generates $\mmm_a/\mmm_a^2$ over $\kk$ (see assertion \eqref{mxa} of \cref{thm:tangent-space}).
\begin{enumerate}[resume]
\item \label{m-principal} Show that $\mmm_a$ is the principal ideal generated by $f$. [Hint: apply Nakayama's lemma (\cref{Nakayama}).]

\item \label{f^k-in-g} Show that the radical of the ideal generated by a nonzero element in $\local{X}{a}$ is either $\local{X}{a}$ itself or $\mmm_a$. [Hint: Let $C$ be an affine neighborhood of $a$ in $X$ and $R = \kk[C]$. Every $g \in \local{X}{a}\setminus \{0\}$ can be expressed as $g = g_1/g_2$, where $g_1, g_2 \in R,\ g_2(a) \neq 0$. If $g_1(a) \neq 0$, then $g$ is invertible in $\local{X}{a}$. Otherwise \cref{thm:pure-dimension,exercise:dimension-examples} imply that $V(g_1)$ consists of finitely many points including $a$. The Nullstellensatz then implies that $\mmm_a = \sqrt{\langle g \rangle}$.]
\item For each $g \in \local{X}{a} \setminus \{0\}$, show that there is $k \geq 0$ such that $g/f^k$ is a unit in $\local{X}{a}$ [Hint: let $k := \inf \{m \geq 0: f^m \in \langle g \rangle\}$. Show that $k$ is a well defined integer.]
\item Let $\nu: \local{X}{a} \to \zz \cup \{\infty\}$ be the map given by $g \mapsto \inf\{m \geq 0: f^m \in \langle g \rangle\}$. Show that $\nu$ extends to a {\em discrete valuation} on the field of fractions of $\local{X}{a}$ [why is $\local{X}{a}$ an integral domain?], its valuation ring is $\local{X}{a}$, and $f$ is a {\em parameter} of $\local{X}{a}$.
\end{enumerate}
\end{exercise}

\begin{exercise}\label{exercise:parameter-expansion1}
Let $a$ be a nonsingular point on a curve $X$ and $\nu$ be the (unique)\footnote{A discrete valuation is necessarily unique - see \cref{prop:discrete-properties}.} discrete valuation associated to $\local{X}{a}$. If $f$ is any parameter of $\local{X}{a}$, show that each $g \in \local{X}{a} \setminus \{0\}$ can be expressed as $cf^m + g'$ where $c \in \kk \setminus \{0\}$, $m = \nu(g)$, and $g' \in \local{X}{a}$ with $\nu(g') > m$. [Hint: take $c := u(a)$, where $u := g/f^m$.]
\end{exercise}

\begin{exercise} \label{exercise:curve-nonsingular-morphextension}
Let $C$ be a curve and $f: C \to \pp^N$ be a morphism. If $\bar C$ is a compactification of $C$ such that every point of $\bar C \setminus C$ is nonsingular, then show that $f$ extends to a morphism $\bar C \to \pp^N$. [Hint: fix $a \in \bar C \setminus C$ and a parameter $t$ of $\local{\bar C}{a}$. Use \cref{exercise:curve-dvr} to show that there is an open neighborhood $U$ of $a$ in $\bar C$ such that $f|_{U \setminus a}$ can be expressed as $[u_0t^{k_0}: \cdots : u_Nt^{k_N}]$, where the $u_j$ are invertible regular functions at $a$ and $k_j \in \zz$. Now ``clear the denominators.'']
\end{exercise}

\begin{exercise} \label{exercise:curve-morph-nonextension}
This exercise shows that the conclusion of  \cref{exercise:curve-nonsingular-morphextension} might fail if $\bar C \setminus C$ has singular points with ``more than one branch.'' Assume $\character(\kk) \neq 2$. Let $C$ be the curve on $\kk^2$ defined by the equation $y^3 = x(y^2 - 1)$. Let $[x_0: x_1: x_2]$ be homogeneous coordinates on $\pp^2$. The map $(x,y) \mapsto [1:x: y]$ identifies $\kk^2$ with the basic open subset $U_0 := \pp^2 \setminus V(x_0)$ of $\pp^2$. Let $\bar C$ be the closure of $C$ in $\pp^2$.
\begin{enumerate}
\item Show that $\bar C = V(x_2^3 - x_1(x_2^2 - x_0^2)) \subset \pp^2$ [Hint: use \cref{exercise:projective-closure}] and $\bar C \setminus C = \{[0:1:1], [0:1:0]\}$.
\item Show that the projection from $C$ to $y$-axis is one-to-one, and the inverse of this map extends to a morphism $\phi: \pp^1 \to \bar C$ which is generically one-to-one, and $\phi^{-1}([0:1:0])$ consists of two points.
\item Conclude that the conclusion of \cref{exercise:curve-nonsingular-morphextension} fails with $C,\bar C$ and $f := y$.
\item Show that $O := [0:1:0]$ has an affine neighborhood in $\bar C$ isomorphic to the plane curve $v^3 = (v-w)(v+w)$. A drawing of this curve makes apparent the two ``branches'' (see \cref{branchion-0}) at $O$ with ``tangents'' $v - w = 0$ and $v + w = 0$ (see \cref{fig:node}).
\end{enumerate}

\end{exercise}


\section{Completion of the local ring at a point} \label{completion-section}
If $I$ is an ideal of a ring $R$, the {\em $I$-adic topology} on $R$ is the (unique) topology in which a subset $S$ of $R$ is open if and only if $S \supseteq f + I^m$ for some $f \in R$ and $m \geq 0$. A {\em Cauchy sequence} in $R$ is a sequence of elements $(f_j)_{j \geq 0}$ of $R$ such that for any open neighborhood $U$ of $0$, there is $m \geq 0$ with the property that $f_i - f_j \in U$ for all $i,j \geq m$. Two Cauchy sequences $(f_i)_i$ and $(g_j)_j$ are {\em equivalent} if the sequence $(f_i - g_i)_i$ converges\footnote{Recall that on a topological space $X$, a sequence $(x_i)_i$ {\em converges} to a point $x$ if for every open neighborhood $U$ of $x$ in $X$ there is an integer $N$ such that $x_i \in U$ for all $i \geq N$.} to $0$ in $R$. The {\em $I$-adic completion} of $R$ is the set of equivalence classes of Cauchy sequences.

\begin{example}
Let $R := \kk[x_1, \ldots, x_n]$ and $I$ be the ideal of $R$ generated by all polynomials vanishing at some point $a = (a_1, \ldots, a_n) \in \kk^n$. Let $(f_j)_j$ in $R$ be a Cauchy sequence with respect to the $I$-adic topology. We treat each $f_j$ as a polynomial in $y_i := x_i - a_i$, $i = 1, \ldots, n$. For each $k \geq 0$, there is $M_k$ such that the degree (with respect to $(y_1, \ldots, y_n)$-coordinates) of $f_i - f_j$ is greater than $k$ for each $i, j \geq M_k$. In particular, with respect to $(y_1, \ldots, y_n)$-coordinates the homogeneous components $f_{j,k}$ of degree $k$ of all $f_j$ agree with each other whenever $j \geq M_k$; write $F_k := f_{M_k, k}$. It is straightforward to check that the map 
\begin{align*}
(f_j)_j \mapsto \sum_k F_k
\end{align*}
induces a $\kk$-algebra isomorphism between $\hat R$ and $\kk[[x_1 - a_1, \ldots, x_n - a_n]]$. 
\end{example}

\begin{example} \label{example:polynomial-local-completion}
We have seen (in the discussion preceding \cref{hat-intersection}) that the local ring $\local{\kk^n}{a}$ of $\kk^n$ at a point $a = (a_1, \ldots, a_n)$ can be treated as a subring of $\kk[[x_1 - a_1, \ldots, x_n - a_n]]$. We leave it as an exercise (\cref{exercise:polynomial-local-completion}) to check that $\hatlocal{\kk^n}{a} \cong \kk[[x_1 - a_1, \ldots, x_n - a_n]]$. 
\end{example}


\begin{prop} \label{prop:complete-inclusion}
Let $\hat R$ be the completion of a ring $R$ with respect to an ideal $I$. Given $f \in R$, write $\hat f$ for the equivalence class of the Cauchy sequence $(f, f, \ldots)$. Let $\phi : R \to \hat R$ be the map which sends $f \mapsto \hat f$. 
\begin{enumerate}
\item $\ker \phi = \bigcap_{m \geq 1} I^m$.
\item \label{complete-inclusion:local} If $R$ is a Noetherian local ring, and $I$ is a proper ideal of $R$, then $\phi$ is injective. 
\end{enumerate}
\end{prop}

\begin{proof}
Since the zero element of $\hat R$ is the equivalence class of $(0, 0, \ldots)$, the first assertion is immediate from the definition of completion. The second assertion then follows from \cref{thm:Krull}. 
\end{proof}


If $X$ is a variety and $a \in X$, then $\local{X}{a}$ has a unique maximal ideal $\mmm_a$, namely the ideal generated by polynomials vanishing at $a$ (\cref{exercise:local=local}). We write $\hatlocal{X}{a}$ for the $\mmm_a$-adic completion of $\local{X}{a}$. The ring $\hatlocal{X}{a}$ captures ``very local'' information about $X$ at $a$. \Cref{example:polynomial-local-completion} shows that if $X$ is the affine space, then $\hatlocal{X}{a}$ is the ring of formal power series expansions centered at $a$; in general it is a quotient of a power series ring: 

\begin{prop} \label{complete-quotient}
Let $a = (a_1, \ldots, a_N)$ be a point of a subvariety $X$ of $\kk^N$, and let $\hat R := \kk[[x_1 - a_1, \ldots, x_N - a_N]]$. Then $\hatlocal{X}{a} \cong \hat R/(I(X)\hat R)$.
\end{prop}

\begin{proof}
Since $\local{X}{a} \cong \local{\kk^N}{a}/(I(X)\local{\kk^N}{a})$ (\cref{exercise:local-isomorphism}), the result follows from \cref{example:polynomial-local-completion} and the exactness of completion (\cref{thm:exactly-complete}).
\end{proof}

\begin{thm} \label{smooth-completion}
Let $a$ be a nonsingular point of an irreducible variety $X$ of dimension $n$. Then
\begin{enumerate}
\item \label{complete-isomoprhism} $\hatlocal{X}{a} \cong \kk[[x_1, \ldots, x_n]]$.
\end{enumerate}
Assume $X$ is a subvariety of $\kk^N$ with coordinates $(x_1, \ldots, x_N)$. Pick $g_1, \ldots, g_n \in \kk[X]$ such that $g_i(a) = 0$ for each $i$, and $(\partialxiifrac{g_i}{1}(a), \ldots, \partialxiifrac{g_i}{N}(a))$, $i = 1, \ldots, n$, generate $\tangent{X}{a}$ as a vector space over $\kk$ (see assertion \eqref{txa} of \cref{thm:tangent-space}). Then
\begin{enumerate}[resume]
\item \label{complicit-isomorphism} it is possible to choose the isomorphism from assertion \eqref{complete-isomoprhism} such that $\hat g_i \to x_i$, $i = 1, \ldots, n$ (where $\hat g_i$ are defined as in \cref{prop:complete-inclusion}).
\end{enumerate}
\end{thm}

\begin{proof}
Taking an appropriate open neighborhood of $a$ we may assume that $X$ is an irreducible subvariety of $\kk^N$, and $I(X)$ is generated by $f_1, \ldots, f_{N - n}$ (the second property can be ensured due to \cref{local-equations}). By a change of coordinates if necessary, we may assume $a$ is the origin in $\kk^N$. Then $\hatlocal{X}{a} \cong \hat R/(I(X)\hat R)$, where $\hat R := \kk[[x_1, \ldots, x_N]]$ (\cref{thm:exactly-complete,exercise:local-isomorphism}). The nonsingularity of $X$ at $a$ implies that the linear parts of the $f_j$ are linearly independent over $\kk$, and we may choose $g_1, \ldots, g_n \in \kk[X]$ which satisfy the hypothesis of assertion \eqref{complicit-isomorphism} (namely, take polynomials $g'_1, \ldots, g'_n$ which vanish at $a$ and are such that the linear parts of $f_1, \ldots, f_{N-n}, g'_1, \ldots, g'_n$ are linearly independent over $\kk$; then set $g_i := g'_i|_X$, $i = 1, \ldots, n$). It then follows from \cref{power-basics} that $\hat R/(I(X)\hat R)$ is isomorphic to the ring of power series in $n$-variables over $\kk$ via an isomorphism that maps $\hat g_i \to x_i$, $i = 1, \ldots, n$.
\end{proof}

\begin{cor} \label{smooth-1-completion}
Let $a$ be a nonsingular point of an irreducible curve $C$, and $x$ be a {\em parameter} of $\local{C}{a}$ (see \cref{exercise:curve-dvr}). Then $\hatlocal{C}{a} \cong \kk[[x]]$.
\end{cor}

\begin{proof}
Pick $g_1$ as in \cref{smooth-completion}. By definition of a parameter, $g_1 = uf^k$ for some $k \geq 0$ and a unit $u$ of $\local{C}{a}$. The properties of $g_1$ implies that $k = 1$. Let $c := u(a) \neq 0$. Then $g_1 = uf = cf + (u-c)f$. Since $(u-c)f \in \mmm_a^2$ (where $\mmm_a$ is the maximal ideal of $\local{C}{a}$), it follows that $\partialxi{((u-c)f)} = 0$ and $\partialxi{g_1} = c\partialxi{f}$ for each $i = 1, \ldots, n$, i.e.\ the linear parts of $g_1$ and $f$ are proportional. The corollary then follows from the arguments of the proof of \cref{smooth-completion}.
\end{proof}


\subsection{Exercises}
\begin{exercise}
Show that open subsets in $I$-adic topology satisfy the axioms of open subsets of a topological space.
\end{exercise}

\begin{exercise} \label{exercise:polynomial-local-completion}
Let $a = (a_1, \ldots, a_n) \in \kk^n$, and $\mmm_a$ be the unique maximal ideal of $\local{\kk^n}{a}$ generated by polynomials vanishing at $a$. Show that the $\mmm_a$-adic completion $\hatlocal{\kk^n}{a}$ of $\local{\kk^n}{a}$ is isomorphic as a $\kk$-algebra to $\kk[[x_1 - a_1, \ldots, x_n - a_n]]$.
\end{exercise}

\begin{exercise} \label{exercise:complete-non-inclusion}
Show that the $R$-adic completion of $R$ is the zero ring; in particular, assertion \eqref{complete-inclusion:local} of \cref{prop:complete-inclusion} does not hold if $I = R$. 
\end{exercise}


\begin{exercise} \label{exercise:finite-quotient}
Let $a \in X$ and $\qqq$ be an ideal of $\local{X}{a}$ such that $\local{X}{a}/\qqq\local{X}{a}$ is a finite dimensional vector space over $k$. Show that $\local{X}{a}/\qqq\local{X}{a} \cong \hatlocal{X}{a}/\qqq\hatlocal{X}{a}$. [Hint: if $\mmm$ is the maximal ideal of $\local{X}{a}$, then $\qqq \supset \mmm^q \local{X}{a}$ for some $q > 0$. Then it follows from the definition of completion that
$

	
	(\local{X}{a}/\mmm^q) /(\qqq\local{X}{a}/\mmm^q)
	\cong (\hatlocal{X}{a}/\mmm^q\hatlocal{X}{a}) /(\qqq\hatlocal{X}{a}/\mmm^q\hatlocal{X}{a})
	
$]
\end{exercise}


\section{Degree of a dominant morphism} \label{degree-section}
Let $\phi:X \to Y$ be a dominant morphism of irreducible varieties. Then $\phi$ induces an inclusion $\kk(Y) \into \kk(X)$ (\cref{prop:star-injective}). The {\em degree} $\deg(\phi)$ of $\phi$ is the degree $[\kk(X): \kk(Y)]$ of the induced extension of fields. \Cref{fiber-dimension} implies that
\begin{itemize}
\item if $\dim(X) > \dim(Y)$, then $\deg(\phi) = \infty$ and $|\phi^{-1}(y)|$ is infinite for each $y \in Y$;
\item if $\dim(X) = \dim(Y)$, then $\deg(\phi)$ is finite, and there is a nonempty Zariski open subset $U$ of $Y$ such that $|\phi^{-1}(y)|$ is finite for each $y \in U$.
\end{itemize}
This suggests an analogy of the degree of morphisms with topological degree of continuous maps. This analogy is the most evident in the case that $\character(\kk) = 0$ (or more generally, when $\kk(X)$ is {\em separable} over $\kk(Y)$), since in that case there is a open dense subset $U$ of $Y$ such that for each $y \in U$, the number of elements in $\phi^{-1}(y)$ is precisely $\deg(\phi)$. The preceding statement is a special case of \cref{degree-morphism} below. The statement of \cref{degree-morphism} is more complicated since it also covers the case of positive characteristics, in which there are morphisms such as $\psi: x \mapsto x^p$ (where $p := \character(\kk)$) for which the simpler version is false. Note that the field extension $\kk(X)/\kk(Y)$ induced by $\psi$ in the preceding sentence is {\em not} separable. We write $\degsep(\phi)$ (respectively $\deginsep(\phi)$) for the {\em separable degree}\footnote{Given a field extension $E/F$, the {\em separable closure} of $F$ in $E$ is the set $\bar F$ of all elements in $E$ which are separable over $F$. It can be shown that $\bar F$ is a field. The {\em separable degree} (respectively {\em inseparable degree}) of $E/F$ is $[\bar F: F]$ (respectively $[E: \bar F]$).} (respectively {\em inseparable degree}) of the extension $\kk(X)/\kk(Y)$. Note that
\begin{align*}
\deg(\phi) = \degsep(\phi) \deginsep(\phi)
\end{align*}

\begin{thm} \label{degree-morphism}
Assume $\dim(X) = \dim(Y)$. There exists a nonempty Zariski open subset $U$ of $Y$ such that for each $y \in U$,
\begin{enumerate}
\item $Y$ is nonsingular at $y$;
\item $|\phi^{-1}(y)| = \degsep(\phi)$;
\item for each $x \in \phi^{-1}(y)$
\begin{enumerate}
\item $X$ is nonsingular at $x$,
\item $\dim_\kk(\hatlocal{X}{x}/\mmm_y\hatlocal{X}{x}) = \deginsep(\phi)$, where $\mmm_y$ is the maximal ideal of $\local{Y}{y}$;
\end{enumerate}
\item in particular
\begin{align*}
\sum_{x \in \phi^{-1}(y)} \dim_\kk(\hatlocal{X}{x}/\mmm_y\hatlocal{X}{x}) = \deg(\phi)
\end{align*}
\end{enumerate}
\end{thm}

\begin{proof}
We may assume \woutlog\ that $X$ and $Y$ are affine and nonsingular [why?]. Let $L$ be the separable closure of $\kk(Y)$ in $\kk(X)$. Pick regular functions $z_1, \ldots,  z_k$ on $X$ such that $L$ is the field of fractions of $T := \kk[Y][z_1, \ldots, z_k]$. There is (up to isomorphism) a unique affine variety $Z$ with coordinate ring $T$ (\cref{exercise:algebra-to-affine-variety}). The chain of inclusions $\kk[Y] \into T \into \kk[X]$ induces a factorization of $\phi$ of the form:
\begin{align*}
X \xrightarrow{\phi_i} Z \xrightarrow{\phi_s} Y \subseteq \kk^N
\end{align*}
By \cref{thm:primitive-element} there is $g \in T$ which generates $L$ over $\kk(Y)$. We can factor $\phi_s$ as:
\begin{align*}
Z \xrightarrow{\psi} Y \times \kk \xrightarrow{\pi} Y
\end{align*}
where $\psi$ maps $z \mapsto (\phi_s(z), g(z))$ and $\pi$ is the projection onto $Y$. Let $G(y,t) = \sum_{i=0}^{d_s}a_i(y) t^{d_s-i} \in \kk[Y][t]$, where $t$ is an indeterminate and $d_s := \degsep(\phi)$, be the minimal polynomial of $g$ over $\kk(Y)$. The separability of $g$ over $\kk(Y)$ implies that $(\partial G/\partial t)|_{t= g}$ is a non-zero element of $\kk[Z]$. Let $U_0$ be a nonempty Zariski open subset of $Y\setminus (V(a_0) \cup \phi_s(V( (\partial G/\partial t)|_{t=g})))$ [why does such $U_0$ exist?] and $U'_0 := \{(y,t) : \sum_{i=0}^{d_s}a_i(y) t^{d_s-i}  = 0\}  \subset U_0 \times \kk$. Then $U'_0$ is irreducible (since $G$ is irreducible in $\kk(Y)[t]$), and $\psi$ induces a birational map from $Z$ to $U'_0$ [why?]. Let $Y_0 \subseteq U_0$ be a nonempty Zariski open subset such that $\psi$ induces an isomorphism $\phi_s^{-1}(Y_0) \cong Y'_0 := (\pi|_{U'_0})^{-1}(Y_0)$. Let $y_0 \in Y_0$. Then $Y'_0$ contains $(y_0,t_0)$ for all the roots $t_0$ of $G (y_0,t)$. Let $z_0 := \psi^{-1}(y_0,t_0)$. Since $(\partial G/\partial t) (y_0,t_0)$ equals $(\partial G/\partial t)|_{t=g}$ evaluated at $z_0$, it follows that $(\partial G/\partial t) (y_0,t_0) \neq 0$ for every root $t_0$ of $G(y_0,t)$. Consequently, $|\pi^{-1}(y_0)| = \deg(G(y_0,t)) = d_s = \degsep(\phi)$.

\begin{proclaim}
For each $(y_0,t_0) \in \pi^{-1}(y_0)$, $\dim_\kk(\hatlocal{Y'_0}{(y_0,t_0)}/\mmm_{y_0}\hatlocal{Y'_0}{(y_0,t_0)}) =1$.
\end{proclaim}

\begin{proof}
Pick $(y_0,t_0) \in \pi^{-1}(y_0)$. The image of $G(y,t)$ in $\hatlocal{\kk^{N+1}}{(y_0,t_0)} = \kk[[y_1-y_{0,1}, \ldots, y_N -y_{0,N},t-t_0]]$ (where $(y_{0,1}, \ldots, y_{0,N})$ are coordinates of $y_0$ in $\kk^N$) is
\begin{align*}
 G(y_0, t_0) + \sum_{j=1}^N (y_j - y_{0,j})\frac{\partial G}{\partial y_j} (y_0,t_0)
 	+ (t-t_0) \frac{\partial G}{\partial t}(y_0,t_0)  + \hot
\end{align*}
where $\hot$ denotes terms with order (in $(y-y_0,t-t_0)$) greater than one. Since $G(y_0,t_0) = 0$ and $(\partial G/\partial t) (y_0,t_0) \neq 0$, \cref{power-basics} implies that $t$ is in the ideal of $\kk[[y_1 -y_{0,1}, \ldots, y_N -y_{0,N},t-t_0]]$ generated by $G(y,t)$ and $y_j-y_{0,j}$, $j = 1, \ldots, N$. Since $\hatlocal{Y'_0}{(y_0,t_0)}$ is the quotient of $\kk[[y_1 -y_{0,1}, \ldots, y_N-y_{0,N},t-t_0]]$ modulo the ideal generated by $G(y,t)$ (\cref{complete-quotient}), it follows that $t$ is in the ideal of $\hatlocal{Y'_0}{(y_0,t_0)}$ generated by the $y_j - y_{0,j}$, which implies the claim.
\end{proof}

Due to the above claim and the sentence preceding it, in order to prove \cref{degree-morphism} it suffices to show that
\begin{align}
\parbox{0.87\textwidth}{
there is a nonempty open subset $\tilde Y$ of $Y_0$ such that for each $y_0 \in \tilde Y$ and $z_0 := \phi_s^{-1}(y_0) \in Z$, $\phi_i^{-1}(z_0)$ consists of a single $x \in X$ and $\dim_\kk(\hatlocal{X}{x}/\mmm_y\hatlocal{X}{x}) = \deginsep(\phi)$.
\label{inseparable-claim}
}
\end{align}
Pick $x_1, \ldots, x_q \in \kk[X]$ such that $\kk[X] = T[x_1, \ldots, x_q]$. Set $T_0 := T$ and $T_j := T_{j-1}[x_j]$ for $j = 1, \ldots, q$. The minimal equation of $x_j$ over the field of fractions of $T_{j-1}$ is of the form $a_{j,0}x_j^{p^{e_j}} - a_{j,1} = 0$, where $p := \character(\kk)$. For each $j = 0, \ldots, q$, let $X_j$ be the unique affine variety with coordinate ring $T_j$. Fix $j$, $1 \leq j \leq q$. The natural map $\phi_j :X_j \to X_{j-1}$ is one-to-one. Pick $x \in X_{j-1}$ such that
\begin{prooflist}[resume]
\item $X_{j-1}$ is nonsingular at $x$,
\item $X_j$ is nonsingular at  $x' := \phi_j^{-1}(x)$,
\item $a_{j,0}(x) \neq 0$.
\end{prooflist}
Let us write $n := \dim(X)$. Then each $X_i$ has dimension $n$. After choosing an affine neighborhood of $x$ if necessary, we may assume that $x$ is the origin in $\kk^{m+n}$ with coordinates $(u_1, \ldots, u_{m+n})$ and there are $h_1, \ldots, h_m \in \kk[u_1, \ldots, u_{m+n}]$ which cut out $X_{j-1}$ near $x$ and the linear component of $h_j$ is $u_j$, $j = 1, \ldots, m$. It follows that
\begin{prooflist}[resume]
\item $\hatlocal{X_{j-1}}{x} \cong \kk[[u_{m+1}, \ldots, u_{m+n}]]$.
\end{prooflist}
Now, $X_j$ is cut out in $X_{j-1} \times \kk$ near $x'$ by the irreducible polynomial $h := x_j^{p^{e_j}} - a_{j,1}/a_{j,0}$. Replacing $x_j$ by $x_j + c$, where $c$ is an appropriate element in $\kk$, we may assume that $x'$ is the origin with respect to coordinates $(u_1, \ldots, u_{m+n}, x_j)$. Let $\bar a_{j,1}$ be the image of $a_{j,1}$ in $\kk[[u_{m+1}, \ldots, u_{m+n}]]$. Since $X_j$ is nonsingular at $x'$, it follows that the rank of the Jacobian matrix of $(h_1, \ldots, h_m, h)$ at $x'$ is $m+1$. Therefore the linear part of $\bar a_{j,1}$ contains at least one of $u_{m+1}, \ldots, u_{m+n}$ with a non-zero coefficient. After a reordering of $(u_{m+1}, \ldots, u_{m+n})$ if necessary we may assume that the linear part of $\bar a_{j,1}$ is $u_{m+1}$. It then follows from \cref{power-basics} that $u_{m+1}$ can be expressed in $\hatlocal{X_j}{x'}$ as a power series in $x_j^{p^{e_j}}, u_{m+2}, \ldots, u_{m+n}$, so that
\begin{prooflist}[resume]
\item $\hatlocal{X_j}{x'} \cong \kk[[x_j, u_{m+2}, \ldots, u_{m+n}]]$.
\end{prooflist}
Let $I$ be any ideal of $\hatlocal{X_{j-1}}{ x}$ such that $d := \dim_\kk(\hatlocal{X_{j-1}}{x}/I) < \infty$. Pick a $\kk$-basis $(g_1, \ldots, g_d)$ of $\hatlocal{X_{j-1}}{x}/I$.

\begin{proclaim} \label{basis-proclaim}
$x_j^kg_e$, $0 \leq k < p^{e_j}$, $1 \leq e \leq d$, constitute a $\kk$-basis of $\hatlocal{X_j}{x'}/I \hatlocal{X_j}{x'}$.
\end{proclaim}

\begin{proof}
Pick an arbitrary element $b \in \hatlocal{X_j}{x'}$. Let $a_j$ be the image of $a_{j,1}/a_{j,0}$ in $\kk[[u_{m+1}, \ldots, u_{m+n}]] \cong \hatlocal{X_{j-1}}{x}$. Let $b = \sum_{k \geq 0} b_k x_j^k $, where $b_k \in \kk[[u_{m+2}, \ldots, u_{m+n}]]$. Since $x_j^{p_j} = a_j \in \hatlocal{X_j}{x'}$, we have
\begin{align*}
b
	&=  \sum_{k=0}^{p^{e_j}-1}x_j^k \sum_{l \geq 0} x_j^{lp^{e_j}}b_{lp^{e_j} + k}
	=  \sum_{k=0}^{p^{e_j}-1}x_j^k \sum_{l \geq 0} a_j^l b_{lp^{e_j} + k}
\end{align*}
By assumption on the $g_e$, for each $k = 0, \ldots, p^{e_j} - 1$, the element $\sum_{l \geq 0} a_j^l b_{lp^{e_j} + k}$ of $ \hatlocal{X_{j-1}}{x}$ be expressed as $\sum c_{k,e}g_e + f_k$, where $c_{k,e} \in \kk$ and $f_k \in I$. It follows that
\begin{align*}
b &= \sum_{k,e} c_{k,e}x_j^kg_e + \sum_k f_kx_j^k
\end{align*}
Therefore $x_j^kg_e$, $0 \leq k < p^{e_j}$, $1 \leq e \leq d$, span $\hatlocal{X_j}{x'}/I\hatlocal{X_j}{x'}$ over $\kk$.\\

Now we show that $x_j^kg_e$ are linearly independent in $\hatlocal{X_j}{x'}/I\hatlocal{X_j}{x'}$ using the results from \cref{power-order-section}. Fix a monomial order $\preceq$ on $\zzeroo{n}$ and define $\exp_\preceq(I)$ as in \cref{power-section}. Due to \Cref{power-basis} \woutlog\ we may assume that $g_e = u^{\alpha_e}$ where $\alpha_e$, $e = 1, \ldots, d$, are elements of $\zzeroo{n} \setminus \exp_\preceq(I)$. Pick $c_{k,e} \in \kk$ such that $\sum_{k,e} c_{k,e} x_j^kg_e \in I\hatlocal{X_j}{x'}$. Recall that
\begin{align*}
\hatlocal{X_j}{x'}
	\cong \hatlocal{X_{j-1}}{x}[[x_j]]/\langle x_j^{p^{e_j}} - a_j \rangle
	\cong \kk[[u_{m+1}, \ldots, u_{m+n}, x_j]]//\langle x_j^{p^{e_j}} - a_j \rangle
\end{align*}
It follows that $\sum_{k,e} c_{k,e} x_j^kg_e$ is in the ideal of $A := \kk[[u_{m+1}, \ldots, u_{m+n}, x_j]]$ generated by $I$ and $x_j^{p^{e_j}} - a_j$. Therefore
\begin{align}
\sum_{k,e} c_{k,e} x_j^kg_e = (x_j^{p^{e_j}} - a_j)b_0 + \sum_{i=1}^s f_i b_i \label{linear-expression}
\end{align}
for some $b_0, \ldots, b_s \in A$ and $f_1, \ldots, f_s \in I$. Write $b_0 = \sum_l b_{0,l} x_j^l$ for $b_{0,l} \in \kk[[u_{m+1}, \ldots, u_{m+n}]$. Due to \cref{power-basis} we may further assume that
\begin{prooflist}[resume]
\item  for each $l \geq 0$, either $b_{0,l} = 0$ or the exponent of $(u_{m+1}, \ldots, u_{m+n})$ in $\In_\preceq(b_{0,l})$ is one of $\alpha_1, \ldots, \alpha_d$; denote it by $\alpha_{e_l}$. 
\end{prooflist}
Identity \eqref{linear-expression} can be rearranged as:
\begin{align}
\sum_{k = 0}^{p^{e_j}-1} \sum_{e = 1}^d c_{k,e} x_j^k u^{\alpha_e} = (x_j^{p^{e_j}} - a_j)\sum_{l \geq 0}b_l x_j^l + \sum_{l \geq 0} \tilde f_l x_j^l \label{linear-expression-2}
\end{align}
where $\tilde f_l \in I$ for each $l \geq 0$. Now extend $\preceq$ to a monomial ordering $\preceq'$ on $A$ as follows: $u^\alpha x_j^q \preceq' u^{\beta}x_j^r$ iff either $\alpha \precneqq \beta$, or $\alpha = \beta$ and $q \leq r$. Note that
\begin{prooflist}[resume]
\item  $\In_{\preceq'}(x_j^{p^{e_j}} - a_j) = x_j^{p^{e_j}}$.
\end{prooflist}
Denote by $f$ the element in $A$ represented by either of the two sides of identity \eqref{linear-expression-2}. We claim that $f = 0$. Indeed, assume $f \neq 0$. Denote $\In_{\preceq'}(f)$ by $cu^{\alpha}x_j^r$. The left hand side of \eqref{linear-expression-2} implies that $(\alpha, r) = (\alpha_e, k)$ for some $e = 1, \ldots, d$ and $k = 0, \ldots, p^{e_j}-1$. On the other hand, the right hand side of \eqref{linear-expression-2} implies that either $(\alpha, r)$ of the form $(\alpha_e, p^{e_j} + l)$ for some $e = 1, \ldots, d$ and $l \geq 0$, or $\alpha \in \exp_\preceq(I)$ and $r \geq 0$. In either case the initial terms from the two sides of \eqref{linear-expression-2} do not match. It follows that $f = 0$, as claimed.
\end{proof}

Let $y$ be the image of $x$ in $Y$. The statement \eqref{inseparable-claim} follows via a straightforward induction on $j$ via applications of \cref{basis-proclaim} with $I = \mmm_y \hatlocal{X_{j-1}}{x}$ for $j = 1, \ldots, q$.
\end{proof}
{"config": "arxiv", "file": "1806.05346/varieties-v7.tex"}