Composition of Mapping with Mapping Restricted to Image

Theorem
Let $A, B, C$ be sets.

Let $f : A \to B, g: B \to C$ be mappings.

Let $g \circ f : A \to C$ denote the composite mapping of $f$ with $g$.

Let $f \sqbrk A$ denote the image of $A$ under $f$.

Let $f \restriction_{A \times f \sqbrk A} : A \to f \sqbrk A$ denote the restriction of $f$ to $A \times f \sqbrk A$.

Let $g \restriction_{f \sqbrk A} : f \sqbrk A \to C$ denote the restriction of $g$ to $f \sqbrk A$.

Let $g \restriction_{f \sqbrk A} \circ f \restriction_{A \mathop \times f \sqbrk A} : A \to C$ denote the composite mapping of $f$ with $g$.

Then:
 * $g \restriction_{f \sqbrk A} \circ f \restriction_{A \mathop \times f \sqbrk A} \mathop = g \circ f$

Proof
From Restriction of Mapping to Image is Surjection:
 * $f \restriction_{A \times f \sqbrk A} : A \to f \sqbrk A$ is a well-defined mapping

From Restriction of Mapping is Mapping:
 * $g \restriction_{f \sqbrk A} : f \sqbrk A \to C$ is a well-defined mapping

By definition of composite mapping:
 * $g \restriction_{f \sqbrk A} \circ f \restriction_{A \mathop \times f \sqbrk A} : A \to C$ is a well-defined mapping

We have: