I'm taking an introduction to discrete math course and I'm having some trouble with this homework problem. I think we're supposed to assume that the coefficients are integers based on other examples we've been given and if they are I think I understand how to prove this "informally" as if I have the equation:
$$ ax^2 + bx + c = 0 $$
Then I can say
$$ ax^2 + bx + c = (px - r)(qx - s) $$
so it seems like $b = - qr - ps$ and so:
$$ r = \frac{-b -ps}{q}\\ \text{and} \\ s = \frac{-b -qr}{p} $$
So if either r or s are rational then both must be rational. So my question is, is my proof even valid and secondly, how could I write this more "formally"? We're supposed to write our proof in this style (this is unrelated to this problem, I'm just showing this example of style):
$$ \textbf{Theorem:}\\ \forall m,n \in \mathbb{Z}, (m ~\equiv~ 0(mod ~2)) ~\wedge~ (n ~\equiv~ 0(mod ~2)) ~\rightarrow~ (m + n) ~\equiv~ 0(mod ~2)\\ \begin{array}{| c || l | l |} \hline \textbf{Step} & \textbf{Derivation} & \textbf{Justification} \\ \hline 1 & m,n ~\in~ \mathbb{Z} ~\equiv~ 0(mod ~2) & \text{Select generic particulars} \\ \hline 2 & \exists r ~\in~ \mathbb{Z} ~\mid~ m = 2 \cdot r & \text{Definition of} \equiv ~0(mod ~2) \\ \hline 3 & \exists s ~\in~ \mathbb{Z} ~\mid~ n = 2 \cdot s & \text{Definition of} \equiv ~0(mod ~2) \\ \hline 4 & m + n ~=~ 2 \cdot r ~+~ 2 \cdot s & \text{Substitution} \\ \hline 5 & m + n ~=~ 2 \cdot (r + s) & \text{Distributive property} \\ \hline 6 & 2 \cdot (r + s) ~\in~ \mathbb{Z} & \text{Closure of } \mathbb{Z} \text{ on} \cdot and + \\ \hline 7 & \therefore m + n ~\equiv~ 0(mod ~2)$ & \text{Definition of} \equiv ~0(mod ~2) \\ \hline \end{array} $$
I really have no idea how to even state the theorem in formal terms. All the other problems are stated more formally and I guess I don't get how to write "for the two possible answers of a quadratic equation" as part of a formal universal statement. The furthest I've come so far is:
$$ \forall a,b,c \in \mathbb{Z}, x \in \mathbb{R}, ax^2 + bx + c = 0 \land \text{one of the roots } \in \mathbb{Q} \rightarrow \text{the other root} \in \mathbb{Q} $$
But I need to replace the English text with the actual correct symbols. I'm also not completely sure how to write the justifications for what I did above, it's been 10 years since I've taken any sort of math class and I don't really remember the names for a lot of stuff.