Argument of Zariski density to prove rationality of a regular map Question: I want to know if the following result  is correct: 
Let $k$ be a number field and $k_v$ be a completion of $k$ at some place $v$, denote $K_v$ an algebraic closure of $k_v$.
Proposition.(hypothetical) Suppose $f$ is a regular map $f: K_v^{n} \rightarrow K_v$, if there exists a subset $A \subset k^n$ which is Zariski dense in $K_{v}^n$ and such that $f(A)\subset k$. Then $f$ is defined over $k$. 
I doubt that such result is true for any field of characteristic zero (I know it is true after Zimmer prop 3.1.8 when $K$ is the algebraic closure of $k$ only). 
Thanks
 A: This is valid in any characteristic (over an infinite field) and has nothing to do with completions, and is a "relative schematic density" result.  It is a special case of EGA IV$_3$ 11.9.13, but it may not be immediately apparent why that is so. Hence, we give the entire proof of the affirmative answer below, going beyond the affine case to convey the geometric content (and because it is very useful beyond the affine case, to keep track of "fields of definition").
Let $k$ be an infinite field, and $K/k$ an arbitrary extension field.  Let $X$ and $Y$ be arbitrary $k$-schemes with $X$ reduced and $Y$ separated.  Assume a subset $\Sigma$ of $X(k)$ is Zariski-dense in $X$ (such as $\Sigma = X(k)$ with $X = \mathbf{A}^n_k$, or $\Sigma = X(k)$ with any generically smooth and reduced $X$ if $k$ is separably closed). 
We claim that if a $K$-morphism $f:X_K \rightarrow Y_K$ carries $\Sigma$ into $Y(k)$ then $f$ descends to a $k$-morphism $f_0:X \rightarrow Y$ (such an $f_0$ being unique if it exists, by descent theory).  The special case when $k = \overline{\mathbf{Q}}$, $K = \mathbf{C}$, and $\Sigma$ is a set of "special points" underlies considerations with fields of definition for Shimura varieties (and maps among them).
By fpqc descent theory, it suffices to show that the two pullback maps 
$$p_1^{\ast}(f), p_2^{\ast}(f): X_{K \otimes_k K} \rightrightarrows Y_{K \otimes_k K}$$
over $K \otimes_k K$ coincide. The subsets $p_1^{-1}(\Sigma)$ and $p_2^{-1}(\Sigma)$ in $X(K \otimes_k K)$ coincide since
the two evident composite maps
$$k \rightarrow K \rightrightarrows K \otimes_k K$$
coincide. Let $\Sigma' \subset X(K \otimes_k K)$ denote this subset.
For any point $x' \in \Sigma'$, the maps
$(p_i)^{\ast}(f)$ carry $x'$ to the same point in $Y(K \otimes_k K)$.
Indeed, for each $i \in \{1, 2\}$ we have $x' = p_i^{\ast}(\sigma_K)$ for some common $\sigma \in \Sigma \subset X(k) \subset X(K)$ (depending on $x'$), and by hypothesis $f(\sigma_K) = y(\sigma)_K$ for some $y(\sigma) \in Y(k)$, so 
$$((p_i)^{\ast}(f))(x') = p_i^{\ast}(f(\sigma_K)) = p_i^{\ast}(y(\sigma)_K) = y(\sigma)_{K \otimes_k K}$$
for both values of $i$.
We are now reduced to showing that if two maps $F_1, F_2: X_{K \otimes_k K} \rightrightarrows Y_{K \otimes_k K}$ over $K \otimes_k K$ 
coincide on the subset
$\Sigma'$ of $X(K \otimes_k K)$ then these maps agree.  It is the same to show that if the restriction to any point in $\Sigma'$ of 
the associated $K \otimes_k K$-map 
$$F:X_{K \otimes_k K} \stackrel{(F_1,F_2)}{\longrightarrow}
Y_{K \otimes_k K} \times_{{\rm{Spec}}(K \otimes_k K)} Y_{K \otimes_k K} = 
(Y \times_{{\rm{Spec}}(k)} Y)_{K \otimes_k K}$$
factors through the diagonal
$$\Delta_{Y_{K \otimes_k K}/K \otimes_k K} = (\Delta_{Y/k})_{K \otimes_k K}$$
then $F$ factors through that diagonal.
But recall that $Y$ is separated, so $\Delta_{Y/k}$ is a closed immersion.  Hence, the $F$-preimage of the diagonal of $Y_{K \otimes_k K}$ is a closed subscheme of $X_{K \otimes_k K}$, and so our task is reduced to showing that if $Z$ is an arbitrary closed subscheme of $X_{K \otimes_k K}$ through which all points in $\Sigma'$ factor then $Z = X_{K \otimes_k K}$.  Now $Y$ and $f$ have dropped out of the picture (e.g., the definition of $\Sigma'$ had nothing to do with $Y$ or $f$). 
We may now work Zariski-locally on $X$, so finally $X$ is affine, say $X = {\rm{Spec}}(A)$ for a $k$-algebra $A$.  Hence, $\Sigma$ is a collection of ideals $\{\mathfrak{m}_{\sigma}\}_{\sigma \in \Sigma}$ of $A$ for which $A/\mathfrak{m}_{\sigma} = k$ as $k$-algebras, and since $X$ is reduced the Zariski-density of $\Sigma$ in $X$ says exactly that
$$\bigcap_{\sigma \in \Sigma} \mathfrak{m}_{\sigma} = 0.$$
The closed subscheme $Z$ is defined by an ideal $J$ in $A_{K \otimes_k K}$, and we want to show $J=0$. By hypothesis any element $a' \in J$ vanishes under specialization at $K \otimes_k K$-points arising from $\Sigma$, which is to say $a' \in \mathfrak{m}_{\sigma} \otimes_k (K \otimes_k K)$ for all $\sigma \in \Sigma$.
Proving $J=0$ is therefore reduced to showing that 
$$\bigcap_{\sigma \in \Sigma} (\mathfrak{m}_{\sigma} \otimes_k (K \otimes_k K)) \stackrel{?}{=} 0$$
inside $A \otimes_k (K \otimes_k K)$.
Finally, we are brought down to a problem entirely in linear algebra:
if $V$ and $W$ are arbitrary vector spaces over field $k$
(e.g., $V = A$, $W = K \otimes_k K$) and if $\{V_i\}$ is a collection of subspaces of $V$ such that $\cap_i V_i = 0$, then
$\cap_i (V_i \otimes_k W) = 0$ inside $V \otimes_k W$.  This
has (a bit of) content since $W$ may be infinite-dimensional over $k$
and $\{V_i\}$ may be a collection of infinitely many subspaces.
Suppose to the contrary that there exists a nonzero
$\xi \in \cap_i (V_i \otimes_k W)$. By using a $k$-basis of $W$, we can pick a linear functional $\ell:W \rightarrow k$ such that ${\rm{id}}_V  \otimes \ell: V \otimes_k W \rightarrow V$
does not kill $\xi$.  But this map carries each $V_i \otimes_k W$ into $V_i$, so it carries $\xi$ into $\cap_i V_i$.  This contradicts the hypothesis that $\cap_i V_i = 0$.
QED
A: You should clarify what you mean by a regular map. I'll take it to mean that $f$ is given by a polynomial with coefficients in $K_{\nu}$. Let $F$ be the field extension of $k$ generated by the coefficients of $f$. If $F/k$ is transcendental, there exists a non-trivial derivation $\delta$ of $F/k$ and so $\delta$ does not annihilate all coefficients of $f$, i.e. the polynomial $f^{\delta}$ obtained by applying $\delta$ to the coefficients of $f$ is non-zero. Now, applying $\delta$ to the equations $f(a) = c, a \in A, c \in k$ yields $f^{\delta}(a) = 0, a \in A$. So $A$ is not Zariski dense. Thus $F/k$ is algebraic and you can conclude by the result you quote that $f$ is defined over $k$.
A: To Felipe Thank you very much for your nice answer. 
(By regular function I meant a continous function for the Zariski topology, so our definition coincides). 
To nfdc, thank you very much for your extremely detailled answer,I never expected that such result could be proved in a so high degree of generality. I am not comfortable at all with schemes but you convince me that it is the most natural way to treat questions about rationality. I find your claim clearer than my proposition below....The fact that Zariski density is equivalent to the cancellation of the products of the $m_{\sigma}$'s for affine reduced scheme is cleary hidden in classical algebraic geometry. 
