I read on MO that if an integer $a$ is a square mod $p$ for sufficiently large primes $p$, then $a$ is a square. Now that's a statement that looks awfully like a Lefschetz-principle-type statement; and so I'm wondering whether there'd be a model-theoretic proof.
It could start as follow: fix such an $a$; let $T$ be a theory looking like the theory of rings + $\exists x, (x^2 = 1+...+1) \land P(x)$ (there are $a$ $1$'s) + for all $p$, $char \neq p$; where $P$ is a nice formula expressing something that looks like "$x$ is an integer".
One reason this might work is that for instance $\mathbb{N}$ is definable in $(\mathbb{Q},+,\times)$, and so we may expect that such a "nice" formula $P$ may exist. With a bit of luck, using compactness would then allow us to conclude.
Of course I haven't done much here, I just threw a bunch of ideas but it's mostly because I don't see how to do better for the moment.
So my question is :
Is there a known model-theoretic proof of this fact? Has one ever been attempted ? Are there number-theoretic obstructions to the existence of such a proof ? (like for instance "this theorem implies such and such deep theorems that for some reason are essentially number-theoretic")
I don't believe this can work. It is hard to prove that something can't be done, but here is what persuaded me: For every prime $p$, we can solve $x^2+y^2 \equiv -1 \bmod p$, but there is no solution to $x^2+y^2 = -1$ in the integers.
To give an example that uses only one variable, for all primes $p$, we can solve $(z^2-2)(z^2-3)(z^2-6) \equiv 0 \bmod p$, but we can't solve $(z^2-2)(z^2-3)(z^2-6) =0$ in the integers.
So there is no logical principle that let us go from $\forall_p \exists_{x,y} \ (\mbox{polynomial relation}) \bmod p$ to $\exists_{x,y} \ (\mbox{same polynomial relation})$ in the integers. You have to use some special properties of the quadratic polynomial in question, and that strikes me as too specific for model theory.
Proof of the statement that $x^2+y^2 \equiv -1 \bmod p$ is solvable: Clear for $p=2$, so we focus on $p$ odd. The function $x^2+1$ takes $(p+1)/2$ distinct values, and $-y^2$ does as well, so by the pigeonhole principle, we can solve $x^2+1 \equiv -y^2 \bmod p$.
Proof of the statement that $(z^2-2)(z^2-3)(z^2-6) \equiv 0 \bmod p$ is solvable: Clear for $p=2$ or $3$. For $p$ larger than that, note that $$\left( \frac{2}{p} \right) \left( \frac{3}{p} \right) \left( \frac{6}{p} \right) = \left( \frac{36}{p} \right) =1$$ so the residue symbols on the left hand side cannot all be $-1$.