Could someone please explain how to develop a proof and the reasoning behind the following:
My professor said that to determine if a function is well-defined, we check to see if equivalent elements map to equivalent elements.
1) f : Q -> Q by f(p,q) = (2p + q) / 2q. Given: (p1,q1) ~ (p2,q2) => p1q2 = q1p2.
His proof went along something like this:
f(p1, q1) = f(p2, q2)
=> (4 * q1 * p2) + (2 * q1 * q2) = (4 * q1 * p2) + (2 * q1 * q2) (LINE 1)
=> (4 * p1 * q2) + (2 * q1 * q2) = (4 * q2 * p2) + (2 * q1 * q2)
=> (2 * p1 + q1) / (2 * q1) ~ (2 * p2 + q1) / (2 * q2)
Q.E.D
I don't understand how he got what I labeled as line 1. Did he input (p1, q1) and (p2,q2) into the function and then cross-multiply? If so, shouldn't it have been (4 * p1 * q2) + (2 * q1 * q2) = (4 * p2 * q1) + (2 * q1 * q2)?
Another question. My book says that the following function is NOT well defined:
g: Q -> Q by g(m/n) = m + n. The example is g(1/2) = 3 but g(2/4) = 6.
This is NOT well defined because 3 is not equivalent to 6 right and because (1,2) and (2,4) are equivalent, so we expect to get equivalent outputs, right?
For part 1), I don't understand the proof either. What you want to show is that if $(p_1,q_1) \sim (p_2,q_2)$ (with $q_1, q_2\ne 0$) then $f(p_1,q_1) = f(p_2,q_2)$. But \begin{align*} f(p_1,q_1) &= \frac{2p_1+q_1}{2q_1} = \frac{p_1}{q_1} + \frac{1}{2} \\ f(p_2,q_2) &= \frac{2p_2+q_2}{2q_2} = \frac{p_2}{q_2} + \frac{1}{2}. \end{align*} But $(p_1,q_1) \sim (p_2,q_2)$ implies that $\frac{p_1}{q_1} = \frac{p_2}{q_2}$ and you are done.
For part 2), your interpretation is correct.