# Flatness of direct image sheaf over local artinian ring

Let $$\pi:X \to \mbox{Spec}(\mathbb{C}[t]/(t^2))$$ be a smooth, projective morphism and $$L$$ be an invertible sheaf on $$X$$. Denote by $$L_0$$ the restriction of $$L$$ to the closed fiber, say $$X_0$$ of $$\pi$$. Suppose that the natural morphism $$H^0(L) \to H^0(L_0)$$ is surjective. Can we conclude that $$\pi_*L$$ is flat over $$\mbox{Spec}(\mathbb{C}[t]/(t^2))$$?

This follows easily from the theory of modules over $$R = \mathbb C[t]/(t^2)$$. Indeed, we have a short exact sequence $$0 \to H^0(\mathscr L_0) \to H^0(\mathscr L) \to H^0(\mathscr L_0) \to 0,$$ induced by the observation that $$(t) \cong R/(t)$$ and your assumption that the map $$H^0(\mathscr L) \to H^0(\mathscr L_0)$$ is surjective. Now we have the following lemma.
Lemma. Let $$0 \to N \stackrel f\to M \stackrel g\to N \to 0$$ be a short exact sequence of finitely generated $$R$$-modules, and assume that $$fg \colon M \to M$$ is multiplication by $$t$$. Then $$M$$ is free and $$N = tM \cong M/tM$$.
Proof. Because $$N \stackrel f\to M \stackrel g\to N$$ is exact, $$M \stackrel g\to N$$ is surjective, and $$N \stackrel f\to M$$ is injective, the sequence $$M \stackrel{fg} \longrightarrow M \stackrel{fg}\longrightarrow M\tag{1}\label{1}$$ is exact. But we also have $$fg = t$$. From the structure theory of $$R$$-modules, we may write $$M \cong R^m \oplus (R/(t))^n$$ for some $$m,n \in \mathbb Z_{\geq 0}$$. If $$n > 0$$, then any nonzero element in $$(R/(t))^n$$ is killed by $$t$$ but not in the image of $$t$$, contradicting exactness of (\ref{1}). We conclude that $$n = 0$$, so $$M$$ is free. The final statement follows since $$N = \operatorname{im}(fg) = tM$$. $$\square$$
$$\newcommand{\C}{\mathbb{C}}\newcommand{\D}{\C[t]/t^2}\newcommand{\im}{\mathrm{im}\,}$$A module $$M$$ over $$\D$$ is flat if and only if the inclusion $$(t)\subset \D$$ remains injective after tensoring with $$M$$ over $$\D$$. In other words, the map $$M/tM\xrightarrow{t} M$$ is injective which is equivalent to saying that the inclusion $$\im (M\xrightarrow{t} M)\subset \ker\, (M\xrightarrow{t} M)$$ is equality. If $$M$$ is finite-dimensional as a $$\C$$-vector space, then this condition is equivalent to $$\dim\im t=\dim\ker t=\dim M-\dim \im t$$ which can be rephrased as $$\dim\im t=\frac{1}{2}\dim M$$(for a non-flat module the LHS is strictly smaller).
(All of the above is more or less tautological since any finitely generated module over $$\D$$ is a direct sum of some number of copies of $$\C$$ and a few copies of $$\D$$ and a module is flat iff it is free)
Denote by $$i:X_0\to X$$ the immersion of the closed fiber. we have an exact sequence of sheaves on $$X$$ $$0\to L\otimes_{\D} \C\xrightarrow{t} L\to L\otimes_{\D}\C\to 0$$ which can be rewritten as $$0\to i_*L_0\to L\to i_*L_0\to 0$$ Applying $$\pi_*$$ we get a sequence of $$\D$$-modules which is in general not necessarily exact on the right, but you're assuming it is $$0\to\pi_*i_*L_0\to\pi_*L\to\pi_*i_*L_0\to 0$$ Since $$\pi$$ is projective, $$\pi_*L$$ is a finitely generated $$\D$$-module and from the exact sequence we see that $$\dim_{\C} \pi_*L=2\dim H^0(L_0)$$. A priori, this exact sequence doesn't imply that $$\pi_*L$$ is flat, but let's recall the meaning of the arrow $$\pi_*i_*L_0\to\pi_*L$$. Consider multiplication by $$t$$ as an endomorphism of $$L$$. Since $$L$$ is flat over $$\D$$, it factors as $$L\twoheadrightarrow i_*L_0\hookrightarrow L$$ Taking global sections and using your assumption again, we get $$H^0(L_0)\subset\im (\pi_*L\xrightarrow{t}\pi_*L)$$ an this implies the desired equality $$\dim\im t=\frac{1}{2}\dim \pi_*L$$