Integral locus of Hitchin morphism Let $\Sigma$ be a Riemann surface of genus $g$. To it, we can associated $M_{Dol}$ be the Higgs moduli space of rank $n$ and degree $d$. Fo simplicity let us take $(n,d)=1$. This quasiprojective variety admits a morphism $$h:M_{Dol}\rightarrow \bigoplus_{i=0}^nH^0(\Sigma,\Omega^i_{\Sigma})=A_n $$ where $\Omega^1_{\Sigma}$ is the usual sheaf of differentials.
Moreover, to each element $x \in \bigoplus_{i=0}^nH^0(\Sigma,\Omega^i_{\Sigma})$ we can associated a so called spectral curve $$C_x \rightarrow C$$ and the fiber of $h$ are related to torsion free sheaves over such a curve.
I've read in lots of articles that the so called elliptic locus $A_{n,ell}$ given by $x$ such that $C_x$ is integral is open and of big codimension. Does anyone know a simple proof of the openness part? Also, is there any explicit bound for the codimension?
 A: To get the codimension, if the curve corresponding to $x = (x_i \in H^0 (\Sigma, \Omega_\Sigma^i))_{i=1}^n$ fails to be integral, then the equation $T^n - x_1 T^{n-1} + x_2 T^{n-2} + \dots $ defining the curve splits as a product of two such equations, say $T^k - y_1 T^{k-1} + \dots  + (-1)^k y_k $ and $T^{n-k} - z_1 T^{n-k-1} + \dots + (-1)^{n-k} z_{n-k}$.  We have $y_i, z_i \in H^0 ( \Sigma, \Omega_{\Sigma}^i))$ so the dimension of the locus where this occurs is
$$ \sum_{i=1}^k \dim H^0 ( \Sigma, \Omega_{\Sigma}^i) + \sum_{i=1}^{n-k} \dim H^0 ( \Sigma, \Omega_{\Sigma}^i) = k^2 (g-1) +1 + (n-k)^2 (g-1) + 1$$ and since the total dimension of the Hitchin base is $n^2 (g-1) +1$, the codimension is $$ (n^2 - k^2 - (n-k)^2)(g-1) -1 = 2 k (n-k) (g-1) -1$$ which is minimized with $k=1$ or $k=n-1$, giving a total codimension of $2 (n-1) (g-1)-1$.
We can also use this factorization to check that the non-integral locus is closed. It is the union over $k$ of the image of the map from $\prod_{i=1}^k H^0 ( \Sigma, \Omega_{\Sigma}^i)) \times \prod_{i=1}^{n-k} H^0 ( \Sigma, \Omega_{\Sigma}^i))$ that sends $y_1,\dots, y_k, z_1,\dots, z_{n-k}$ to $$(T^k - y_1 T^{k-1} + \dots  + (-1)^k y_k ) (T^{n-k} - z_1 T^{n-k-1} + \dots + (-1)^{n-k} z_{n-k}).$$ It suffices to check that this map is proper, from which it follows that the image is closed.
In fact, it is finite, because the $y_1,\dots, y_k, z_1,\dots, z_{n-k} $ all satisfy monic polynomial equations with coefficients polynomials in $x_1,\dots, x_n$. Indeed, we can express the $y_1, \dots , y_k$ formally as polynomials  in the roots of $T^n - x_1 T^{n-1} + x_2 T^{n-2} + \dots $, and the roots certainly satisfy a monic equation, so any polynomial in the roots does as well.
