Union of Mappings which Agree is Mapping

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

Let $f: A \to Y$ and $g: B \to Y$ be mappings.

Let $X = A \cup B$.

Let $f$ and $g$ agree on $A \cap B$.

Then $f \cup g: X \to Y$ is a mapping.

Proof
By definition, $f \cup g$ is a relation whose domain is $X = A \cup B$.

Let $\tuple {x, y_1} \in f \cup g$ and $\tuple {x, y_2} \in f \cup g$.

At least one of the following must be true:
 * $(1): \quad \tuple {x, y_1} \in f, \tuple {x, y_2} \in f$
 * $(2): \quad \tuple {x, y_1} \in g, \tuple {x, y_2} \in g$
 * $(3): \quad \tuple {x, y_1} \in f, \tuple {x, y_2} \in g$
 * $(4): \quad \tuple {x, y_1} \in g, \tuple {x, y_2} \in f$

Because $f$ and $g$ are mappings, $(1)$ and $(2)$ imply that $y_1 = y_2$.

If $(3)$ holds, then $y_1 = \map f x$ and $y_2 = \map g x$.

But then $x \in A \cup B$.

So by hypothesis:
 * $y_1 = \map f x = \map g x = y_2$

Similarly if $(4)$ holds.

Thus in all cases:
 * $\tuple {x, y_1}, \tuple {x, y_2} \in f \cup g \implies y_1 = y_2$

and so by definition $f \cup g: X \to Y$ is a mapping.