# Prove $P \implies Q$ where $P$ and $Q$ are statements about rational numbers

My goal is to prove the following statement $\left(P\implies Q\right)$ in order to use it as a lemma in another proof.

Given, $$P = \left(z\in\Bbb Q \implies \exists \,p,q\in\Bbb Z:z\,=\,\frac pq\wedge q \ne 0 \right)$$ consider the following $$1+2z=x^2+y^2$$ $$y\;=\;\sqrt {\frac {q+2p}{q}-x^2}$$ on which we impose $$x\in(0,1)$$ $$y\in\Bbb [-1,1]$$ as the domain and range.

We claim $$Q\;=\;\left(x^2+y^2=\frac {q+2p}{q}\in\Bbb Q\implies x,y\in\Bbb Q:x\in(0,1)\wedge y\in\Bbb [-1,1]\right)$$ so we need to show that $$P\implies Q$$ is true.

So, since $P$ is true it is left to be shown that $Q$ is also true.

The converse of $Q$ is $$\left(Q \; converse \right)\,=\, \left(x,y\in\Bbb Q:x\in(0,1)\wedge y\in\Bbb [-1,1] \implies x^2+y^2=\frac {q+2p}{q}\in\Bbb Q\right)$$ thus, using a result from a previous question (proof about rational numbers),

$$\left(x,y\in\Bbb Q:x\in(0,1)\wedge y\in\Bbb [-1,1]\right) \implies \left(\exists\,p,q,r,s\in\Bbb Z: x=\frac pq \wedge y= \frac rs \wedge q,s \ne 0 \right)$$ $$\left(\exists p,q,r,s\in\Bbb Z: x=\frac pq \wedge y= \frac rs \wedge q,s \ne 0 \right)\implies\left( x^2+y^2=\frac {q+2p}{q}\in\Bbb Q\right)$$ $$\therefore \;\left(x,y\in\Bbb Q:x\in(0,1)\wedge y\in\Bbb [-1,1] \implies x^2+y^2=\frac {q+2p}{q}\in\Bbb Q\right)$$ Hence, $\left(Q \;converse\right)$ is true, by contrapositive and so, $Q$ is also true. $$\therefore\; P\implies Q$$

Is this correct?

• I don't see how you can deduce that $x, y \in \mathbb{Q}$ from Q's assumptions. – marty cohen Jan 28 '17 at 3:16
• Consider $x=\sqrt{3}, y=0, p=q=1$ for a counterexample. – dxiv Jan 28 '17 at 3:32
• Is this all junk or is there something there that I can use in order to show that $z\in \Bbb Q : 1+2z=x^2+y^2\implies x,y\in \Bbb Q$? – user409521 Jan 28 '17 at 3:41
• @TheStrikeofRunningWater Hard to guess what you are after, but in general knowing $x^2+y^2$ tells you nothing about the individual $x,y$. Maybe helps to think of it this way: there are uncountably many points on the unit circle such that $x^2+y^2=1$. But, out of them, only countably many have rational coordinates. – dxiv Jan 28 '17 at 3:48
• @TheStrikeofRunningWater Restricting the ranges won't help, since you can always scale $x,y \mapsto \lambda x, \lambda y$ with some rational factor. As for the rest, sorry, but I can't guess what you really have in mind, so I don't know whether the track is right or not (though, honestly, I don't see this one going anywhere). – dxiv Jan 28 '17 at 4:08

The comment by dxiv gives a counterexample to the statement in your question. In a comment, you mention that your main goal is to prove that if $z$ is rational and $1+2z=x^2+y^2$, then $x$ and $y$ are rational. This is also false: for instance, consider $z=1, x={\sqrt{3}\over 2}, y={\sqrt{3}\over 2}$. And there are many other examples.
You are conflating the converse and the contrapositive here. The converse of a statement $\alpha\implies\beta$ is the statement $\beta\implies \alpha$; the contrapositive, meanwhile, is the statement $\neg\beta\implies\neg\alpha$ (where "$\neg$" means "not").
The contrapositive is equivalent to the original statement; if you show that the contrapositive is true, you've shown that the original statement was true. However, the converse is not! For example, "If $c=3$ then $c$ is prime" is clearly true, but its converse - "If $c$ is prime then $c=3$" - is equally clearly false.
• I see what you mean about my confusion between converse and contrapositive. Also, doesn't the fact that I restricted the variables $x \in \left(0,1)\right)$ and $y\in \left[-1,1\right]$ mean I am avoiding the irrational cases? – user409521 Jan 28 '17 at 4:10
• @TheStrikeofRunningWater No, how would it? E.g. $\pi\over 4$ is irrational but in $(0, 1)$. – Noah Schweber Jan 28 '17 at 4:11