Preimage of Set Difference under Mapping

Theorem
Let $f: S \to T$ be a mapping.

Let $T_1$ and $T_2$ be subsets of $T$.

Then:
 * $f^{-1} \left({T_1 \setminus T_2}\right) = f^{-1} \left({T_1}\right) \setminus f^{-1} \left({T_2}\right)$

where:
 * $\setminus$ denotes set difference;
 * $f^{-1}$ denotes preimage.

Corollary 1
In addition to the other conditions above:

Let $T_1 \subseteq T_2$.

Then:
 * $\complement_{f^{-1} \left({T_2}\right)} \left({f^{-1} \left({T_1}\right)}\right) = f^{-1} \left({\complement_{T_2} \left({T_1}\right)}\right)$

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

Corollary 2

 * $\complement_S \left({f^{-1} \left({T_1}\right)}\right) = f^{-1} \left({\complement_T \left({T_1}\right)}\right)$

Proof
As $f: S \to T$, being a mapping, is also a many-to-one relation, it follows from Inverse of Many-to-One Relation is One-to-Many that its inverse $f^{-1}: T \to S$ is one-to-many.

Thus we can apply One-to-Many Image of Set Difference:
 * $\mathcal R \left({T_1 \setminus T_2}\right) = \mathcal R \left({T_1}\right) \setminus \mathcal R \left({T_2}\right)$

where in this context $\mathcal R = f^{-1}$.

Proof of Corollary 1
From One-to-Many Image of Set Difference: Corollary 1 we have:
 * $\complement_{\mathcal R \left({T_2}\right)} \left({\mathcal R \left({T_1}\right)}\right) = \mathcal R \left({\complement_{T_2} \left({T_1}\right)}\right)$

where $\mathcal R \subseteq T \times S$ is a one-to-many relation on $T \times S$.

Hence as $f^{-1}: T \to S$ is a one-to-many relation:
 * $\complement_{f^{-1} \left({T_2}\right)} \left({f^{-1} \left({T_1}\right)}\right) = f^{-1} \left({\complement_{T_2} \left({T_1}\right)}\right)$

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

where $\mathcal R \subseteq T \times S$ is a one-to-many relation on $T \times S$.

Hence as $f^{-1}: T \to S$ is a one-to-many relation:
 * $\complement_{\operatorname{Im}^{-1} \left({f}\right)} \left({f^{-1} \left({T_1}\right)}\right) = f^{-1} \left({\complement_T \left({T_1}\right)}\right)$

But from Preimage of Mapping equals Domain, we have that:
 * $\operatorname{Im}^{-1} \left({f}\right) = S$

Hence:
 * $\complement_S \left({f^{-1} \left({T_1}\right)}\right) = f^{-1} \left({\complement_T \left({T_1}\right)}\right)$