Let $M$ be a complex manifold, and $Z \subset M$ a closed real analytic subvariety. Suppose that the set of smooth points in $Z$ is complex analytic in $M$. Will it follow that $Z$ is complex analytic? I can deduce this statement from Remmert-Stein theorem when $2\dim\_R S < \dim\_R Z$, where $S$ is the singular set of $Z$. Also I can deduce this statement from Skoda-El Mir theorem when $S$ is pluripolar. I suspect that it should be true in bigger generality, maybe always.



Real analytic subvariety in complex manifold which is complex outside of its singular set
There is a paper by Hans-Jörg Reiffen called "Fastholomorphe Algebren" (1970) where he apparently proves something like this. [Here](https://link.springer.com/article/10.1007/BF01338660) is a link to the springer publication. I have not read the paper in detail so I can not really comment on the methods used there. Moreover, the paper is written entirely in german. The last highlighted statement in the appendix reads (translated to english by me):


"Let $G$ be a domain in $\mathbb{C}^N$ and $X\subseteq G$ a real analytic subset, which in the points of an open dense subset of $X$ is complex analytic, then $X$ is complex analytic."


**EDIT:** Below I have translated the statement 1' and 2' from the appendix of the mentioned paper. Apparently the above quoted statement is a corollary from these two facts, at least that is what the author of the paper states. In the paper the notation $R\_{\omega}$ denotes the ring of complex-valued real analytic functions.


**Satz 1'.** Let $X\_0$ be a germ of an irreducible real analytic set in $\mathbb{R}^N$. Then there exists a real analytic subgerm $S\_0$ of $X\_0$ with the following properties:


(a) $\mathrm{dim}X\_0> \mathrm{dim}S\_0$


(b) There exist representatives $X$ of $X\_0$ and $S$ of $S\_0$ in an open neighbourhood $U$ of $0$ such that for all $x\in X\setminus S$ the germ $X\_x$ is non-singular and $\mathrm{dim}X\_x= \mathrm{dim}S\_0$.


(c) If $f\_1,...,f\_n$ is a generating system of $J\_{\omega}(X\_0):=\left\{f\in R\_{\omega} : f\mid\_{X\_0}=0\right\}$, then the $f\_1,....,f\_n$ is a coherence basis on $X\_0\setminus S\_0$ (i.e. there exists an open neighbourhood $U$ of $0$ with representatives $X$ of $X\_0$ and $S$ of $S\_0$, such that the $f\_1,....,f\_n$ are defined on $U$ and for all $x\in X\setminus S$ the germs $(f\_1)\_x,...,(f\_n)\_x$ generate the ideal $J\_{\omega}(X\_x)$.)


**Satz 2'.** Let $X\_0$ be a germ of an irreducible real analytic set in the origin of $\mathbb{C}^N$. Further assume that there exists a set $Y$ in a representative $X$ of $X\_0$ with the following properties:


(a) $0$ is an accumulation point of $Y$.


(b) For $y\in Y$ one has $\mathrm{dim}X\_y=\mathrm{dim}X\_0$ and $X\_y$ is complex analytic.


Then $X\_0$ is complex analytic.


