Restriction of Inverse is Inverse of Restriction

Theorem
Let $S_1$ and $S_2$ be sets.

Let $f: S_1 \to S_2$ be a bijection.

Let $M_1 \subseteq S_1$ be a subset of $S_1$.

Let $f^{-1}$ be the inverse of $f$.

Let $f {\restriction_{M_1 \times f \left[{M_1}\right]}}$ be the restriction of $f$ to $M_1 \times f\left[{M_1}\right]$.

Let $f^{-1} {\restriction_{f \left[{M_1}\right] \times M_1}}$ be the restriction of $f^{-1}$ to $f \left[{M_1}\right] \times M_1$.

Then:
 * $f {\restriction_{M_1 \times f \left[{M_1}\right]}}$ is a bijection

and:
 * $\left({f {\restriction_{M_1 \times f \left[{M_1}\right]}} }\right)^{-1} = f^{-1} {\restriction_{f \left[{M_1}\right] \times M_1}}$

Proof
Let $y \in f \left[{M_1}\right]$.

By the definition of image:
 * $\exists z \in M_1 : f \left({z}\right) = y$

Since $f$ is a bijection, $f^{-1}$ is a mapping.

Let $x = f^{-1} \left({y}\right)$.

Suppose $x \notin M_1$.

Suppose $x = z$.

Then $x \in M_1$.

Thus $x \ne z$.

By the definition of inverse mappng:
 * $f\left({x}\right) = y$

By Equality is Transitive:
 * $f \left({x}\right) = f \left({z}\right)$

Thus, $f$ is not an injection.

Thus, $f$ is not a bijection.

This contradicts the assumption.

Therefore, $x \in M_1$.

By the definition of restriction of mapping:
 * $f {\restriction_{M_1 \times f \left[{M_1}\right]}} \left({x}\right) = f\left({x}\right)$

By Equality is Transitive:
 * $f {\restriction_{M_1 \times f \left[{M_1}\right]}} \left({x}\right) = y$

Suppose there exists a $w \in M_1$ such that $w \ne x$ and $f {\restriction_{M_1 \times f \left[{M_1}\right]}} \left({w}\right) = y$.

By the definition of restriction of mapping:
 * $f {\restriction_{M_1 \times f \left[{M_1}\right]}} \left({w}\right) = f\left({w}\right)$

By Equality is Transitive:
 * $f \left({w}\right) = y$

By Equality is Transitive:
 * $f \left({w}\right) = f\left({x}\right)$

Thus, $f$ is not an injection.

Thus, $f$ is not a bijection.

This contradicts the assumption.

Therefore, there exists one and only one $x \in M_1$ such that:
 * $f {\restriction_{M_1 \times f\left[{M_1}\right]}} \left({x}\right) = y$

Since $y \in f\left[{M_1}\right]$ was arbitrary, $f {\restriction_{M_1 \times f \left[{M_1}\right]}}$ is a bijection.

Thus, $(f {\restriction_{M_1 \times f \left[{M_1}\right]}})^{-1}$ is a mapping.

Let $x' = (f {\restriction_{M_1 \times f \left[{M_1}\right]}})^{-1}\left({y}\right)$.

By the definition of inverses:
 * $f {\restriction_{M_1 \times f \left[{M_1}\right]}} \left({x'}\right) = y$

By the definition of restrictions, we have $f \left({x'}\right) = y$.

Suppose that $x' \ne x$.

By Equality is Transitive:
 * $f\left({x'}\right) = f\left({x}\right)$

Thus, $f$ is not an injection.

Thus, $f$ is not a bijection.

This contradicts the assumption.

Therefore, $x' = x$.

By Equality is Transitive:
 * $f^{-1}\left({y}\right) = (f {\restriction_{M_1 \times f \left[{M_1}\right]}})^{-1} \left({y}\right)$

By definition of restriction:
 * $f^{-1} {\restriction_{f \left[{M_1}\right] \times M_1}} \left({y}\right) = f^{-1} \left({y}\right)$

By Equality is Transitive:
 * $(f {\restriction_{M_1 \times f \left[{M_1}\right]}})^{-1} \left({y}\right) = f^{-1} {\restriction_{f\left[{M_1}\right] \times M_1}} \left({y}\right)$

Since $y \in f\left[{M_1}\right]$ was arbitrary:
 * $(f {\restriction_{M_1 \times f \left[{M_1}\right]}})^{-1} = f^{-1} {\restriction_{f \left[{M_1}\right] \times M_1}}$