Translating "Such that" when writing statements in symbolic form. (Discrete math) So im confused as to how to do the following question:


  A: “If c is a prime number such that c divides ab, then c divides a or
  c divides b”
  
  B: “If c is a prime number such that c divides ab, and c does not
  divide b, then c divides a”
  
  (a) Write the statements A and B in symbolic form and then show that
  they are logically equivalent.


Here is what I have tried to do:

Let p be "C is a prime number such that C divides ab"

Let q be "C divides a"

Let r be "C divides b"

So I get the equation:

$$
p \rightarrow (q \vee r) \Longleftrightarrow p \wedge (\neg q \rightarrow r)
$$

But these equations dont appear to be logically equivalent.  I believe that I might be interpreting "such that" incorrectly?

Thanks
We have $A: p\rightarrow(q\vee r)$ and $B: (p\wedge\neg r)\rightarrow q$. Therefore $$p\rightarrow(q\vee r)\Leftrightarrow (p\wedge\neg r)\rightarrow q$$
$\bullet$1:I would prefer to see more brackets. Give $p\to (q\lor r)\iff p \land (\neg p\to r)$ to a computer. It might not interpret it as $(p\to (q\lor r))\iff (p\land ((\neg p)\to r))). $ $\bullet$2:By definition, $x\to y$ is equivalent to $(\neg x)\lor y.$ So $((\neg q)\to r))\iff ((\neg \neg q)\lor r)\iff (q\lor r).$ So your final "equation" (you should say "formula" ) is true. $\bullet$3: Sometimes "such that" is written as  brackets, especially when there is a preceding logical quantifier "$\exists$" or :"$\forall$". E.g.: "There exists a  real $r$ such that $r^2=2$" is $\exists r\in R\;(r^2=2).$ This can also be re-written so that "such that" becomes "and". Consider that $\exists r\in R\; (r^2=2)$ is short for $\exists x\;(x\in R \land x^2=2).$