Logical proof of the statement $xy = 0 \implies x=0\text{ or } y=0$ Claim:

If $xy=0$, then $x=0$ or $y=0$.

My proof is as follows: 


*

*case 1: $x=0$, so $0y=0$

*case 2: $y=0$, so $x0=0$


Either way, $xy=0$.
I'm very confused by this myself. So if I let $xy=0$ be $P$, and $x=0$ or $y=0$ be $Q$, then the claim "if $xy=0$, then either $x=0$ or $y=0$" is asking me to prove that $P \implies Q$. But I feel as if the proof I gave is $Q \implies P$, which is very different from $P \implies Q$. Can anyone enlighten me on the subject of proving if-then statements?
 A: Your feeling is right: What you have done is the opposite direction. Your argument proves
$$(x = 0 \text{ or } y = 0) \implies xy = 0.$$

How can you prove a statement of the form
$$A \implies B$$
in general?
The direct method is to assume that $A$ is true, and then to conclude that also $B$ is true under this assumption.

Let's apply this to prove the statement 
$$xy = 0 \implies (x = 0 \text{ or } y = 0).$$
In this case
\begin{align*}
A & = \text{''}xy = 0\text{''} \\
B & = \text{''}x = 0\text{ or }y = 0\text{''}
\end{align*}
So we assume that $xy = 0$ is true. Now we have to show that $(x = 0 \text{ or } y = 0)$ is true. The nature of an "or"-statement often involves a case by case study:


*

*If $x = 0$, then of course $(x = 0 \text{ or } y = 0)$ is true.

*Otherwise, we have $x \neq 0$. Now we may divide our assumption (the equation $xy = 0$) by $x$ to get $y = 0$, so $(x = 0 \text{ or } y = 0)$ is true also in this case.



As an addition:
We have just proven 
$$xy = 0 \implies (x = 0 \text{ or } y = 0),$$
and the argument in your question proves
$$xy = 0 \Longleftarrow (x = 0 \text{ or } y = 0).$$
So in fact, we have an equivalence, which we can write down as
$$
xy = 0 \iff (x = 0 \text{ or } y = 0).
$$
A: well, it only happens in an integral domain, or fields as we generally works in which are integral domains automatically. 
if you are in, say, Z6 , its not true, as take 3*2=6mod6=0 where none of 3 and 2 are zero.
but i guess u have already assumed it over reals which is a field, in that case, 
 T.P  xy=0⟹x=0 or y=0, you can assume y≠0, and then multiply on both sides by y^-1 which will give you x.1=0*y^-1=0 implies x=0.
for integral domains, its basically the definition if an integral domain.
A: Not quite right, as you have it written you merely show that if either $x$ or $y$ are zero then their product is zero. Not that if the product is zero then either $x$ or $y$ must necessarily be zero. 
You can show this by contradiction; assume $xy=0$ but $x\neq0$ and $y\neq 0$ then $xy\neq 0$ which contradicts our original assumption that $xy=0$ so we cannot have that both $x$ and $y$ are non zero. In other words at if $xy=0$ at least one of $x$ and $y$ must be zero.
A: If $x\ne0$, what happens if you multiply both sides by $\frac1x$?
A: Just another way. It might not be a formal method.
The solution satisfying the following equation
$$
A \times B =0
$$
is $A=0$ (for any $B$) or $B=0$ (for any $A$).
You cannot apply the same pattern for the case in which the right hand side is not zero. Why?
For example,
$$
A\times B = 2
$$
If you choose $A=2$ then $B$ must be $1$ (rather than for any $B$). If you choose $B=2$ then $A$ must be $1$ (rather than for any $A$). 
