Is there an example of a flat proper relative curve $X/S$ with geometrically connected fibres and with $\mathrm{dim} S > 1$ and $S$ regular and connected with $0$-dimensional locus of bad reduction $S\_{\mathrm{bad}} = \{s \in S: X\_s/s \text{ not smooth}\}$?



curve over higher dimensional basis with 0-dimensional locus of bad reduction
The answer is no if $f:X\to S$ is locally projective and the genus $g$ of the general fiber is $\geq1$. (About these restrictions, see remarks at the end). 


Assuming this, put $U:=S\smallsetminus S\_\mathrm{bad}$. By assumption, $S$ is regular and $U$ contains all points of codimension $\leq1$ of $S$. I do not assume $\dim S\_\mathrm{bad}=0$, but of course we may reduce to this case if we prefer.


The main point is:



> 
> $X\_U$ extends uniquely to a proper and smooth $f':X'\to S$. 
> 
> 
> 


This follows from my paper: *Un théorème de pureté pour les familles de courbes lisses*, CRAS Paris vol 300 issue 14 (1985), 489-492.


Now let us prove that the identification $X\_U\cong X'\_U$ extends to an isomorphism $X\cong X'$. Fix an invertible sheaf $L$ on $X$, very ample relative to $S$ and such that $\mathscr{E}:=f\_\*L$ is locally free on $S$, and commutes with base change in the usual sense. Moreover, assume that the degree of $L$ in the fibers is large enough ($\geq2g+2$ ?) to automatically ensure these properties on all smooth curves of genus $g$. So, we have a closed immersion $i:X\hookrightarrow \mathbb{P}(\mathscr{E})$.



> 
> Claim: The pair $(X,L)$ (subject to the conditions of flatness, smoothness over $U$, and strong ampleness) is determined up to unique isomorphism by $(X\_U,L\_U)$.
> 
> 
> 


Indeed, $(X\_U,L\_U)$ determines $\mathscr{E}\_U$ and $i\_U:X\_U\hookrightarrow \mathbb{P}(\mathscr{E}\_U)$. Then we recover $\mathscr{E}$ as $j\_\*\mathscr{E}\_U$ (by the codimension assumption, $j$ being the inclusion of $U$), and then $X$ must be isomorphic to the schematic closure of $i\_U(X\_U)$ in $\mathbb{P}(\mathscr{E})$. Of course, $L$ is then the restriction of $\mathscr{O}\_{\mathbb{P}(\mathscr{E})}(1)$ to $X$.


Now we can "do the same" with $X'$. More precisely, over $X'\_U=X\_U$ we have the sheaf $L\_U$, and since $X'$ is a regular scheme this extends to an invertible sheaf $L'$ on $X'$. Since the degree in the fibers is locally constant, this $L'$ satisfies all our ampleness requirements. So we get a pair $(X',L')$ whose restriction to $U$ is isomorphic to $(X\_U,L\_U)$, and we conclude by the above claim.


**Remark 1**. One can probably get rid of the projective assumption: we may assume $S$ local henselian, in which case projectivity should be automatic.


**Remark 2**. My purity result might be true in genus $0$, but I never worked this out.


