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 1
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.

Corollary 2

 * $\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 1
From Image of Set Difference: Corollary 1 we have:
 * $\complement_{\mathcal R \left({S_2}\right)} \left({\mathcal R \left({S_1}\right)}\right) \subseteq \mathcal R \left({\complement_{S_2} \left({S_1}\right)}\right)$

where $\mathcal R \subseteq S \times T$ is a relation on $S \times T$.

As $f$, being a mapping, is also a relation, it follows directly that:
 * $\complement_{f \left({S_2}\right)} \left({f \left({S_1}\right)}\right) \subseteq f \left({\complement_{S_2} \left({S_1}\right)}\right)$

Proof of Corollary 2
From Image of Set Difference: Corollary 2 we have:
 * $\complement_{\operatorname{Im} \left({\mathcal R}\right)} \left({\mathcal R \left({S_1}\right)}\right) \subseteq \mathcal R \left({\complement_S \left({S_1}\right)}\right)$

where $\mathcal R \subseteq S \times T$ is a relation on $S \times T$.

As $f$, being a mapping, is also a relation, it follows directly that:
 * $\complement_{\operatorname{Im} \left({f}\right)} \left({f \left({S_1}\right)}\right) \subseteq f \left({\complement_S \left({S_1}\right)}\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\}$