AbstractLet $$f :X \rightarrow \mathbb {R}$$
f
:
X
→
R
be a function defined on a nonsingular real algebraic set X of dimension at least 3. We prove that f is an analytic (resp. a Nash) function whenever the restriction $$f|_{S}$$
f
|
S
is an analytic (resp. a Nash) function for every nonsingular algebraic surface $$S \subset X$$
S
⊂
X
whose each connected component is homeomorphic to the unit 2-sphere. Furthermore, the surfaces S can be replaced by compact nonsingular algebraic curves in X, provided that dim$$X \ge 2$$
X
≥
2
and f is of class $$\mathcal {C}^{\infty }$$
C
∞
.