Image of Set Difference under Mapping

Theorem
The image of the set difference is a subset of the set difference of the images.

That is:

Let $$f: S \to T$$ be a mapping. Let $$S_1$$ and $$S_2$$ be subsets of $$S$$.

Then:
 * $$f \left({S_1}\right) \setminus f \left({S_2}\right) \subseteq f \left({S_1 \setminus S_2}\right)$$

where $$\setminus$$ denotes set difference.

Corollary
In addition to the other conditions above:

Let $$S_1 \subseteq S_2$$.

Then:
 * $$\complement_{f \left({S_2}\right)} \left({f \left({S_1}\right)}\right) \subseteq f \left({\complement_{S_2} \left({S_1}\right)}\right)$$

where $$\complement$$ (in this context) denotes relative complement.

Hence:
 * $$\complement_{\operatorname{Im} \left({f}\right)} \left({f \left({S_1}\right)}\right) \subseteq f \left({\complement_S \left({S_1}\right)}\right)$$

where $$\operatorname{Im} \left({f}\right)$$ denotes the image of $$f$$.

Proof
As $$f$$, being a mapping, is also a relation, we can apply Image of Set Difference:


 * $$\mathcal{R} \left({S_1}\right) \setminus \mathcal{R} \left({S_2}\right) \subseteq \mathcal{R} \left({S_1 \setminus S_2}\right)$$

Proof of Corollary
We have that $$S_1 \subseteq S_2$$.

Then by definition of relative complement:
 * $$\complement_{S_2} \left({S_1}\right) = S_2 \setminus S_1$$
 * $$\complement_{f \left({S_2}\right)} \left({f \left({S_1}\right)}\right) = f \left({S_2}\right) \setminus f \left({S_1}\right)$$

Hence, when $$S_1 \subseteq S_2$$:
 * $$\complement_{f \left({S_2}\right)} \left({f \left({S_1}\right)}\right) \subseteq f \left({\complement_{S_2} \left({S_1}\right)}\right)$$

means exactly the same thing as:
 * $$f \left({S_2}\right) \setminus f \left({S_1}\right) \subseteq f \left({S_2 \setminus S_1}\right)$$

Similarly, by definition of the image of $f$:
 * $$\operatorname{Im} \left({f}\right) = f \left({S}\right)$$

So, when $$S_2 = S$$:
 * $$\complement_{\operatorname{Im} \left({f}\right)} \left({f \left({S_1}\right)}\right) = \complement_{f \left({S}\right)} \left({f \left({S_1}\right)}\right)$$

Hence:
 * $$\complement_{\operatorname{Im} \left({f}\right)} \left({f \left({S_1}\right)}\right) \subseteq f \left({\complement_S \left({S_1}\right)}\right)$$

means exactly the same thing as:
 * $$\complement_{f \left({S}\right)} \left({f \left({S_1}\right)}\right) \subseteq f \left({\complement_{S} \left({S_1}\right)}\right)$$

that is:
 * $$f \left({S}\right) \setminus f \left({S_1}\right) \subseteq f \left({S \setminus S_1}\right)$$

Note
Note that equality does not hold in general.

Let:
 * $$S_1 = \left\{{x \in \Z: x \le 0}\right\}$$
 * $$S_2 = \left\{{x \in \Z: x \ge 0}\right\}$$
 * $$f: \Z \to \Z: \forall x \in \Z: f \left({x}\right) = x^2$$

We have:
 * $$f \left({S_1}\right) = \left\{{0, 1, 4, 9, 16, \ldots}\right\} = f \left({S_2}\right)$$

Then:
 * $$f \left({S_1}\right) \setminus f \left({S_2}\right) = \varnothing$$

but:
 * $$f \left({S_1 \setminus S_2}\right) = f \left({\left\{{x \in \Z: x > 0}\right\}}\right) = \left\{{1, 4, 9, 16, \ldots}\right\}$$