hcju/stacksqa huggingface dataset:
Let $f : X \to S$ be a family of curves. By More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-flat-finite-presentation-CM-open} the set $$ W = \{x \in |X| : f \text{ is Cohen-Macaulay at }x\} $$ is open in $|X|$ and formation of this open commutes with arbitrary base change. Since $f$ is proper the subset $$ S' = S \setminus f(|X| \setminus W) $$ of $S$ is open and $X \times_S S' \to S'$ is Cohen-Macaulay. Moreover, formation of $S'$ commutes with arbitrary base change because this is true for $W$ Thus we get the open substack with the desired properties by the method discussed in Section \ref{section-open}.
By Lemma \ref{lemma-CM-curves} it is clear that we have $\Curvesstack^{CM, 1} \subset \Curvesstack^{CM}$ if it exists. Let $f : X \to S$ be a family of curves such that $f$ is a Cohen-Macaulay morphism. By More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-lfp-CM-relative-dimension} we have a decomposition $$ X = X_0 \amalg X_1 $$ by open and closed subspaces such that $X_0 \to S$ has relative dimension $0$ and $X_1 \to S$ has relative dimension $1$. Since $f$ is proper the subset $$ S' = S \setminus f(|X_0|) $$ of $S$ is open and $X \times_S S' \to S'$ is Cohen-Macaulay and has relative dimension $1$. Moreover, formation of $S'$ commutes with arbitrary base change because this is true for the decomposition above (as relative dimension behaves well with respect to base change, see Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-dimension-fibre-after-base-change}). Thus we get the open substack with the desired properties by the method discussed in Section \ref{section-open}.
Given a family of curves $X \to S$ the set of $s \in S$ where $\kappa(s) = H^0(X_s, \mathcal{O}_{X_s})$ is open in $S$ by Derived Categories of Spaces, Lemma \ref{spaces-perfect-lemma-jump-loci-geometric}. Also, the set of points in $S$ where the fibre has dimension $1$ is open by More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-dimension-fibres-proper-flat}. Moreover, if $f : X \to S$ is a family of curves all of whose fibres have dimension $1$ (and in particular $f$ is surjective), then condition (1)(b) is equivalent to $\kappa(s) = H^0(X_s, \mathcal{O}_{X_s})$ for every $s \in S$, see Derived Categories of Spaces, Lemma \ref{spaces-perfect-lemma-proper-flat-h0}. Thus we see that the lemma follows from the general discussion in Section \ref{section-open}.
We apply Derived Categories of Spaces, Lemma \ref{spaces-perfect-lemma-proper-flat-h0}. This proves part (1). It also implies that locally on $S$ we can write $Rf_*\mathcal{O}_X = \mathcal{O}_S \oplus P$ where $P$ is perfect of tor amplitude in $[1, \infty)$. Recall that formation of $Rf_*\mathcal{O}_X$ commutes with arbitrary base change (Derived Categories of Spaces, Lemma \ref{spaces-perfect-lemma-flat-proper-perfect-direct-image-general}). Thus for $s \in S$ we have $$ H^i(P \otimes_{\mathcal{O}_S}^\mathbf{L} \kappa(s)) = H^i(X_s, \mathcal{O}_{X_s}) \text{ for }i \geq 1 $$ This is zero unless $i = 1$ since $X_s$ is a $1$-dimensional Noetherian scheme, see Cohomology, Proposition \ref{cohomology-proposition-vanishing-Noetherian}. Then $P = H^1(P)[-1]$ and $H^1(P)$ is finite locally free for example by More on Algebra, Lemma \ref{more-algebra-lemma-lift-perfect-from-residue-field}. Since everything is compatible with base change we also see that (3) holds.
We already have the existence of $\Curvesstack^{h0, 1}$ as an open substack of $\Curvesstack$ characterized by the conditions of the lemma not involving $R^1f_*$ or $H^1$, see Lemma \ref{lemma-pre-genus-curves}. The existence of the decomposition into open and closed substacks follows immediately from the discussion in Section \ref{section-open} and Lemma \ref{lemma-genus}. This proves the characterization in (1). The characterization in (2) follows from the definition of the genus in Algebraic Curves, Definition \ref{curves-definition-genus}.
Let $f : X \to S$ be a family of curves. By More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-geometrically-reduced-open} the set $$ E = \{s \in S : \text{the fibre of }X \to S\text{ at }s \text{ is geometrically reduced}\} $$ is open in $S$. Formation of this open commutes with arbitrary base change by More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-base-change-fibres-geometrically-reduced}. Thus we get the open substack with the desired properties by the method discussed in Section \ref{section-open}.
By Lemmas \ref{lemma-geometrically-reduced-curves}, \ref{lemma-geomred-in-CM}, \ref{lemma-CM-curves}, and \ref{lemma-CM-1-curves} it is clear that we have $$ \Curvesstack^{grc, 1} \subset \Curvesstack^{geomred} \cap \Curvesstack^{CM, 1} $$ if it exists. Let $f : X \to S$ be a family of curves such that $f$ is Cohen-Macaulay, has geometrically reduced fibres, and has relative dimension $1$. By More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-stein-factorization-etale} in the Stein factorization $$ X \to T \to S $$ the morphism $T \to S$ is \'etale. This implies that there is an open and closed subscheme $S' \subset S$ such that $X \times_S S' \to S'$ has geometrically connected fibres (in the decomposition of Morphisms, Lemma \ref{morphisms-lemma-finite-locally-free} for the finite locally free morphism $T \to S$ this corresponds to $S_1$). Formation of this open commutes with arbitrary base change because the number of connected components of geometric fibres is invariant under base change (it is also true that the Stein factorization commutes with base change in our particular case but we don't need this to conclude). Thus we get the open substack with the desired properties by the method discussed in Section \ref{section-open}.
First proof: set $\Curvesstack^{grc, 1}_g = \Curvesstack^{grc, 1} \cap \Curvesstack_g$ and combine Lemmas \ref{lemma-geomredcon-in-h0-1} and \ref{lemma-pre-genus-one-piece-per-genus}. Second proof: The existence of the decomposition into open and closed substacks follows immediately from the discussion in Section \ref{section-open} and Lemma \ref{lemma-geomredcon-in-h0-1}. This proves the characterization in (1). The characterization in (2) follows as well since the genus of a geometrically reduced and connected proper $1$-dimensional scheme $X/k$ is defined (Algebraic Curves, Definition \ref{curves-definition-genus} and Varieties, Lemma \ref{varieties-lemma-proper-geometrically-reduced-global-sections}) and is equal to $\dim_k H^1(X, \mathcal{O}_X)$.
Let $f : X \to S$ be a family of curves. By More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-flat-finite-presentation-gorenstein-open} the set $$ W = \{x \in |X| : f \text{ is Gorenstein at }x\} $$ is open in $|X|$ and formation of this open commutes with arbitrary base change. Since $f$ is proper the subset $$ S' = S \setminus f(|X| \setminus W) $$ of $S$ is open and $X \times_S S' \to S'$ is Gorenstein. Moreover, formation of $S'$ commutes with arbitrary base change because this is true for $W$ Thus we get the open substack with the desired properties by the method discussed in Section \ref{section-open}.
Recall that a Gorenstein scheme is Cohen-Macaulay (Duality for Schemes, Lemma \ref{duality-lemma-gorenstein-CM}) and that a Gorenstein morphism is a Cohen-Macaulay morphism (Duality for Schemes, Lemma \ref{duality-lemma-gorenstein-CM-morphism}. Thus we can set $\Curvesstack^{Gorenstein, 1}$ equal to the intersection of $\Curvesstack^{Gorenstein}$ and $\Curvesstack^{CM, 1}$ inside of $\Curvesstack$ and use Lemmas \ref{lemma-gorenstein-curves} and \ref{lemma-CM-1-curves}.
Recall that being a syntomic morphism is the same as being flat and a local complete intersection morphism, see More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-flat-lci}. Thus (1)(b) is equivalent to (1)(c). In Section \ref{section-open} we have seen it suffices to show that given a family of curves $f : X \to S$, there is an open subscheme $S' \subset S$ such that $S' \times_S X \to S'$ is a local complete intersection morphism and such that formation of $S'$ commutes with arbitrary base change. This follows from the more general More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-where-lci}.
To prove the lemma it suffices to show that given a family of curves $f : X \to S$, there is an open subscheme $S' \subset S$ such that the fibre of $S' \times_S X \to S'$ have property (2). (Formation of the open will automatically commute with base change.) By definition the locus $T \subset |X|$ of points where $X \to S$ is not smooth is closed. Let $Z \subset X$ be the closed subspace given by the reduced induced algebraic space structure on $T$ (Properties of Spaces, Definition \ref{spaces-properties-definition-reduced-induced-space}). Now if $s \in S$ is a point where $Z_s$ is finite, then there is an open neighbourhood $U_s \subset S$ of $s$ such that $Z \cap f^{-1}(U_s) \to U_s$ is finite, see More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-proper-finite-fibre-finite-in-neighbourhood}. This proves the lemma.
Since $\Curvesstack \longrightarrow \Spec(\mathbf{Z})$ is locally of finite presentation (Lemma \ref{lemma-curves-qs-lfp}) formation of the open substack where $\Curvesstack \longrightarrow \Spec(\mathbf{Z})$ is smooth commutes with flat base change (Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-where-smooth}). Since the Cohen ring $\Lambda$ is flat over $\mathbf{Z}$, we may work over $\Lambda$. In other words, we are trying to prove that $$ \Lambda\text{-}\Curvesstack \longrightarrow \Spec(\Lambda) $$ is smooth in an open neighbourhood of the point $x_0 : \Spec(k) \to \Lambda\text{-}\Curvesstack$ defined by $X/k$ if and only if $\Deformationcategory_X$ is unobstructed. \medskip\noindent The lemma now follows from Geometry of Stacks, Lemma \ref{stacks-geometry-lemma-characterize-smoothness} and the equality $$ \Deformationcategory_X = \mathcal{F}_{\Lambda\text{-}\Curvesstack, k, x_0} $$ This equality is not completely trivial to esthablish. Namely, on the left hand side we have the deformation category classifying all flat deformations $Y \to \Spec(A)$ of $X$ as a scheme over $A \in \Ob(\mathcal{C}_\Lambda)$. On the right hand side we have the deformation category classifying all flat morphisms $Y \to \Spec(A)$ with special fibre $X$ where $Y$ is an algebraic space and $Y \to \Spec(A)$ is proper, of finite presentation, and of relative dimension $\leq 1$. Since $A$ is Artinian, we find that $Y$ is a scheme for example by Spaces over Fields, Lemma \ref{spaces-over-fields-lemma-codim-1-point-in-schematic-locus}. Thus it remains to show: a flat deformation $Y \to \Spec(A)$ of $X$ as a scheme over an Artinian local ring $A$ with residue field $k$ is proper, of finite presentation, and of relative dimension $\leq 1$. Relative dimension is defined in terms of fibres and hence holds automatically for $Y/A$ since it holds for $X/k$. The morphism $Y \to \Spec(A)$ is proper and locally of finite presentation as this is true for $X \to \Spec(k)$, see More on Morphisms, Lemma \ref{more-morphisms-lemma-deform-property}.
If we can show that there is an open substack $\Curvesstack^{lci+}$ whose points are characterized by (2), then we see that (1) holds by combining Lemma \ref{lemma-in-smooth-locus} with Deformation Problems, Lemma \ref{examples-defos-lemma-curve-isolated-lci}. Since $$ \Curvesstack^{lci+} = \Curvesstack^{lci} \cap \Curvesstack^{+} $$ inside $\Curvesstack$, we conclude by Lemmas \ref{lemma-lci-curves} and \ref{lemma-isolated-sings-curves}.
To prove the statements regarding $\Curvesstack^{smooth}$ it suffices to show that given a family of curves $f : X \to S$, there is an open subscheme $S' \subset S$ such that $S' \times_S X \to S'$ is smooth and such that the formation of this open commutes with base change. We know that there is a maximal open $U \subset X$ such that $U \to S$ is smooth and that formation of $U$ commutes with arbitrary base change, see Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-where-smooth}. If $T = |X| \setminus |U|$ then $f(T)$ is closed in $S$ as $f$ is proper. Setting $S' = S \setminus f(T)$ we obtain the desired open. \medskip\noindent Let $f : X \to S$ be a family of curves with $f$ smooth. Then the fibres $X_s$ are smooth over $\kappa(s)$ and hence Cohen-Macaulay (for example you can see this using Algebra, Lemmas \ref{algebra-lemma-smooth-over-field} and \ref{algebra-lemma-lci-CM}). Thus we see that we may set $$ \Curvesstack^{smooth, 1} = \Curvesstack^{smooth} \cap \Curvesstack^{CM, 1} $$ and the desired equivalences follow from what we've already shown for $\Curvesstack^{smooth}$ and Lemma \ref{lemma-CM-1-curves}.
If we set $$ \Curvesstack^{smooth, h0} = \Curvesstack^{smooth} \cap \Curvesstack^{h0, 1} $$ then we see that (1) holds by Lemmas \ref{lemma-pre-genus-curves} and \ref{lemma-smooth-curves}. In fact, this also gives the equivalence of (2)(a) and (2)(b). To finish the proof we have to show that (2)(b) is equivalent to each of (2)(c), (2)(d), and (2)(e). \medskip\noindent A smooth scheme over a field is geometrically normal (Varieties, Lemma \ref{varieties-lemma-smooth-geometrically-normal}), smoothness is preserved under base change (Morphisms, Lemma \ref{morphisms-lemma-base-change-smooth}), and being smooth is fpqc local on the target (Descent, Lemma \ref{descent-lemma-descending-property-smooth}). Keeping this in mind, the equivalence of (2)(b), (2)(c), 2(d), and (2)(e) follows from Varieties, Lemma \ref{varieties-lemma-geometrically-normal-stein}.
By the very construction of the topology on $|\Curvesstack^{lci+}|$ in Properties of Stacks, Section \ref{stacks-properties-section-points} we find that $|\Curvesstack^{smooth}|$ is an open subset. Let $\xi \in |\Curvesstack^{lci+}|$ be a point. Then there exists a field $k$ and a scheme $X$ over $k$ with $X$ proper over $k$, with $\dim(X) \leq 1$, with $X$ a local complete intersection over $k$, and with $X$ is smooth over $k$ except at finitely many points, such that $\xi$ is the equivalence class of the classifying morphism $\Spec(k) \to \Curvesstack^{lci+}$ determined by $X$. See Lemma \ref{lemma-big-smooth-part-curves}. By Deformation Problems, Lemma \ref{examples-defos-lemma-smoothing-proper-curve-isolated-lci} there exists a flat projective morphism $Y \to \Spec(k[[t]])$ whose generic fibre is smooth and whose special fibre is isomorphic to $X$. Consider the classifying morphism $$ \Spec(k[[t]]) \longrightarrow \Curvesstack^{lci+} $$ determined by $Y$. The image of the closed point is $\xi$ and the image of the generic point is in $|\Curvesstack^{smooth}|$. Since the generic point specializes to the closed point in $|\Spec(k[[t]])|$ we conclude that $\xi$ is in the closure of $|\Curvesstack^{smooth}|$ as desired.
In fact, it suffices to show that given a family of curves $f : X \to S$, there is an open subscheme $S' \subset S$ such that $S' \times_S X \to S'$ is at-worst-nodal of relative dimension $1$ and such that formation of $S'$ commutes with arbitrary base change. By More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-locus-where-nodal} there is a maximal open subspace $X' \subset X$ such that $f|_{X'} : X' \to S$ is at-worst-nodal of relative dimension $1$. Moreover, formation of $X'$ commutes with base change. Hence we can take $$ S' = S \setminus |f|(|X| \setminus |X'|) $$ This is open because a proper morphism is universally closed by definition.
We urge the reader to deduce this directly from the discussion above of what happens after base change to a field. Our proof will use a somewhat cumbersome reduction to the Noetherian schemes case. \medskip\noindent Once we show $\omega_{X/S}^\bullet = \omega_{X/S}[1]$ with $\omega_{X/S}$ flat over $S$, the statement on base change will follow as we already know that formation of $\omega_{X/S}^\bullet$ commutes with arbitrary base change. Moreover, the pseudo-coherence will be automatic as $\omega_{X/S}^\bullet$ is pseudo-coherent by definition. Vanishing of the other cohomology sheaves and flatness  may be checked \'etale locally. Thus we may assume $f : X \to S$ is a morphism of schemes with $S$ affine (see discussion above). Write $S = \lim S_i$ as a cofiltered limit of affine schemes $S_i$ of finite type over $\mathbf{Z}$. Since $\Curvesstack^{CM, 1}$ is locally of finite presentation over $\mathbf{Z}$ (as an open substack of $\Curvesstack$, see Lemmas \ref{lemma-CM-1-curves} and \ref{lemma-curves-qs-lfp}), we can find an $i$ and a family of curves $X_i \to S_i$ whose pullback is $X \to S$ (Limits of Stacks, Lemma \ref{stacks-limits-lemma-representable-by-spaces-limit-preserving}). After increasing $i$ if necessary we may assume $X_i$ is a scheme, see Limits of Spaces, Lemma \ref{spaces-limits-lemma-limit-is-scheme}. Since formation of $\omega_{X/S}^\bullet$ commutes with arbitrary base change, we may replace $S$ by $S_i$. Doing so we may and do assume $S_i$ is Noetherian. Then $f$ is clearly a Cohen-Macaulay morphism (More on Morphisms, Definition \ref{more-morphisms-definition-CM}) by our assumption on the fibres. Also then $\omega_{X/S}^\bullet = f^!\mathcal{O}_S$ by the very construction of $f^!$ in Duality for Schemes, Section \ref{duality-section-upper-shriek}. Thus the lemma by Duality for Schemes, Lemma \ref{duality-lemma-affine-flat-Noetherian-CM}.
Given a family of curves $X \to S$ we see that it is prestable if and only if the classifying morphism factors both through $\Curvesstack^{nodal}$ and $\Curvesstack^{h0, 1}$. An alternative is to use $\Curvesstack^{grc, 1}$ (since a nodal curve is geometrically reduced hence has $H^0$ equal to the ground field if and only if it is connected). In a formula $$ \Curvesstack^{prestable} = \Curvesstack^{nodal} \cap \Curvesstack^{h0, 1} = \Curvesstack^{nodal} \cap \Curvesstack^{grc, 1} $$ Thus the lemma follows from Lemmas \ref{lemma-pre-genus-curves} and \ref{lemma-nodal-curves}.
The equivalence of (2)(b) and (2)(c) is Algebraic Curves, Lemma \ref{curves-lemma-contracting-rational-tails}. In the rest of the proof we will work with (2)(b) in accordance with Definition \ref{definition-semistable}. \medskip\noindent By the discussion in Section \ref{section-open} it suffices to look at families $f : X \to S$ of prestable curves. By Lemma \ref{lemma-semistable} we obtain the desired openness of the locus in question. Formation of this open commutes with arbitrary base change, because the (non)existence of rational tails is insensitive to ground field extensions by Algebraic Curves, Lemma \ref{curves-lemma-contracting-rational-tails}.
Assume (2). Then $\omega_{X_s}$ is ample on $X_s$. By Algebraic Curves, Lemmas \ref{curves-lemma-rational-tail-negative} and \ref{curves-lemma-rational-bridge-zero} we conclude that (1) holds (we also use the characterization of ample invertible sheaves in Varieties, Lemma \ref{varieties-lemma-ampleness-in-terms-of-degrees-components}). \medskip\noindent Assume (1). Then $\omega_{X_s}$ is ample on $X_s$ by Algebraic Curves, Lemmas \ref{curves-lemma-contracting-rational-bridges}. We conclude by Descent on Spaces, Lemma \ref{spaces-descent-lemma-ample-in-neighbourhood}.
By the discussion in Section \ref{section-open} it suffices to look at families $f : X \to S$ of prestable curves. By Lemma \ref{lemma-stable} we obtain the desired openness of the locus in question. Formation of this open commutes with arbitrary base change, either because the (non)existence of rational tails or bridges is insensitive to ground field extensions by Algebraic Curves, Lemmas \ref{curves-lemma-contracting-rational-tails} and \ref{curves-lemma-contracting-rational-bridges} or because ampleness is insenstive to base field extensions by Descent, Lemma \ref{descent-lemma-descending-property-ample}.
Proof of the first assertion. Let $X$ be a scheme proper over a field $k$ whose singularities are at-worst-nodal, $\dim(X) = 1$, $k = H^0(X, \mathcal{O}_X)$, the genus of $X$ is $\geq 2$, and $X$ has no rational tails or bridges. We have to show that the classifying morphism $\Spec(k) \to \overline{\mathcal{M}} \to \Curvesstack$ factors through $\Curvesstack^{DM}$. We may first replace $k$ by the algebraic closure (since we already know the relevant stacks are open substacks of the algebraic stack $\Curvesstack$). By Lemmas \ref{lemma-stable-curves}, \ref{lemma-DM-curves}, and \ref{lemma-in-DM-locus-vector-fields} it suffices to show that $\text{Der}_k(\mathcal{O}_X, \mathcal{O}_X) = 0$. This is proven in Algebraic Curves, Lemma \ref{curves-lemma-stable-vector-fields}. \medskip\noindent Since $\Curvesstack^{DM}$ is the maximal open substack of $\Curvesstack$ which is DM, we see this is true also for the open substack $\overline{\mathcal{M}}$ of $\Curvesstack^{DM}$. Finally, a DM algebraic stack is Deligne-Mumford by Morphisms of Stacks, Theorem \ref{stacks-morphisms-theorem-DM}.
Let $(U, u) \to (S, s)$ be an \'etale neighbourhood such that $\mathcal{O}_{Y_U} = (X_U \to Y_U)_*\mathcal{O}_{X_U}$ and $R^1(X_U \to Y_U)_*\mathcal{O}_{X_U} = 0$ and the same is true after base change by $U' \to U$. Then we replace $S$ by the open image of $U \to S$. Given $S' \to S$ we set $U' = U \times_S S'$ and we obtain \'etale coverings $\{U' \to S'\}$ and $\{Y_{U'} \to Y_{S'}\}$. Thus the truth of the statement for the base change of $c$ by $S' \to S$ follows from the truth of the statement for the base change of $X_U \to Y_U$ by $U' \to U$. In other words, the question is local in the \'etale topology on $S$. Thus by Lemma \ref{lemma-etale-locally-scheme} we may assume $X$ and $Y$ are schemes. By More on Morphisms, Lemma \ref{more-morphisms-lemma-h1-fibre-zero-isom} there exists an open subscheme $V \subset Y$ containing $Y_s$ such that $c_*\mathcal{O}_X|_V = \mathcal{O}_V$ and $R^1c_*\mathcal{O}_X|_V = 0$ and such that this remains true after any base change by $S' \to S$. Since $g : Y \to S$ is proper, we can find an open neighbourhood $U \subset S$ of $s$ such that $g^{-1}(U) \subset V$. Then $U$ works.
Let $s \in S$. Let $c_0 : X_s \to Y_0$ be the contraction of Algebraic Curves, Section \ref{curves-section-contracting-to-stable} (more precisely Algebraic Curves, Lemma \ref{curves-lemma-characterize-contraction-to-stable}). By Lemma \ref{lemma-contract-basic} there exists an elementary \'etale neighbourhood $(U, u)$ and a morphism $c : X_U \to Y$ of families of curves over $U$ which recovers $c_0$ as the fibre at $u$. Since $\omega_{Y_0}$ is ample, after possibly shrinking $U$, we see that $Y \to U$ is a stable family of genus $g$ by the openness inherent in Lemmas \ref{lemma-stable-curves} and \ref{lemma-stable-one-piece-per-genus}. After possibly shrinking $U$ once more, assertion (1) of the lemma for $c : X_U \to Y$ follows from Lemma \ref{lemma-contract}. Moreover, part (2) holds by the uniqueness in Algebraic Curves, Lemma \ref{curves-lemma-characterize-contraction-to-stable}. We conclude that a morphism $c$ as in the lemma exists \'etale locally on $S$. More precisely, there exists an \'etale covering $\{U_i \to S\}$ and morphisms $c_i : X_{U_i} \to Y_i$ over $U_i$ where $Y_i \to U_i$ is a stable family of curves having properties (1) and (2) stated in the lemma. \medskip\noindent To finish the proof it suffices to prove uniqueness of $c : X \to Y$ (up to unique isomorphism). Namely, once this is done, then we obtain isomorphisms $$ \varphi_{ij} : Y_i \times_{U_i} (U_i \times_S U_j) \longrightarrow Y_i \times_{U_j} (U_i \times_S U_j) $$ satisfying the cocycle condition (by uniqueness) over $U_i \times U_j \times U_k$. Since $\overline{\mathcal{M}_g}$ is an algebraic stack, we have effectiveness of descent data and we obtain $Y \to S$. The morphisms $c_i$ descend to a morphism $c : X \to Y$ over $S$. Finally, properties (1) and (2) for $c$ are immediate from properties (1) and (2) for $c_i$. \medskip\noindent Finally, if $c_1 : X \to Y_i$, $i = 1, 2$ are two morphisms towards stably families of curves over $S$ satisfying (1) and (2), then we obtain a morphism $Y_1 \to Y_2$ compatible with $c_1$ and $c_2$ at least locally on $S$ by Lemma \ref{lemma-contract-basic}. We omit the verification that these morphisms are unique (hint: this follows from the fact that the scheme theoretic image of $c_1$ is $Y_1$). Hence these locally given morphisms glue and the proof is complete.