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

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

Proof
As $$f$$, 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}$$ 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
We have that $$T_1 \subseteq T_2$$.

Then by definition of relative complement:
 * $$\complement_{T_2} \left({T_1}\right) = T_2 \setminus T_1$$
 * $$\complement_{f^{-1} \left({T_2}\right)} \left({f^{-1} \left({T_1}\right)}\right) = f^{-1} \left({T_2}\right) \setminus f^{-1} \left({T_1}\right)$$

Hence, when $$T_1 \subseteq T_2$$:
 * $$\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)$$

means exactly the same thing as:
 * $$f^{-1} \left({T_2}\right) \setminus f^{-1} \left({T_1}\right) = f^{-1} \left({T_2 \setminus T_1}\right)$$

Similarly, by definition of the preimage of $f$:
 * $$\operatorname{Im}^{-1} \left({f}\right) = f^{-1} \left({T}\right)$$

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

So, when $$T_2 = T$$:
 * $$\complement_{S} \left({f^{-1} \left({T_1}\right)}\right) = \complement_{f^{-1} \left({T}\right)} \left({f^{-1} \left({T_1}\right)}\right)$$

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

means exactly the same thing as:
 * $$\complement_{f^{-1} \left({T}\right)} \left({f^{-1} \left({T_1}\right)}\right) = f^{-1} \left({\complement_{T} \left({T_1}\right)}\right)$$

that is:
 * $$f^{-1} \left({T}\right) \setminus f^{-1} \left({T_1}\right) = f^{-1} \left({T \setminus T_1}\right)$$