Book: Mathematical Analysis by Apostol

Theorem 2.2:$\displaystyle (a,b) = (c,d) \iff a = c \text{ and } b = d$.

$\displaystyle A - B = \{ x: x\in A, \text{ but } x \notin B\}$

Let $\displaystyle f: X \rightarrow Y$. Prove that if $\displaystyle f(A-B) = f(A) - f(B) \text {for all } A,B \subseteq X \text{, then } f \text{ is injective.}$

My attempt: Let $\displaystyle y \in f(A-B).$ Then $\displaystyle y \in f(A)-f(B)$, by assumption. Then, $\displaystyle \exists x \in A - B$ such that $\displaystyle y = f(x)$. Similarly, $\displaystyle \exists x_1 \in A$ such that $\displaystyle y = f(x_1)$.

Since $\displaystyle y \in f(A)-f(B)$, $\displaystyle y=f(x_1) \in f(A)$, but $\displaystyle y=f(x_1) \notin f(B)$. Then $\displaystyle x_1 \notin B$. Since $\displaystyle x \in A-B$, $\displaystyle x \in A$, but $\displaystyle x \notin B$.

So we have that $\displaystyle x,x_1 \in A$ and $\displaystyle x,x_1 \notin B$. Since $\displaystyle y = f(x)$ and $\displaystyle y = f(x_1)$, $\displaystyle f(x) = y = f(x_1)$.

This is equivalent to saying that for $\displaystyle (x,y) \in f$ and $\displaystyle (x_1, y) \in f$, we have that $\displaystyle (x, y) = (x_1, y)$.

By theorem 2.2, it must be that $\displaystyle x=x_1$. So $\displaystyle f(x) = f(x_1)$ implies that $\displaystyle x=x_1$. Therefore, f is injective.

Have I made any errors in my argument?