Solution (source code)

= Solution

Assume $X$ is a connected <compact Riemann surface> of <geometric genus> $g\ge1$. Work first in $\operatorname{Pic}^{g-1}(X)$, translating back to the <Jacobian variety> by tensoring with $\mathcal O_X(-(g-1)p_0)$ when desired. Put
$$
\Theta=W_{g-1}=\{L:\deg L=g-1,\ h^0(X,L)>0\}.
$$
This is the image of the <Abelian sum map> from $X^{(g-1)}$. The <Riemann singularity theorem> asserts that this image is a reduced <Cartier divisor> and that
$$
\boxed{\operatorname{mult}_L\Theta=h^0(X,L).}
$$
Here multiplicity means the order of a local defining equation in the <maximal ideal> of the smooth ambient <Jacobian variety>. Consequently \b[the singular points are precisely the classes with at least two independent sections]. We will prove the multiplicity equality, including the nonvanishing of its proposed leading term.

Choose an effective <divisor> $E$ of degree $n\ge g$, and a local holomorphic family $\mathcal L$ of degree-$g-1$ <line bundles> about $L$ on $X\times U$, where $U$ is a small neighborhood in $\operatorname{Pic}^{g-1}(X)$. Such a family is obtained by varying the <Čech cocycles> of a <line bundle>. Since $\deg L'(E)>2g-2$ for all $L'\in U$, <Serre duality> gives $H^1(L'(E))=0$; the <Riemann-Roch theorem> gives $h^0(L'(E))=n$. The <cohomology and base change for line bundles on a curve> then identifies
$$
A=\pi_*\mathcal L(E),\qquad B=\pi_*(\mathcal L(E)|_E)
$$
as <vector bundles> of rank $n$. Evaluation defines a <matrix> $M:A\to B$. For each $L'$, its exact sequence is
$$
0\longrightarrow H^0(L')\longrightarrow A_{L'}\xrightarrow{M(L')}B_{L'}\longrightarrow H^1(L')\longrightarrow0.
$$
Thus $f=\det M$ vanishes exactly on $\Theta$.

The function $f$ is not identically zero. To exhibit a degree-$g-1$ <line bundle> with no section, choose $g$ distinct points $p_1,\ldots,p_g$ giving independent evaluation functionals on $H^0(K_X)$. Such points can be chosen successively because a nonzero <holomorphic differential form> cannot vanish everywhere. For $F=\sum p_i$, the <Riemann-Roch theorem> gives $h^0(\mathcal O_X(F))=1$. Choose $q$ outside $F$. The unique section of $\mathcal O_X(F)$ does not vanish at $q$, so $\mathcal O_X(F-q)$ has no section. Therefore the evaluation <determinant> genuinely cuts out a hypersurface. Its support is irreducible, since it is the image of the irreducible <symmetric product of a curve> $X^{(g-1)}$.

Fix now $L\in\Theta$, and put $r=h^0(L)=h^1(L)$, the equality following from the <Riemann-Roch theorem>. The <matrix> $M(L)$ has an invertible $(n-r)$ by $(n-r)$ block. After invertible holomorphic row and column operations, its local form is
$$
\begin{pmatrix}I_{n-r}&0\\0&N(x)\end{pmatrix},\qquad N(0)=0,
$$
where $N$ is $r$ by $r$. More explicitly, eliminate the invertible block by its <Schur complement>; the discarded <determinant> is a holomorphic unit. Hence $f$ is a unit times $\det N$. Every entry of $N$ lies in the <maximal ideal>, so its order is at least $r$.

The linear term of $N$ is the cup-product map
$$
N_1(\xi):H^0(L)\longrightarrow H^1(L),\qquad s\longmapsto\xi\smile s,\quad\xi\in H^1(\mathcal O_X).
$$
To verify this, deform the transition functions as $g_{ij}(1+\varepsilon\xi_{ij})$ and try to lift a section $s$ to $s+\varepsilon s'$. Its first-order gluing equation has right side $\xi_{ij}s_j$, whose <Čech cohomology> class is exactly the obstruction to the lift. The kernel-to-cokernel derivative of the evaluation <matrix> gives that same obstruction. Under <Serre duality>, if $s_1,\ldots,s_r$ and $t_1,\ldots,t_r$ are bases of $H^0(L)$ and $H^0(K_X\otimes L^{-1})$, then
$$
(N_1(\xi))_{ji}=\langle\xi,s_it_j\rangle.
$$
We must show that this <matrix> is invertible for some $\xi$; otherwise the lower bound on multiplicity would not be an equality.

For each of these two $r$-dimensional section spaces, there are $r$ distinct points with independent evaluations. Choose them successively, using a section in the remaining kernel to find the next point. The set of such $r$-tuples is a nonempty open subset of $X^r$. The two open sets intersect because $X^r$ is irreducible, and we may avoid their diagonals. Choose $q_1,\ldots,q_r$ in that intersection and trivialize $L$ and $K_X$ there. Both <matrices>
$$
S_{ki}=s_i(q_k),\qquad T_{kj}=t_j(q_k)
$$
are invertible. Let $\xi\in H^0(K_X)^*=H^1(\mathcal O_X)$ be the sum of the evaluation functionals at these points, with any nonzero weights $c_k$. Then
$$
N_1(\xi)=T^t\operatorname{diag}(c_1,\ldots,c_r)S
$$
is invertible. It follows that the degree-$r$ polynomial $\det N_1$ is nonzero, so $\operatorname{ord}_L f=r$. This proves the needed <invertible cup-product direction for a line bundle on a curve> by an explicit construction.

We still need to identify this <determinant> hypersurface with the reduced image, rather than a multiple of it. Choose $g-1$ distinct points imposing independent conditions on $H^0(K_X)$. For their sum $D$, the <Riemann-Roch theorem> gives $h^0(D)=h^0(K_X-D)=1$. At its class, the calculation above gives order one. The <determinant> hypersurface has irreducible support, so its sole <divisor on an algebraic curve> coefficient is one everywhere. A local hypersurface in a smooth space with these <divisor on an algebraic curve> coefficients is reduced. Thus it is exactly the reduced image $W_{g-1}$, and the multiplicity formula holds for that image itself.

The argument gives the useful additional description
$$
\boxed{\text{the tangent cone at }L\text{ is defined by }\det(\xi\smile-)=0.}
$$
For $r=1$, its nonzero linear equation is $\langle\xi,st\rangle=0$. This agrees with the <derivative of the Abelian sum map>: if $\operatorname{div}(s)=D$, then $st$ is the unique <holomorphic differential form> vanishing along $D$. For $r\ge2$, the local equation has no linear term and the point is singular. When $g=1$, $W_0$ is the single trivial <line bundle> in $\operatorname{Pic}^0(X)$, with multiplicity one; the argument includes this case using the empty effective <divisor>. In genus zero there is no $W_{g-1}$ of effective <divisors on an algebraic curve>, so that hypothesis is necessary.