So I have to translate the following definition of rational number into logical expression.
The real number r is rational if there exist integers p and q with q = 0 such that r = p/q.
I have come up with the following $$r∈ℝ,(∃p∧∃q∧p∈ℤ∧q∈ℤ∧q≠0 \rightarrow r=\frac pq)\rightarrow r∈ℚ$$. Is this right? If not what adjustments do I need to make?
(Answer to the original post.) It is not right, even if we add that $p$ and $q$ are integers. Let $r=\sqrt{2}$ and pick $q=0$, and $p$ say $1$. Then the first implication is true, so we conclude that $\sqrt{2}$ is rational.
Added: Here is a semi-formal version. $$(\forall r\in \mathbb{R})[(\exists p)(\exists q)((p\in \mathbb{Z})\land (q\in\mathbb{Z})\land (q\ne 0)\land (r=p/q))\implies r\in \mathbb{Q}].$$.