Is there any theorem like implicit function theorem in $\mathbb{Q}$ ? My qeustion is that,
is there any theorem like implicit function theorem in $\mathbb{Q}$ ?
More precisely, let $p(\bar{x},\bar{y})$ be in $\mathbb{Z}[\bar{x},\bar{y}]$ such that in $\mathbb{Q}$, for any $\bar{a}$, there is a solution of $p(\bar{x},\bar{a})$. Then for some polynomial(or rational polynomial) $q(\bar{y})$ with $\mathbb{Q}$ coefficients, $p(q(\bar{y}),\bar{y})=0$ holds in the rational polynomial fields over $\mathbb{Q}$.
For example, $x^2+y^2=1$ does not satisfy the condition
but for $x+y=0$ it holds.
And how about the same question in p-adic field $\mathbb{Q}_{p}$?
 A: Here's what I think happens over $\mathbb{Q}$. Write your polynomial $P(X,Y)$ as a product of irreducible polynomials $P_i(X,Y)$. Hilbert's irreducibility theorem ( http://en.wikipedia.org/wiki/Hilbert%27s_irreducibility_theorem ) tells you that there are infinitely many $a$'s such that $P_i(X,a)$ is irreducible for every $i$. If one of them has a solution, it is therefore of degree $1$ in $X$. Some $P_i$ is therefore of degree $1$ in $X$, which answers your question.
EDIT: it does not answer the question but rather shows that there is some polynomial $Q$ such that $P(Q(Y),Y)=0$ which is more reasonable, since then $P(Q(a)),a)=0$. This should have been the question.
A: The same question in $\mathbb Q_p$ is false. For instance, if $p \neq 2$, let $\alpha \in \mu_{p-1}$ be a primitive root of unity. Then $(x^2-y)(x^2-py)(x^2-\alpha y)(x^2-p \alpha y)$ has a solution for each $y$, but you cannot make that solution a polynomial in $y$.
A: Look up Hensel's lemma. E.g., in the following form ($K$ is a field, without further assumptions):
Let $f \in K[[X]][Y]$ be monic and such that $f(0,Y)=p(Y)q(Y)$, where $p(Y),q(Y) \in K[Y]$ are relatively prime and non-constant, of degrees respectively $r$ and $s$. Then there exist two uniquely determined polynomials $g,h \in K[[X]][Y]$, of degrees respectively $r$ and $s$, such that $f=gh$, with $g(0,Y)=p(Y)$ and $h(0,Y)=q(Y)$.
(after Hefez, Abramo: Irreducible plane curve singularities. Real and complex singularities, 1–120, Lecture Notes in Pure and Appl. Math., 232, Dekker, New York, 2003) 
More information, including the $p$-adic version, can be found here:
An unfamiliar (to me) form of Hensel's Lemma
(especially Wanderer's answer).
