Let $X$ be a smooth projective variety. Given fixed Chern classes with positive rank $r$, let $M$ be the moduli space of semistable sheaves with such Chern classes. In general we only know $M$ is a projective scheme. (if $\mathrm{dim}(X)$ is $1,2$ a lot more can be said)


1st Question: Is there an example where $M$ is smooth but not connected?


2nd Question: I am trying to show the following scenario cannot happen: $M$ is smooth of dimension $d\geq 1$(Edit: first version did not contain $\geq 1$, see Jason Starr's comments below for an interesting example for $d=0$) but disconnected and one of the connected components consists merely of stable vector bundles. I feel we might be able to use the fact that the component only contains vector bundles to contradicts the projectivity but not sure how.


Thanks in advance!



Connectedness of moduli space
The answer to the second question is also negative. Here is a quick review of the Hartshorne-Serre construction in the smooth case. Let $X$ be a smooth, connected, proper $k$-scheme of pure dimension $n\geq 2$. Let $C\subset X$ be a codimension $2$, closed subscheme that is a local complete intersection scheme such that $H^0(C,\mathcal{O}\_C)$ equals $k$ (this implies that $C$ is connected, and it is equivalent to connectedness if $C$ is reduced).


**Hypothesis 1.** There exists an invertible sheaf $\mathcal{L}$ on $X$ such that the $\mathcal{L}|\_C$ is isomorphic to $\omega\_{C/k}$ and such that $H^{n-2}(X,\mathcal{L})$ vanishes.


**Hartshorne-Serre Correspondence**. Under the hypothesis, there exists a pair $(\mathcal{E},s)$ of a locally free $\mathcal{O}\_X$-module $\mathcal{E}$ of rank $2$ and determinant $\omega^\vee\_{X/k}\otimes\_{\mathcal{O}\_X} \mathcal{L}$ together with a global section $s$ whose zero scheme is precisely $C$. Moreover, the set of isomorphism classes of such pairs is naturally a torsor for the $k$-vector space $H^1(X,\mathcal{L}^\vee\otimes\_{\mathcal{O}\_X}\omega\_{X/k})$.


**Proof**. Denote by $\mathcal{I}$ the ideal sheaf of $C$ in $X$. Consider the Ext group $\text{Ext}^1\_{\mathcal{O}\_X}(\mathcal{I},\mathcal{L}^\vee\otimes\_{\mathcal{O}\_X}\omega\_{X/k})$. Since the left-exact functor $\text{Hom}\_{\mathcal{O}\_X}(\mathcal{I},-)$ is the composition of the sheaf Hom functor followed by the global sections functor, there is a corresponding Grothendieck spectral sequence computing the right derived functors. The low terms of this spectral sequence give a long exact sequence. 


Before writing this long exact sequence, note first the canonical isomorphism,
$$
\textit{Ext}^1\_{\mathcal{O}\_X}(i\_\*\mathcal{O}\_C,i\_\*\mathcal{O}\_C) \cong i\_\*(i^\*\mathcal{I})^\vee = i\_\* N\_{C/X},
$$
where $i^\*\mathcal{I}$ is the conormal sheaf of $C$ in $X$, and where $N\_{C/X}$ denotes the dual locally free $\mathcal{O}\_C$-module, i.e., the normal sheaf. For every closed subscheme of arbitrary codimension $c$, equal to the rank of $N\_{C/X}$, the exterior product on the Ext algebra defines a morphism of differential graded $i\_\*\mathcal{O}\_C$-algebras,
$$
i\_\* \bigwedge^\bullet\_{\mathcal{O}\_C} N\_{C/X} \to \textit{Ext}^\bullet\_{\mathcal{O}\_X}(i\_\*\mathcal{O}\_C,i\_\*\mathcal{O}\_C).
$$
Working locally, and using the fact that $C$ is a local complete intersection scheme, this morphism is an isomorphism. Chasing exact sequences, $\textit{Ext}^r\_{\mathcal{O}\_X}(i\_\*\mathcal{O}\_C,\mathcal{O}\_X)$ is nonzero if and only if $r$ equals the codimension $c$, in which case it equals the pushforward of the determinant of $N\_{C/X}$. Chasing long exact sequences of the short exact sequence relating $\mathcal{I}$ and $i\_\*\mathcal{O}\_C$, we have
$$
\textit{Hom}\_{\mathcal{O}\_X}(\mathcal{I},\mathcal{F}) \cong \mathcal{F}, \ \ \textit{Ext}^{c-1}\_{\mathcal{O}\_X}(\mathcal{I},\mathcal{F}) \cong i\_\*(\text{det}(N\_{C/X})\otimes\_{\mathcal{O}\_C} i^\*\mathcal{F}),
$$
and all other sheaf Ext groups vanish. In the case of interest, where $c$ equals $2$, this gives 
$$
\textit{Hom}\_{\mathcal{O}\_X}(\mathcal{I},\mathcal{L}^\vee\otimes\_{\mathcal{O}\_X}\omega\_{X/k}) \cong \mathcal{L}^\vee\otimes\_{\mathcal{O}\_X}\omega\_{X/k}, \ \ 
\textit{Ext}^1\_{\mathcal{O}\_X}(\mathcal{I},\mathcal{L}^\vee\otimes\_{\mathcal{O}\_X}\omega\_{X/k}) \cong i\_\*\mathcal{O}\_C.
$$
Now, the long exact sequence of the Grothendieck spectral sequence becomes
$$
0\to H^1(X,\mathcal{L}^\vee\otimes\_{\mathcal{O}\_X}\omega\_{X/k}) \to \text{Ext}^1\_{\mathcal{O}\_X}(\mathcal{I},\mathcal{L}^\vee\otimes\_{\mathcal{O}\_X}\omega\_{X/k}) \to H^0(C,\mathcal{O}\_C) \xrightarrow{\delta} H^2(X,\mathcal{L}^\vee\otimes\_{\mathcal{O}\_X}\omega\_{X/k}).
$$
By Serre duality, the last term is dual to $H^{n-2}(X,\mathcal{L})$. This vanishes by hypothesis. Thus, there exists an extension class that maps to the element $1$ in $H^0(C,\mathcal{O}\_C)$, and the set of all such extension classes is a torsor under the $k$-vector space $H^1(X,\mathcal{L}^\vee\otimes\_{\mathcal{O}\_X}\omega\_{X/k})$. Interpreting the Ext group as a Yoneda Ext group, each such extension class is equivalent to a short exact sequence,
$$
0 \to \mathcal{L}^\vee\otimes\_{\mathcal{O}\_X}\omega\_{X/k} \to \mathcal{E}' \to \mathcal{I} \to 0,
$$
such that the induced map 
$$
i^\*\mathcal{E}' \to i^\*\mathcal{I}
$$
is an isomorphism. This is equivalent to local freeness of $\mathcal{E}'$ on a Zariski open neighborhood of $C$. Since also $\mathcal{E}'$ is locally free on the complement of $C$, since also $\mathcal{I}$ is an invertible sheaf on the complement of $C$, these extension classes are precisely the ones for which $\mathcal{E}'$ is locally free of rank $2$. The dual locally free sheaf $\mathcal{E}$ has a natural global section $s$ coming from $\textit{Hom}\_{\mathcal{O}\_X}(\mathcal{I},\mathcal{O}\_X) \cong \mathcal{O}\_X$. The set of isomorphism classes of pairs $(\mathcal{E},s)$ is equivalent to the set of isomorphism classes of Yoneda extension classes above. **QED**


**Note**. The history of the Hartshorne-Serre correspondence involves many other mathematicians: Horrocks, Barth, van de Ven, Grauert, Mülich, and Vogelaar. I recommend the following article for more about this.


MR2351117 (2008g:14084)   
 
Arrondo, Enrique   

A home-made Hartshorne-Serre correspondence.   

Rev. Mat. Complut. 20 (2007), no. 2, 423–443.   

<https://pdfs.semanticscholar.org/982e/8d2ed4fcc0a0a445d5dbc81a361b368f8876.pdf>


**Edit.** The following edit produces positive dimensional components of the moduli space of stable bundles, not just semistable bundles. The original post is below the edit.


**Moduli spaces of rank $2$, stable bundles on a quintic threefold**. Now consider the special case that $X$ is a smooth quintic hypersurface in $\mathbb{P}^4$. This is a Calabi-Yau manifold, i.e., $\omega\_{X/k} \cong \mathcal{O}\_X$. By the Grothendieck-Lefschetz hyperplane theorem for Picard groups, every invertible sheaf on $X$ is isomorphic to $\mathcal{O}\_{\mathbb{P}^4}(d)|\_X$ for some integer $d$. As a complete intersection, also $H^r(X,\mathcal{O}\_{\mathbb{P}^4}(d)|\_X)$ vanishes for $r=1$ and $r=2$. Thus, for every complete intersection curve $C$ in $X$ with $H^0(C,\mathcal{O}\_C)$ equal to $k$ and with $\omega\_{C/k}$ equal to $\mathcal{L}|\_C$ for some invertible sheaf $\mathcal{L}$ on $X$, the hypotheses of the Hartshorne-Serre correspondence are satisfied. 


**Hypothesis 1.** The restriction map $H^0(X,\mathcal{L})\to H^0(C,\mathcal{L}|\_C)$ is surjective.


Under this hypothesis, also $H^1(X,\mathcal{L}\otimes \mathcal{I})$ vanishes. Thus, associated to the defining short exact sequence, $$0\to \mathcal{O}\_X \xrightarrow{s} \to \mathcal{E} \to \mathcal{L}\otimes\omega\_{X/k}^\vee\otimes \mathcal{I} \to 0,$$ the long exact sequence of cohomology gives vanishing of $H^1(X,\mathcal{E})$. Therefore, for every infinitesimal deformation of $\mathcal{E}$, there is a corresponding infinitesimal deformation of the global section $s$, and thus also an infinitesimal deformation of the zero scheme $C$ of $s$. In other words, the morphism from the Hilbert scheme to the moduli space of sheaves is formally smooth.


**Hypothesis 3.** The invertible sheaf $\omega\_C$ is isomorphic to $\mathcal{O}\_{\mathbb{P}^4}(1)|\_C$, i.e., $\mathcal{L}$ equals $\mathcal{O}\_{\mathbb{P}^4}(1)|\_X$. Combined with Hypothesis 2, this is equivalent to the hypothesis that the embedding of $C$ in its linear span in $\mathbb{P}^4$ is a **canonical embedding**.


Under these hypotheses, from the defining short exact sequence above, it follows that $\mathcal{E}$ is stable. The slope is $\mu=c\_1(\mathcal{O}\_{\mathbb{P}^4}(1))/2$. An invertible sheaf $\mathcal{O}\_{\mathbb{P}^4}(e)$ has slope $\geq \mu$ if and only if $e\geq 1$. Since there is a nonzero morphism from $\mathcal{O}\_{\mathbb{P}^4}(e-1)|\_X$ to $\mathcal{I}$ if and only if $e-1 \leq -1$, i.e., if and only if $e\leq 0$, and similarly there is a nonzero morphism from $\mathcal{O}\_{\mathbb{P}^4}(e)|\_X$ to $\mathcal{O}\_X$ if and only if $e\leq 0$, there is a nonzero morphism from $\mathcal{O}\_{\mathbb{P}^4}(e)|\_X$ to $\mathcal{E}$ if and only if $e\leq 0$. Therefore $\mathcal{E}$ is stable.


It remains to describe the relevant family of canonical curves $C$. For every line $R$ in $X$, for every $2$-plane $\Pi$ that contains $R$, the intersection $\Pi\cap X$ is a plane quintic $R\cup C$, where $C$ is a plane curve of degree $4$. Thus, $C$ is a complete intersection curve with $H^0(C,\mathcal{O}\_C)$ equal to $k$. Also $\omega\_{C/k}$ equals $\mathcal{O}\_{\mathbb{P}^4}(1)|\_C$ by adjunction. Thus, these residual curves satisfy the hypotheses above. 


Note that $H^0(X,\mathcal{E})$ equals $3$, i.e., there is a net of such curves associated to $E$. This is consistent: there is also a net of $2$-planes $\Pi$ containing the line $R$ in $\mathbb{P}^4$. 


A general quintic threefold $X$ has precisely $2875$ lines, and thus $M$ would contain $2875$ isolated points. However, there are many smooth quintic threefolds $X$ whose Fano scheme of lines has positive dimension, e.g., this holds if $X$ has a conical tangent hyperplane (the intersection of the tangent hyperplane with $X$ is a cone over a smooth plane quintic curve). There exists such a quintic threefold with a conical point and with an isolated line. For such a qunitic threefold, the moduli space $M$ of stable sheaves with fixed numerical invariants equal to those of $\mathcal{E}$ has one isolated component and one connected component that is a smooth plane quintic curve.


**Original post.**


**Moduli spaces of slope $0$ semistable sheaves with many isolated points**. Now consider the special case that $\mathcal{L} \cong \omega\_{X/k}$. In this case, the hypothesis is that $H^2(X,\mathcal{O}\_X)$ equals $0$. This is true if $X$ is a Calabi-Yau threefold, for instance, and if $C$ is a smooth elliptic curve. In this case, since the determinant of $\mathcal{E}$ equals the trivial invertible sheaf, the defining short exact sequence proves that $\mathcal{E}$ is semistable. Moreover, since $H^1(X,\mathcal{O}\_X)$ also vanishes, also $H^1(X,\mathcal{E})$ vanishes. 


Thus, for every infinitesimal deformation of $\mathcal{E}$, there is a corresponding infinitesimal deformation of $s$, and thus an infinitesimal deformation of $C$, the zero scheme of $s$. If $C$ is infinitesimally rigid, then it follows that $[\mathcal{E}]$ gives an isolated point of the moduli space $M$ of semistable sheaves with numerical invariants equal to those of $\mathcal{E}$. Moreover, those numerical invariants depend only on the curve class of $C$ in $X$ and the genus of $C$, namely $1$. Thus, if there is more than one infinitesimally rigid elliptic curve in $X$ having the specified curve class, then $M$ has more than one isolated point.


By the enumerative computation of Sheldon Katz mentioned above, a generic quintic threefold in $\mathbb{P}^4$ contains precisely $609250$ elliptic curves $C$ that are smooth plane cubics as curves in $\mathbb{P}^4$. Thus, the corresponding moduli space $M$ of semistable sheaves of rank $2$ and slope $0$ has (at least) $609250$ isolated points.


**A moduli space of slope $0$ semistable sheaves with a connected component of positive dimension** Next consider the special case of a smooth cubic threefold $Y$ in $\mathbb{P}^4$. Consider the codimension $2$ closed subschemes of $Y$ that are lines $R$ contained in $Y$. In this case, the moduli space of locally free $\mathcal{O}\_Y$-modules of rank $2$ obtained from the Hartshorne-Serre correspondence has been thoroughly analyzed in the following article.


MR1795549 (2001j:14055)   

Markushevich, D; Tikhomirov, A. S.   

The Abel-Jacobi map of a moduli component of vector bundles on the cubic threefold.   
 
J. Algebraic Geom. 10 (2001), no. 1, 37–62.   

<https://arxiv.org/abs/math/9809140>


The curves $R$ are genus $0$ curves with $\omega\_{R/k} \cong \mathcal{O}\_{\mathbb{P}^4}(-2)|\_R$. Thus, for the invertible $\mathcal{O}\_Y$-module $\mathcal{L} \cong \mathcal{O}\_{\mathbb{P}^4}(-2)|\_Y$, the restriction of $\mathcal{L}$ to $R$ equals $\omega\_{R/k}$. Since $Y$ is a complete intersection $H^r(Y,\mathcal{O}(d))$ vanishes for every integer $d$ and for every integer $r$ that satisfies $0<r<\text{dim}(Y)$. In particular, $H^{n-2}(Y,\mathcal{L})$ and $H^1(Y,\mathcal{L}^\vee\otimes\_{\mathcal{O}\_Y}\omega\_{Y/k})$ both vanish. Thus, by the Hartshorne-Serre correspondence, for every line $R$ in $Y$, there exists a unique pair $(\mathcal{F},t)$ of a locally free $\mathcal{O}\_Y$-module $\mathcal{F}$ of rank $2$ and a global section $t$ whose zero scheme equals $R$. Also, as in the case of elliptic curves on a Calabi-Yau threefold, $\mathcal{L}$ equals $\omega\_{Y/k}$. Thus, the locally free $\mathcal{O}\_Y$-module $\mathcal{F}$ is semistable of rank $2$ and slope $0$, and $t$ is the unique global section up to scaling. Thus, the component of the moduli space $N$ of rank $2$, slope $0$, semistable sheaves that parameterizes $\mathcal{F}$ (among others) is isomorphic to the Hilbert scheme of lines $R$ in $Y$. This Hilbert scheme is a smooth surface of general type (cf. Clemens-Griffiths). 


**Moduli spaces of slope $0$ semistable sheaves with many components of positive dimension**. Finally, consider the product $k$-scheme $X\times Y$, where $X$ is a general qunitic threefold and $Y$ is a smooth cubic threefold. The Picard group of $X\times Y$ is $\text{Pic}(X)\oplus \text{Pic}(Y)$, with ample cone equal to the product of the ample cones. For any choice of ample divisor, the locally free sheaf $\mathcal{G}:=\text{pr}\_X^\*\mathcal{E}\oplus \text{pr}\_Y^\*\mathcal{F}$ is semistable of rank $4$. By K\"{u}nneth computations, again $H^1(X\times Y,\mathcal{G})$ is zero. Thus, the global section $s\oplus t$ deforms together with any infinitesimal deformation of $\mathcal{G}$. The zero scheme of $s\oplus t$ is the codimension $4$ closed subscheme $C\times R$ in $X\times Y$. Thus, the component of the moduli space of semistable sheaves on $X\times Y$ of rank $4$ and slope $0$ that contains $\mathcal{G}$ is isomorphic to a component of $M\times N$. Since $M$ contains $609250$ isolated points $[\mathcal{E}]$ as above, and since $N$ is a smooth, projective, connected surface, it follows that this moduli space has at least $609250$ connected components that are each isomorphic to $N$, a smooth, projective, connected surface.


