# A number $a$ is a square in $\mathbf{Q}$ if and only if it is a square in $\mathbf{R}$ and $\mathbf{Q}_p$ for all primes $p$

Problem from Schikhof's Ultrametric Calculus.

As I understand it, the intersection of $\mathbf{R}$ and all $\mathbf{Q}_p$ is just $\mathbf{Q},$ so it seems that $x^2-a$ having a zero in $\mathbf{Q}$ implies that $\sqrt{a}\in\mathbf{R}$ and $\mathbf{Q}_p$ for all primes $p.$ And on the other hand, if $\sqrt{a}\in\mathbf{R}$ and $\mathbf{Q}_p$ for all $p,$ then in particular it is in their intersection, which implies $\sqrt{a}\in\mathbf{Q}.$

But this seems like such a trivial proof that I feel like I've misunderstood what is really going on, because it suggests a more general principle that a polynomial has a rational zero if and only if it has a real zero and a $p$-adic zero for any prime $p.$ In that case, why should the question have been specifically about squares?

Hoping someone can correct or verify what is going on here.

• $\mathbb{Q}$ is a subfield of $\mathbb{R}$ and $\mathbb{Q}_p$, so it makes sense that a square in $\mathbb{Q}$ is a square in the others. But what is it supposed to mean that $\mathbb{Q}$ is the "intersection" of these fields? This doesn't sound like it can be made into a meaningful statement very easily. – Slade May 19 '16 at 8:49
• By 'intersection' I mean 'the elements which are in each of these fields'. In your words '$\mathbf{Q}$ is a subfield of $\mathbf{R}$ and $\mathbf{Q}_p$'. – Hobbyist May 19 '16 at 8:51
• "$\mathbb{Q}$ is a subfield of $\mathbb{R}$" is really shorthand for "there is a canonical injective morphism of fields $\mathbb{Q}\to\mathbb{R}$." For reasons I have tried to convey in my other comment, it is not wise to think of these things as naked sets, because your answers will depend on specifics of your set-theoretic constructions, rather than properties of your objects. Of course you can think of $\mathbb{Q}$ as being literally a subset of $\mathbb{R}$, but that had better be your definition of $\mathbb{Q}$, which may exclude it from also being a subset of $\mathbb{Q}_p$. – Slade May 19 '16 at 9:04
• A more precise way of phrasing that would read: both $\bf{R}$ and $\bf{Q}_p$ have (canonical even) subfields that are isomorphic to $\bf{Q}$ (by a unique isomorphism). Unfortunately that is not enough to form the intersection. Up to isomorphism is not enough. For example, all the fields $\bf{Q}_p$ and $\bf{R}$ also contain transcendental elements. So they have even bigger "shared" isomorphic subfields. Granted, those are no longer unique, but may be you see the problem. Also, the elements called $\sqrt2$ in, say $\bf{R}$ and $\bf{Q}_7$, are in no way the same object. – Jyrki Lahtonen May 19 '16 at 9:06
• Jyrki Lahtonen, that makes sense to me, thanks. I didn't realise that 'up to isomorphism' wasn't enough, which was how I was thinking of it. Thanks Slade also. – Hobbyist May 19 '16 at 9:15

It doesn't make sense to consider the intersection of all of the $\mathbb Q_p$, since they are not all contained in some bigger field. In fact, the result is false in general! For example the polynomial $$3X^3+4X^3+5Y^3$$ has a root in $\mathbb R$ and $\mathbb Q_p$ for all $p$, but not in $\mathbb Q$.

In this case if $a$ is not a square in $\mathbb Q$, either $a$ is negative, in which case it has no solutions in $\mathbb R$, or without loss of generality, by replacing $X$ with $pX$ as necessary, we can assume that $a$ is square free. So $X^2-a$ is Eisenstein for any $p\mid a$.

• Why doesn't it make sense to consider what elements two sets have in common even if they aren't subsets of some other set? And in case someone is tempted to say "it's not defined" can they instead say why we would not allow such a definition? – Hobbyist May 19 '16 at 8:49
• This is exactly the proof I was about to post. There is one small omission, though: it is possible that $a=-1$ after factoring out squares, so we have to look at $\mathbb{R}$ as well. – Slade May 19 '16 at 8:54
• There might be some set theoretic way to take their intersection, but it won't be at all nice. Different $p$-adic structures are completely incompatible. How would you define the intersection field theoretically? Usually, $A\cap B=\{x\in A\cdot B:x\in A\text{ and }x\in B\}$. Since there is no way of composing two of the $\mathbb Q_p$ to make a new field, there's no field theoretic way of taking their intersection. – Mathmo123 May 19 '16 at 8:54
• @Hobbyist How would you compute $\mathbb{Z}\cap\mathbb{Q}$ without doing so inside an ambient set? $\mathbb{Q}$ is usually defined as a set of equivalence classes of fractions. But no element in $\mathbb{Z}$ is a fraction (according to usual definitions), so $\mathbb{Z}\cap\mathbb{Q}=\emptyset$. You will get seriously strange answers like this if you try to compute intersections without some ambient structure. – Slade May 19 '16 at 8:59
• Eisenstein's theorem works more generally: if $f(X)$ is a monic polynomial such that $p$ divides all its coefficients and $p^2$ does not divide the constant term (so $f$ is "Eisenstein at $p$"), then $f$ is irreducible in $\mathbb Q_p$. – Mathmo123 May 19 '16 at 11:14

Another argument, which some people may like better:

If a rational is a square, then certainly it’s a square in every $\Bbb Q_p$. It’s the converse that’s interesting. Any rational $\lambda$ has a unique representation $\lambda=(-1)^\varepsilon\prod_pp^{v_p(\lambda)}$, where $\varepsilon$ is $0$ or $1$, and the (finite) product over all primes has the exponents $v_p(\lambda)=$ the $p$-order of $\lambda$. Any square in $\Bbb Q_p$ has even $p$-order, so every exponent in the product above is even, and $\varepsilon=0$ to give a positive rational, necessary for it to be a square in $\Bbb R$. And that does it.