Image of Subset is Image of Restriction

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

Let $X \subseteq S$.

Let $f \restriction_X$ be the restriction of $f$ to $X$.

Then:
 * $f \left({X}\right) = \operatorname{Im} \left({f \restriction_X}\right)$

where $\operatorname{Im} \left({f}\right)$ is the image of $f$, defined as:
 * $\operatorname {Im} \left ({f}\right) = \left\{{t \in T: \exists s \in S: t = f \left({s}\right)}\right\}$

Proof
Suppose $y \in f \left({X}\right)$.

Then by defintion of the image of a subset:
 * $\exists x \in X: f \left({x}\right) = y$

or equivalently:
 * $\exists x \in X: \left({x, y}\right) \in f$

But then by definition of restriction of $f$ to $X$:
 * $f \restriction_X = \left\{{\left({x, y}\right) \in f: x \in X}\right\}$

Thus by definition of the image set of $f \restriction_X$:


 * $\operatorname {Im} \left ({f \restriction_X}\right) = f \restriction_X \left ({X}\right) = \left\{{y \in T: \exists x \in X: \left({x, y}\right) \in f \restriction_X}\right\}$

Hence it can be seen that $y \in \operatorname {Im} \left ({f \restriction_X}\right)$.

So $f \left({X}\right) \subseteq \operatorname {Im} \left ({f \restriction_X}\right)$.

Now suppose that $y \in \operatorname {Im} \left ({f \restriction_X}\right)$.

Then by definition of the image set of $f \restriction_X$:
 * $\exists x \in S: \left({x, y}\right) \in f \restriction_X$

By definition of restriction of $f$ to $X$, we have that $x \in X$.

Thus by defintion of image of a subset, $y \in f \left({X}\right)$.

So $\operatorname {Im} \left ({f \restriction_X}\right) \subseteq f \left({X}\right)$.

We have:
 * $f \left({X}\right) \subseteq \operatorname {Im} \left ({f \restriction_X}\right)$
 * $\operatorname {Im} \left ({f \restriction_X}\right) \subseteq f \left({X}\right)$

The result follows by definition of set equality.